Game Development Community

Units

by Richard Van Stone · in RTS Starter Kit · 02/07/2006 (6:50 pm) · 6 replies

I've been thinking about how to adapt the rtskit to my game needs and have a few thoughts/questions that I wanted to post so as to bounce the ideas off of those more experienced with its workings. First off I want to preface this with the fact that I haven't finished reading all the docs on this forum so if I'm asking something someone already explained please forgive me.

I'm working on an rts game that is could most be compared to warhammer. I understand the rts kit was made to simulate 100s of models, but I don't think for my game there will be more than 100 models per player on screen. That said this is how I'm working things and how I'm thinking it'll work for me please let me know if there's a better way to do things.

In the game a player will define their units before game start. I will add in functionality so that when players leave the lobby(or perhaps even in the lobby gui) they will define their units. Units will not be able to be dynamically altered during gameplay it's set at level start.

Players will be able to have:

Unit 1: 1 Leader character plus 4 bodyguards (5 )
Unit 2: Troops (8)
Unit 3: Fast Attack (12)
Unit 4: Heavy Support (6)
Unit 5: Elite (6)

That's a basic example. So as I understood Zepp's last post the server doesn't actually keep track of the groups and that the group is created on the client. What I'm envisioning then, is a system where a null character is placed as a unit (perhaps a dummy model with null texture that can't be attacked) when players select a unit the null character is selected and will bring up a list of commands available for that unit.

For example Unit 1 is selected and told to move. The null unit would move to the location at normal and then the actual visible models will move to that location in relation to the null unit.

I'm still trying to formulate the process in my head so please ask for clarification if this doesn't make sense. I appreciate any feedback in advance.

Thanks

Rich

#1
02/08/2006 (7:06 am)
I loved Warhammer! Actually, Warhammer fantasy, but also stuff like Necromunda. I love the idea and you get my *full* encouragement. Hehe.

I'm not sure what the objective is... ohh wait! I'm remembering now... in warhammer, you put all the little guys on cards and moved them all as a unit... is that right? And you were able to have several groups that moved as one unit.

In that case, it seems like your idea will work, good approach to the problem. It seems like it could be done with just script.
#2
02/08/2006 (7:09 am)
Yeah in warhammer you have trays that you place your units on and they move in a group together. Kind of what I wanted to do. Just wanted to make sure my theory on how to accomplish my task was the right way to go.
#3
02/08/2006 (8:09 am)
If you run into any major hitches, let me know, helping out others is teaching me a lot!
#4
02/08/2006 (10:29 am)
I've actually made some progress doing this exact thing (although it doesn't work yet, so won't be a code drop), and will probably do a TDN writeup on the theory sometime this weekend. It will be -very- basic in that it will expect a bit of knowledge about various aspects of torque and leave a lot for the user to implement, but hopefully it will be picked up and we may see an implementation in the works!
#5
02/08/2006 (12:42 pm)
Oh great I'm screwed ^_^ I'm still learning torque. I'll have to pick your brain for help Zepp *gets out his fork and knife and pops open your scalp* Ok time to dig in Hehe
#6
02/11/2006 (10:21 am)
Ok so unit information is kept on the server, all you need to do is pass group information up to the server correct? When you assign a group, this is what should be done.

%this.group = new SimSet();
%this.group.add( %this.selection );

From there you just do something like this.

function getUnit()
{
for( %i = 0; %i < %this.group.getCount(); %i++ )
{
if (%this.selection.getObject(%i).getdatablock().getname() $= "FastAttack")
{
%target = %this.selection.getObject(%i);
}
//Now the server knows the units in the group, apply buffs or something to units.
}
}