Allow modders to choose how many of a certain building each type of AI can build Easy medium hard

Bug #894909 reported by Hogo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ares
Fix Released
Wishlist
AlexB

Bug Description

See the Additional Information section for actual INI code this will use

How about a Tag That allows you to choose what Setting it can be built by the AI Eg AIEasy=bool AIMedium=Bool AIHard=Bool This would allow things like clones to be used for the harder levals but for the easy Ai not. This would mean people who make there AI better would have an Easyer time making Easy Easy not hard.

Or On the actual build have
AIEasy= Number allowed to build and so on for Easy med Hard

##### ADDITIONAL INFORMATION #####
Will be implemented as:

[MayanPrismCannon]
AIBuildCount=0,1,2 ;number of instances of this building the AI will construct E,M,H, overrides AIBuildThis=

Revision history for this message
Hogo (hogo) wrote :

Something I forgot to say is, This would also make work easier for modders that want to make AI's use clones this would mean that they do not have to go through the process of making cloned buildings.

Revision history for this message
Millennium (kotaka) wrote :

A far more customizable AI would be preferable anyway. Possibly using taskforces for building ...err... buildings and removing (or at optionalizing) a whole bunch of AI cheats...

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

I don't think this idea would be very useful - there's alreaady controls for the defenses which use a weighting system to choose the best (although no way to add new types of defense/weighting parameters).

However, if this request were to be implemented I would suggest the following tag:

[MayanPrismCannon]
AIBuildCount=0,1,2 ;number of instances of this building the AI will construct E,M,H. If specified, overrides AIBuildThis=

The AI would have to build everything available to it in the correct order once, and only then make another pass through the BuildingTypes list to see which buildings it should build another instance of.

Revision history for this message
MRMIdAS (mrmidas) wrote :

Or, for more accurate weighting, each structure could have a maximum build number, 0 being infinite (if you want to disable it, theres a multitude of ways to do it already)

IE:
BuildNumber=1,2,3 (easy/medium/hard)

if you want this logic to be ignored (power plants for example) don't add the tag, or set it to 0.

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

No, because then you couldn't have certain AI difficulties not build it whilst others do. 'Infinite' should be -1 and leaving the tag out means rely on existing logic.

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

I agree with what Marshall Said beats how I set it out and makes things much simpler and more like the defense ways.

Hogo

Revision history for this message
MRMIdAS (mrmidas) wrote :

Shouldn't -1 be "don't build at all (like tech level)" and 0 be Infinate/rely on existing logic (like build limits)?

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

That could also make some decent use I feel we should have that added if this goes ahead.

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

TechLevel is a bad example, because it doesn't represent any kind of limit or goal. TechLevel is the level of tech you have to be to build something. Zero means you don't have to have any tech to build, as does -1. Actually, -1 is a special value (because you can't have negative tech, that makes no sense) which means "the AI *CAN* build this but human palyers can't". Only if something requires higher tech than you've got (11, because 10 is the game's max tech level) are you unable to build it.

This feature request is talking about a goal for the number of a building the AI should build. Zero should mean zero. You can't build a negative number but you can build zero. Negative numbers should be used for special values, such as 'infinite' or 'default logic'. I suggest -1 for 'default logic' and -2 for 'infinite' (like weapon Range=)
It's just common sense.

However I still think the main purpose of this would be for custom base defenses (such as the Grand Cannon). In which case, being able to customise the base defense tags would be more appropriate, rather than having a second system for limiting buildings.

Revision history for this message
MRMIdAS (mrmidas) wrote :

I see, I know about techlevel and stuff like that, but I'm not massively up on the innre workings of RA/YR, and just thought the as 0 meant infinate with buildlimits, it'd make more sense to keep that here, as a universal "infinate" value.

If your way makes more sense, then I'm fully behind it.

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

The AI can build buildings with Techlevel 11
I used this hack to make it build more airfields.

~ZeroMD

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

Well I don't know about the AI building TL11 stuff (I suspect this only applies to buildings with AIBuildThis=yes set), but regarding BuildLimit, zero for that means zero too, not infinite.

The actual default BuildLimit is 2147483647 (largest possible value you can store in a 4-byte signed integer)

Changed in ares:
assignee: DCoder DCoder (dcoder1337) → nobody
AlexB (alexander-b)
Changed in ares:
assignee: nobody → AlexB (alexander-b)
milestone: outdated-0.6 → 0.d
status: In Progress → Fix Committed
Revision history for this message
mevitar (mevitar) wrote :

17.139.1131, this functions properly.

Also this post confirms it: https://ppmforums.com/viewtopic.php?p=555816#555816

Revision history for this message
AlexB (alexander-b) wrote :

Thank you!

Changed in ares:
status: Fix Committed → Fix Released
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.