Do weapons support categories for damage?

Do weapons support categories for damage?

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

Post Reply
User avatar
MadRat
Posts: 532
Joined: 24 Oct 2006, 13:45

Do weapons support categories for damage?

Post by MadRat » 24 Oct 2006, 14:19

I'm new here and have just skimmed over the tutorials. One of my pet peeves with modding TA was that you couldn't tell weapons that they could only affect certain unit categories. Instead one had to define every unit under the sun if they had slightly different effects per unit. And when creating games with 3rd party units you had to meticulously go back through every weapon to make sure they were within the weapons files. I've always thought that it would of been more wise to say something anti-air has so much effect on air units. Something anti-vehicle has so much anti-vehicle, and so on.

Does Spring fix this?
0 x

User avatar
FireCrack
Posts: 676
Joined: 19 Jul 2005, 09:33

Post by FireCrack » 24 Oct 2006, 14:46

I beleive you can do this.
0 x

User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k » 24 Oct 2006, 17:02

Yes, instead of unitnames the damage section now takes the keywords defined in the armor.txt that's supposed to be in the root folder of your mod.
0 x

User avatar
PauloMorfeo
Posts: 2004
Joined: 15 Dec 2004, 20:53

Post by PauloMorfeo » 24 Oct 2006, 20:29

Just keep in mind that the system is broken as you can read in this thread:
http://taspring.clan-sy.com/phpbb/viewt ... 632#128632

To sum it up, a unit can only efectively belong to one class in Armor.txt.
0 x

User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh » 25 Oct 2006, 01:31

Just because you're not doing it right does not mean it doesn't work, as I stated in that thread :P
0 x

User avatar
MadRat
Posts: 532
Joined: 24 Oct 2006, 13:45

Post by MadRat » 25 Oct 2006, 03:46

Its explained like mud in that thread unfortunately. I would think it would build an array with weapons in one coordinate and unit names in another. When it builds the array I'd think it would first look through damage according to a unit category (in this case its per unit in the armor.txt file?) and then individual listings under the specified damage lists. I'd think the latter value would overwrite the former value.

Argh, can you explain this in simple layman's terms?
0 x

User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh » 25 Oct 2006, 08:28

Firstly, go download NanoBlobs 0.63... it is full of things that will teach you how mods should be structured, how to use many advanced features of Spring, has commented animation scripts, and much more. If you still have questions after looking through it, let me know.
0 x

User avatar
PauloMorfeo
Posts: 2004
Joined: 15 Dec 2004, 20:53

Post by PauloMorfeo » 25 Oct 2006, 13:28

Argh wrote:Just because you're not doing it right does not mean it doesn't work, as I stated in that thread :P
I'm sorry Argh, but you are quite wrong. As i stated in that thread :P.

https://taspring.clan-sy.com/svn/spring ... /UnitDef.h

Code: Select all

struct UnitDef
{
	...
	int armorType;
	...
}
https://taspring.clan-sy.com/svn/spring ... andler.cpp

Code: Select all

void CUnitDefHandler::ParseTAUnit(std::string file, int id)
{
	ud.armorType=damageArrayHandler->GetTypeFromName(ud.name);
}
Units can belong to only one armor type. Your mod works fine because you don't have any unit in more than one class. If you did, you would notice that the armor.txt thing is broken, that a unit would be associated to only one of the classes in armor.txt to which it would suposedly belong.

I swear, this is the last time i will bother explaining that it is broken...
0 x

User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh » 26 Oct 2006, 02:15

It is not broken... you're just expecting it to do something it wasn't designed to do. Why is using one Armor class so hard? You can just adjust by weapon, like I did in NanoBlobs... no problems. If you have a very special case you need a very special value for, then create that special case. It's not that hard :P
0 x

User avatar
PauloMorfeo
Posts: 2004
Joined: 15 Dec 2004, 20:53

Post by PauloMorfeo » 26 Oct 2006, 13:56

Argh wrote:It is not broken... you're just expecting it to do something it wasn't designed to do. ...
- The documentation in the wiki explains diferently.
- It was meant to work diferently (don't know how it actually did in oTA).
- It sucks...
Argh wrote:... Why is using one Armor class so hard? ...
And it sucks because, imagine this: i have a Bulldog. I want it to belong to all of these classes:
- GroundUnits
- BattleTanks
- Lvl2Units
- Lvl2BattleTanks
So i can make weapons give dif dmg to all ground units, or only to battletanks, or ..., or ...

Not that it bothers me that much, you know, because i have always been all for using the least amount (few or none) of special damages. (i don't like rock/paper/scissors) But i think it is important to be noted because i know for sure that newcoming moderss, like the original poster, will try to put units into more than one class in armor.txt and will end up wondering why it doesn't works (if it notices at all).
0 x

User avatar
Pxtl
Posts: 6112
Joined: 23 Oct 2004, 01:43

Post by Pxtl » 27 Oct 2006, 05:39

Well, multiple armour classes does create the problem of which to choose when a weapon has damages defined for two different classes that the target is both a member of.

Really, single class would be enough _if_ your classes and various other stats are being generated through an external script. If you're hand coding, it's not really expressive enough if you have complex armour classing system.
0 x

User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh » 27 Oct 2006, 06:13

Paulo... if you have a Bulldog, and you need it to have a very special class... just make a class called "Bulldog"... add it to the weapons... and you're done. Then the Bulldog either takes default damage, or Bulldog damage, if it exists. This is how it was done in OTA, and since weapons can only apply one type of damage to one type of object, I still don't see the problem here.

If you assigned a Bulldog to multiple damage categories, then... how would the engine decide which one to apply? For example:

Code: Select all

[DAMAGE]
{
default=1000;
GroundUnits=200;
BattleTanks=2000;
Lvl2Units=1500;
Lvl2BattleTanks=1000;
}
The first one? The last one? A random one? Give me a break! If you really need to have that Bulldog take special damage from a certain weapon, make class like this:

[BULLDOG]
{
Bulldog=99;
}

Then have any weapons that do special damage to the Bulldog have a Bulldog category in their damage table, otherwise have them do default :-) It's really that easy. I don't see adding a Bulldog category, in the very few cases that might call for it in a mod that doesn't make very strong use of RPS balance ... as a major big deal. In NanoBlobs, where I do very strongly make use of RPS, I solved the problem by simply thinking through my categories logically, and reducing them to the lowest possible number that made game-design sense. Any small wrinkles that showed up are soooooo easily corrected by hitpoint adjustments to the unit that is having problems that it really isn't an issue at all.
0 x

User avatar
Snipawolf
Posts: 4357
Joined: 12 Dec 2005, 01:49

Post by Snipawolf » 27 Oct 2006, 13:13

I am going to have flesh, light, heavy, and fortified armors :P

Flesh is kinda simple, huh?
Light covers light vehicles and airplanes.
Heavy covers my tanks and other stuff.
Fortified is for buildings and extremely large units..
Last edited by Snipawolf on 28 Oct 2006, 00:58, edited 1 time in total.
0 x

User avatar
Caydr
Omnidouche
Posts: 7179
Joined: 16 Oct 2004, 19:40

Post by Caydr » 27 Oct 2006, 19:47

As Argh says, units can only exist in one category if you want things to work right. That's all there is to it.

The reason the wiki says otherwise can be found in the list of users who contributed to that particular page and the dates on which they did so. They were individuals who had little or not experience in modding Spring at the time.
0 x

Post Reply

Return to “Game Development”

cron