Lots of little things this week.
I installed new speech bubbles from Evan, then made them shrink/grow to fit the text within them. Together, these make the speech bubbles look much better, and make it much clearer who is talking.
I improved the Mind Rush effect, so it adds new links/bubbles over the course of 4 seconds, instead of all at once.
I fixed the Mind Blank effect, so you can’t click on the nodes that are disappearing.
I implemented a simpler way for being notified when an amount of time has been passed, and updated a few places in the code to use this new method, instead of the old one that was designed for animating a trait over time.
Then I got to work trying to fix the weird twitchy/glitching rotations that happen when nodes fade out (mainly the node that connects you to the rest of the web.) While working on this (with mixed success) I realized that I need to change the way I position the link angles. Right now the main determinant is how many links there are, and they’re positioned mostly dynamically. This made a lot of sense when all links were created at once, and never deleted (at least not in the foreground). But now that links are coming and going a lot more, they can’t be spinning around to accommodate the comings/goings of the other links… or at least not spinning around so fast. I’m going to rip out the old angle generator, and instead have links remember what angle they are at, and have them repel nearby links/nodes. I can make it a bit of a physics simulator. This way I can fiddle with the numbers, and achieve some important gameplay constraints, like no overlapping nodes, and making sure that nodes don’t go too fast to be clicked on.
This week, I made it so you could script multiple interruptions to occur while you’re trying to find a word. Also, I implemented a second interruption: “mind blank”, which makes all the thought bubbles except the one you’re on poof away into nothingness… then new ones come in. It needs some polish, but is basically working.
Very techy progress this week!
First I ripped out the SDL2_mixer library, because it seemed to be incompatible with cross-compiling for 32-bit windows. Also, we want to do more sophisticated things with our music than SDL2_mixer’s music API supports, so it wasn’t overwhelmingly useful. So I made it so our music and sound effects work with the much lower-level API of SDL2. Now I am copying audio samples myself. Evan and I talked about this, to see if there’s some cool effects that we can do easily now that we’re involved at the audio-sample level. Not sure anything exciting will come out of that, but we’ll certainly be able to fade in and out the various tracks of the music as we planned.
Then after those two, I got cross-compiling working again, so I can spit out windows builds… with sound! This took a bit of work too, because windows doesn’t reference embedded binaries (our data files) it quite exactly the same way as my machine.
I met with Evan to discuss various effects and interruptions that happen while you’re trying to navigate the web.
I deleted the old syllable mode, and implemented a new one that uses the structure of the web, instead of having free-floating thought bubbles. This works much better with the new UI (especially the speech bubbles at the top). Also, coding will be much easier from here on out, because you’re always on the same structure when finding words/syllables.
And I implemented one of the interruption effects that Evan and I talked about: “Mind Rush”. In the screenshot below the human has just shouted “Answer me!!” while I was trying to find “apple” and then lots of new, useless thought bubbles appeared with words like “hurry”, “quick”, etc..
We have audio!
I pulled in another library (SDL2_mixer), and now there’s music on the menu screen (that fades in and out nicely) and sound effects when the goblin talks, when you click on a word/bubble, and when you arrive at a new node/bubble.
I’ve been sick, so it’s been a slow week.
I did some reorganizing of the code, so that the web effects (such as the letters wiggling around) can run on their individual schedules, and be triggered by anything, instead of being hard-coded to a progress bar.
And I met with Evan, and discussed the various web effects we’re going to have, and what will trigger them.
As I hoped, I’ve now got it set up so you can script conversations. Here’s the script for our sample conversation:
Now that I’ve got the code organized in a way that the sequencing can be driven by such a script, we can add some dynamic features, so you aren’t always looking for the same words every time you play.
I’m not sure yet if such scripts will be generated dynamically, or if we’ll add more dynamic options within the script (such as replacing “apple” with a list of words that would work there.) Probably some combination of both approaches, ie we’ll have lots of conversation snippets with some variability to them (such as lists of words that work) and code to dynamically assemble full conversations out of those pieces.
As promised, I made the speech bubbles more dynamic. The letters appear one at a time (quickly) and the next speech bubble appears after the previous one has finished typing. Also, the thought bubble web in the brain doesn’t appear until the dialog is almost done. That part of the screenshot looks almost the same though, since I mostly just changed how/when they appear.
I finally sat down to fix a long-standing bug where the whole web lurches a bit when you click on a node. The angles and distances of the links wobble/sway a bit over time. This creates a very cool visual effect, since it’s applied recursively throughout the web, but makes it tricky to get the code right when switching nodes.
I updated the rendering of the nodes to use the new, higher-resolution white blobs from Evan, and also made them bigger, and the links bigger, etc.. Now you can read the smaller nodes, even at 500×500 pixels (the size of the screenshot above). The individual letters in the thought bubbles noodle around a bit. It looks very cool while playing, but looks a little wonky when frozen in time in the screenshot.
Oh, I also put the finishing touches on the layering code, so that when the thought web doesn’t fit in the brain (which happens as you get frantic as the time runs out) the bubbles don’t float into the foreground outside the head.
I did some code cleanup, and got the code a lot closer to being able to script meaningful/interesting conversations. I’m looking forward to playing a conversation that makes some sense, instead of just hunting for words chosen at random (or the hard-coded starting word “hat” as shown above.)
Over the last week, I spent most of my project time reorganizing the code. Very early on in the coding for this project I focused on getting things on screen as quickly as possible, and not building up infrastructure that I thought I’d need later. Now that I’ve got basic gameplay working, and I’m starting to build more of the different screens (main menu, level map, gameplay) I know what sort of things I need from code organization, and so I’m doing that now.
It seems like boring progress for this week, but I think in the grand scheme of things, this is the quickest way to build the game.
My organization of the code makes it easier for me to work with graphical elements in groups that make sense. For example, when transitioning from the main menu to gameplay, there are a lot of elements that should fade in together (see screenshot below.) It also gives me an easy way to get the right layering.
Below you can see that I’ve started mocking up the code for speech bubbles. Currently their position and contents are hard-coded, but it will come to life soon.
Sorry the thought bubbles are so small and hard to read. I’m not quite done switching to the new target resolution / coordinate-system.
Most of my updates since last week have been on the graphics. I’m mid-way through reorganizing the code to handle our target screen resolution/coordinate system. The game will render to whatever resolution the screen is, but I need a coordinate system for coding, and also it’s nice to have a target resolution when deciding how big to make the graphics.
I’ve got a fun thing to share that I did finish though, and that is parallax scrolling. I brought some of Evan’s art to life by scrolling his layers behind the menu:
Sorry it doesn’t go all that far. My animated-gif-making-skills are a little rusty.
That’s all for now. More next week!