Posted: Tue Aug 11, 2015 5:48 pm Post subject:
AI Issues in Mod
Hi, everyone. My personal mod has come a long way, close to the point of feeling complete, and I've had a lot of help and questions answered in the past here. Thank you all for that.
However, even all those years ago, there has been one error I've yet to solve. Korea has always been a buggy side in my mod. Be it only building their aircraft when they aren't being attacked (they are an aircraft specialized side, so it makes sense), sending everything they have to my base, and crashing the game with a "Main executable for Yuri's Revenge has stopped working" error.
I have read about the usage of cloak generators being buggy/laggy in YR, which I have noticed, but I haven't read about it causing crashes. I've narrowed it down to a few possible causes.
- Something to do with buildings being destroyed, likely while in the middle decloaking/recloaking
- Aircraft on airpads being buggy (when they glitch out a bit and don't land properly)
- The airpad being destroyed with buggy aircraft on it
For whatever reason, I rarely get a known EIP. First thing I do with an IE or other crash is google the EIP, but I almost never get a result, so I have a few text documents to post which may indicate the cause (the syringe.log is from only half an hour ago).
I don't have any debug.log files saved now, but if I get an error and generate one, I'll look into it.
_________________ Tiberium Uprising (a few missions for TS): http://www.ppmsite.com/forum/viewtopic.php?t=31029 Last edited by PePsiCola on Sun Nov 15, 2015 8:25 pm; edited 4 times in total QUICK_EDIT
I haven't touched an ini-checker in years. It had a tendency to change other things in my INI files, which didn't help.
It's most likely an AI crash, since I've never encountered this sort of issue when playing as Korea. I think it has something to do with the AI and its buggy aircraft, so I could look into that.
Also, I'm not sure when the except.txt I posted is from, but I know for certain the syringe.log includes information on a crash caused by Korea. _________________ Tiberium Uprising (a few missions for TS): http://www.ppmsite.com/forum/viewtopic.php?t=31029 QUICK_EDIT
I've looked at just about everything I could think that could help me with this and other errors.
I've done INI Checker in the past. I've attempted to use the debug.log command line argument -LOG, but I don't think I know how to enter CL arguments properly (I entered Syringe "gamemd.exe" "-LOG") and ran the game with no results. And I would try your program, G-E, but I'm not sure how it works, and want to be sure of what I'm doing before trying anything.
Although I'm more concerned with the issue I mentioned in this post, I've encountered the same AI related internal error with a new faction (Side) multiple times today. I'm almost certain it's related to refineries or radars, yet everything appears to be coded correctly. I'm not asking for a quick solution though, since I'm already asking for enough help, but I'll leave the log here just in case.
While that could be an issue, I don't see why it would cause crashes. The side works perfectly fine for me. It has to do with the AI base building. They've never managed to build a refinery or radar. They built power, barracks, and endless defenses until they reach the limit I set for the side. Immediately afterwards, the game crashes.
And I understand that about your program, but I don't know what to do with the .tcl files in order for them to work with my mod. _________________ Tiberium Uprising (a few missions for TS): http://www.ppmsite.com/forum/viewtopic.php?t=31029 QUICK_EDIT
I am now almost certain the new side AI error occurs when the AI attempts to build a radar. I'll post all radar related coding here, although I see no problem with the code, it could only help to try (and it's the same EIP as the syringe.log above every time, which has been about twenty).
;this is of course placeholder, I'm just trying to have a functional side first
[RARADR]
UIName=Name:NARADR
Name=Soviet Radar Tower
BuildCat=Tech
Prerequisite=PROC,RACNST
Strength=1000
Image=NARADR
Radar=yes
Armor=wood
TechLevel=3
Adjacent=2
Sight=10
Owner=Vietnam,Japan,Philippines,Australia,India
AIBasePlanningSide=3 ;gs 0 for Good, 1 for Evil
Cost=1000
Points=60
Power=-50
Powered=true
Capturable=true
Crewed=yes
Explosion=TWLT070,S_BANG48,S_BRNL58,S_CLSN58,S_TUMU60
DebrisAnim=Dbris3sm,Dbris4lg,Dbris4sm,Dbris6sm,Dbris7lg,Dbris7sm,Dbris8sm,Dbris9lg,Dbris10lg,Dbris10sm
MaxDebris=15
MinDebris=5
ThreatPosed=0 ; This value MUST be 0 for all building addons
DamageParticleSystems=SparkSys,SmallGreySSys,BigGreySmokeSys
DamageSmokeOffset=220, 390, 150
AIBuildThis=yes
Spyable=yes ; A spy can do something to this, works like captureable
ImmuneToPsionics=no ; defaults to yes for buildings, no for others
SuperWeapon=SpyPlaneSpecial
SpyEffect.RevealRadar=yes
SpyEffect.KeepRadar=yes
SpyEffect.Custom=yes
EDIT: I don't think this is the cause. I set AIBuildThis to no and TechLevel to 11, but it still crashes when they build a certain building. Basically there's a sentry gun clone that is also under BuildDummy, so the AI begins by building a lot of those, then builds a flak cannon clone or two before placing some building, causing the crash.
syringe.log
Description:
Again, this is the same error as the above syringe.log, just more up to date.
One month later, and I've now decided to give this another try. The radar and base defenses seem to be the culprit with my new side's AI crashes.
These are the results I've come across
- Radar and Defenses disabled for AI = no crash
- Radar enabled for AI = crash
- Defenses enabled for AI = crash
- Radar and defenses enabled for AI = crash
If one or the other is enabled, the game crashes. The game seems to only not crash when both of these are disabled. The AI and gameplay goes fine.
Some more notes
- When defenses and radar are disabled, AI only builds vehicle attack force, infantry attack force, infantry guard force, and miners (there are only one of each as of right now).
- When defenses are enabled, the game crashes before I can really look at how AI Triggers work.
- When defenses and radar are enabled, the AI builds engineers to capture tech buildings, as instructed to via AITriggers. But they also start spamming MCVs as soon as they have a war factory, then the game crashes (presumably by the time they attempt to build a radar).
What interests me is the fact than with all three instances of crashes listed above, I receive the same EIP. There is no need to post an except or syringe.log since the above files all contain essentially the same information. _________________ Tiberium Uprising (a few missions for TS): http://www.ppmsite.com/forum/viewtopic.php?t=31029 QUICK_EDIT
The five countries of [NewSide] should be fine, as they are coded similarly to all of my new fully functional Soviet and Yuri sides. _________________ Tiberium Uprising (a few missions for TS): http://www.ppmsite.com/forum/viewtopic.php?t=31029 QUICK_EDIT
So from the look of things, all of my mod's issues relate to the AI. I'll report each issue here, as these have been ongoing. I'm posting it in this topic since I already have my IEs and notes posted here.
1) The fourth side crashes (syringe.log is above). I've done very much in an effort to solve the issue, so I still don't know what the cause of the error is. I have my notes about it posted above.
2) The Korean AI crash likely related to the airpad (I believe I left a syringe.log above for that as well).
3) China (custom Soviet side) has been in my mod for probably a year with no issue. I added a new building for them, and since then, I've noticed the China AI will not rebuild factories unless they are practically destroyed (take out all their base except for construction yard, or allow them to spam Tesla reactors and battle bunkers until they reach their limits for defense counts). After that, they will rebuild factories, but this issues makes them easy to defeat, since they won't have factories to produce units. Disabling the building for AI has not fixed the issue.
I've been trying for ages to fix the first two issues, but I will attempt to fix the third one on my own, as it's probably something simple. It would still be nice if someone could shed some light on possible causes, though. _________________ Tiberium Uprising (a few missions for TS): http://www.ppmsite.com/forum/viewtopic.php?t=31029 QUICK_EDIT
Thanks, it did help a bit. The only difference I notice between all of my codes and your code was that I was using unique prerequisites for the radar. I changed it like your's so that I wasn't, and the AI is able to build a radar now. However, the AI rarely manages to build a refinery or radar, simply because there is WallTower-esque bug going on with the AI building an endless amount of the same defense (except unlike in TS with GDI, they won't build any of their other main buildings).
All my defenses for the side right now require only a barracks to build. Once they have a barracks, they will spam a defense, which will be RALASR (Sentry gun clone which also appears under BuildDummy).
My mod has a mode where defenses are not buildable, and it works for both the player and AI. But disabling the three defenses (RALASR, RAFLAK, and RAFTWR) with TechLevel=11 as I have with every other defense did not work. They wouldn't build RALASR or RAFLAK, but would instead spam RAFTWR.
Code:
; Sentry Gun
[RALASR]
UIName=Name:NALASR
Name=Soviet Sentry Gun
BuildCat=Combat
Strength=300
Armor=steel
Image=NALASR
Prerequisite=BARRACKS,RACNST
TechLevel=3
Adjacent=4
ROT=10
Sight=7
DetectDisguise=no
Owner=British,French,Germans,Americans,Alliance,Russians,Confederation,Africans,Arabs,China,YuriCountry,Ukraine,Greece,Italy,Norway,Vietnam,Japan,Phillipines,Australia,India
AIBasePlanningSide=3 ;gs 0 for Good, 1 for Evil
Cost=700
BaseNormal=yes
Points=30
Power=0
Crewed=no
Capturable=false
Explosion=TWLT070,S_BANG48,S_BRNL58,S_CLSN58,S_TUMU60
DebrisAnims=DBRIS4LG,DBRIS4SM,DBRIS6LG
MaxDebris=2
MinDebris=1
Primary=ThermalFire
ElitePrimary=ThermalFireE
Trainable=yes
Powered=yes
Turret=yes
TurretAnim=LASER
TurretAnimIsVoxel=true
;TurretAnimX=-8
TurretAnimY=10
TurretAnimZAdjust=-20
ThreatPosed=30 ; This value MUST be 0 for all building addons
;DamageParticleSystems=SparkSys,LGSparkSys
IsBaseDefense=yes
VeteranAbilities=STRONGER,FIREPOWER,ROF
EliteAbilities=STRONGER,FIREPOWER
HasStupidGuardMode=false
ImmuneToPsionics=no ; defaults to yes for buildings, no for others
AntiInfantryValue=10
AntiArmorValue=5
AntiAirValue=0
[RAFLAK]
UIName=Name:NAFLAK
Name=Soviet Flak Cannon
BuildCat=Combat
Image=NAFLAK
Strength=500
Armor=steel
TechLevel=4
Prerequisite=BARRACKS,RACNST
Adjacent=4
Sight=5
Owner=British,French,Germans,Americans,Alliance,Russians,Confederation,Africans,Arabs,China,YuriCountry,Ukraine,Greece,Italy,Norway,Vietnam,Japan,Phillipines,Australia,India
AIBasePlanningSide=3 ;gs 0 for Good, 1 for Evil
Cost=900
BaseNormal=yes
Points=30
Power=-75
Crewed=no
Primary=FlakWeapon
ElitePrimary=FlakWeaponE
Trainable=yes
LandTargeting=1
NavalTargeting=6
Capturable=false
Sensors=yes
SensorsSight=7
Explosion=TWLT070,S_BANG48,S_BRNL58,S_CLSN58,S_TUMU60
DebrisAnims=DBRIS4LG,DBRIS4SM,DBRIS6LG
MaxDebris=3
MinDebris=2
ThreatPosed=0 ; This value should be 0 for objects that are purely anti-air, since aircraft do not use the threat values
;DamageParticleSystems=SparkSys,LGSparkSys
IsBaseDefense=yes
VeteranAbilities=STRONGER,FIREPOWER,ROF
EliteAbilities=STRONGER,FIREPOWER
Powered=yes
ROT=8
TurretRotateSound=PatriotRotate
Turret=yes
TurretAnim=FLAKTUR
TurretAnimIsVoxel=true
TurretAnimX=0
TurretAnimY=2
TurretAnimZAdjust=-40
HasStupidGuardMode=false
;FireAngle=32 ; 45 degrees -- affects barrel, not turret
WorkingSound=PowerOn
NotWorkingSound=PowerOff
ImmuneToPsionics=no ; defaults to yes for buildings, no for others
Drainable=yes
AntiInfantryValue=0
AntiArmorValue=0
AntiAirValue=15
;gs these three are in abstract units and just help the AI pick the right base defense. (see AIForcePredictionFudge)
[RAFTWR] ;Flame Tower
UIName=Name:FLAMTWR
Name=Flame Tower
BuildCat=Combat
Image=NAFLAMTWR
Prerequisite=BARRACKS,RACNST
Strength=400
Armor=steel
TechLevel=6
Adjacent=2
Sight=5
Owner=British,French,Germans,Americans,Alliance,Russians,Confederation,Africans,Arabs,China,YuriCountry,Ukraine,Greece,Italy,Norway,Vietnam,Japan,Phillipines,Australia,India
AIBasePlanningSide=3 ;gs 0 for Good, 1 for Evil
Cost=800
Points=25
Power=-60
Crewed=no
Capturable=false
Primary=FlameTower
ElitePrimary=FlameTowerE
Trainable=yes
;these 3 are needed for offsets
Turret=yes
TurretAnimIsVoxel=true
TurretAnim=FLAMERTUR
TurretAnimZAdjust=-90
DebrisAnims=Dbris1sm,Dbris1lg,Dbris4sm,Dbris5sm,Dbris4lg,Dbris7sm,Dbris8sm,Dbris5lg,Dbris4lg
MaxDebris=15
MinDebris=5
ThreatPosed=40 ; This value MUST be 0 for all building addons
DamageParticleSystems=SparkSys,SmallGreySSys,BigGreySmokeSys
DamageSmokeOffset=96, 64, 112
IsBaseDefense=yes
BaseNormal=yes
Powered=yes
HasStupidGuardMode=false
WorkingSound=PowerOn
NotWorkingSound=PowerOff
ImmuneToPsionics=no ; defaults to yes for buildings, no for others
Drainable=no
AntiInfantryValue=25
AntiArmorValue=0
AntiAirValue=0
Also, I recall there being a posting feature where you can hide text in a tab that people have to open to see, so that long pages of text/code don't have to take up people's screens. Does PPM not use this? _________________ Tiberium Uprising (a few missions for TS): http://www.ppmsite.com/forum/viewtopic.php?t=31029 QUICK_EDIT
In YR, typically xxxBaseDefenseCounts gives the counts and AI uses AIForcePredictionFudge, AntiXXXValue for
the proportion of the defenses. Ares adds AI.BaseDefenses, AI.BaseDefenseCounts to the side definition. Check
them and also those defenses could be made to be built after the primary buildings are built.
If AI is allowed to start with multiple MCVs, then also the defense counts gets multiplied. QUICK_EDIT
The animations and everything weapon related is fine, and I've been using AI.BaseDefenses and AI.BaseDefenseCounts for as long as I've had the side. First I used it on just [NewSide] itself, then I used it on of its corresponding countries as well with no difference (I mean, it would make a difference if I had given any country specific defenses, but I'll save that for when the basic AI functions properly). Since I've had BaseDefenseCounts kept in check, I can only question why the defenses are endlessly built, and this can't be the issue either, as they choose to only spam one specific defense. Though TechLevel=11 made no difference in the No Defenses game mode, I'll test ForbiddenHouses as well when I am home later.
And about MCVs, they do not start with more than one MCV/Conyard, but when they manage to build a war factory, they spam MCVs (even though the MCV taskforce includes only one MCV, and the script/teamtype/triggertype have the same settings for the MCV forces of the other three factions. Perhaps there is connection between these two issues. I think the AI has actually been spamming defenses from the beginning, but the game would crash before it became noticeable (and the crash no longer occurs, or at least there hasn't been one yet). And yes, RALASR, the defense usually spammed, is under BuildDummy. _________________ Tiberium Uprising (a few missions for TS): http://www.ppmsite.com/forum/viewtopic.php?t=31029 QUICK_EDIT
Try xxx(AI.)BaseDefenseCounts=0,0,0 for your defenseless mode for AI. TechLevel disabling could be used
for human player.
MCV spamming through AITrigger could be corrected if the code is shared.
What I meant earlier was the starting count of mcv/conyards like in unholy alliance, for AI that would build
plenty of buildings. That is not your case.
Even high defense count could do the spamming. The example I shared doesn't do that, try smaller counts. QUICK_EDIT
Setting AI.BaseDefenseCounts to 0,0,0 for the countries in the no defenses mode allowed them to play properly in that mode. And the values of about 30, mid-20s and 10 for defense counts are what I generally use for all other countries, so I'm still unsure why defenses are spammed.
I was going to report that the MCV issue was still there, but when I was typing out the details of the problem to post, it occurred to me how simple the issue was; the AI Trigger Type had the MCV being built if there were no instance of GANCST, rather than RACNST. Not being Allied, they would of course continuously build MCVs. I guess when copying the MCV Trigger type code, that's one change I forgot to make.
On the bright side, I don't recall making significant changes, but the issue with China not rebuilding factories seems to have fixed itself (but there was no denying that it was definitely occurring before, and I wasn't just being impatient).
So my mod's only real issues now:
- Korean AI crash (not a big deal, since it doesn't occur often, though I still have no idea what's wrong with the airpad/aircraft)
- Fourth Side base defense spam (my main focus) _________________ Tiberium Uprising (a few missions for TS): http://www.ppmsite.com/forum/viewtopic.php?t=31029 QUICK_EDIT
If the base defense stuff is not working out even with very low counts for 4th side, then alternative option
would be to disable them completely. And make those as normal buildings, clone them as many as you want
for AI only and set AIBuildThis=yes. QUICK_EDIT
Yes, I suppose I may have to go with the alternative option, but due to prerequisites, the AI would build them all at once. Even if I gave each clone a different prerequisite, it really breaks the AntiInfantry, AntiArmor and AntiAir values, as well as every other code related to how the AI builds base defenses (since these clones would not be regarded as such).
Should I upload all my code related to the defenses? I find it very strange that defenses are spammed by an AI that appears to be coded just fine, and would really not like to resort to the clone option, considering 4th sides work perfectly fine for many Ares mods. _________________ Tiberium Uprising (a few missions for TS): http://www.ppmsite.com/forum/viewtopic.php?t=31029 QUICK_EDIT
It happens with the example I shared also. It is with the 4th side with Ares. On easy setting, it doesn't happen.
On normal and brutal settings e.g. AI.BaseDefenseCounts=12,12,12 it starts non-stop base defenses production
for 4th side. Lower values of 8 or less on the AI.BaseDefenseCounts seems to reduce the occurance.
Changing BuildDummy, IsBaseDefense=yes, AntiXXXValue, more AI.BaseDefenses etc. doesn't seem to affect it. QUICK_EDIT
I have no intention to find a workaround, only a solution.
And it seems the issue with defense counts are true. I changed the side's defense counts to 6, 5, 5. Brutal AI spammed. Medium AI built a good portion of their base before spamming indefinitely. Easy AI was the same as medium, but one managed to build a proper full base with only five defenses as they are supposed to. I imagine lowering it to only a couple defenses would make the situation even better.
Update: The China AI issue with not rebuilding any important buildings is back in the latest Ares update. _________________ Tiberium Uprising (a few missions for TS): http://www.ppmsite.com/forum/viewtopic.php?t=31029 QUICK_EDIT
I dont believe AI.BaseDefenseCounts= is responsible, it may have an effect but it isn't the problem. If it was then every mod that adds new sides would be effected. The same goes for your Chinese AI, if it was a problem with Ares then there would be lots of people posting bug reports to Alex.
BTW above you posted that you use Sidebar.YuriFileNames=sidenc02, that tag excepts boolean (yes or no) entries tho. _________________
0.9: good
0.a 1: good
0.a 2: sometimes occurs
0.a 3: always occurs
Anyway, here's the code for the Chinese AI and the fourth side that may help with the AI. It's gotten to the point where I feel others should have a look at the codes.
So, just like the fourth side bug, China's bug also relates to AI.BaseDefenseCounts. I don't know what it is about that feature that could cause the issue, considering I use the same values for other AIs. I was able to confirm this about the Chinese AI because the issue did not occur on medium or easy difficulties, nor in the No Defenses game mode on any difficulty.
Just to restate the issue clearly, since I've already been so redundant and vague in my commentary on it:
- The AI will not rebuild any important buildings (refineries, factories, battle labs, and special buildings that are only built once like the industrial plant), with the exception of Tesla reactors.
- The issue does not occur until the AI reaches tier 3 (battle lab).
- The AI will build the max number of defenses specified, as it should.
- The issue is easy to watch unfold when the AI completes its base, with every structure built, and the defense count reached. I will destroy every building that isn't a tesla reactor or defense, and the AI will either not build anything or replace the building with a defense (and a Tesla reactor if it's a powered defense).
- When the AI is left with nothing but tesla reactors, defenses, and of course a conyard, I'll destroy the defenses. The AI will replace it with only a battle bunker. I take out every defense one by one, and until all of them are battle bunkers.
When every building in their base is a tesla reactor or battle bunker, and the max defense count has been reached, the AI will finally begin to rebuild the rest of its base. They play fine until they lose a structure, and the process restarts all over again. _________________ Tiberium Uprising (a few missions for TS): http://www.ppmsite.com/forum/viewtopic.php?t=31029 QUICK_EDIT
AI.BaseDefenses & AI.BaseDefenseCounts are side not country tags, so they should be under [Nod] not [China]. [China] is however missing AI.PowerPlants.
Thanks for that information, though it made no difference in the performance of the AI.
[STRYUP] was originally intended to be an Sentry Gun upgrade for China, hence its name, but I never figured out how to make a building upgrade fire a weapon, so now it's just a different type of sentry gun available to China alongside the regular one. _________________ Tiberium Uprising (a few missions for TS): http://www.ppmsite.com/forum/viewtopic.php?t=31029 QUICK_EDIT
When the AI is left with nothing but tesla reactors, defenses, and of course a conyard, I'll destroy the defenses. The AI will replace it with only a battle bunker. I take out every defense one by one, and until all of them are battle bunkers.
That's possibly because of it is only defence that prerequisites are met. Battle Bunkers requires nothing but CYard if you didn't changed. You said you destroy everything else except PPs and defences.
I tried that out, and you were right. So as usual the AI played until I went and started destroying their base. This time they were left with Tesla reactors, defenses, and a battle lab.
With the Battle bunker set to require a barracks, and with no barracks being present, they instead spammed Speaker Tower, the only defense with the Battle Lab as a prerequisite. And now that I look back on it, the AI actually did build all the defenses they were supposed to, until the prerequisite buildings (barracks, radar, and battle lab) were destroyed, since they would not rebuild these, refineries, or factories.
So it's definitely clear they will build power plants and defenses perfectly fine, but would not build anything else. Perhaps the cause falls under the BuildXXXX keys in the [AI] section? _________________ Tiberium Uprising (a few missions for TS): http://www.ppmsite.com/forum/viewtopic.php?t=31029 QUICK_EDIT
The only solution I've found for China was lowering SovietBaseDefenseCounts to almost none. Of course, like in the No Defenses game mode, the AI builds to high tier much faster, but must rely on units for defense, which is unfair when Allies and Yuri can build far more defenses. And this solution would unfortunately affect all Soviet sides, since Ares' AI.BaseDefenseCounts is not applicable to specific countries.
Seeing as it's been almost two months since I reported the issue, and that myself and others have not found a solution, and that based on the code, there seems to be no logical reason for such an issue, I am going to put this issue to rest (as a sidenote, I have gone and completely remade the country to no avail). _________________ Tiberium Uprising (a few missions for TS): http://www.ppmsite.com/forum/viewtopic.php?t=31029 QUICK_EDIT
Found out what was causing the production of large amount of base defense buildings by the AI in the sample 4th side I linked earlier in this thread.
If a side is not provided with that side specific wall in ConcreteWalls and ProtectWithWall is used on any of its building, the AI Base planning goes into a loop as it cannot find a wall for that side and it produces more base defenses instead.
Solution is to provide a wall for that side or remove ProtectWithWall from all the buildings of that side. QUICK_EDIT
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