Game Development Community

DIF, DTS, Life and the universe in T3D - advice please

by David McDonald · in Torque 3D Professional · 08/30/2009 (1:02 am) · 12 replies

Hi all,
I'm seeking some advice and suggestions as my rag tag bunch of men (all three of us) slowly get our heads around Torque and T3D specifically. I understand a lot of the TGEA material in the forums is generally valid but I still have some confusion of the meshes and how to implement our vision.

1. I understand the main difference between using DTS and DIF after reading up in the TGEA docs. If, however I wanted a building that is just the exterior (i.e. closed doors as part of the mesh, single sided textures etc) would this be best as a DTS or still as a DIF? Which type is more efficient if I were building a busy city up?

2. To have multiple shops etc in my city I would consider having an instance type approach. I've seen comments around interior instances but can't find any detail to tell if this is the area I need to focus on.

3. Do we have the facility to create one interior area (aka a bakers shop), place that somewhere out of sight and zap people to it from the front of the shop (as in say oblivion or many of those other approaches)or would the best approach be to model the entire shop as a DIF and just have players walk inside to deal with the NPCs etc?

I appreciate any feedback folks. I know these may have been asked many moons ago but if they had they don't show up easy in the forums.

Cheers
David McDonald

#1
08/30/2009 (9:33 am)
1. DIF is a depreciated (BSP type - think Quake) format, and probably won't be available in future T3D releases. So, DTS for the future, it gives better performance. If you're using polysoup (mesh collision) watch out for high density (poor performance and sticky collision), don't have very long thin polys (having said that, I've never had any problems - yet), try to keep things vaugely squarish-rectangular.

2. Not entirely sure what you mean. I think "instance" in the case you mention just means "object". If you mean "can I use the same model multiple times at different areas of the map/level" then yes, you can.

3. Here's a rough and ready example of how to do that.
a) Set up a trigger at the doorway, call it's datablock entrance.
b) Set up a waypoint or other marker inside - call it inside.
c) When the player walks into the trigger, you send him to the marker.

datablock TriggerData(entrance)
{
   tickPeriodMS = 500;
};

function entrance::onEnterTrigger(%this,%trigger,%obj)
{
//first check it's a player in the trigger
%isplayer = %obj.getclassname();
   if(%isplayer $= "player")
	{
            echo("Player in Trigger -> send inside");
	 
            %isplayer.setposition(inside.getposition());  
            //set the player to the inside marker's position
	}
	else
	{
            //and if it's not a player ...
            echo("NOT player in entrance trigger -> Do Nothing");
	}
   Parent::onEnterTrigger(%this,%trigger,%obj);
}

edit:
You can practise this in the console. Give your player the name bob, and make a marker soemwhere, call it gohere. In the console type -
bob.setposition(gohere.getposition());
- and bob should appear at the marker. You can swap get/setposition for get/setransform if you want the player to align to the same direction the marker is facing.
#2
08/30/2009 (6:42 pm)
Excellent thanks Steve.
By instance I was referring more to the traditional dungeon style instance in games. Effectively a level or map where one group enters and the runs around doing their thing and another group could enter later and do 'their' thing sperately.

Cheers
#3
08/30/2009 (7:30 pm)
That will require a considerably rewrite or multiserver structure (1 server per group without rewrite) as T3D is targeted at 1 game = 1 mission, its not MMO or MMO alike ready and without some considerable work it also won't be.

One could say that you could use the MMOKit as base to work off but thats a very hairy thing as there isn't even one in beta / usable state for TGEA (especially not TGEA 1.8.1, its additionally only community driven and the community seems to get less and less active so you will primarily do the work for yourself), as such I'm none of those suggesting it.
Its good if you need a base idea on how the architecture should look like, but in the end, we are talking about 2-3 months of fulltime work (+2-3 months if you are new to torque) till you have base technology to go there
#4
08/30/2009 (7:42 pm)
You might do something like that in torque by spawning off new dedicated servers and migrating clients to them, as a random thought.
#5
08/30/2009 (7:52 pm)
@Steve: Good info. One question - "don't have very long thin polys". How long is long say in measurements of the default player's height? Is that a factor related to GPU? Thanks

#6
08/30/2009 (7:57 pm)
David,

I played Lord of the Rings Online and I have to tell you they did what you were asking by making every building that you could go into an instance. Personally for me I absolutely hated waiting to be ported to the interior of a building. This really ruined the immersion factor for me.
#7
08/30/2009 (8:15 pm)
@Chris, that is my main concern actually.
On one hand, having a city with the shops 'open' and you just walk in is more immersive but then you have more objects in your scene and would need to keep a close watch on how busy you make it.
The idea of the instance would allow more shops, but I do tend to agree that popping in and out every 5 mins if you were busy gathering supplies would be annoying.

It's probably obvious but the questions were basically around the multiplayer side of things. In for example, our spawn city we may have 20 buildings around. Currently these are closed shell meshes, i.e. just the pretty outsides with no mesh detail inside. In the previous engine we were making instances for the buildings rather than having open shops/residences etc.

By the looks of things though it seems we may need to rethink the approach.

Thanks for the discussion guys.
#8
08/30/2009 (8:18 pm)
@Scott
I don't know what exactly counts as a "don't have very long thin polys", but Matt Fairfax warns against them.

I've noticed that on mesh railings - long thin rectangle, especially if the end tapers into anything like a point (damaged, broken railings), the player can get caught up. Sticking a poly at the end instead of tapering seems to help prevent this.
#9
08/30/2009 (8:28 pm)
Not sure which engine you were using before, but if you were going to instance anything in torque you are going to see a loading screen. You can use portals in DIF objects in TGEA or portal objects in T3D to work with DTS objects to block out anything outside of that portal so you can have a lot of objects inside a room (say for a bank or auction room) and keep the framerate high.

Torque doesn't really support dynamically bring in too many objects as it really needs some more threading support to do that properly without causing loading lag on the client end.
#10
08/30/2009 (9:33 pm)
David,

I understand what your saying about having to be careful with too much going on in the scene.

Have you thought about maybe having shops open only at certain times like in a real city? You could help alleviate load by having certain places open at certain times.

That would be a bit annoying for people who only play at certain times (if your game is set to real time like WOW is).

Anyways just a thought....
#11
08/31/2009 (2:26 am)
If you use zones and portals to make sure that things inside a shop are not rendered while you're outside then you shouldn't have much of a performance impact on the client, but the server will have to keep track of it.

I think you'd be better off trying to do the entire cities instanced, so that while in a city players are seamless, but they zone once to leave to the world map.

I would create it first, and then see what type of performance you have an optimize. While creating the technology would always be beneficial make sure it's necessary before doing the work.
#12
08/31/2009 (11:08 am)
That will be the general approach, suck it an see as we say here in Australia.
We did consider in our early concepts the idea of opening hours for shops. Actually we went one step further and considered having the shopkeepers turn up elsewhere like the Inn or marketplace when the shop is closed as well to add some depth.

The drawback is exactly as you say, players who can only be on at set times. A previous game I played had that issue with respect to night time. Everytime I logged in it was always the night cycle...most annoying. But still food for thought.

I think the nicest approach would be via portals and once we get our heads around that we can see how performance goes.

Cheers.