Project Perfect Mod Forums
:: Home :: Get Hosted :: PPM FAQ :: Forum FAQ :: Privacy Policy :: Search :: Memberlist :: Usergroups :: Register :: Profile :: Log in to check your private messages :: Log in ::


The time now is Fri Mar 29, 2024 7:50 am
All times are UTC + 0
AI avoiding Ares' Prerequisite.Negative tag
Moderators: Global Moderators, Red Alert 2 Moderators
Post new topic   Reply to topic Page 1 of 1 [18 Posts] Mark the topic unread ::  View previous topic :: View next topic
Author Message
Flaguna
Cyborg Engineer


Joined: 07 Feb 2018
Location: HUELand

PostPosted: Tue Mar 19, 2019 7:51 pm    Post subject:  AI avoiding Ares' Prerequisite.Negative tag
Subject description: RA2 AI destroying my dreams since ever
Reply with quote  Mark this post and the followings unread

For context, I added a second Tech Lab for Yuri, called YABIOS. This building is meant to be built to give access to toxins-based arsenal and disable the original Tech Lab (YATECH). When the vanilla tech lab is built it gives access to paychic-based arsenal and disables YABIOS.

Spoiler (click here to read it):

[YATECH]
...
Prerequisite.Negative=YABIOS
...

[YABIOS]
...
Prerequisite.Negative=YATECH


This logic works just fine with a HUMAN player, but not with a AI player.
I mean, the AI build both Tech Labs and get access to both arsenals, unbalancing gameplay and f*cking with TeamTypes

Is there a way to "Fix" this? It is quite clear that the AI is simply avoiding "Prerequisite.Negative" tag, and I was unable to fix this issue, wich is frustrating

Help

_________________
I'll throw bananas at your general direction.

Back to top
View user's profile Send private message
cxtian39
Commander


Joined: 11 Feb 2016

PostPosted: Tue Mar 19, 2019 7:53 pm    Post subject: Reply with quote  Mark this post and the followings unread

Then which one you want AI to build?

_________________

Back to top
View user's profile Send private message Skype Account
MRMIdAS
Energy Commando


Joined: 17 Jul 2008

PostPosted: Wed Mar 20, 2019 2:00 am    Post subject: Reply with quote  Mark this post and the followings unread

cxtian39 wrote:
Then which one you want AI to build?


I assume he wants it to be random, so the AI sometimes builds the regular one, and sometimes builds the bio one, but not both. kind of a "Branching Tech Tree" setup.

_________________
MIdAS - Turning wages into beer since 2002

Back to top
View user's profile Send private message
Flaguna
Cyborg Engineer


Joined: 07 Feb 2018
Location: HUELand

PostPosted: Wed Mar 20, 2019 3:12 am    Post subject: Reply with quote  Mark this post and the followings unread

MRMIdAS wrote:
cxtian39 wrote:
Then which one you want AI to build?


I assume he wants it to be random, so the AI sometimes builds the regular one, and sometimes builds the bio one, but not both. kind of a "Branching Tech Tree" setup.


You're right. In my head, doing what I did would make it random, but I dunno, I'm kinda confused

_________________
I'll throw bananas at your general direction.

Back to top
View user's profile Send private message
G-E
Defense Minister


Joined: 09 Feb 2015

PostPosted: Wed Mar 20, 2019 3:52 am    Post subject: Reply with quote  Mark this post and the followings unread

AI ignores Prerequisite= but if your triggers are based owning the building, then it's always possible that early game it will choose differently, which can boost the weighting of it, and continue preferencing it later. Likewise if one of them is detroyed, only the other trigger will fire.

_________________
http://www.moddb.com/mods/scorched-earth-ra2-mod-with-smart-ai

Back to top
View user's profile Send private message
cxtian39
Commander


Joined: 11 Feb 2016

PostPosted: Thu Mar 21, 2019 7:49 am    Post subject: Reply with quote  Mark this post and the followings unread

Try AIBuildCounts=0,0,0 and AIExtraCounts=1,1,1
iirc AI seems to respect prerequisite for buildings otherwise it would just build tech lab before war factory.
AI Triggers are another independent thing I guess you need to rewrite them.

_________________

Back to top
View user's profile Send private message Skype Account
G-E
Defense Minister


Joined: 09 Feb 2015

PostPosted: Thu Mar 21, 2019 12:26 pm    Post subject: Reply with quote  Mark this post and the followings unread

The only prerequisites it respects is whether it has a factory capable of producing the unit or not.

_________________
http://www.moddb.com/mods/scorched-earth-ra2-mod-with-smart-ai

Back to top
View user's profile Send private message
Mig Eater
Defense Minister


Joined: 13 Nov 2003
Location: Eindhoven

PostPosted: Thu Mar 21, 2019 5:59 pm    Post subject: Reply with quote  Mark this post and the followings unread

It's not possible to make the AI randomly chose between the two. The best option is to make the AI only build one of them.

_________________



Back to top
View user's profile Send private message Visit poster's website ModDB Profile ID YouTube User URL Facebook Profile URL Twitter Channel URL
NimoStar
Commander


Joined: 07 Nov 2012
Location: Buenos Aires

PostPosted: Fri Mar 22, 2019 1:15 am    Post subject: Reply with quote  Mark this post and the followings unread

Make an AI general that builds it and one that doesn't. AI will respect Country restrictions (AKA it won't build snipers as Americans)

_________________

Back to top
View user's profile Send private message Visit poster's website
MRMIdAS
Energy Commando


Joined: 17 Jul 2008

PostPosted: Fri Mar 22, 2019 2:40 am    Post subject: Reply with quote  Mark this post and the followings unread

NimoStar wrote:
Make an AI general that builds it and one that doesn't. AI will respect Country restrictions (AKA it won't build snipers as Americans)


Yeah, but that takes the randomness out of it, I had a similar idea, give Yuri a branching tech-tree, one at RADAR one at Battle Lab, so it's 4 sides in 1, so you're not sure what to expect as a player, it's also a fun thing to do as a player.

_________________
MIdAS - Turning wages into beer since 2002

Back to top
View user's profile Send private message
NimoStar
Commander


Joined: 07 Nov 2012
Location: Buenos Aires

PostPosted: Fri Mar 22, 2019 4:08 am    Post subject: Reply with quote  Mark this post and the followings unread

when it builds everything also you don't know what to expect :V one of them must come first anyways...

in any case, if the AI truly ignores prerrequisites (eg can actually build kirovs without tech lab, which you don't see but may be AI scripting), it woudn't do any good if it builds it or not (except maybe for superweapons)

_________________

Back to top
View user's profile Send private message Visit poster's website
Flaguna
Cyborg Engineer


Joined: 07 Feb 2018
Location: HUELand

PostPosted: Fri Mar 22, 2019 10:43 am    Post subject: Reply with quote  Mark this post and the followings unread

G-E wrote:
AI ignores Prerequisite= but if your triggers are based owning the building, then it's always possible that early game it will choose differently, which can boost the weighting of it, and continue preferencing it later. Likewise if one of them is detroyed, only the other trigger will fire.


Wait, are you telling me I can create triggers for the AI to build structures? I thought that this was somehow "hardcoded"? I never actually meddled too far on this AI scripting sorcery, so [thinkingemoji]

cxtian39 wrote:
Try AIBuildCounts=0,0,0 and AIExtraCounts=1,1,1


how dos this work exactly? I have to add both tags on both structures?

Mig Eater wrote:
It's not possible to make the AI randomly chose between the two. The best option is to make the AI only build one of them.

I figured this out and did it, added a whole new Yuri house just to solve this issue. I'm satisfied with the results, but I feel that this is not what I wanted.

Edit: sorry for the late reply, been busy with school, yay.

_________________
I'll throw bananas at your general direction.

Back to top
View user's profile Send private message
Mig Eater
Defense Minister


Joined: 13 Nov 2003
Location: Eindhoven

PostPosted: Fri Mar 22, 2019 7:42 pm    Post subject: Reply with quote  Mark this post and the followings unread

Flaguna wrote:
Wait, are you telling me I can create triggers for the AI to build structures?

No, he is saying you can make the triggers fire when the AI owns a specific structure. Then depending on which of the two buildings the AI builds first it might decided to use the triggers associated with that structure more then the other.

_________________



Back to top
View user's profile Send private message Visit poster's website ModDB Profile ID YouTube User URL Facebook Profile URL Twitter Channel URL
cxtian39
Commander


Joined: 11 Feb 2016

PostPosted: Sat Mar 23, 2019 2:58 am    Post subject: Reply with quote  Mark this post and the followings unread

You can have AI build random amount of a building. Read docs for more

_________________

Back to top
View user's profile Send private message Skype Account
E1 Elite
General


Joined: 28 May 2013

PostPosted: Sat Mar 23, 2019 9:44 am    Post subject: Reply with quote  Mark this post and the followings unread

AIBuildCounts, minimum value is 1, so cannot have 0 there.

Back to top
View user's profile Send private message
Flaguna
Cyborg Engineer


Joined: 07 Feb 2018
Location: HUELand

PostPosted: Sun Mar 24, 2019 3:24 pm    Post subject: Reply with quote  Mark this post and the followings unread

Mig Eater wrote:

No, he is saying you can make the triggers fire when the AI owns a specific structure. Then depending on which of the two buildings the AI builds first it might decided to use the triggers associated with that structure more then the other.


This is exactly what I did. Added a set (let's call it SET A) of triggers to YATECH wich is made of specific units you get only when you build YATECH, and the same with YABIOS (SET B). My problem here is the AI simply ignoring Prerequisite.Negative= , building both Labs and then attacking with both sets of units, thus causing balancing and building problems.

_________________
I'll throw bananas at your general direction.

Back to top
View user's profile Send private message
Virgil
Stealth Laser Trooper


Joined: 22 Jul 2018

PostPosted: Sun Mar 24, 2019 4:30 pm    Post subject: Reply with quote  Mark this post and the followings unread

Is it possible to give AI a fake building, which fires a self-targeting-auto-fire UnitDelivery SW deliverying the real tech center? AI do respect SW.NegBuildings=, and this can be set to the other tech center so that AI will never be able to have both, as the SW deliverying it is not available with the other one at presence.
The only problem here is that wether AI will keep rebuilding the fake one it lost and doesn't build anything new, as it doesn't own one yet.

Back to top
View user's profile Send private message
MRMIdAS
Energy Commando


Joined: 17 Jul 2008

PostPosted: Sun Mar 24, 2019 6:50 pm    Post subject: Reply with quote  Mark this post and the followings unread

Virgil wrote:
Is it possible to give AI a fake building, which fires a self-targeting-auto-fire UnitDelivery SW deliverying the real tech center? AI do respect SW.NegBuildings=, and this can be set to the other tech center so that AI will never be able to have both, as the SW deliverying it is not available with the other one at presence.
The only problem here is that wether AI will keep rebuilding the fake one it lost and doesn't build anything new, as it doesn't own one yet.


You can set the "Spawned" building to have Negative buildings for the "fake building too, so that might work.

_________________
MIdAS - Turning wages into beer since 2002

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [18 Posts] Mark the topic unread ::  View previous topic :: View next topic
 
Share on TwitterShare on FacebookShare on Google+Share on DiggShare on RedditShare on PInterestShare on Del.icio.usShare on Stumble Upon
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © phpBB Group

[ Time: 0.1728s ][ Queries: 11 (0.0112s) ][ Debug on ]