Posted August 10, 2019 by AddiekinStudio
#2dshooter #building assets #game design #game design notes #game building ideas
Its pretty typical for me as a programmer to want to work with code. And so that is where I started making more enemies. Just plugging away thinking to myself of offsets and working from an enemy design in my head. I had thought that it wouldn't be that difficult to build an enemy ship design in the form of a ring with empty space in the center. So I started to plot in my head where all the parts would go. What I needed was something like below.
e:addPart(-2, -1, c.ShipPart) e:addPart(-2, -0, c.ShipPart) e:addPart(-2, 1, c.ShipPart) e:addPart(-1, -2, c.ShipPart) e:addPart(-0, -3, c.ShipPart) e:addPart(1, -3, c.ShipPart) e:addPart(2, -2, c.ShipPart) e:addPart(2, -0, c.ShipPart) e:addPart(-1, 2, c.ShipPart) e:addPart(1, 3, c.ShipPart) e:addPart(-0, 3, c.ShipPart) e:addPart(2, 2, c.ShipPart) e:addPart(3, -1, c.Weapon) e:addPart(3, 1, c.Weapon) e:addPart(-1, -0, c.Engine)
I was so totally wrong about the difficulty my brain had when trying to visualize where these parts ended up. I found myself adding a part then popping in to the game waiting for the enemy to show up to see how it turned out. A few iterations of this and I started considering alternatives. I thought maybe it would be nice if I had a ship tester where I could see the enemy ships in action and kind of fight them. Maybe I'll do that in the future as a way to group them together and balance difficulty and continuity.
I mean it took me like 30 minutes just to do a single ship and test to make sure that everything looked and worked ok. Then it occurred to me, Hmmm I have this in game editor, what if I wrote some code that would output the ship design code for me based on the ship design in the editor.
All I needed to do was to force it to not cost me money or I could have just given myself an insane amount to build all the ships which would have worked too. Of course I would need a way to output the ship designs so I could copy them into the game. So I wrote a little function that would output the current ship design as the code above with the write grid offsets and part types. Also made it save the designed ship code to a file.
Then I just needed to add some buttons so I could decide when this code would run and of course simply clear the design and viola.
I set to work as soon as this was done and I uploaded the experimental build to my phone which is where I like to play test. I got in a comfy chair and 30 minutes later all the enemies were ready. I downloaded all the saved ship design files to my computer, cat'd them all together and appended them to where I loaded the enemy catalog. QED!
I am always amazed at how quickly you can make content when you have the right tools. So now I have absolutely no excuse for not adding a million enemies to the game and need to find different ways to give them more traits and add to the overall game feel.