Enemies now break up into pieces and that’s very cool. But I’d also really want the player to collect something from this. May be not from every enemy and may be dependent on the enemy type, but something. There should be “casual” loot in regular combat, sort of, the archetypal equivalent of coins. Now, if enemies drop some sort of robot parts, what is the player going to do with them exactly? The player would also need to be able to convert these parts into something they can use, which likely implies the player is also a robot or at least has mechanical accessories. I have to be careful about feature creep though. There are simple things I can add, like health or walking speed increase. But I could also scope this too much, need too many assets, require lots of UI, etc.

So let’s start simple. An item that drops from dead enemies. Enemies can define what they want dropped:

And I can spawn the new item when the enemy dies:

I’ll just call it scrap for now implying multi-purpose reuse — it’s some sort of part, module, chip or something that robots can drop — doesn’t matter right now.

I can use the player’s weapon pickup logic to gather scrap:

But I don’t really want to have the player manually pick up every scrap item, if they are going to drop a lot. I want them picked up when the player is in range:

And since I have all my entity physics set up, I can just use a soft force towards the player:

So that the player can hoover up the items:

They are not very noticeable at the moment. I will likely need a unique color scheme for them. Of course, my enemy parts will (likely) not be orange rectangles either.

But of course, I need a better way to select what items to drop. I also want to share drops between similarly reward-giving enemies. So all trash mobs can drop trash loot, etc. For that I can make a bunch of assets for loot selection (very similar to weapon selection):

And I can specify for each enemy exactly what sort of stuff and how much of it to drop:

One issue is that this will always drop something, so I need a default “no drop” entry that will result in no loot distributed:

I don’t want the items to just appear on the floor, but rather “spew” out randomly. For that I need to shove them away from the mob:

Of course, this is greatly exaggerated here — only bosses would drop a lot of items. Regular enemies might drop one or two occasionally. The reward of these should feel somewhat proportional to the combat required.

Collecting these doesn’t actually do anything yet, so I need to make a player inventory system. For now, it’s literally just a scrap counter. And I need to add this to the HUD:

I also need a purpose for the scrap. I want the player to fight all enemies they can and skip them as little as necessary. For that I need to add significant reward for collecting scrap. And I think the best way right now would be to “upgrade” the player’s robot, as I mentioned before. I guess I’m just rolling with the whole robot thing here. (Man, half my design is literally “what if?” followed by “sounds cool.”)

So the player needs to upgrade, but I don’t want them to do this just anywhere. This interrupts gameplay and is not a good enough “checkpoint”. But I also want to keep the player constantly playing — to be in the level at all times. So I don’t want to have upgrading between-level. Which means it will be in-level at certain key points. The question is what those key points are. The answer is likely just random “upgrade rooms”, since I cannot really predict reliable what the player’s path would be. Instead, I think I should add a room they really want to find to upgrade their stuff.

Hey, what do you know, I have 2×1 cubby rooms! I can repurpose them into scrap-spending rooms. I think I will just keep them calling (upgrade) cubbies since I already named everything that. I do want to change the content to be more specific though as I might use cubbies for other things too:

Now I can make an actual prop for this:

And add custom logic for player interation:

And it now spawn in the cubby (I set their count to 1) somewhere in the level:

Now I need to do some UI for this. I think I can just do it on the HUD. And I am going to keep it very simple:

Of course, this isn’t actually wired to anything. There is no concept of “upgrade” in the game. So let’s add that (via assets, of course):

This way I can have each upgrade have its own properties, such as:

A lot of my features are a whole lot of framework that need a whole lot more content. But stuff like stat upgrades practically generate content on the fly. I just need to keep up with making assets for every stat and parameter I can potentially upgrade. In other words, this is an easy, but impactful feature.

Anyway, let me actually show this in-game. First, I need to actually have a player upgrade system that remembers what upgrades were applied and where I can query what upgrades it wants next. So then I can present them:

Now, these have to appear only when I approach the upgrade station, so I need to wire everything through correctly to get that.

And, of course, I don’t want to present them all, just a set number. The question is how exactly do I choose which ones to show. Presumably, my upgrades will have some commonalities, like being a vital stat or weapon upgrade, that I can group by. In any case, I can add this group to the upgrades:

I will have to deal with randomness between levels later. But for now will just pick the upgrades randomly at the start of the level for the upgrade terminal. The player can then upgrade those “upgrade things” until they max out:

The final “touch” is to actually require and spend player scrap for this and “redden” non-affordable items. Also”green out” maxed out ones:

The final last thing is to actually use the upgrades. That is, wire the upgrade levels into something the game recognizes and uses. This is mostly hard-coding each upgrade into something in-game. For example, here is the player’s max health increased:

I also want the player to drop the scrap when they die for that final “wah wah waaah” moment:

I will likely talk about actual upgrades more at some point. I will likely also design a bunch that fit different gameplay styles and characters. But for now I have the framework.

MicroRogue DevDiary #35 – Scrap and upgrades
Tagged on:             

Leave a Reply

Your email address will not be published. Required fields are marked *