I am not asking for someone to program this for me, I still would like to do all the programming, however I need some additional mathematical programming background for this kind of stuff because I haven't really dabbled into 3D spaces much and I am thinking lots of potential if-thens and switches could be simplified way down if I think of this concept the right way. I will be using a programming language that supports 2D tiled or text screen output (think Java). I want to know if there are simple ways to program in the viewing, orienting and moving about this virtual space I am about to describe without resorting to lots of switch statements to control i.e. what the screen will be displaying depending on the PC's location, facing direction and rotation.
Okay so far I am working out concepts of a way to explore a 3D top-down maze type environment with a procedurally generated voxel landscape and a 1x1x1 player character which can view only the eye level plane and the plane 1 unit below it. the PC can move in the following ways; Please note I intend whichever way the PC considers down to be which direction gravity is acting upon it, (unrealistic):
- Walk forward to another square unobstructed by a wall or cliff
- Turn the face another direction, in which case a different direction becomes the PC's forward face (visually). The PC will always appear to be facing up for the user.
- Start scaling a wall, in which case the previously upward direction (out of the screen, towards the user) becomes forward.
- Climb down and scale the wall of a pit below, in which case the previously down direction become forward.
- Flip upside down and tether off the now ceiling, scaling up or down the tether until the PC hits a floor. in which case it can choose other transportation modes again.
- Each time the PC moves, all other entities get their chance to move in a turn based fashion.
This won't be like a Minecraft-esque sandbox, so editing the landscape after generation won't be likely necessary. I will have a screen that views 16x16x2 voxels at a time. I do however like the idea of dynamically allocated chunks. I plan on generating or loading previously generated 16x16x16 chunks of voxels and the adjacent 26 chunks as needed. while unloading out of range chunks and saving them to a file. I want to know the mathematical/conceptual ideas behind generating these chunks and loading already generated chunks. Note I still use the term voxel even though I will only view them as squares on a text screen, because the game space is a 3D grid.