Re: Modeling events that occur in a game world
- From: Alvin Ryder <alvin321@xxxxxxxxxxx>
- Date: 28 Apr 2007 01:58:15 -0700
On Apr 28, 5:00 am, Jordan Marr <jnm...@xxxxxxxxxxx> wrote:
Try these queries with your RDBMS. Create a simple 2D world using
points and lines, let there be areas. One area could be a poison pond,
just a simple polygon like (1,1), (1,7), (7,7), (7,1) will do.
Now answer queries like:-
-1. "Have you fallen into the poison pond"?
is point (0,0) within the pond, is (3,3) within it?
-2. "There are two polygons do they intersect"? (collision)
-3. Create a road with corners; "how far is it from
point A to point B if you travel only via the road"?
Without a spatial join things are a tad awkward.
This reminds me of a project I worked on recently involving a LPS
(local positioning system). The system consisted of sensors that were
placed inside a building, and tags worn by people or objects that
enabled them to be tracked by the software. We were creating guidance
software for blind people. Part of this involved mapping out the
building with things like walls, and other objects that people needed
to be routed around.
My plan was to use AutoCAD to either create maps visually, or import
existing blueprint layouts. Then the software could simply delegate
all spatial needs to AutoCAD. To go along with Topmind, AutoCAD is
simply an in-memory database of geometry (and it's good at what it
does).
But my boss wanted to manually create maps by walking around and
recording bounding box coordinates for each wall and object in a room,
and then save that array of coordinates to SQL Server... modeled as:
Object (1 to *) Coordinates.
And he didn't just save the bounding box coordinates, he saved every
single coordinate within that bounding box rounded to the nearest inch
within the coordinates table for each object. So that meant that the
process for adding a new object was this:
1) using LPS hardware, manually write down the array of XYZ bounding
box coordinates
2) enter coordinates into a script to create a list of all points
inside box
3) create an object entry in object table
4) create 1 zillion related coordinates entries for that object
Very "awkward", as you said.
He then created a webservice to bounce current position against the
coordinates table to return an object.
If we had used my method, adding a new object would have been as
simple as drawing it in AutoCAD. The software would have determined
spatial information by bouncing your current location against the CAD
layout and returning the names of nearby objects.
Jordan
That sounds like a very interesting and cool project.
Yes I agree, using a tool like Auto CAD then exporting is exactly how
games are built. The pretties are done with cousins of Auto CAD like
3d Studio Max or MAYA, there is usually an exporter involved then you
import into your game engine and render. The first version of Doom had
an in built map editor but these days most engines rely on external
specialist pretty picture painting software. You let them do their
bit, you let the engine do its bit.
Otherwise it sounds like your project is all working now so "all is
well that ends well", even if it isn't so schmick ;-)
Cheers.
.
- References:
- Modeling events that occur in a game world
- From: Aaron J. M.
- Re: Modeling events that occur in a game world
- From: topmind
- Re: Modeling events that occur in a game world
- From: Alvin Ryder
- Re: Modeling events that occur in a game world
- From: Jordan Marr
- Modeling events that occur in a game world
- Prev by Date: Re: Modeling events that occur in a game world
- Next by Date: Re: Dependency Management (Was: Mixing P/R philosophy with OO)
- Previous by thread: Re: Modeling events that occur in a game world
- Next by thread: Re: Modeling events that occur in a game world
- Index(es):