Game
Hensen Hopper

21 days ago

I wrote a modular language system! I can now add new entries with definitions in as many languages as I please and all from the inspector window in the Unity editor! This allows me to potentially have Hensen Hopper translated to other languages easily!


I literally thought this entire system out WHILE AT WORK over the last week haha! I got super excited multiple times and probably made my coworkers think I'm nuts by yelling things like "AHA!" and "I GOT IT!" and "This is gonna be GREAT!" out loud.

I work in a warehouse, noise isn't exactly a concern 🤣

Anyway, here's my infodump:

image.png

This is how the entries I can modify from the inspector window are structured internally. Pretty straight forward, LangEntry's contain an internal name and an array of LangDefinitions which represent the definition of that entry in a specified language.

image.png

As you might expect, the first member of the LangManager class (the script that is attached to an object in the scene through which I can define lang entries from the inspector window) is a serialized array of LangEntries, however, for the sake of ease of access by other scripts, I changed the hierarchy relating entry names to languages to definitions a bit from how it functions in the inspector window internally. What's happening in this snippet is probably a bit difficult to follow intuitively if you're new to programming, but what is happening here is all of the string data contained in the Entries array (the language names, entry names, and definitions) is copied into a hierarchy of dictionaries. The outermost dictionary maps language names to inner-dictionaries that map lang entry names to their definitions in that language (if they exist).

image.png

This copying of data from the LangEntry array I modify from the inspector from to internal dictionaries might seem pointless at first, however, this is actually a best of both worlds scenario. It allows me not only to easily add new definitions for an existing lang entry in other languages but get the definition of that entry in the user's current language without needing to loop through every entry and it's definitions to find it!

image.png

The only drawback to this approach is that I cannot modify the game's lang during runtime as the internal dictionaries are constructed on awake, but, at the same time, I cannot imagine a situation in which I'll HAVE to so that should be fine.



3 comments

Loading...

Next up

I've been working on the sprite for the beetle shell power-up drop! I'm thinking when you collect this one, it will kind of poof away similarly to the enemies when they're defeated and play an "equip" sound.

This is a much larger (in terms of resolution) video than I've shared here before!!!

This is a full round of Hensen Hopper in it's current state! I mainly recorded this to showcase the new wave difficulty curve algorithm I've been working on!

I've decided to have the statistics behind the quests in Hensen Hopper be handled as actions reported to the quest manager rather than try to write variables into a whole bunch of scripts solely for quests.

Doki Doki Literature Club is celebrating Monika's birthday and the 8th anniversary of DDLC with exclusive stickers, avatar frames and backgrounds on Game Jolt! 

Head over to the shop to collect yours 👉 https://gamejolt.com/#shop

The beetle shell is now fully VISUALLY implemented! Next thing on my list is a unique sound for Hensen equipping it.

Mae Borowski is the main character of Night in the Woods! It's an adventure game that tells the story of her return to her hometown of Possum Springs. She was confirmed as canonically pan in a social media post by the game's creator Scott Benson.

I've been working on some proper visual art for the beetle shell when it's equipped! I've also gone ahead and drawn a break animation for it. All I need to do now is actually set all of this up in Unity which I'll probably do on Tuesday.

I made some updates to the hints system! Now it reads from the message hub to determine when to show hints and the hint texts now come from the lang system I wrote yesterday. This simplified my the hints handling algorithm A LOT from what it used to be!

Happy Joltidays! A new quest has entered your quest log. Accept the quest and follow @ElPichon to open today's slot on the calendar.

Here's a short demonstration of the beetle shell power-up in-action! It's not very obvious what it does at the moment because I still need to work on a lot of the effects for it, but the functionality is there if you pay attention to the health bar!