Login

russian armor

Modding Commanders - Custom Unit Deployment

19 May 2024, 17:18 PM
#1
avatar of Ellie7598

Posts: 12

Hello guys, I would like some help as I've looked everywhere and tried everything I could think of, but I cannot figure it out.

I am trying to create a custom unit deployment commander ability, and it works perfectly, except that I cannot find a way to link it to the commander. I tried making a custom archtype upgrade, but it doesn't seem to apply it when the commander is picked.

I messed with every setting but could not find any method of getting the ability to appear when the commander was selected.

Please can somebody shed some light on this?
22 May 2024, 17:16 PM
#2
avatar of SneakEye
Senior Modmaker Badge

Posts: 817 | Subs: 5

Hi,
Although the files in the category 'commander' can be cloned, but the game does not use them. Which means it is not possible to edit commanders that way.

There is a workaround! Each commander unlocks 5 upgrades. These can be found in the category 'commander', select one of the ability links and press the spacebar, then the upgrade link is shown within the ability.

If you make a custom ability and set the requirement to one or more of those player upgrades, then the ability will be unlocked after a commander with the upgrade(s) is selected. It is important that the new ability is added in the player ability list in the category 'army' > abilities.
Without that the ability will never be visible.
23 May 2024, 17:05 PM
#3
avatar of Ellie7598

Posts: 12

Yeah, I had thought about that, although it does mean I'm limited to working within the game's commander upgrades. I'll look into it.
25 May 2024, 12:57 PM
#4
avatar of Ellie7598

Posts: 12

There's another, more concerning matter, though no clue if you'll be able to help. You see, at a seemingly random time, my game starts to lag. This is when playing with my mod + Cheat Commands II in custom matches, just me and the AI.

The lag is really bad, and happens no matter the map nor circumstances. We're talking freezing for multiple seconds with less than a second inbetween, rendering the match over because it's impossible for me to keep playing.

I have no idea what causes this, have you got the faintest clue? It is frustrating, usually it only happens mid way through the match but I find with more AIs present it happens earlier on.

My best guess is it's the AI attempting to do something it can't and getting confused or something, causing lag as it loops? It usually begins with a normal lag spike due to lots going on, and will then persist. I've disabled a lot of regular spawns and abilities as I wanted to "rebuild" CoH2 from the ground up, slowly re-adding bits once I'm happy with them.

For Context, my Mod aims to make the game mainly tank-focused, similarly to ones like Tank Combat 7.8, but with a lot more vehicles, unique abilities and functions, and better balance, creating a unique and more nuiansced experience while also being simpler and more straight forward than vanilla (I suck at vanilla, mainly an issue with paying attention and not floating resources / idling units)
25 May 2024, 17:17 PM
#5
avatar of SneakEye
Senior Modmaker Badge

Posts: 817 | Subs: 5

Finding the cause of lag is very hard. Overall, the AI itself consumes a lot of CPU and the game does not utilize many cores. Pathing is the biggest problem. The larger the map and the more AI players, the more lag.

There are some settings in ai_settings\default_skirmish_<difficulty> to reduce the amount of parallel actions and how long it remembers locations. I set pathing_theat_memory_duration from 120 to 30. And I use in tatic_retry_timeout_defaults a minimum of 3 seconds.

Besides that, abilities with filters, aura's and interval_actions also have a bad impact on the performance. OKW's Forward Receivers is one example of an ability that causes lag (abilities\west_german\always_on_ability\dispatch_ability\sws_halftrack_forward_receivers). The combination of always_on with the timed_action should really be avoided. In this case, the animator_set_state action can be directly in the action_table, without the timer around it.

If lag appeared recently, then retrace your steps. What kind of changes did you make since the last test?
25 May 2024, 18:55 PM
#6
avatar of Ellie7598

Posts: 12

Yeah, I will try that and see if it changes anything. The lag hasn't appeared that recently, I don't know what causes it. Regarding always on abilities, I do have a couple. For example, the T-100LT Light Tank I added has an ability which makes its armour indestructible for 1 second, every 5 seconds; basically, any shot fired at it has a 20% chance to just deflect, because Soviet Tank.
25 May 2024, 19:57 PM
#7
avatar of Ellie7598

Posts: 12

Alright, I made the changes you suggested and a first run 2v2 went well, noticeable FPS improvement and didn't get the death lag, though only through more testing can I know what impact it has had for sure.
26 May 2024, 06:12 AM
#8
avatar of Ellie7598

Posts: 12

Just had a new idea: I can completely remove commanders from the game, or rather just leave them useless with no abilities / functions.

I can then re-add them, as upgrades to the HQ for armies; picking any one would lock the rest out, and would then unlock that commanders abilities which I can modify to require that upgrade.

This way I would also have complete creative freedom with regards to giving which abilities to which commanders, no messing about with archtypes or anything of the sort.
26 May 2024, 08:48 AM
#9
avatar of Sie_Sayoka
Modmaker Badge

Posts: 100 | Subs: 1

For lag you can take a look at this thread to get an idea of what may be your issue. The game speed is directly correlated to your frame rate and by extension your graphics card and processing power. This is a good indicator to use when diagnosing how much it's lagging and what, if any, specific units are causing it. You may want to use a program to log your frame rate.

I don't know the specifics of your mod but my guesses are:
1. Pathing. Will take up the most processing power and maps are key. A map with bad pathing will lead to lag as units will not be able to move to where they want to. If you aren't already, use a 2v2 vanilla map.
2. Test conditions. If you're using cheat commands it'd be easy to just set your HQ as invincible and go afk. This is bad since the AI has trouble moving all of its forces to attack a base, even in vanilla. In general having idle units is bad for some reason and will cause a lot of lag.
3. Abilities. Units will scan an area around them constantly for the opportunity to use an ability. This will cause lag. You can consider removing some abilities for AI with an AI specific upgrade.
4. Units and popcap. If your mod has a lot of them then it's going to compound the issue.

Diagnosing the source of lag is very time consuming. Good luck.
26 May 2024, 11:59 AM
#10
avatar of Ellie7598

Posts: 12

Interesting, well after the changes to AI settings it seems better, I've yet to have the death lag. My computer is not particularly good for gaming:

Windows 10 64-bit
Intel Core i5 7600 @ 3.50Ghz
32GB DDR4 Ram
MSI H110M ECO Motherboard
Intel HD Graphics 630 (no dedicated GPU)

I run the game in lowest settings. My mod has a lot of custom vehicles which you can build quickly and cheaply, and sets pop cap to 200 for all players, to allow for constant, large-scale tank battles. Almost all vehicles have at least 1 ability, and some have upgrades too.

I use Cheat Commands II simply to enable extra camera zoom and for placement of defense turrets (indestructible, immobile tanks with powerful guns I added that prevent the enemy AI zerg rushing our base territory, or make it costly to do so), and also I use the no win condition mode; I prefer to just infinitely fight. I do not set my HQ to invincible.

I play on lots of different maps, but only ones that look professionally made and are quite small, I do not play on big maps as I prefer close quarters, scrappy combat and don't like the long distances.

26 May 2024, 12:09 PM
#11
avatar of Ellie7598

Posts: 12

Just had a new idea: I can completely remove commanders from the game, or rather just leave them useless with no abilities / functions.

I can then re-add them, as upgrades to the HQ for armies; picking any one would lock the rest out, and would then unlock that commanders abilities which I can modify to require that upgrade.

This way I would also have complete creative freedom with regards to giving which abilities to which commanders, no messing about with archtypes or anything of the sort.


Regarding this idea, I have attempted it with success; I now have a "Commander" that you can upgrade to on the ostheerostheer HQ, which unlocks two tank deployment abilities. I just need to add more "Commanders" and make/re-enable abilities for them, and make the upgrades mutually exclusive.

26 May 2024, 12:40 PM
#12
avatar of Ellie7598

Posts: 12

Update: I indeed still get the "death lag". It is definitely something AI related as when I disable all AI it ceases, but I still don't know what causes it. It doesn't seem to be as bad, though the game still isn't really playable.
26 May 2024, 21:26 PM
#13
avatar of Sie_Sayoka
Modmaker Badge

Posts: 100 | Subs: 1

You can disable replays to help a bit improving your FPS. Not directly related to your issue but it will alleviate some lag since you only use integrated graphics.
27 May 2024, 06:46 AM
#14
avatar of Ellie7598

Posts: 12

I shall try it. It seems disabling the AI and then Re-Enabling it made the lag start to resolve, and I was able to carry on playing, though the lag came back after a while.
27 May 2024, 07:36 AM
#15
avatar of Ellie7598

Posts: 12

I'm not certain what impact that had, I did indeed get the lag again and it got very bad to the extent I had to kill the game with task manager. This was in a 2v2 match without much going on in a small map.
29 May 2024, 10:26 AM
#16
avatar of Sie_Sayoka
Modmaker Badge

Posts: 100 | Subs: 1

Yes disabling replays will do a bit but wont fix an issue that would be caused by the mod itself.

If you're really committed to diagnosing why it's lagging take FPS logs of both vanilla and your mod as baseline comparisons.

Then make a copy of your mod and start reverting changes half at a time. i.e. delete half of the things in the 'instances' folder for your copied mod, then see if there's lag. If it doesn't lag then the issue would be in the deleted half, if it does lag then delete half again. Repeat this process until you've narrowed it down.

This method is known as half splitting. It's useful but only if there's a singular cause. It also wont work if the cause is from two instances in conjunction i.e. a unit with an ability. For your purposes the causes would most likely be within the abilities, sbps, ebps, or any of the ai folders so I'd start by deleting those first.

You'll want to take extra care to not overwrite your mod with the copy. Ultimately it'd take several hours to diagnose but perhaps you'll get lucky.
31 May 2024, 13:04 PM
#17
avatar of Ellie7598

Posts: 12

Possibly, I don't know, I can give it a try. I've used process of elimination before, it's a simple but effective strategy.
0 user is browsing this thread:

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

1075 users are online: 1075 guests
0 post in the last 24h
10 posts in the last week
26 posts in the last month
Registered members: 50001
Welcome our newest member, rwintoday
Most online: 2043 users on 29 Oct 2023, 01:04 AM