Weekly devlog! Diablo-style wardrobe drops
Added 2019-05-08 23:05:57 +0000 UTCHiya! This week was all about creating diablo-style wardrobe drops. Let me back up and assume you haven't played the game yet. The game has a wardrobe system. By playing, you unlock new accessories that you can equip on the characters to dress them up however you want. Here's how that system looks:

The way it used to work is, "to unlock Kira's bottomless accessory, you need to successfully complete her last upgrade X times."
Back when it worked this way, you would buy upgrades and upgrades would give you needs, and then you chose which needs were active. You could have two needs active at a time.
But, this UI was pretty clunky, and I also wanted (and did) add a catalog to automate needs. Both of these nudged me in the direction of removing the concept of active/inactive needs. Now, when you buy an upgrade, that need is automatically active and there's no way to deactivate it. You own five needs? Well then each time a character has a need pop up, it's going to be one of those five that you have to do. Does that make sense so far? I feel like I'm being a bit convoluted.
Anyway, with all needs active, the old way of unlocking clothing accessories became ridiculously grindy. If you owned five needs and there were five characters on screen and you wanted to unlock Kira's "bottomless" accessory, you'd have to be lucky enough that Kira was picked and lucky enough that the need that unlocks "bottomless" was picked. Probability wise, that's like 6/90 odds (This may be inaccurate. I'm not a mathematician.) Point is, it's not fun!
So now you unlock clothing completely differently. Every time you complete a need, regardless of which need it is, there's a chance that you'll unlock a new wardrobe item for that character. I call this Diablo-style, because it's like every time you kill an enemy, there's a chance some loot will drop.
Part of getting this to work is giving the player some feedback when they've unlocked a wardrobe item. I decided to go with a bouncing hanger icon that Yo recently created for me. Here's the progression of the animation. The gif on the left is the earliest stage and the one on the right is the way it currently looks in the game. I can probably "juice this up," way better, but for now, I think it's good enough and improving other things would be higher priority.

Hopefully the one on the far right looks the best.
OK, now for the devlog:
- Bug: Kira's clothing changes are not saved when you click the back button
- Make sure Kira and Jessie are placed in the correct positions
- Make a Jessie emoji - This was for the discord server. She has a cute "OK" face, so I wanted to turn it into an emoji.
- Make sure that Jessie's thought bubble is centered above her head
- Delete code from the old animation system - Ah, this was amazing. I had so much code that was like, "If the character is a sprite, do x. If the character has the old way of doing animation, do y. If the character has the new way of doing animation, do z." Now, there's only "do z," and my code is so much cleaner.
- Write a test that all character data should have a spine reference
- When you successfully close the dialog, there's a random chance a wardrobe drop drops out of the character - It's hard to articulate what I really mean here... all this did was make it so there was a framework to work off of. A way to ask, "Should I get a wardrobe drop?" and get a yes or no response to that question. But it didn't actually do anything yet.
- See if asmdefs will speed up compiling - This is some technical stuff, but my game takes 9 seconds to compile and it's driving me insane. It's the perfect amount of time to get distracted and tab away, then realize 2 minutes have passed and, "What was I doing again? Oh yeah." Seeing as how my current computer seems to be dying, I think I'm going to buy a new one very soon.
- Add the wardrobe drop icon to the game
- The wardrobe drop has its own animation that appears when you get a wardrobe item - See the gif above
- The wardrobe drop icon disappears after some time
- When a wardrobe item drops, a previously unowned wardrobe item for that character will be available - Before this, you'd just get an animation that wouldn't do anything.
- You can only wear/see owned wardrobe items in the wardrobe screen
- Remove the concept of a "locked/unlocked" accessory
- Maintenance can't have wardrobe drops - There have been requests for sexy plier skins. Maybe some day.
- Make sure owned wardrobe items are saved/loaded when you quit.
- Handle the situation where the player has already gotten all wardrobe items for a character and then the drop generator says they got a new drop
- Tell the player how many clothes are unowned - It would suck if you couldn't tell when you've unlocked everything, so I wanted to inform the player, "you have x out of y unlocked."
- Write an editor script that populates WardrobeData with WardrobeItemData - Very technical feature. If you're interested in the details, let me know.
- Use Jessie's new conservative wardrobe items - She's a cutie and I love her new outfit. It's now the default when you play the game.
That's it for now! Next, I'm going to have wardrobe rarity. It's possible to unlock "topless" as your very first wardrobe drop, but I want to make that a "legendary" drop instead. In other words, unlocking a common bracelet should occur more often than unlocking the ability to see the character's boobs.
Also, I've got a massive backlog of ways to polish the game that I really should attend to. For example, I've got a new UI/BG from Yo, and I should incorporate that sooner than later.
Hope you're all having a great week!