Skip to main content
gamedev.net
🔒 Locked

"Zone" implementation ideas??

Started by jon723 3 replies 1.3k views
Original Post
jon723
jon723
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
hplus0603
hplus0603
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 };
jon723
jon723
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
JamesKilton
JamesKilton
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.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.