Game Development Community

Looking for ideas around defining "spaces" in missions

by Orion Elenzil · in Torque Game Engine · 08/29/2007 (11:11 am) · 8 replies

Hey folks !

we often want to mark up our missions with a notion of what "space" the player is in.
for example, a single interior zone may have several areas the player can be in which control what music stream they get, what "store" they're shopping in, whether they have permission to be in the area, etc, etc, yada, yada.

we currently use triggers to mark up the mission with this sort of stuff, but i'm looking for something better.

difficulties of heavily using triggers:

* they're very difficult to visualize and work with in the world editor.
we've made some improvements in that area, but they're still very difficult to place in the editor.

* they're rectangular boxes.
if you have a U-shaped space, you'll need three triggers to mark it up,
if you have a wedge-shaped space, you'll need several triggers to accurately mark it up.

* they're placed in the world editor instead of in the DIF-creating tool. (in our case, constructor)
it would be nice if the DIF itself came marked up with spaces.


what i would like:

a way to Paint On space markup info.
maybe this takes the form of a special Brush type in constructor,
or perhaps a way to paint on space markup in the world editor - maybe some sort of PaintBall gun which you fiure at the ground ?

spaces need to be freely overlappable, and when overlapped, easy to visualize.

of course it needs to be performant.


i realize that there are already aspects of DIFs which partially map to defining spaces,
for example well-designed DIF has been portalized s.t. each or most rooms are a Zone,
and in addition you can tell if you're inside a DIF or not,
but that's unfortunately not fine-grained or flexible enough for more complex scenes.

so.

any creative ideas ?
this painting-on thing seems nice, but i'm not sure how it would actually get the job done.
downward ray-casts are easy, but it gets complicated when you've got say a four story building.

even just improving the visibility of triggers would be great.
maybe i can fill them w/ volume fog. HMM actually maybe just filling them with 3D grid lines would help.


one thing which i Am starting on soon is a new SceneObject called a "Space", which will have more or less the same functionality as a trigger, but be an aggregate of many triggers and spaces. ie, so you can lay out three triggers as a single space and get OnEnter() etc on the space instead of the triggers.

#1
08/29/2007 (11:28 am)
Couple of ideas:

1. If your levels are interiors exclusively, you maybe able to add new brush types to define your spaces. Then your spaces could be defined in Constructor or Quark or something. Issues with this approach would be having to monkey with three pieces of software: your map editor, map2dif, and the engine. But it might be the artist friendly way to go (depending on your pipeline). Hrmm, rereading above, you've already thought of this. ;)

2. Invisible DTS shapes. You could author collision meshes that fit your spaces tightly and place them with the DTS in constructor support. I'm not actually sure what the issues here might be. Agressive culling? Too many notifications?

3. For the paint on space markup idea. Maybe you could switch that to a "flood fill" this area with triggers type thing. That would work will with your new SceneObject.

Just random ideas, hope it helps a little.
#2
08/29/2007 (8:57 pm)
Create an overhead mini-map that will show ownership of space using translucent filled circles.
Track area ownership using specialized sim objects (scriptobjects?) to hold information such as owner and radius.
Edit the sphere locations using the min-map.
Use radius search functions that are scheduled to check for occupancy of the spaces periodically. Say every 200mS or even every 500mS.

Drawback may be using radius search. You may need to create/find a faster function if there is going to be a lot of people or owned spaces. You can speed up the search by only checking for specific object types.
#3
08/30/2007 (10:25 am)
Thanks for the ideas guys.
Brian - yes, our levels are entirely Interiors and DTSs, so a new brush type is definitely interesting. Oh you've already read that we've already thought of that. haha! Invisible DTS shapes is pretty interesting. I'll give that some thought. Flood Fill - good idea.

Frank - that could be done, but our maps are somewhat more complex than can really be visualized accurately by an overhead map, and i we're after more precise markup than spheres. Eg, filling a square room accurately with spheres will take a lot of spheres.


On a side note,
i went ahead and implemented SimSpace, the trigger aggregator i described:
here's the pending-approval resource
#4
08/30/2007 (12:38 pm)
This is something I'd be interested in as well...I keep track of the player's location in my game using triggers, probably the same way you do it, Orion. The SimSpace idea would work well for some things, so I'll check it out. It would be nice if there was an easier method, though...
#5
08/31/2007 (5:59 am)
Yay! Orion, you are wizard! Just today I was thinking about the same, and good I decided to check what's new on forums :)
I have "non-PVP" areas in our game and it was headache when I need to set multiple triggers to act as one. Great stuff!

I nominate Orion to be "Associate" for all of these great improvements!
#6
08/31/2007 (6:44 am)
I looked quickly at the resource, looks good. Will be a handy thing in our game.

I will have to look at it more indepth when i get some free time later today.

Good Job.
#7
08/31/2007 (9:32 am)
Quote:I have "non-PVP" areas in our game and it was headache when I need to set multiple triggers to act as one.
rock! that's exactly the sort of situation we were facing too.
#8
09/01/2007 (8:10 pm)
Orion,
Very cool!