itch.io is community of indie game creators and players

Making a Lovecraftian Poetry Puzzle in 38 Hours (Part 2)

Ooooh boy did we really do it all in 38 hours? Howdy folks, Gustavo Rolanski here!

I’ll be honest with you. Poetry? Definitely not my strong suit, which is why I’m thankful to have Sid’s Big Beautiful Writer Brain to do the heart side of the job, while I focus on building and creating the body of the project. The soul? That comes from both of us 😉

I’ll do a quick once-over of the programming and Unity side of things for y’all!

The Technical Stuff

If you ever wondered what it takes to program a small game for a game jam, here’s the breakdown.

Of course, this doesn’t take into account the 3 plugins we used (LeanTween, Odin Inspector, and PlayerPrefsEditor). 1580 lines of code isn’t that much, in comparison to our bigger game, the Dialogue Manager in Crow’s Requiem alone has nearly 1200 lines of code.

For anyone interested in a more in-depth look, here’s a quick rundown on each script used in Last Round:

Interaction Scripts:

  • Button Interaction - Simple script with methods for button interaction that can be assigned to the button’s OnClick event.
  • Move Interaction - The brain behind the screen switching, using IPointer Handlers to grab the mouse interaction with the buttons.
  • NPC Interaction - Also using IPointer Handlers, this is the script used to engage our dear villagers in conversation (as well as controlling the outline shader. This also helps with identifying which NPC is being interacted with.

Manager Scripts:

  • Game Manager - Your run-of-the-mill game manager that controls game flow and asset loading.
  • Dialogue Manager - The single most important script of the game, controlling dialogue flow and the choices. It also handled player inputs on dialogue screens.
  • NPC Manager - This is what controls which NPC is chosen as the sacrifice, and also controls what the non-sacrifice NPCs will say. It also holds a list of each NPC’s information.
  • Settings Manager - A Simple Settings manager plundered from another project and stripped down to only handle audio settings, saving everything in playerprefs.
  • Poem Controller - Not as important as it might sound in a poetry-focused game, it builds the poem text and displays it on screen.

Scriptable Object:

  • DialogueData - The second most important script. This is the Scriptable Object that contains all our lines of dialogue. In total, we have one for each NPC, plus one for the Poem lines.

Shader:

  • Icon Outline - A Shader we use in Crow’s Requiem to produce a colored outline around an image. Pretty simple and precise.

Utility Scripts:

  • AlphaRaycastFilter - A Helper script for ignoring transparency when using IPointerEnter and Exit. Doesn’t work 100% correctly, but does enough to help avoid misclicks.
  • UIHelper - A Collection of static methods I’ve been building that helps with UI manipulation of various kinds, like the slow typing you see in the game.
  • VideoUtils - Another script from Crow’s Requiem, used to make videos in WebGL playable. It also has some other utility, like video skipping.

Putting It All Together

The game could have worked fine with only two scenes, but I decided to separate it more, to a total of four: the Title Screen, the Intro Video, the Bar, and the Ending Video. The Bar, being the game’s main scene, is the most complex. All scenes use 2 Canvases, one for the main elements and one for overlay elements.

Last Round’s dialogue system uses this nifty scriptable object, which holds all the info we need to display text on screen, which happens whenever you click an NPC’s image. We have the text and speaker name for each line, and when we reach a line with “Is Choice” on, we display the Heart/Soul/Body buttons. Crow’s Requiem uses the same system, but with a LOT more complexity added in.

When the player clicks one of the buttons, the system will relate the line’s Demand with the NPC’s chosen demands to select the correct line of text to show the player. 

And let’s talk about the Tracker. We initially planned to do something like how Phasmophobia tracks the ghosts you’re hunting, but honestly, that would require a lot more than 96 hours to do it properly. So instead, I built this monstrosity of a table full of Dropdowns, with less than 12 hours remaining in the jam. Surprisingly, there is no programming required for it. While you are in the Bar scene and change things around in the tracker, they will stay like that even if you close it, and when the game loops, the whole thing resets on scene load.

Other than that, no other outstanding things to talk about with the Unity side of things, just a lot of UI building, image dragging, and tiny adjustments everywhere!

The Last Minute Issues

Unity WebGL and Videos. They don’t go together at all, do they? I mentioned earlier that skipping videos should be possible with the VideoUtils script, and in the Unity Editor, it works like a charm. HTML5 video player, on the other hand, does not like it when you try to change the video’s current time, which is why I gave up on it entirely for the build that’s playable on the Jam. 

Another issue came from having the DialogueManager handle player inputs using Unity’s Input Action system, which would advance text when you were trying to open the poem or the tracker. I opted to add a button component that calls the method that advances text to the Raycast blocker the Dialogue Box uses to block clicks on NPCs and the move arrows. Issue solved! (At 4 in the morning, but that’s alright!)

In hindsight, I probably should have added more means of controlling things, like pressing A/D or arrow keys to move left and right, or P to open the Poem panel. Those are probably going to be implemented in a future release, along with gamepad support, maybe?

And That’s The Last Round

That’s it from me! We hope our weird game gave you an enjoyable ride. And if you haven’t played it yet, why not? It’s free and it’s fun, go check it out and make these two tired devs day by rating and commenting!


Leave a comment