Today’s goal was to stop my user from walking off the ends of the planet(map)!
I admit that I made a fairly severe error in planning and logic and trundled off down the path of creating a “Master Map” that would clearly rule them all. This master map was going to list all the rooms/cells and whether you could go NSEW. It would probably tell me what other events would occur in the room, like how many NPCs are present, would there be any story points triggered in that room, y’know, all the stuff that you might need on a “Master Map” – otherwise known as a map. That’s where the error lies. Suddenly I was writing a map for my map – a map for a map that then needed classes to interface with my first map.
Now that I write this out it seems obvious that a map for a map is circular and pointless. What then? A map for that map? Mega master map for my master map? I’d have to get more creative with my naming conventions.
The solution was obvious, really. I’m using JSON to store my map, why not just add it to that? I added in Boolean values for North, South etc. with getters/setters to match and now I have a map with a defined, albeit nonlinear path; more importantly the path has boundaries! All directional commands work and when the user deviates from the path they’re on they remain in the current room and a random retort is added to the text buffer.
This first issue discovery has been interesting. I’m beginning to see what sorts of problems one can create for themselves without proper planning and I’m also seeing that the first answer is not always the correct one. Particularly when in pursuit of a dream, any answer can seem like the way forward.
Moving forward, I’ve been thinking about this weeks points of consideration. My first two considerations were about user movements off the map and how to keep track of my data. At this stage I’m considering item one resolved and item two in a second phase. I’ve moved into a more advanced nested JSON so that I can manage different mapping areas and the contents of those mapping areas and at this stage it is working soundly. I’ll continue to revisit this as I review the components of my game and look to add in NPCs, items, etc.
Two points that I have been thinking about but not really working on relate to the way that the game will divulge its story to the user and how they will interact with the other inhabitants of the world. Cut-scenes seem to exist in some role-playing games as a type of narrative exposition and given that I’m working towards a merging of video role-playing game traditions, text based game traditions and good old-fashioned fiction I feel a need to include a sort of exploratory text that guides the continuation of the storyline. At this stage it appears in my plans as a scripted battle or conversation but I imagine as the game progresses and the puzzles and story emerge it will become clearer how I can include this aspect of my storytelling.
TL;DR – I fixed it! And by it, I mean the problem I created by not covering all of my bases in planning. Also; text-based cutscenes – I want them. No, I need them. But I’ll need to spend more time figuring out what they are.