Posted by on:
Polish, Playtesting and Bugs
There were a few bugs we had to squash.
Projectile Spawning With Attack Speed Modifiers
The Zooids were not being able to fire a projectile when they had the attack speed modifier.
We had a check where the attackTick had to equal projectileSpawnTick, but because the Frenzied attribute makes the attack ticks go from 78 to 39 per attack, then a hardcoded-in-JSON projectileSpawnTick of 60 will never happen.
And so if the projectile never spawns, the damage is also never applied.
We changed this:
UnitSpriteMeta unitSprite = unitSprites.at(u.name);
if (unitSprite.projectileSpawnTick > 0 && u.attackTicks == unitSprite.projectileSpawnTick) {
to:
UnitSpriteMeta unitSprite = unitSprites.at(u.name);
int targetTick = static_cast<int>(u.attackCooldownTicks * unitSprite.projectileSpawnRatio);
if (unitSprite.projectileSpawnRatio > 0.f && u.attackTicks == targetTick) {
And now everything is good because the tick when the projectile spawns is, let's say, 0.5, so when half of the attack animation is done, then spawn the projectile.
Even if the attack speed and attackCooldownTicks changes, the targetTick is still adjusted and fine.
So having a 0.5 or 50% is better than a hardcoded value like 60.
Corpse Colors
The color of the dead units (corpses) was changing all the time.
This was because of the introduction of groups where we color the units based on if they are in a white, blue or yellow group.
Now when drawing the corpses we set the color based on the group as we do in the units and, of course, reset to white:
meta.sprite.color = {255, 255, 255, 255};
Because what if the unit is in no group?
Units Without a Group
There was also a bug when the unit had no group and I hovered on it, it would change to a yellow one.
I had to make sure that if the unit has no group, getUnitGroup returns -1, and made it count groups from ID 1 instead of 0.
So now it's easy to check if the unit doesn't have a group and skip drawing the attributes altogether.
Campaign & World Map
Making sure that the world map works correctly and doesn't allow you to skip main missions. Have branching optional side missions. Make it so you won't successfully finish a mission if you don't accomplish all the objectives. Make the world map always default the current mission to the highest main (not optional) one you can go to. Make descriptions for all the missions. Survival & Mission Balance Messing with the extraction Survival to make it not so hard. Don't count the environmental units to kills for the messages to be shown. In the second mission even the bird drops alien data.
For that last one, we just added a check in dropItem so if the target ownerId is the environmental ID, we return.
UI & Fullscreen
We had to fix the UI of the main menu for fullscreen so it would not be hardcoded with pixels but instead be adaptive based on the screen size, using percentages and anchoring most elements to the center of the screen.
And honestly, designing the UI for the main menu and in game was much more challenging than we first thought. Mainly where to place buttons and other elements, and how to display the UI in game.
Should it be all just a big bar at the bottom? Or, as we have done it now, having it separated into a minimap on the left, a middle bar for the selections of units/buildings/etc., and lastly the right bar being for actions/spells.
We found that this was better than having one huge bar at the bottom. It was just eating too much of the screen space.
With fullscreen there came other problems in game, like the fog misbehaving or tiles not being rendered because before we had hardcoded the size of the screen to 1280x720. Now it's all adaptive to the player's screen size.
We made a bunch of smaller UI improvements:
- For dead units in the list, we added a skull before their name. This is much more easily readable than having DEAD next to the name.
- When hovering over an enemy unit, show in the top bar the unit name and its modifiers if it has any. More Unit Modifiers
- We don't show the text Corpse dropped anymore. It's just distracting and hides other items being dropped. Now it's much cleaner.
- We added tooltips to signals in the inventory on the signals page.
- Also added tooltips to items in units' inventory in game.
- Added tooltips to crafting items in the Armory inventory.
- Added tooltips to crafting items on hover in the inventory.
- We had to refactor the tooltips to not only be able to give it one text but multiple lines with different colors. This is for requirements, so for example in tech you want to show if it requires another tech to be researched before it can be unlocked.
- We also added labels to hotkey shortcuts. Our hotkeys are the classic grid style QWER.
Passive Tree
In the passive tree, only change the color of the nodes and lines if the passive tree is successfully unlocked.
Yeah, easy. Just check if the node can be unlocked and only then change the colors.
We also made the passive tree modal not have to initialize every time something changes, but just update.
Because it looks bad, man. They initialize and reset the position of the modal and yeah, not good.
Map Editor
We improved the map editor UI.
Because we had added the plants and rocks, the UI was getting cluttered.
We put elements into categories and on select only show the elements of the selected category.
Mission Rewards
After every mission/signal, show a rewards modal in the bottom right of what loot, tech points and manpower you received.
High Ground
We had a few bugs related to high ground.
Fix spawning units on high ground when there are no ramps. Pick up item on high ground doesn't work at all. The projectiles and smoke trail need to be elevated on high ground.
For maps like that, we had to add settings such as highspawn=false and then check it when spawning enemies in Extraction.
We use find_nearby_clear_tile as we did before, but modify it to check if the tile height is 0.
And Much, Much More...
And much, much more...
Just to list it all would make enough for another blog to be honest.
So yeah, we will leave those.
But mostly it's just what we found during playtesting and that had to be polished.
Some of the bugs were quite funny and amateurish haha.
Berserker Enrage
We made the Berserker become enraged when at 30% health.
This increases movement and attack speed.
This should have been easy, maybe 30 minutes of work, but honestly I had to refactor how we do the groups and attributes.
I changed group attributes to unit attributes and put them in their own attribute header file.
Now attributes are tied directly to a unit, instead of a group, so when we want to give a unit an attribute we don't have to create a new group to do so.
Groups still have attributes, but we directly assign those to the unit.
Now groups are more for managing the units inside of them, like movement (wandering around), attacking together, etc.