Need help on design

This is a discussion on Need help on design within the Game Programming forums, part of the General Programming Boards category; I have (or will have) a coordinate-based world in my game and I can't find a good way to do ...

  1. #1
    Registered User
    Join Date
    Aug 2003
    Posts
    1

    Need help on design

    I have (or will have) a coordinate-based world in my game and I can't find a good way to do it. Should the coordinates, in a hash table, contain the objects in the game?

    Or, should each object in the game have coordinates, and write a function to compare distances between objects? Each object type (people, items,...) would have to be in separate lists/trees, and each list would have to be searched, which seems very expensive.

    What is a good data design to represent multiple objects in a coordinate-based world, where it is fast to find the distances between them?

    Im kinda high, hope that made any sense.

  2. #2
    Pursuing knowledge confuted's Avatar
    Join Date
    Jun 2002
    Posts
    1,916
    The way it's normally done in 3d is that you have a bunch of objects, and then a world file - essentailly a map. The map contains data about where objects are located (object name, position, orientation). That way, you can use your "tree" object in 173 different places in the world, but you only need to store the object once.
    Away.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. which design is better to wrap another class instance
    By George2 in forum C++ Programming
    Replies: 7
    Last Post: 04-13-2008, 01:27 AM
  2. any comments about a cache design?
    By George2 in forum C Programming
    Replies: 6
    Last Post: 09-14-2006, 01:53 PM
  3. Implementing Inheritence into your design
    By bobthebullet990 in forum C++ Programming
    Replies: 6
    Last Post: 08-05-2006, 05:40 PM
  4. Cprog tutorial: Design Patterns
    By maes in forum C++ Programming
    Replies: 7
    Last Post: 10-11-2004, 02:41 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21