A new way of defining powerplants

Bug #894916 reported by Black Temple Gaurdian
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ares
Incomplete
Wishlist
Unassigned

Bug Description

Like, maybe:
AlliedPowerPlants=basicpowerplant,omgmegauberpowerplant
SovietPowerPlants=
ThirdPowerPlants=
FourthPowerPlants=
ect.

Revision history for this message
TheMan (gaffelvilica) wrote :

Your idea of this is good but not your code suggestion, it is still hardcoded for more sides.
[Americans]
PowerPlants=x,x,x
AdvancePowerPlants=x,x,x
This system would brake the hardcoding

VK have the same system but only works for GDI and Nod, witch then it uses for the whole side

Revision history for this message
pd (pdmail) wrote :

TheMan's idea kinda reflects my plans.
In order to have freedom of adding as many sides as you want, these things should be defined per side in a side's section.

[GDI] and [Nod] would then define both side and country properties, but that's not a problem.

Revision history for this message
DCoder DCoder (dcoder1337) wrote :

Okay. I found the code that handles this part, it's idiotic. I know why soviets never build their advanced powerplant now. But that's irrelevant.

Why were both PowerPlants= and AdvancedPowerPlants= requested? What's wrong with just having one list and picking a random plant whose prereqs are met?

Revision history for this message
Bug Importer (bug-importer) wrote :

"Why were both PowerPlants= and AdvancedPowerPlants= requested? What's wrong with just having one list and picking a random plant whose prereqs are met?"

I dunno, I gues they want to copy NPatch.

Another thing, one side can only have one powerplant that AI build. :(
If you set many, and add required/forbidden-houses, it still wont work

Revision history for this message
MRMIdAS (mrmidas) wrote :

"Why were both PowerPlants= and AdvancedPowerPlants= requested? What's wrong with just having one list and picking a random plant whose prereqs are met?"

Well I'd like the game to act somewhat intelligently and pick whichever buildable power plant will give them the most power.

If that is facilitated by there being 2 powerplant lists, so be it.

Revision history for this message
DCoder DCoder (dcoder1337) wrote :

1) It's trivial to make it pick the most powerful available powerplant whenever it's needed.
2) The most powerful powerplant is not always the best choice. Back in either TD or RA, one side had both Regular and Advanced Power Plants, and experienced advice was "use powerplant A if your opponent is side X, and powerplant B if your opponent is side Y - side X's superweapon can annihilate ppB, but only damages ppA, and vice versa." Making the AI go blindly for the most powerful one would make it dumber in certain cases, and I'd rather not do that.
This is not to say that the AI will definitely perform such elaborate planning (though that is possible), just that I prefer (even if it's random in nature) variety to a predictable, one-track mind.

Revision history for this message
Marshall (m-edward) wrote :

Perhaps the modder could specify a new flag, Risk=integer with default = 0

if (FreePowerNow - PowerSurplus) < 0 then
    //below surplus (possibly even in low power) so critical!
    pick cheapest available power plant that brings power back online (ignore risk)
    if no such power plant then pick most cost effective power plant (ignore risk)
else
    //at or above surplus so not critical
    consider which buildings we are planning to build, calculate how much power we will need, consider total current power Risk, random number to determine max risk willing to take (flag for modder to control this per difficulty level?), pick highest-risk power plant that the random number affords (this of course assumes that higher risk means more cost effective power)
endif

Or, to avoid the need for the Risk= flag, you could calculate risk internally based on death weapon damage and building HP.

Revision history for this message
Renegade (renegade) wrote :

Closing as suspended since feedback has been requested and there was no activity on the issue for more than four weeks.

Issue will be of lower priority if re-opened.

Revision history for this message
DCoder DCoder (dcoder1337) wrote :

No no, there was feedback, I just didn't update the status ...

Revision history for this message
Renegade (renegade) wrote :

...he said 7 months later. xD

Revision history for this message
Renegade (renegade) wrote :

Is this on our pseudo-mental "list of stuff to do"?
If so, somebody set this to "invalid" and update the blueprint.
If not, somebody set this to "won't fix" and the blueprint to "obsolete".

Changed in ares:
status: New → Incomplete
Revision history for this message
Linglin (linglin) wrote :

I tried the NP's logic based on Reloaded 0.99 and I found GDI AI can place Power Upgrade like in TS
So I think this logic is quite useful for AI

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.