RTSUnits and Weapons
by Edward Pollard · in RTS Starter Kit · 01/09/2005 (3:56 pm) · 7 replies
I'm toying with the concept of customizable weapons for my RTSUnits. I think this is one of the things that got stripped out for simplicity, as the Inventory scripts are nowhere to be found.
I'm trying to reintegrate them, and then attach weapons to the mount points, but have reached a dead end as I'm not particularily fluent in Torque.
So, anyone have any thoughts on how this would get done? I copied Inventory.cs into /core/, added it to game.cs and init.cs, and added a call to mountImage in gameConnection.cs when units are created.
How wrong have I gone?
I'm trying to reintegrate them, and then attach weapons to the mount points, but have reached a dead end as I'm not particularily fluent in Torque.
So, anyone have any thoughts on how this would get done? I copied Inventory.cs into /core/, added it to game.cs and init.cs, and added a call to mountImage in gameConnection.cs when units are created.
How wrong have I gone?
#2
Customizable units in a RTS is cool. We're trying to do it with Torque.
So, can I move RTSUnit towards my needs, or if I need to use regular units with the RTS Starter Kit instead?
(to defer the recommendation of implementing permutations and combinations, our concept involves multiple mount points with many options for each. It's certainly *doable*, but I'm not sure its preferred, or really necessary)
01/09/2005 (5:34 pm)
I hear you, I'm just not wanting to dance that specific dance.Customizable units in a RTS is cool. We're trying to do it with Torque.
So, can I move RTSUnit towards my needs, or if I need to use regular units with the RTS Starter Kit instead?
(to defer the recommendation of implementing permutations and combinations, our concept involves multiple mount points with many options for each. It's certainly *doable*, but I'm not sure its preferred, or really necessary)
#3
As for your wanting to mount them a la normal Torque, take a look at the rtsUnits pack and unPack functions, then take a look at the packUpdate methos for shapeBase. you will notice that the rtsUnit version, while it masks for images that don't need any updating, it doesn't send any info. It will need to transmit the image data like shapeBase does (don't forget the unpack methods too).
While rtsUnit is derived from player and shapebase, it bypasses their pack/unPack methods, so the only information sent to the clients is contained in it's own methods.
But do consider that going that route will add 8 or 9 more pieces of data to be sent per weapon, per unit. WHich could get to be a pretty heavy extra burden if you are planning on allowing hundred(s) of units on screen at any one time.
01/09/2005 (7:42 pm)
We are working alonge these lines, except we've no plans to have seperate weapon objects. We'll end up implementing the different weapons based on enviroment, distance to target, etc, where each machine will calc what type of projectile to fire from where.As for your wanting to mount them a la normal Torque, take a look at the rtsUnits pack and unPack functions, then take a look at the packUpdate methos for shapeBase. you will notice that the rtsUnit version, while it masks for images that don't need any updating, it doesn't send any info. It will need to transmit the image data like shapeBase does (don't forget the unpack methods too).
While rtsUnit is derived from player and shapebase, it bypasses their pack/unPack methods, so the only information sent to the clients is contained in it's own methods.
But do consider that going that route will add 8 or 9 more pieces of data to be sent per weapon, per unit. WHich could get to be a pretty heavy extra burden if you are planning on allowing hundred(s) of units on screen at any one time.
#4
Thank you for your advice.
01/12/2005 (5:14 pm)
Part of our desire to have the flexibility in weapons was a concession in terms of unit numbers. We'll be on the low side, for sure.Thank you for your advice.
#5
01/12/2005 (7:14 pm)
If your plans are not have very large numbers of units, then you ought to do fine with the extra netload, especially considering that the RTSUnit is efficient to begine with. For us, I think what will eventually dictate the unit limit is how our implementation of AI turns out.
#6
Ed, as Martin points out, this is certainly possible in the RTS SK, and fairly easy to do. Sounds like you've got an interesting design.. don't forget to share previews. :)
01/13/2005 (4:24 am)
Thanks for the detailed reply Martin, nice job.Ed, as Martin points out, this is certainly possible in the RTS SK, and fairly easy to do. Sounds like you've got an interesting design.. don't forget to share previews. :)
#7
01/13/2005 (8:30 am)
We're in the process of testing the idea of mounting weapons on RTS units vs "organic weapons"--where the weapon is part of the base model--ourselves. It is looking as if the better option is to have the weapons integrated with the unit model instead of mounted, for the reasons Martin pointed out--they trimmed down RTSUnit for a reason (performance, especially network), and it can be very easy to forget/ignore those design decisions and make ones that may bite you when you get to a high number of units in a game.
Associate Anthony Rosenbaum
Instead make differant units that have a seperate dts file , and datablock.