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 Sun Dec 08, 2024 9:21 pm
All times are UTC + 0
[Ares] Initialpayload problem on buildings
Moderators: Global Moderators, Red Alert 2 Moderators
Post new topic   Reply to topic Page 1 of 1 [9 Posts] Mark the topic unread ::  View previous topic :: View next topic
Author Message
NimoStar
Commander


Joined: 07 Nov 2012
Location: Buenos Aires

PostPosted: Sat Apr 20, 2024 1:41 pm    Post subject:  [Ares] Initialpayload problem on buildings
Subject description: They are neutral and WILL kill you
Reply with quote  Mark this post and the followings unread

See here for stated functionality:
https://ares-developers.github.io/Ares-docs/new/initialpayload.html

I made buildings with initial payload and everything seems to work, except for a "small" detail: The whole thing is the wrong house

When AI creates the pre-occupied buildings, they come out as neutral.

If the building is sellable it will be auto-sold, infantry will emerge (as with my occupiable foxhole, in pic not depicted since it was auto-sold)

AI will continue creating them to "fight" the invasion of enemy soldiers, except, they will just join these hostiles instead.

If the case the building is not sellable or something, it will still attack the AI anyways.

It seems to me that the problem is the logic was designed for vehicles ("Troop crawlers") and not tested properly on buildings.

Something which the developers might have not identified is the order of the algorithm of creation of a building occupied in this way. They might have told the game this:

Step 1: Create neutral infantry ->
Step 2: Put in [technotype] ->
Step 3: Make infantry the same owner as [technotype]

But the non-owned infantry will just interrupt the chain by making the building neutral in Step 2 by occupying it (something which doesn't happen in vehicles), therefore step 3 reconfirms everyone as neutral. This is speculation as how the error might have come to be.

Anyways, any fix or workaround will be greatly appreaciated, or if anyone can report this to ares for a hotfix (not really developed these day but this should be doable?)

In case there is interest here are my codes for both pre-occupied Bunker and Manhole (pillbox). Nothing out of the ordinary.

This unwanted behavior still happens if the buildings are set as
Crewed=yes

As me be very bery smart, I also tried later to make the building into a static Battle Fortress. That logic just doesn't work on buildings, though.

Spoiler (click here to read it):

Code:

;Soviet Bunker, pre-occupied since AI won't often do so
[NABNKR_AI]
Image=NABNKR
UIName=Name:NABNKR
Name=Soviet Battle Bunker
Adjacent=3 ;2
AIBasePlanningSide=1 ;gs 0 for New Order, 1 for Soviet, 2 for Yodvavresh
Armor=concrete ;steel
BaseNormal=no
BuildCat=Combat
Prerequisite=NACNST,FACTIONBUILDING
Capturable=false
ClickRepairable=yes
Cost=1200 ;500
Crewed=no
DebrisAnim=Dbris3sm,Dbris4lg,Dbris4sm,Dbris6sm,Dbris7lg,Dbris7sm,Dbris8sm,Dbris10lg,Dbris10sm
Explosion=manimFire,TWLT070,S_BANG48,S_BRNL58,S_CLSN58,S_TUMU60
IsBaseDefense=yes
MaxDebris=15
MinDebris=5
Owner=British,French,Germans,Americans,Alliance,Russians,Confederation,Africans,Arabs,YuriCountry
Powered=no
Sight=6
Strength=600
TechLevel=-1 ; AI should be able to build techlevel -1

;AIBuildThis=no ; Being raidable just gives you free stuff as they leave it ungarrisoned coz ai is stupid
;Now that it comes with single conscripts, use this

AntiInfantryValue=25 ;0
AntiArmorValue=15 ;0
AntiAirValue=0
;made so AI will build it.
;gs these three are in abstract units and just help the AI pick the right base defense. (see AIForcePredictionFudge)

CanBeOccupied=yes
MaxNumberOccupants=6 ;5
CanOccupyFire=yes
;Bunker.Raidable=yes
;May generate unwanted effects with pre-occupation
;Nevermind, the unwanted effects happen anyhow...
UC.PassThrough=1%
InitialPayload.Types=E2
InitialPayload.Nums=6


Code:

; PillBox for AI, occupiable but pre-crewed
[GAPILL_AI]
Image=GAFOXH
UIName=Name:GAPILL
Name=Allied Pill Box
Nominal=yes

;Primary=Vulcan2

BuildCat=Combat
Strength=400
Armor=steel
Prerequisite=BARRACKS,GACNST
TechLevel=-1
Adjacent=4
ROT=10
Sight=7
DetectDisguise=no
Owner=British,French,Germans,Americans,Alliance,Russians,Confederation,Africans,Arabs,YuriCountry
AIBasePlanningSide=0 ;gs 0 for New Order, 1 for Soviet, 2 for Yodvavresh
Cost=600
BaseNormal=no
Points=30
Power=0
Crewed=no
Capturable=false
Explosion=manimFire,TWLT070,S_BANG48,S_BRNL58,S_CLSN58,S_TUMU60
DebrisAnim=Dbris1sm,Dbris1lg,Dbris4sm,Dbris5sm,Dbris4lg,Dbris7sm,Dbris8sm,Dbris5lg,Dbris4lg
MaxDebris=15
MinDebris=5
;Turret=yes
;TurretAnim=LASER
;TurretAnimIsVoxel=true
;TurretAnimX=-8
;TurretAnimY=16
;TurretAnimZAdjust=-40
ThreatPosed=30 ; This value MUST be 0 for all building addons
DamageParticleSystems=SparkSys,LGSparkSys
IsBaseDefense=yes
HasStupidGuardMode=false
ImmuneToPsionics=no ; defaults to yes for buildings, no for others
AntiInfantryValue=25
AntiArmorValue=10
AntiAirValue=0
;gs these three are in abstract units and just help the AI pick the right base defense. (see AIForcePredictionFudge)

CanBeOccupied=yes
MaxNumberOccupants=2
CanOccupyFire=yes
;Bunker.Raidable=yes
;Generates unwanted effects with pre-occupation
UC.PassThrough=1%

InitialPayload.Types=E1
InitialPayload.Nums=2




2024-04-20 09_39_20-Yuri's Revenge.png
 Description:
Neutral GI destroys AI
 Filesize:  587.43 KB
 Viewed:  2290 Time(s)

2024-04-20 09_39_20-Yuri's Revenge.png



_________________

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


Joined: 07 Nov 2012
Location: Buenos Aires

PostPosted: Sun Apr 21, 2024 9:47 am    Post subject: Reply with quote  Mark this post and the followings unread

By the way, it only behaves like that for AI, and only if the tech level is -1 (buildable by AI, but unbuildable by player)

If there is other way in which the AI may build this but not the player, you tell me. Perhaps having another building with techlevel -1 as prerequisite?

_________________

Back to top
View user's profile Send private message Visit poster's website
silverwind
Cyborg Firebomber


Joined: 11 Jun 2016

PostPosted: Sun Apr 21, 2024 8:04 pm    Post subject: Reply with quote  Mark this post and the followings unread

It's definitely the TechLevel messing with it.

Try the prerequisite trick. The AI is supposed to respect Prerequisites, so you should use a duplicate building with AIBuildThis. Make sure the player has no way to own it, though. Something like a mind-control-resistent, uncapturable base defense should do the trick.

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


Joined: 09 Feb 2015

PostPosted: Mon Apr 22, 2024 1:09 am    Post subject: Reply with quote  Mark this post and the followings unread

The AI doesn't care about prerequisites, if it's told to build something it will. It does respect Owner=, and Techlevel=11 will prevent everyone building.

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

Back to top
View user's profile Send private message
silverwind
Cyborg Firebomber


Joined: 11 Jun 2016

PostPosted: Mon Apr 22, 2024 5:58 am    Post subject: Reply with quote  Mark this post and the followings unread

Just checked, you're right. I seem to have misread the prerequisite flow chart. Then preventing the player from building it simply a matter of giving it a prerequisite that the player can't own, like YAROCK or something.

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


Joined: 28 May 2013

PostPosted: Mon Apr 22, 2024 7:00 am    Post subject: Reply with quote  Mark this post and the followings unread

Even already discussed stuff about InitialPayload wasn't implemented. Good luck getting any new bugs fixed.

This topic could have been posted under Ares sub-forum.

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


Joined: 07 Nov 2012
Location: Buenos Aires

PostPosted: Tue Apr 23, 2024 2:51 pm    Post subject: Reply with quote  Mark this post and the followings unread

Not new bugs, old bugs found just yet ho ho

Yes, I forgot about ares sub forum. its dead anyways.

I did try to have a positive techlevel and another prerequisite, but then, AI just doesn't build

It may be possible that AI does respect prerequisite in certain cases.

For example, defenses (such as this) have special AI scripting.

_________________

Back to top
View user's profile Send private message Visit poster's website
silverwind
Cyborg Firebomber


Joined: 11 Jun 2016

PostPosted: Thu Apr 25, 2024 5:41 pm    Post subject: Reply with quote  Mark this post and the followings unread


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


Joined: 07 Nov 2012
Location: Buenos Aires

PostPosted: Fri Apr 26, 2024 10:50 am    Post subject: Reply with quote  Mark this post and the followings unread

I will try that, However note that ModEnc only says that AI ignores buildlimits when setting Task Forces.

Quote:
AI players are not subject to any unit's BuildLimit. AI players will build whichever units are required by the chosen TaskForce regardless of how many instances of those units the AI player already owns.


In my experience, AI normally obeys buildlimits of buildings in terms of constructing only one at the time - such as Superweapons in the vanilla game. (unless you have set the optional rule of AI base doubling, in which case they will make two, but at the same time)

Yet, I will report any findings.

PS: Well, that did seem to do the trick! Although I did increase the AI value for defense and Added
Code:
AIBuildThis=yes


So it might not be the only consideration... (it used to build all gun turrets before, perhaps because the loaded bunkers were much more expensive for a similar defense value) ; now, in contrast, it is the turrets which it never builds.

But, the BuildLimit=0 does seem like a good way to bar players while allowing AI to use buildings which doesn't need TechLevel=-1 , so that works too

_________________

Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [9 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.2296s ][ Queries: 14 (0.0132s) ][ Debug on ]