Innovate / Suits Tower Defence / Log #3
The Dumb Idea That Was Actually A Good Idea
Alright, we've finally made some good progress. I was grabbing a morning coffee with my new colleague who used to work as a game developer before we met. I've seen his stuff and like every game dev I meet, he runs laps around me - and I love it. While preparing a morning coffee and having classic 9-5 office chit-chat by the water cooler, I expressed my frustrations with the grid to him. We explored the idea of the grid as a blanket where all the grid tiles are still somehow square even on inclines. He swiftly shut down my fantasy. He started to break down the problem into an idea that simple is better. I was on a mission to do terrain mirroring which if anything was going to make the grid even weirder looking had I managed to implement it like that.
So my head said, maybe a lower frequency for a more basic mesh... Do I even need a mesh? Sure, a wireframe blanket is a textbook 90s sci-fi nerd's dream, but was it what I should be doing? This is my third game project and biggest commitment of the three, after all. Do I need the grid to even incline?; is there any value to showing that "You can't place towers on the enemy track, idiot!"? Was the solution really as stupid as putting squares down where I designed the terrain to have towers?
Well I started to explore the idea.
I ripped out all the lines of code and all the classes I created trying to be the Einstein of the worlds biggest tic-tac-toe board, and started from nothing once more.


It... It actually looks kind of nice? Each one had colliders too so selecting them was going to be pretty easy.
So what did I do next? Did I get that selection working? Did I try to get towers snapping in place? Fuck no. I made it look pretty.
I needed some tile art.

That's not it.

There we go. Somehow basic geometry is always king.
So I spliced that up with in paint.net and exported it into my project. There was a lot of tinkering with materials, textures, and sprites; and enough sliders to drive anyone crazy. But eventually I got it playing nice and look how it turned out.

It's definitely not the last iteration but in a few hours I've trumped months of flopping around as if I had to get out of bed for work at night. The shapes 'grid' well together, don't they? Definitely brings a bit more life to that tech-feel. Also you may have noticed that I changed my home base to red while I was losing my mind trying to programatically play with the grid's colours.
"Hahaa... Wait, programatically? Wasn't this a quick manual texture upload - ha ha..? That's all you intended to do right? ha..ha?"

Fuck no. I'm gonna make it glow like nuclear fusion, baby.
Really though, I found immersive value in having the grid calmly glowing while it was waiting to be used. I had to do a bunch of research on interpolation and also colours do not work the way they should in the back end. Anyway after a ton of closed tabs and trial and error... Take. A look. At this.

Look at that. I'm stoked with my pretty mound of rubbish. Below is the code if you're interested.

I'm going to wrap up the article talking about last minute notes on what went well and what didn't, that I haven't already mentioned.
What went well was that my git history is pretty on-point with the work I actually did.

What didn't end well was time wasted on third party platforms. My mind was made up the second I got that bad boy glowing that I wanted to show you guys and force you to watch it glow. So I recorded some footage and went to upload it to a site that I wont mention because I don't slander, I'm also incredibly stoic, and the most humble guy I know.
Of course it demanded me to sign up to use the platform (much like the beta testers I'm forcing to read my articles :)) and of course it wasn't an easy process.


Yup, username was taken. And every time I tried and failed to select a username, the captcha would have expired as a one time use and I'd have to reload the website and try and fail again. Eventually I just got fed up so I set a guid as my user.
Then I realised it wouldn't actually let me download my gif, just share a url or embed it in my source code. But my mum didn't raise no quitter.

This guy was amazing and this is almost exactly the solution I used. However when I tried, it failed due to syntax and a quick dumb google said I wasn't actually using curl commands - as if it was redirecting behind the scenes. So I went on a curl goose chase.


Curls obviously don't get girls. Whatever dumb curl site I was on failed to kick off a download no matter what I did so I went back to google and fortunately found this beautiful result in stack overflow that basically pointed out --output was for nerds and all the cool kids were using -o these days.

And it worked.
So yeah cool, now you too can snatch some gifs up for your blogs, built on the foundations of my achy bones and sleep deprived mind. Peace <3
