AttacqueSuperior / Engine

A customized fork for the modification Attacque Supérior of the open-source implementation of the Command & Conquer: Red Alert engine using .NET/Mono and OpenGL. Runs on Windows, Linux and Mac OS X.
http://attsup.swr-productions.com
GNU General Public License v3.0
16 stars 3 forks source link

add "PowerDownBotASModule" #97

Closed dnqbob closed 4 years ago

dnqbob commented 4 years ago

Make AI cut down power if low power, and restore later if possible.

Known flaw: AI will ignore all captured buildings that already offline. Because AI will only put the buildings that turned off by this trait into possible online list.

GraionDilach commented 4 years ago

You can use a helper trait for that flaw to fix - https://github.com/AttacqueSuperior/Engine/blob/master/OpenRA.Mods.AS/Traits/BotRepairOrSellCaptures.cs was written in AS for a similar reason to somewhat emulate WW post-capture logic to fix the inconsistency. The way this one does it's job would work fine for that flaw too.

I'll look into this PR during the weekend, my workdays are being readjusted currently and my sleeping habits still haven't adjusted along.

dnqbob commented 4 years ago

The flaw here is mainly because this can help to improve performance. I post this at upstream but it seemed that they were too busy to look into the PR after first series fixes. Pchote said maybe later a fix will get owner-changed actor reset the powerdown which can make the code here easier.

Because this one is relative independent and used in our localization SP version and works out fine, so I guess I can give it to AS before it is really put into use by bleed.

I will look into helper and find what I can do here to fix this flaw, only for AS engine here.

dnqbob commented 4 years ago

Upon first glance I think I should wait for the change of toggle condition on owner changed. But I think I'd better rename this trait for AS so you can do some crazy experiment and extension on it.

Update: changed to name "PowerDownBotASModule".

GraionDilach commented 4 years ago

Also add this to AUTHORS.AS.

dnqbob commented 4 years ago

Also add this to AUTHORS.AS.

I just thought host should update AUTHORS.AS in other commit, that will be formal/polite for me to wait the host I guess?

By the way, if the pr at up-stream is accepted, especially with the toggle-condition-restore-on-owner-change commit, we won't even bother to make a dummy trait for all affected captured buildings.

But if it is not, we should welcome our dummy to do the job.

dnqbob commented 4 years ago

And upon extension of this module, probably I will make it not only for building, but for all actors operate on power. Although in my mod there are many problem against the application of a powerdown unit, like when unit powerdown and immobilized it will stuck at the door of war factory.

GraionDilach commented 4 years ago

I expect the AI tweaks getting another look past next release at this point. From what I've noticed, the recent PRs are all trying to wrap things up which implies to me that the AI advancements are delayed for another cycle.

I'd merge this as-is but I'd still request that AUTHORS.AS update. While I tend to maintain it, it's better if the PR introducing the feat has the update included.

dnqbob commented 4 years ago

ok wait for me for a second

Update: @GraionDilach done adding to credits.

dnqbob commented 4 years ago

AI in upstream needs a redesign, although not completely but still nasty to do.

GraionDilach commented 4 years ago

Thank you.