Ledges, puddles, and stairs
Despite the gameplay mostly taking place on a "single plane", you will occasionally encounter elevated platforms or small height drops. Their goal is not to add verticality to the gameplay, but rather to provide "one-way passages" (you can jump down, but not climb back up) and branching paths, as well as providing focus on important items (for example a weapon or keycard could be placed on an elevated platform, coupled with smart lighting to draw attention to it).
For backers who intend to get into modding: ledges are tagged directly in the tileset, so once you have setup your tileset there is no need to manually tag every possible ledge in the entire level :)
The same trick is used to tag things like puddles, which should produce little splashes of water when stepped into:
On the last gif you can catch a glimpse of more collision masks on the right wall. Each color used in the collision mask has a specific meaning, not just "this is a wall, you can't get through", but also things like ledges, puddles, stairs, and much more. When combining each color's three channels (red, green, and blue), this system can be used to convey a lot of information.
For example a mask color with a RED value of 1 means the tile is "stairs", while the value in the GREEN channel will indicate in which direction the stairs are facing. This makes it easy to alter the character movement to give the impression of the character climbing up or down the stairs (if the character kept moving in a straight line when going over stairs it would look very wrong of course).
Another way we use the "collision color" is to automatically tag "underwater tiles" which require altering the character sprites to make it look like they are semi-submerged. Here you can see both stairs and "underwater tiles" in the collision mask (notice how the character moves up and down the stairs, even though all I'm pressing is left and right to move around):
The other big feature of the past ten days or so are the systems supporting "AI companions". In other words, the ability for NPCs to follow you around (without getting in the way), pick up items (and equip them in the case of weapons), and of course engage enemies!
Each AI companion's behavior is determined by four "stats":
- Aggressiveness : this stat determines how willing the NPC is to engage targets
- Fear : this stat determines how afraid the NPC currently is, and is influenced by the number of enemies present on the screen and how much health the NPC has left
- Greed : this stat determines how willing the NPC is to go out of his way to collect loot or weapons, and how willing he is to share health and ammo packs with you
- Loyalty : this stat determines how likely the NPC is to abandon you when things turn sour
Each AI companion has essentially 4 main states : following you around, fighting enemies, collecting items, and running away.
When the time comes to make a decision on what to do next, each state is attributed a weight based on the current situation: for example having a lot of loot around will give weight to the "collect items" state, while having a lot of enemies on the screen will give weight to the "fighting" state, and so on.
These weights are then multiplied by each NPC's unique profile: for example a greedy NPC will have a big "greed multiplier" resulting in a disproportionate weight in the "collect items" state compared to an NPC with a low "greed" stat.
Multipliers can also be negative, for example a high "loyalty" stat will reduce the weight of the "run away" state, resulting in NPCs which will potentially fight to the death rather than abandon you.
Of course friendly fire is on with AI companions, so nothing is stopping you from shooting deserters ^_^'
Here I am playing as the Don, while the Beggar is controlled by the AI:
Cheers and have a great Sunday everybody!
Marco / benitosub