Okay so in a game like Animal Crossing, there's a bunch of things all happening at once. You can have a screen full of villagers walking around doing their thing, balloons flying, bugs bugging, a system in the background to handle hourly background music with chimes in between, all that good stuff, while you're doing your own things.
When you talk to a villager, you and the villager both stop on the spot, and a script takes over. That script then makes the villager turn to the player and a dialogue window appears. There may be a multiple choice thing now — "talk", "gift", or "leave" — and the script won't stop, releasing control to both, until what you've selected plays out.
So you have a villager with an attached script. The villager waits for the script to finish before continuing on their merry way, while the script waits for the villager to finish turning to the player. Once that's done, it picks something to say and eventually ends up opening the dialogue window. The script now has to wait for the message to finish writing, and the very next command is an "if" involving the result of a multiple choice question, so now the script has to wait for that to return.
I was thinking for Project Special K I might implement all that as several Tickable objects. Not unlike in SCI, you'd have a big list of things in the game that all implement a Tick method. In SCI, that'd be the cast, and its members have doit methods. It's the same deal, but Tick also gets a delta-time argument. So the dialogue box gets to be its own thing that implements Tickable, the multiple choice box is as well. Inventory window? Yes.
Also the script interpreter.
But all that wouldn't let the villager wait for the script interpreter, which waits for the dialogue box, right? Script execution should be halted until the dialogue box is dismissed. That one villager's AI should be halted until the interpreter finishes, only moving (or rather, emoting) because of embedded commands in the dialogue box's text stream.
So I figured, what if I gave them something like a mutex variable? The villager would have a bool waiting or whatever, and passes a pointer to that bool to the script interpreter they spawn when the player interacts with them. The interpreter is added to the cast list and starts running the code it was given. When it's done, it not only removes itself from the cast but sets the bool pointer so the villager can tell it's over and done with.
Now every time through the loop, the villager's Tick is called and they can tell "oh, I'm waiting for a script to finish" because their bool isn't set yet. The script interpreter likewise can spawn a dialogue box into the cast and have its own "waiting for that darn dialogue box" bool, in exactly the same way the villager can wait for the script interpreter.
Next trick, the dialogue box should remain on screen even when things are done, so multiple choice answers can have the question remain visible. It should only close when a different style of box is called for, or when the script ends. My idea is to always have a dialogue box object in the cast, idling until called for. When the villager realizes the script has ended, they can simply poke the dialogue box and have it close, if nothing else already did.
96 notes
·
View notes
Thoughts on RPG Maker
Good and happy ones! I made a couple RPG Maker games back in high school, nothing that ever left the home computer, but it was very freeing and my first taste of making my own games. I also enjoy that they let folks get really weird with it. Off, OneShot, Ib, the original Corpse Party; I love that they exist, and I love the way you can feel their legacy in bitsy and GB Studio games. I still need to check out some of the RPG Maker games my fellows in the indie VN community have made; I adore adventure games!
Sometime, I’d really like to work with someone making an RPG Maker game. It would be fun to write and do cutscenes for them using sprites. I think I’d quite enjoy the limitation of having existing characters and a general plot, and working it into something polished and consistent. Y’know, if someone was more technically minded, and wanted to focus on dungeon and combat design.
Buuuut it would also be great to work with someone to add some simple map traversal and puzzles to a game I was making, too! I think Serialized Killer/Lead Into Gold would be kinda nice if you were walking around the mansion in between conversations. 🤔 But as always, it’s good to start small, so it would probably be best to work with someone on a game jam game first, and see where it goes from there.
I’ve uh. It’s something I’ve been thinking about a lot lately.
16 notes
·
View notes
Using Unity and want to learn Godot engine?
Fortunately for you, there is documentation to help transfer your Unity knowledge into Godot
If you want to try and salvage your project rather than starting over from scratch, there is an experimental script to attempt converting some parts of your project for Godot
53 notes
·
View notes
took me 4 hours to code this hahaha...
the little button sheathes and draws the sword...
this "game" is called second life... it's more of a virtual world. you can create meshes and script stuff. it's fun because i get to see my code work and i get to interact w/ it as well...
i followed this tutorial for this toggle switch...
36 notes
·
View notes