Phobos-developers / Phobos

Ares-compatible C&C Red Alert 2: Yuri's Revenge engine extension
GNU Lesser General Public License v3.0
300 stars 95 forks source link

use SW deferment on Phobos logic #1412

Closed Coronia closed 1 week ago

Coronia commented 4 weeks ago

Previously several Phobos super weapon launching logic (e.g. SW.Next and LaunchSW) didn't support SW.Deferment. This pull request implements a workaround to enable this. UseDeferment tags delay the launch by a certain amount of frames determined by the superweapon's SW.Deferment if set to true, while ExtraDeferment tags add an extra value to this delay.

In rulesmd.ini:

[SOMEWARHEAD]                     ; Warhead
LaunchSW.UseDeferment=false       ; boolean
LaunchSW.ExtraDeferment=0         ; integer

[SOMESW]                        ; Super Weapon
SW.Next.UseDeferment=false      ; boolean
SW.Next.ExtraDeferment=0        ; integer

[SOMEBUILDING]                                        ; BuildingType
SpyEffect.VictimSuperWeapon.UseDeferment=false        ; boolean
SpyEffect.VictimSuperWeapon.ExtraDeferment=0          ; integer
SpyEffect.InfiltratorSuperWeapon.UseDeferment=false   ; boolean
SpyEffect.InfiltratorSuperWeapon.ExtraDeferment=0     ; integer

I was hoping to add this for the fire superweapon action as well, but it already has all the params used. Maybe this one could simply rely on elapse time action instead.

github-actions[bot] commented 4 weeks ago

Nightly build for this pull request:

This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build.

NetsuNegi commented 3 weeks ago

Have you test deferment at SW.Next in multi player game? I have also tried it (not this PR) and it cause desync by unknown reason.

Coronia commented 3 weeks ago

Not really, only tested it in singleplayer so far. I do suspect changing SW timer tends to desync the game, but in that case there might also be similar problems with the original implementation of not-RealLaunch.

I'll be appreciated if someone could do some more multiplayer testing on it.

Coronia commented 3 weeks ago

Addressed the instance and global launch changes suggested above

Also we've done some multiplayer testing on it yesterday, and no desync so far

Coronia commented 1 week ago

It's confirmed that those SWs which supporting Deferment in Ares also work in Phobos. Therefore I'd like to close it for now since I don't want to add extra complexity and performance tax (this logic is checked per frame). But if there's a need to make Deferment support more SWs please let me know.