User:Emry/lgpGame
From NexusCrossing
Contents |
[edit] Intro
lgpGame is the working title (A better name is coming) for a test game that I am creating to try out the libgamepieces library. The current version will involve a randomly generated maze of rooms.
[edit] Game Specifications
[edit] Current Target Specification
- The maze will be a three dimensional area centered on the coordinates 0,0,0.
- The boundaries of each access will be +/- 5. Those numbers may sound small, but that gives us an 11x11x11 grid, for a total of 1331 rooms. Remember, a simple 10x10 grid is 100 rooms.
- The starting and end points of the game will be chosen at random, but should not be too close to each other.
- The interface will allow users to look at the room, see a list of exits, interact with objects in the environment.
[edit] Future Specifications
- In future versions, users should be able to interact with creatures in the environment.
- They should have to find their way around unnatural obsticals (locked doors, traps, etc)
- Characters should have abilities that they can use, and improve
[edit] Further down the line
- Users should have the ability to save their progress through the game.
- The game should be able to save the existing map to a file, including objects and creatures on the map.
- The developer should be able to create customized maps, that are not confined to the same restraints as the randomly generated maps.
[edit] Maze Generation Algorythm
This algorythm is adapted from the one presented here: Depth First Maze Generation. Some modification was needed to allow for differences in concept and platform. Mostly though, it is because the stack itself provides the perfect mechanism to keep track of the number of rooms involved.
Create a room Stack (LIFO) Create starting room
while stackSize > 0
- find all neighboring locations without rooms
- if one or more empty locations exists
- pick one at random, and create a new room, with a door to it
- Push the current room onto the stack, and move to the new room.
- else
- Pop the most recent room off of the stack
- Move to that room
- if the stack is empty, and no empty spaces exist around the current room, then the maze is complete.
- end if
end while
Once the stack is empty, the maze is mapped.
[edit] Start and Finish Placement
Most likely, I will choose a quadrant at random. Within that quadrant, I will randomly select a room as the start. After that, I will choose a room at random in the opposite quadrant, and place the finish there.
It is also possible that I may choose two boundary rooms, on opposing sides of the cube.
This does not guarantee a long distance between beginning and end, but it is a pretty good chance that it will take a while to figure it out.
