My rooms are currently devoid of any interactable environment. Sure, there are mobs, but that’s no enough. There is an occasional chest, but they are far and few, so they can’t fill out rooms. I am still to adjust exact room layouts and shapes, but even that won’t add any “content”. Besides, there is no gameplay with completely static stuff.
So after some thinking I decided to add “barrels” to the game. These are your typical video game red boxes that explode when you look at them wrong. I call them all “barrels”, because I need a common name, although these can vary. (I thought about calling the post “barrels of fun”, but I am afraid I will have to go back an rename every post to be a pun then.)
My current plan is to have three distinct types of barrels in three sizes:
My thinking goes: red for explosions, blue for EMP discharge, green for toxic sludge. I’d love to add some appropriate effects too — fire, electricity, toxic spill. Furthermore, make environment catch fire or flood with sludge. And have mobs get zapped, slowed down, set on fire. But all of this is very… time-dependent. I might not get to it. For now, they will all just explode.
And these equal to the same assets for them:
Now, they can show up in the game, but they don’t do anything. Thankfully, my bomb-throwing boss mob already needed props that explode, so I actually have that functionality. I just need to add an extra barrel-specific designation:
However, what I don’t have is prop destructibility — being able to shoot and destroy them. So I’m adding a selection to all props (by default non-destructible):
And destructible props can define the base max health they have, which then can use the same sort of logic mobs use to get damaged by projectile that collide with it:
And this works out great and was relatively easy to implement:
The explosion also need to hit both enemies and the player. This basically adds gameplay; I think it’s pretty obvious what sort of stuff this results in.
I did spawn that prop with a debug cheat, but I need to actually spawn these in the levels, specifically rooms. For that I will make a new asset for prop selections, which will cover spawning generic props that don’t have any special rules (like enemies or loot do):
I can then add entries for this for different types of setups of props:
I can then link the prop selection along my other selection-logic assets:
Now I need to tell the level content placement setup that I want the (new) barrels content as part of certain rooms:
Oh boy, is this a mess! I can’t even remember how I am supposed to set up the distribution numbers or what they mean and how the group designation is supposed to affect it. I remember it all being very smart and fancy and totally over the top now that I look at it. I will have to fix it shortly.
For now, I need to do the last step for placing props by specifying where in rooms they can go (yellow cubes):
And finally, I can select loot content (dirty yellow part of debug square) for rooms:
And the rooms have the random selection of props of one of the available prop lists, in this case, blue barrels:
Yay! This is pretty awesome, as I have been missing actual props in the levels. Now I just have to balance these and place them in reasonable locations in the rooms. “Just”.
Finally, back to my content assets. Firstly, I will reuse the same asset for all levels and not have to make 8 separate ones that all need changes individually. I can’t be defining stuff I want this tediously.
And secondly, I removed all of the distribution logic. Now each room simply grabs one of the compatible choices from the content entries and uses that to place content in the room. So it’s much more readable (which makes it much more designable):
In fact, my loot chest now actually spawn properly in cubbies and arenas, since before this then needed weird distribution numbers to ever appear.
I can now specify as many combination as I need, since they are much easier to add and maintain. I might add additional stuff for balancing later, like level ranges in which different combinations are available, thematic variations, or some such.