Unit experience, damage taken and dealt?
Moderator: Moderators
Unit experience, damage taken and dealt?
Trying to track these.
Has anyone figured out how to accurately log them on a per player basis?
Has anyone figured out how to accurately log them on a per player basis?
Re: Unit experience, damage taken and dealt?
Spring.GetTeamStatsHistory ?
Re: Unit experience, damage taken and dealt?
Code: Select all
damageDealt = {}
UnitCreated (blabla unitid)
damageDealt[unitid] = 0
end
UnitDamaged (blabla attackerid, damage, bla)
damageDealt[attackerid] = damageDealt[attackerid] + damage
end
UnitKilled (unitid, bla)
damageDealt[unitid] = nil
end
Re: Unit experience, damage taken and dealt?
What about xp?
Re: Unit experience, damage taken and dealt?
Spring.GetUnitExperience ?
Re: Unit experience, damage taken and dealt?
I guess to track experience gained one would have to compare present/past experience of attacker in UnitDamaged.knorke wrote:Spring.GetUnitExperigence ?
Re: Unit experience, damage taken and dealt?
you may want to consider somehow applying XP within a radius of a dying enemy; otherwise you'll just end up feeding the units with the strongest attacks
Re: Unit experience, damage taken and dealt?
Thing is spring has a built in xp system with levels and all but I have no idea how it works. I like the current but want to boost it for healing peeplz/taking damage(for tanks) so that not just fighters get xp out the yoohoo
Re: Unit experience, damage taken and dealt?
afaik it is just a number that goes up when a unit deals damage, no levels or something.Thing is spring has a built in xp system with levels and all
it increases health and some other things like accurracy/target leading.
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Unit experience, damage taken and dealt?
Moreover, it is biased towards units to that have short reload times attacking large units. For example a unit with a laser that has a reload of 0.1 and does 1 damage per hit shooting a unit that is worth much more than it will rack up experience at a stupidly high rate. Imagine jeffy with reload rate of 0.1 shooting a goliath. Does practically no real damage, but by the time the golly has died, the jeffy has 5x the amount of health it started with.
If it were weighted upon actual damage done, it would be a quite good system.
If it were weighted upon actual damage done, it would be a quite good system.
Re: Unit experience, damage taken and dealt?
and then the goli shots the jeffy and there it goes flying in pieces.
whats your point?
whats your point?
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Unit experience, damage taken and dealt?
now imagine that the weapons are reversed
Golly has uber hp but a little pew pew laser that does fuckall for damage but fires rapidly. 2 Gollies meet, and start firing upon each other, neither can kill the other because xp builds up so exponentially.
Before you know it, gollie has tripled it's hp.
That's the point. It's dependent upon shots fired and metal cost of the target, and as such it's a very broken system.
Best system would be xp gained for kills. Not for shots landed.
Golly has uber hp but a little pew pew laser that does fuckall for damage but fires rapidly. 2 Gollies meet, and start firing upon each other, neither can kill the other because xp builds up so exponentially.
Before you know it, gollie has tripled it's hp.
That's the point. It's dependent upon shots fired and metal cost of the target, and as such it's a very broken system.
Best system would be xp gained for kills. Not for shots landed.
Re: Unit experience, damage taken and dealt?
last hit, I get all xp, I win.
-
- Moderator
- Posts: 2464
- Joined: 12 Oct 2007, 09:24
Re: Unit experience, damage taken and dealt?
For experience: Lua it. As Forboding pointed out the xp gaining system is a bit broken. Also units do not have levels and only HP and Reload Time can be modified. They follow a hardcoded curve based on XP which can be scaled with modrules.
Anyway back to the topic. To track damage taken and dealt use
Anyway back to the topic. To track damage taken and dealt use
You can keep a table and track whatever you want with this. Be aware that projectiles from dead units will have nil attackerID and attackerTeam (I cannot recall what attackerDefID does in this situation). So for example a unit that is a single shot missile will never have damaged registered for it's team.function gadget:UnitDamaged(unitID, unitDefID, unitTeam, damage, paralyzer, weaponID, attackerID, attackerDefID, attackerTeam)