Thread: Map for a game

  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    13

    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.
    thanks
    My current project is an RPG game similar to Diablo, Arcanum and Baulders Gate. Still very much in the planning stage. Anyone has info on Memory Management for games, please PM me, thx

  2. #2
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    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 .
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  3. #3
    Registered User
    Join Date
    Mar 2003
    Posts
    13
    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.

  4. #4
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    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.
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Creating a map of objects with variable width and height
    By MrSparky in forum C++ Programming
    Replies: 6
    Last Post: 07-30-2007, 03:06 PM
  2. craps game & dice game..
    By cgurl05 in forum C Programming
    Replies: 3
    Last Post: 03-25-2006, 07:58 PM
  3. how to create/use a simple map in a game
    By linucksrox in forum Game Programming
    Replies: 36
    Last Post: 06-08-2004, 10:29 PM
  4. Game Programmer's AIM Circle: Join Today
    By KingZoolerius66 in forum A Brief History of Cprogramming.com
    Replies: 28
    Last Post: 12-20-2003, 12:12 PM
  5. My Maze Game --- A Few Questions
    By TechWins in forum Game Programming
    Replies: 18
    Last Post: 04-24-2002, 11:00 PM