Map for a game
Im currently making a RPG/Adventure game and i want to make the map of an enitre world.
i need to beable to represent the world in many sub maps (dividing the world into about 200 segments) so that i can have a random-ish world.
it doesnt need to be a sphere... exactly, just something that can be aproximated a sphere. (if you keep going in the same direction, you eventualy come back to the same position, no matter what direction you go in) Similar to the Final Fantisy 7 (never played any other FF game) world map.
any help would be much apreciated.
That's no trivial question, especially since you don't give any information of the game. DOS Console? Win API? Dx? OpenGL? How is the game constructed? etc...
If you use a 2D array, you could use some algorithm to access the right element.
ie: if you stand at the top of the world and draw some tile that is outside above (Y), add WORLDHEIGHT to the Y position of the tile and it will draw the tile at the bottom of the map. Something similar for X.
You could probably use modulus too, but I don't know how it reacts on negative numbers withouth my math book :).
i'm after a general theory of how to create one.... more the maths side.
all i can realy tell you at the moment about the game is that its going to be for the windows OS. Im no where near making any other decisions. there is still a lot of things i have to plan and figgure out how they are going to fit together.
Im looking for something more complex than your suggestion. it produces some inherent flaws, for example if you draw the map as commonly seen (with the two poles at top and bottom) then what should be a point, is actualy a line. but if you place the poles as 2 seperate points on the map then the equator becomes basicly imposible to create (from what i've come across)
the closest aproximation i've come across is a cube.... but trying to merge the three corners of a square into a flat plain...... gets into somthing that i'd much rather not do.
Well, I thought the map was supposed to be rectangular (I've only played FF 1 - 6 though, and in those games the map is rectangular and wraps at the ends). You're actually looking for a 'real' spherical map?
Well, I have not much experience in 3D but you could create a spherical coordinate system where you alter the angle Theta by pressing Up/Down and the angle Phi by pressing Left/Right.
There might be some problems at the poles, but you could place something impassable at those spots, a rock or a tree (on second though, not a tree :) ) or something else.
To render it will tougher but you'll figure something out.