I’ve had a good week full of retrocomputing, but that hasn’t really translated into a lot of progress. Mostly, I blame the Revision Demoparty, which took place last weekend and is now saturating Youtube with cool videos. I figured watching brand new demos for systems old and new would be inspiring – and it has been – but it’s also been pretty distracting. It’s just hard to look away from the pretty pictures!
I have made some important progress, but a lot of it has been along the lines of gluing pieces together and testing them. After a few missteps, I’m happy with how the engine is loading conversation files. I also went back in to the map editor, and added a few lines to attach the name of a conversation file to each map.
One thing that I had initially deferred was deciding how to map sections of conversation script to individual NPCs in the game world. I figured I might attach an offset into the conversation file to each NPC, but I was also struggling with where to put other NPC related information like individual names (as opposed to the names of a type of entity – the difference between “an Enchanter” and “Tim the Enchanter”).
I decided to kill two birds with one stone by building NPC names into the conversation file. Now, each conversation file begins with a set of CONVERSE_NAME opcodes. Each of these opcodes has two arguments: the name of the NPC, and the index to the next line of that NPC’s conversation. Now the script starts like this:
name "sathress" SATH name "reg" REG name "rorik" RORIK SATH: say "buzz off!" end REG: say "hello" ...
Each NPC on the map has an index into the list of CONVERSE_NAME opcodes, so the player can talk to an NPC and get the right conversation script. The same lookup gives me an easy way to print out an NPC’s name in case I need it. I can also have entities on the map with no NPC_ID, for generic creatures that you can’t talk to
I think the next step for the conversation engine is the interface to buy and sell things, but for that to work I’m going to need to think about the game’s inventory system and item definitions. I just hope there aren’t any more big demoparties this weekend to distract me again!