"Zone" implementation ideas??

Started by
3 comments, last by GameDev.net 17 years, 11 months ago
Greetings everyone, I'm in the early coding stages of a project and I've reached a hurdle that I'm trying to jump over. I have a 3d world in which I'd like to designate "zones" for enemies/objects/player location. The 3d world is already broken up into an octree for rendering but I'm trying to keep graphics and gameplay code seperate (somewhat). Does anyone have any helpful ideas as to how I can go about creating zones for my 3d world. I'm sorry if this is a vague question but hopefuly the "jist" is there.
www.lefthandinteractive.net
Advertisement
What does a "zone" mean? Is it just a trigger shape, so that you can tell whether a goal is accomplished? Is it a "walk mesh" that designates where entities can walk? Is it a rule zone where different rules (say, gravity) apply? Something else?

If you have an octree class, you can probably templatize it, so that you can instantiate two of it -- one for rendering, and one for zones. Then put your zones as convex objects into the octree (convex, because it's much faster to test for) -- rectilinear blocks, spheres, possibly prisms created by extruding a polygon in 3D (easy to test for if you only test "center within" not "intersection of volumes").
enum Bool { True, False, FileNotFound };
When I used the term "zone", for this particular project its used for spawn regions. At any given point in a zone the player is given the chance to spawn to another "spawn zone". I guess you're right in the fact that I can use the octree as a structure to implement this. I'm gonna think this through and see what happens. Thank you.
www.lefthandinteractive.net
In all games I've looked at, a Zone as you describe it is simply an invisible primitive placed in the map, be it a cube or a sphere or what not. If you've got any type of collision checking (bounding boxes, etc), you've got the code to check if a player is in, entered, exited a zone.
Everytime I wanted to implement a spawn point/item location/particle generator I'd always just drop some geometry into the level and tag it. I just use the object's center as its location and don't render it.

If you're thinking more along the lines of only needing to look at a certain section of your octree for rendereing/computation (aside from merely checking whether it is in the frustum), I could only suggest designing your levels such that each zone contains a gateway area that transitions from one zone to the next so that you only need to ever render the current zones and connecting gateways...that's no fun though.

This topic is closed to new replies.

Advertisement