Hello everyone!
I've been doing a lot of thinking about how to best tackle a semi-procedural world for RPG Maker and I've gotten some ideas as to how I could tackle them, but in the end, I feel like I'm either overthinking a lot of things that could be much simpler, or haven't found a way to iron out some of the little problems that are cropping up - I would love to get some feedback on this if possible, so I don't start building myself into a deadlock right from the getgo!
The Problem:
The game world consists of many rooms. Those rooms can, logically speaking, have exits on either cardinal direction. All of these rooms will be handcrafted and come in various forms (e.g. "Left & Right Exit", "Top Exit Only"...) and with various purposes (e.g. "Resources", "Important Event", "Part of Puzzle X", "Locked Door", "Key to Locked Door"...). The general idea is that, at the start of the game (or on map transition if more efficient), these rooms should be connected in a way that allows the game to be beatable - perhaps not every door is able to be opened, but at the very least, all "important events" should be reachable so the game can beaten with at least one of the conditions necessary for an ending.
The Ideas:
Please keep in mind that my JavaScript Knowledge is at a pretty basic level - if I make any mistakes, I'd much appreciate being corrected so I can learn from them! I do have decent familiarity with C, C++ & Java, so feel free to draw any parallels if you feel it might illustrate something better ;;
All Ideas have one thing in common - there is a seed being generated at the very beginning, from then on, they differ quite a bit. The goal is not to have a "truly" random game, but to let it be "random enough" (think 1000+ possible combinations rather than millions from exponential growth for a "true" implementation with enough parts).
Best regards~
I've been doing a lot of thinking about how to best tackle a semi-procedural world for RPG Maker and I've gotten some ideas as to how I could tackle them, but in the end, I feel like I'm either overthinking a lot of things that could be much simpler, or haven't found a way to iron out some of the little problems that are cropping up - I would love to get some feedback on this if possible, so I don't start building myself into a deadlock right from the getgo!
The Problem:
The game world consists of many rooms. Those rooms can, logically speaking, have exits on either cardinal direction. All of these rooms will be handcrafted and come in various forms (e.g. "Left & Right Exit", "Top Exit Only"...) and with various purposes (e.g. "Resources", "Important Event", "Part of Puzzle X", "Locked Door", "Key to Locked Door"...). The general idea is that, at the start of the game (or on map transition if more efficient), these rooms should be connected in a way that allows the game to be beatable - perhaps not every door is able to be opened, but at the very least, all "important events" should be reachable so the game can beaten with at least one of the conditions necessary for an ending.
The Ideas:
Please keep in mind that my JavaScript Knowledge is at a pretty basic level - if I make any mistakes, I'd much appreciate being corrected so I can learn from them! I do have decent familiarity with C, C++ & Java, so feel free to draw any parallels if you feel it might illustrate something better ;;
All Ideas have one thing in common - there is a seed being generated at the very beginning, from then on, they differ quite a bit. The goal is not to have a "truly" random game, but to let it be "random enough" (think 1000+ possible combinations rather than millions from exponential growth for a "true" implementation with enough parts).
- Have a JSON file ready that can be read, including information about every room in the game as follows: Which exits exist and which purpose the room serves (see above, puzzle, events, resources...) as a "tag". Have a "center" room with four cardinal directions - generate an array of interconnected rooms and save them in a $gameVariable (since I'm not entirely sure how variables in plugins are treated when the game is saved) for easy access, then, in each transfer event, refer to the array as to where to transport the player. (Instead of arrays, perhaps a chained list or map might work better?)
Potential pitfall for me here is how "interconnected" paths would work - a chained list could potentially have multiple "outliers" that connect to other parts, but it's just a theoretical thing right now.
- The without-any-code solution, take the seed mod a reasonable number (like 2-6) and then, based on that number, connect the transfer event to a set map - on that map, back to the origin based on the same calculation to ensure it's consistent. These could be as complicated and as easy as I'd like, but the problem I see is the room for manual error (what happens if I connect something wrong? Does the game become unbeatable? Is the player stuck in an "alternate" version he shouldn't have access too? Also, it obviously doesn't have as many possible variations - which might not be a particularly big problem, as depening on the work put it, the numbers could still be high enough so that it's unlikely one player will get the same layout twice.
- Very similar to the former, but in addition to one JSON that holds the "information", the actual "path" could be its own JSON File (Name+SaveFileNumber or something for persistence), although that might pose a problem on web builds of the game, potentially? This "second" JSON would hold all rooms that "made it" into the current playthrough of the game and where they connect to. This data could then be read for the transfers (I hope).
Best regards~