Tuesday, June 15, 2021

Project Breach #7 - "Finishing the engine (1/2)"

Project Breach #7
"Finishing the engine (1/2)"

Map Editor
The two big things I wanted to get done to finish up the engine were area triggers & a cinematics editor. And that's essentially what I've done.

Area triggers can now be placed down:




And used in the map events system as a trigger. Although I can't think of any reasons off the top of my head, I figured spending a little bit of extra effort to make so you can customize if pawns activate your trigger would be worthwhile:






These area triggers took slightly longer than I expected just because I had to figure out some math that I hadn't expected to with regards to placement; since aligning the corners to the exact position of a tile would make it in the center of a tile & would result in the trigger not covering the whole tile.

But once those were done I had the tools I needed to start on the cutscenes editor. But then it occurred to me - I don't remember using a cutscene editor when I made WarCraft 3 maps, how did they do it? So after looking it up it turns out they just used their map events system. This was perfect since it meant I just needed to add a ton of new actions to my existing events editor & I'd be able to support cutscenes/cinematics.

I wont list every new action I've added because it's quite a few, but it's all the essentials & a few extras for what I consider necessary to being able to do cutscenes. The second thing I had to do was make so map events could be triggered over time instead of just all at once so I added a "Wait" action. Right off the bat I knew that having a single "Enter Cinematic Mode" action which froze the player & enemies wouldn't be how I wanted to do it because freezing players & enemies could be their own useful actions, as well as the fact that some cutscenes might do things differently from each other so having a universal cinematics action would only limit how much people could do with the system. But having to create many actions every time you wanted to create a new cutscene like "Stop player movement", "Stop AI Logic", "Show cutscene bars", etc. would also be quite annoying. So my solution was to create "Action Templates":





And with all these new actions & a template system, we can now make cutscenes!


(Ignore the black bar not fully covering the ammo text lol)

So it's not quite a cutscene editor but an extension of existing tools which lets us make cutscenes.

I've also added "Starting Music" to the environment tab which is pretty self-explanatory.




And a map event action that lets you change the music:




The map editor is now also able to save your preferences, so if you toggle on/off lighting or anything else like that, the editor will remember for next time you boot it up.

An old remnant of when the engine was being made for an RTS was that a new map started with 4 active slots & each slot set to a different team. Now maps default to just 1 slot & all slots default to the same team:




Visuals & UI
You may have already noticed, the player & pawns have a new effect I named "Mickey Mouse Bounce".




I also updated the player UI to include "HP" next to the health bar:




And I've added support for camera shake when the player fires a weapon.




This can be adjusted in the weapon file:




Pawns
Pawn dialogue was a system created in the second game update published in March 19th 2021 when the engine was originally being designed for an RTS. I had actually forgotten this system existed until I wanted to work on sound effects for when pawns took damage, and to my surprise, found that such a system already existed under "Pawn Dialogue". The reason pawns weren't using this system was because the game was designed for an RTS & I didn't want random voice/text prompts giving away enemy positions so pawn dialogue only got played if it was by pawns who were on your team. And since in the current system, no pawns are on your team, they never played and eventually I forgot the system existed at all.

So I simply removed the requirement that pawn dialogue only be played by friendly pawn & I was able to add sounds for when pawns take damage without changing much else.

Closing Notes
Unity was released on June 8th, 2005, almost exactly 16 years ago. Yet there hasn't been a single moment where people thought that it was done & no more could be done to improve it whether that meant adding new features, removing old ones, or changing things in some other manner.

Similarly, since I'm mostly financially stable I find myself in a situation where I have all the time in the world to work on this engine and an infinite amount of things which I could be doing to make it better. I could work on it for the next two years. I could add network support to the voxel system, I could reprogram the texture & audio system to use a uniform file structure, I could redo the map editor UI to look more like a proper application, I could add a pawn editor so you could create new pawns without needing to change mod files. I could make it so much better. But I could also make a game.

At some point I have to say, the engine is ready, time to make a game.

The GMTK 2021 game jam came & passed where you had to make a game in 48 hours with the theme "Joined Together" and I participated with an entry. It was a lot of hard work to get it done on time and I worked 20 hours on the last day but I submitted it with 5 hours to spare.

During that messy & fast-paced development, I was reminded of what making simple games feels like & made it me think a lot about this project. It was so nice to be able to add something new without having to take into consideration & program the complexity that comes with:
  1. How will it work with multiplayer / server-side authoritative model?
  2. How will it work with mod support?
  3. Will it require an addition to the map editor & if so, how will that be handled?
And it made me remember how less of a grind game development is when you keep things small. Mostly by not having the game be multiplayer which on its own can make even the most basic of tasks a chore & frustrating. That's not to say I regret making this engine, but it was a reminder that game development doesn't need to be as complex & long as I've been making it for myself.

In game development there's a term "Fail Faster". If I've learned anything from the last few projects it's that this may be the best advice there is for someone to learn. And maybe if I had earlier, I wouldn't have spent an entire year on projects that went nowhere. This September it'll officially be 2 years since my last published game. That's insane. That realization alone is what made me decide that this & the next update are the last updates on the engine before I make the game itself. This update I accomplished the two major things I wanted to get done, next update will be finishing off a bunch of small bits & whatever else I figure needs wrapping up. The update after that, the game will officially be under way. I don't know what it'll be about, who you'll be fighting, what weapons you'll be using. But I know it'll feel great to finally start on it.

I'm pretty hyped. This update & the next the engine will be done & I'll be doing almost nothing but working on the game. Figuring out where the game takes place, what the story is, adding levels, enemies, weapons. I'm getting so excited just thinking about it.

-Blake Gillman