beyond-all-reason / Beyond-All-Reason

Main game repository for Beyond All Reason.
https://www.beyondallreason.info/
Other
1.78k stars 298 forks source link

Cortex and Armada Commanders have different fire rate #834

Open 6AKU66 opened 2 years ago

6AKU66 commented 2 years ago

Only surface laser affected. Underwater laser is ok.

https://www.youtube.com/watch?v=rn_N3sWaTFs

105.1.1-861 19008

изображение_2022-02-22_212149 Снимок

https://youtu.be/x22-pMkfuNA infolog.txt

sprunk commented 2 years ago

armcom is lus, therefore better

Beherith commented 2 years ago

Enable the UnitCallins widget and see if they are dealing identical damage to each other :)

Beherith commented 2 years ago

In fact, do a /luarules unitcallinsgadget to see both at the same time

6AKU66 commented 2 years ago

One try: g:UnitDamaged, 5742, corcom, 0, 18.8300343, false g:UnitDamaged, 5645, armcom, 1, 18.5227242, false

Second try:

g:UnitDamaged, 7119, corcom, 0, 12.9534845, false g:UnitDamaged, 7562, armcom, 1, 12.710968, false

6AKU66 commented 2 years ago

Description updated with new info

KyleAnthonyShepherd commented 2 years ago

My observations:

Cortex commander has an observed fire rate of once per 15 frames, despite the reload time being 0.4, 12 frames. Armada commander has an observed fire rate of alternating between 12 frames and 13 frames, closer matching the reload time being 0.4.

cortex commander is using script = "Units/CORCOM.cob", armada commander is using script = "Units/ARMCOM_lus.lua",

The wait-for-turn in the CORCOM.cob is imposing a minimum 3 frame delay before firing. wait-for-turn equivalent in the lua script only has a 1 frame delay. AimPrimary is called, 3 frames to aim, fire, wait 12 frame for reload, but as soon as it it ready to fire again, AimPrimary is called again because 15 frames has passed, causing the 3 frame wait-for-turn delay again, creating the observed 15 frame, 0.5 second fire rate. (reaim time is actually 5 for both commanders, so AimPrimary is being called every 5 frames)

SethDGamre commented 3 weeks ago

@Zecrus2 @TheSilverHornet I remember hornet saying that he had worked on this issue before. Has it been resolved? Last I heard about it was I think 6 months ago