Game Development Community

Lots & lots of datablocks...?

by St. · in Torque 3D Professional · 09/26/2009 (4:28 pm) · 2 replies

Hi all,

I am currently experimenting with datablocks in my test project and I was wondering about the following:

If I was to create a massive, epic battle with two thousands of participants (let's say... 1000 tanks and 1000 troopers) what would be the best way of implementing this (I'm not talking about technical limitations, I know that 2000 moving objects on one screen would kill almost every single PC in existence)?

I mean, there would be just two object types: tanks and troopers. I don't want to define texture, weight, speed etc. etc. for each of those, I could use just two datablocks for the initial definition. And I don't want my server to send 2000 datablocks to the client as the loading would never end.
But I'd also need to store the objects' health separately and, obviously, they all have to have independant AI instances.

Is there a "recommended" solution to such an objective? How is it possible to achieve this?

#1
09/26/2009 (6:04 pm)
well technically unless you need 1000 different people and 1000 different vehicles, you could use the same datablock to call each type of model, ie, all soldiers of one model is one datablock, and 1 datablock to call each type of vehicle, and you might have 20 datablocks for 2000 units once you call each different one(you might have some soldiers equipped with different things for example or more hit points.)

But then the rest would be pretty much ai calls, now if your talking about pre-scripted events, then you might want to look into pathing, which would mean looking at modifying your aiplayer (which includes a very basic pathing code, ai patrol might be a good place to start) If you need a more complex behaviour.. well aside from sending 2000 ai player positions over the internet.. id consider where the player see and what they dont see certain models, even high end games with 100 or so models on screen cull items off screen and out of view, or even remove them and record thier position to be reloaded when the player gets back into a certain radius. some of teh larger games (mostly single player do a raduis range to show certain ai, and they simple remove them and respawn them at certain ranges.
#2
09/26/2009 (7:47 pm)
Hmm... yes, I could use 20 datablocks for 2000 units, but I believe it would still be quite a mess to have a mission file filled with references to the object declarations using those datablocks (all that "new WheeledVehicle(Tank1){...}" stuff). A database would come in handy...

Perhaps if we ignore the possibility of pre-scripted events and just focus on the easiest way of adding 2000 objects into the game, the best way would really be to make some kind of spawn points adding things into memory from time to time (similar to the ones you mentioned, but without the need to read or write anything to/from the .mis files)...

I just wanted to do something similar, but I can't decide on where and how to start.
I think I'm going to find the old spawn point related resource (or was that an AFX feature...?) *starts digging into bookmarks*