Login

russian armor

Modifying Veterancy System

14 Aug 2017, 22:53 PM
#1
avatar of Nosliw

Posts: 515

As it appears, the veterancy system in the game cannot be changed. However, I have been trying to figure out a way to make a mod where squads gain veterancy only by killing units (like how USA gained veterancy in CoH1).

So far, I've increased the XP required for each level substantially (as to not let damage accumulate XP) and then have been toying around with trying to figure out how I am going to award a squad XP when they kill a unit.

I was fiddling around with the kill_action command, using it combined with action_veterancy (to no avail), as well as combining it with counter_with_ability_action, and trying to activate an ability on the "shooter" called "veterancy", which awards 1,000,000XP (since 8,000,000 XP required for vet1). None of these ideas have worked.

Could any of you help? What would be the best way to design a squad so it gains no (or negligible compared to XP required for vet) XP from damaging enemy units, and only gains (or gains substantial numbers of) XP from killing enemy units?

Edit: right now I have something working, where I combined kill_actions with actions/change_target, set the target type to squad, and the acociated action with action\veterancy. It works SOMETIMES... some kills the squad gets will award 1,000,000 XP (1/8 of the progress bar), and some kills will award 0 XP. Not sure why or how to fix.
15 Aug 2017, 20:40 PM
#2
avatar of ZombiFrancis

Posts: 2742

I have made attempts on this in the past, and I haven't been able to figure out a good solution.

There are the changes that were made in recent patches to reduce the xp gained from infantry AT. I think it reduces the damage done directly by the weapon that gives the squad veterancy, and instead the remaining damage is applied directly through an action. You'd have to do this with every weapon though, which would be very clunky and time consuming to do.

The balance team or relic would have to clarify. I only have access to my coh2 computer on weekends. :P

However I think this method is what has resulted in things like bazookas being bugged so they don't kill their targets when they're reduced to 0 health...

Also this method doesn't affect units getting veterency from taking damage I think. And that's kind of a whole other monster.

I'll dig up my old test mod and see if theres anything useful related to vet in there. I think I ended up rebuilding purchased vet and gave up on adjusting how veterency was gained back in like 2015. :D

I think you could potentially leave giving and taking damage alone and just massively scale up vet requirements as I think it would be easier to do what you're doing and have a much, much larger amount of xp given per kill.

Argh I wish I had mod tools handy here so I could help before friday. ;)
15 Aug 2017, 21:17 PM
#3
avatar of Nosliw

Posts: 515

I tried that solution too. The problem with increasing the XP given per kill is it messes with the Command Point progression.

The only way I can see it happening is increasing the XP required to gain veterency by a huge amount as so that damage gives negligible XP, and then awarding XP to the squad when it kills entities. But even this has proven to be a feat.
15 Aug 2017, 21:22 PM
#4
avatar of ZombiFrancis

Posts: 2742

Argh the CP factor. Now I remember that was the bane of my existence. I tried to reintroduce spending CPS on commanders. That's when I gave up.
16 Aug 2017, 14:31 PM
#5
avatar of Mr.Smith

Posts: 2636 | Subs: 17

I don't know how to do what you're asking. However, what I would start looking for is a way for squads to gain additional XP when they land a killing blow. The rest is easy.

I've never used kill_actions. However it sounds much cleaner than what I am about to recommend, so I suggest you continue toying around that.

1. Awarding veterancy

If you look at the tiger ace files, there's an action that awards veterancy to the tiger (it's either in the ebps file or the sbps file; can't remember). What you need to do is find a trigger for it.

2. Adding a Trigger (try to avoid it, if a better way exists)

If no such trigger exists, you can create your own trigger as follows:
- Go through each entity in the files and look for their death criticals (e.g., vehicle_destroy for vehicles, and I don't know what the name for soldiers is).
- Remove the destroy/brew-up/whatever criticals from the entity file; you're going to add them manually to the weapons
- For every weapon in the game, add a post-damage action that checks for the HP of the target:

Do so as follows:
- If the enemy unit has 0% HP, you should trigger vehicle_destroy on the enemy vehicle
- You should also trigger a veterancy-awarded action on your own unit (change-target-action -> self; award veterancy)
- To keep the interface clean, I recommend creating a special my_vehicle_destroy_crit and my_infantry_kill_crit. Inside each of those crits you call the actual vehicle destroy crit, and you also award the veterancy to the killer
- Inside the my_vehicle_destroy crit, you should also specify how much veterancy each vehicle should award (check Brit Command Vehicle to see how you can have a "switch" statement like this).

3. Removing on-hit veterancy

Once you've done the had part, what remains is to prevent units from awarding veterancy when hit (but are still alive). The way to do this is add an "awarded_veterency" (sic) modifier to each squad sbps with a multiplier set to 0. You can find the precise name of this modifier under sbps -> veterancy.

Currently this modifier is used to add 20% XP worth to each unit as it vets up.

4. Schreck veterancy (not a solution, but for reference)

The hack we used to fix schreck veterancy is commute some raw damage to a 'damage' action. That is because we, accidentally, discovered that the damage-action awards no veterancy of its own.

The schreck-veterancy method is ugly, and you should probably avoid this, as it will make your files difficult to read. Even if this works, I would only integrate this at the final stages of your mod, so that you have the flexibility to update the weapon files in a more humane way.
16 Aug 2017, 15:01 PM
#6
avatar of Mr.Smith

Posts: 2636 | Subs: 17

Note that the reason why your solution might sometimes fail to work is if the kill fails to register as a kill. For instance, brew-up criticals might register as a ritual suicide rather than a kill.

I don't know what kind of criticals exist with respect to infantry. However, the fact that you get inconsistent performance is because some crits might count as a kill while others may not.
16 Aug 2017, 17:17 PM
#7
avatar of Nosliw

Posts: 515

Note that the reason why your solution might sometimes fail to work is if the kill fails to register as a kill. For instance, brew-up criticals might register as a ritual suicide rather than a kill.

I don't know what kind of criticals exist with respect to infantry. However, the fact that you get inconsistent performance is because some crits might count as a kill while others may not.


Thanks for the lengthy and detailed reply. I went ahead and tried the suggestion in this quote first before looking towards the other one - and this fixed the issue. There were two infantry death crits when dying to small arms fire, one called soldier_killed with 75% occurrence rate, and another called make_casualty with 25% occurrence. Removing the make_casualty now causes every kill my Rifleman squad gets to award veterancy.

However, I'm also fiddling around with what you said. But I'm stuck - how do I do a check on the targets HP? I see a requirement action where I can specify a health requirement ... but not sure how I can trigger an action on self depending on a target's HP?
16 Aug 2017, 19:15 PM
#8
avatar of Nosliw

Posts: 515

Okay so new issues:

The kill_action combined with the veterancy_action only applies veterancy to the squad when it causes soldier_killed critical, not make_casualty.

Removing make_casualty from the target critical table fixes this. However, this makes it so there are no casualties being produced, and abilities such as interrogate wont work anymore.

I tried the method you described above, however, when changing target to "self" on the post-damage actions, I'm pretty sure self is the gun, not the squad, and thus when I tried the veterancy_action, it had no effect.

The best solution I could possibly think of would be to use the death_action on the entity, but I would have to somehow find a way to target the squad responsible for causing the death. If I could simply do that, I could make each entity reward a certain amount of experience to whatever killed it. This would be the best solution I think. Do you know if it's possible to target a squad who is attacking you, or has killed an entity?
17 Aug 2017, 10:41 AM
#9
avatar of Mr.Smith

Posts: 2636 | Subs: 17

jump backJump back to quoted post16 Aug 2017, 19:15 PMNosliw

I tried the method you described above, however, when changing target to "self" on the post-damage actions, I'm pretty sure self is the gun, not the squad, and thus when I tried the veterancy_action, it had no effect.


Self is probably the entity that fired the shot. Try the following:

Change target -> self
Change target -> squad
veterancy

To make sure that your setup works until that point, try this:

change target -> self
make dead

The above should make it so that every time you damage something, the squad member that did it died.

Then, to make this action only trigger if the squad is at 0% health, you need a requirement action that checks the health of the target. I really don't remember what it's called, but I'm sure it exists. You just need to check that the health percentage is at 0%.

First do your check for squads that have 30% or lower HP. That's because 0% HP entities tend to die.

Then. To make it so that you only award XP when the entities die:
- Remove soldier_killed and make_casualty from the criticals
- Change your requirement threshold from 30% to 0%
- Add the two to the weapon file you are modifying (along with the veterancy action but, obviously, not wrapped inside change-target-self); to preserve randomness, add them as a random action with weights similar to what they had

jump backJump back to quoted post16 Aug 2017, 19:15 PMNosliw

The kill_action combined with the veterancy_action only applies veterancy to the squad when it causes soldier_killed critical, not make_casualty.

Removing make_casualty from the target critical table fixes this. However, this makes it so there are no casualties being produced, and abilities such as interrogate wont work anymore.


I'm thinking there's no other way to implement this, other than messing around with the weapon files. Even if you manage to get the kill-action method working, you will have no way to tell what died. Then, you will end up in a situation where you will have to award the same amount of XP for a conscript kill as for a King Tiger kill.

jump backJump back to quoted post16 Aug 2017, 19:15 PMNosliw

The best solution I could possibly think of would be to use the death_action on the entity, but I would have to somehow find a way to target the squad responsible for causing the death. If I could simply do that, I could make each entity reward a certain amount of experience to whatever killed it. This would be the best solution I think. Do you know if it's possible to target a squad who is attacking you, or has killed an entity?


I don't think that any such action exists. At best you can use a target action to pick a random squad close to the squad that died to award the veterancy. However, that's probably not what you need. To see how the 'Target' action is used check the medic-auto-heal ability on USF medics.

18 Aug 2017, 12:49 PM
#10
avatar of Nosliw

Posts: 515

Hey Mr. Smith. Thanks again for the very detailed and well thought out reply.



Self is probably the entity that fired the shot. Try the following:

Change target -> self
Change target -> squad
veterancy


Funnily enough, the night before you posted this, I also found this solution, and it worked. I was able to award experience to a squad whenever it triggered make_casualty (since I guess it counts as an alive entity with 0 health, so the requirement_health check of 0 sees this).
To make sure that your setup works until that point, try this:



Then. To make it so that you only award XP when the entities die:
- Remove soldier_killed and make_casualty from the criticals
- Change your requirement threshold from 30% to 0%
- Add the two to the weapon file you are modifying (along with the veterancy action but, obviously, not wrapped inside change-target-self); to preserve randomness, add them as a random action with weights similar to what they had



This part was very interesting and got me thinking.

I am not able to test this until I'm home again on Monday, but I'll ask anyway, in case you know. If I go to say, the pioneer_mp entity and go to health -> criticals, and delete all the criticals that trigger at 0 health, would the entity then be invincible? Or put another way, is an entity without 0 health death criticals unable to die? If so, I was thinking I could merely just remove all the death criticals from German soldiers, and create them on the USA guns instead.

Example, on the M1_Garand, I could do:

post_damage_action:


requirement action:
change target -> self
change target -> squad
veterancy action -> award 1,000,000 XP (so 8 pioneer kills yields Vet1)
requires all:
unit_type = infantry
requirement_health = max 0, min 0




requirement action:
random action:
trigger critical: soldier killed
trigger critical: make casualty

requires all:
unit_type = infantry
requirement_health = max 0, min 0



So 1 action checks health and unit type and rewards XP, and then the next does the same check but will kill the target. I could then just copy/paste this action to all infantry weapons, and in theory can do the same to AT weapons as well (just change the death crits and unit type check).

What do you think?
18 Aug 2017, 13:20 PM
#11
avatar of Mr.Smith

Posts: 2636 | Subs: 17

jump backJump back to quoted post18 Aug 2017, 12:49 PMNosliw

This part was very interesting and got me thinking.

I am not able to test this until I'm home again on Monday, but I'll ask anyway, in case you know. If I go to say, the pioneer_mp entity and go to health -> criticals, and delete all the criticals that trigger at 0 health, would the entity then be invincible? Or put another way, is an entity without 0 health death criticals unable to die?


That's pretty much it, yep!

For instance, the OKW Breakthrough officer model has a bug in that it is immortal to flame damage, due to the absence of death critical from flame weapons.

This means that if you try to take the officer 1-on-1 with a flamethrower, you can knock his health down, but he will never die :O

jump backJump back to quoted post18 Aug 2017, 12:49 PMNosliw

If so, I was thinking I could merely just remove all the death criticals from German soldiers, and create them on the USA guns instead.


Yep! That's precisely what you should do.

Note that you need to do this for -every- weapon that can attack german soldiers, though.

This list should include:
- USA weapons
- Soviet/UKF weapons (since they can also attack germans)
- Grenades
- All tank MGs
- All tank cannons etc
- Offmap abilities (even though you don't care about veterancy, offmaps should still kill units!)
- Damage-over-time weapons (e.g., molotov-like abilities deal both direct damage and damage-over-time)
- German slot items (which can drop and be picked by americans)

Also, note that some weapons already have insta-death-critical actions (e.g., snipers, pathfinders, demos). For instance, Pathfinder slot items have a chance to kill infantry units below 50% HP. If you don't fix this, pathfinders that trigger the snipe will kill enemy units but not gain any HP for it. For those weapons, you should also award XP, but double-check that you are not awarding double-XP (one for the snipe and one for the 0-HP).

Since I suspect that you want CoH1-style veterancy for USF, and if you want only USF guys to gain veterancy from kills, you can add a requirement for the ownership of the enemy unit to be german on west_german.

jump backJump back to quoted post18 Aug 2017, 12:49 PMNosliw

Example, on the M1_Garand, I could do:

post_damage_action:

So 1 action checks health and unit type and rewards XP, and then the next does the same check but will kill the target. I could then just copy/paste this action to all infantry weapons, and in theory can do the same to AT weapons as well (just change the death crits and unit type check).

What do you think?


That could work. Personally, I would place both actions under the same requirement check, as follows:


requirement action:
{
change target -> self
change target -> squad
veterancy action -> award 1,000,000 XP (so 8 pioneer kills yields Vet1)
}
{
random action:
trigger critical: soldier killed
trigger critical: make casualty
}
requires all:
unit_type = infantry
(required ownership german or west_german)
requirement_health = max 0, min 0


To minimize resource consumption, I would also set the following two flags to True:
- No-retrigger
- Instant requirement check
18 Aug 2017, 13:34 PM
#12
avatar of Mr.Smith

Posts: 2636 | Subs: 17

Or, better yet, something you can copy-paste to all weapons in the game (including german once etc) is the following nested requirement action:

Code

requirement action1:
{
{
requirement action2:
[b]check_requirement_self to TRUE[/b]
{
change target -> self
change target -> squad
veterancy action -> award 1,000,000 XP (so 8 pioneer kills yields Vet1)
}
requires ownership: USF
}
{
random action:
trigger critical: soldier killed
trigger critical: make casualty
}
requires all:
unit_type = infantry
requires_any_in_list
(required ownership german)
(required ownership west_german)
requirement_health = max 0, min 0


Requirement action 1 checks if the unit should die (and kills it).
Requirement action 2 checks if the killer is a USF unit and awards veterancy as necessary.

Requirement action 2 is inside requirement action 1, as the first action. You need to have instant requirement check to true for both actions.

Once you get implement this, and we verify it can work (for a small number of weapons), tell me and we can work on rephrasing requirement action 2 so that it awards a different amount of veterancy per unit type.
18 Aug 2017, 15:39 PM
#13
avatar of Nosliw

Posts: 515

You think there's a way if incorporating different unit types to the same action? I was originally just thinking of have several post_damage_actions, one for each unit type I want where I can simply copy the previous code in its entirety, and change unit_type to say, sniper, and then change the veterancy to 3,000,000.
18 Aug 2017, 16:00 PM
#14
avatar of Mr.Smith

Posts: 2636 | Subs: 17

jump backJump back to quoted post18 Aug 2017, 15:39 PMNosliw
You think there's a way if incorporating different unit types to the same action? I was originally just thinking of have several post_damage_actions, one for each unit type I want where I can simply copy the previous code in its entirety, and change unit_type to say, sniper, and then change the veterancy to 3,000,000.


You could. That would be very difficult to maintain in the long-run though (e.g., what if you want the sniper to be worth 2x the experience? You'd have to remodify every single weapon).

Instead, I suggest (ab)using the slot item system to streamline XP worth.

- Each slot item, e.g., will be worth 50XP
- Each squad will hold a specific amount of (blank) slot-items denoting their worth (e.g., pioneer entities will be worth 4 slot items, and grenadiers will be worth 6 slot items).

Then, in your nested requirement action, the victor will gain 50XP points per special slot items that the squad was carrying

Then, to award 50XP per slot item, you have two options:

1) Create a nested requirement action, as follows:

Code

Requirement action_1:
{
Award 50 XP
requirement action_2
{
50 XP
requirement_action_3
{
....
}
required_slot_item count min = 3, max = 100
required_slot_item count min = 2, max = 100
required_slot_item count min = 1, max = 100


2) Flat list of requirement actions
- Same as above, but not nested

The benefit of using slot-items is that you can extend it later on so that, e.g., when units gain veterancy they are worth more XP.

The reason I gave you two options is to see which one causes the least amount of lag; if any.

For the examples above, 50 XP is your unit quantum, and you should pick it as the greatest common divisor of all veterancy values.

Otherwise, you can further extend the system as follows:
- If you are comfortable with binary math, you can create (e.g.) 10 slot item types, to represent XP values 1, 2, 4, 8, 16, etc. That way you can represent all integer XP values from 0 to 1023, without having to check for slot item stacking (which means fewer checks to run)
- Otherwise, you can use different slot item denominators like how we use for money IRL (5-dollar bills, 500-dollar bills, etc).
21 Aug 2017, 15:07 PM
#15
avatar of Nosliw

Posts: 515





So already I have come upon an issue.

I started with my original setup:

post damage:

required action:

action: target self/squad/vet 1,000,000

requirements:
type: german_infantry
health: 0
slot_item: xp_1_vet

And this setup worked.

But, as soon as I tried to do put the xp_1_vet slot item into a nested requirement (so the action for requirement 1 was a requirement action with the slot_item requirement, and the veterancy action) it no longer works.
21 Aug 2017, 19:10 PM
#16
avatar of Mr.Smith

Posts: 2636 | Subs: 17

jump backJump back to quoted post21 Aug 2017, 15:07 PMNosliw




I'd have to see a screenshot to verify what's wrong.

Just make sure that you don't nest your requirement action inside a change-target-action->self, otherwise, you're checking your own unit for the slot item etc.
9 Dec 2017, 12:51 PM
#17
avatar of Kalkstein

Posts: 8

Or, better yet, something you can copy-paste to all weapons in the game (including german once etc) is the following nested requirement action:

Code

requirement action1:
{
{
requirement action2:
[b]check_requirement_self to TRUE[/b]
{
change target -> self
change target -> squad
veterancy action -> award 1,000,000 XP (so 8 pioneer kills yields Vet1)
}
requires ownership: USF
}
{
random action:
trigger critical: soldier killed
trigger critical: make casualty
}
requires all:
unit_type = infantry
requires_any_in_list
(required ownership german)
(required ownership west_german)
requirement_health = max 0, min 0



Thank you both for this solution. I implemented this for my CoH-Retro mod, where I wanted the US faction to have the veterancy system like in CoH 1. And it actually works really well (beside being some amount of work changing all weapons - but I had to do that anyways).

First I was also looking for the death_actions in combination with shooter_action (or something called similar). But soon I realised there was a comment on this action saying it does currently not work (at least the way we want it to do). That's why I looked up here.

For the amount of xp earned I used the slot item solution. For detecting correct the critical death action I used the entity type.

To get this solution work I had to play around a bit with the trigger options of the requirement_actions. It does only work in a specific setup. I would have to look it up, but if you didn't manage to make it work I could paste my code here.
9 Dec 2017, 16:19 PM
#18
avatar of Nosliw

Posts: 515




I'm just curious, what do you mean by CoH retro mod? When making this thread, I was myself attempting to clone CoH1 into CoH2. I managed to create the USA Headquarters (and all units/upgrades), Barracks (all units and ugprades), WSC, and Motor Pool (all units and upgrades). I also created a functional doctrine system, and finished the creating the Airborne doctrine. It was quite tedious producing all the weapons, especially since each has a unique target table with over 40 entries. I've since been slacking for the last 3 months and haven't touched it (since my mortar barrage failed to work, sniper was being buggy, and I couldn't get a visual gunner on my M8). How's your progress going? Any chance maybe on doing a collaborative work?
9 Dec 2017, 19:34 PM
#19
avatar of Kalkstein

Posts: 8

This sounds great! It seems like we had the same idea. I have implemented a fair amount already, with still some things to do. I would appreciate a collaboration - you know how boring it get's to type in all the weapon stats.

You can view a stable version of my progress at Steam Workshop

My mod is at some playable point, but not finished yet. You may add me on Steam: Profile

I'm not hunting for credit or something - I just really want CoH 1 back. Let's do this together.
1 user is browsing this thread: 1 guest

Ladders Top 10

  • #
    Steam Alias
    W
    L
    %
    Streak
Data provided by Relic Relic Entertainment

Replay highlight

VS
  • U.S. Forces flag cblanco ★
  • The British Forces flag 보드카 중대
  • Oberkommando West flag VonManteuffel
  • Ostheer flag Heartless Jäger
uploaded by XXxxHeartlessxxXX

Board Info

931 users are online: 931 guests
0 post in the last 24h
0 post in the last week
28 posts in the last month
Registered members: 49432
Welcome our newest member, weekprophecy
Most online: 2043 users on 29 Oct 2023, 01:04 AM