My map, Bocage, crashes when loading. I previously edited the map by adding new bases and redone AI.
Upon further studying, I found that the game is trying to create PathFinding files as it's loading.
I looked in the map's files in attempt to find a line of code that might tell the game to generate Pathfinding files, but I didn't find it. What can I do?
I found this line of code at the top of "bf1942/levels/Bocage/AIpathFinding.con"
rem *** pathfinding debug mode
rem game.aiPathfindingDebuggingActive 1
^ But it is REMed out. So it can't be this...
- - - - - - - -
There's some kind of pathfinding generation code somewhere that's making the game create pathfinding files for Bocage. The game is crashing in the process of the pathfinding generation.
Map is crashing - Mostly figured out
Map is crashing - Mostly figured out
Last edited by Swaffy on Thu Sep 27, 2012 8:39 pm, edited 1 time in total.
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
Re: Map is crashing - Mostly figured out
Hey Swaffy, It sounds like you've got 'AI.Createallmaps' somewhere in your AIPathfinding.con file. Probably at the bottom. With that, the map will create new pathmaps every time you run it until you 'Rem' it out or remove it.
Re: Map is crashing - Mostly figured out
Thank you for taking your time to reply.
I did a Ctrl+F (find) for that code in "AIpathfinding.con" and "AI.con" and didn't find the code (I even visually went through just in case).
Here is my code, so that there is a visual example of what I have:
[Edited: wrong map]
Bocage/AI.con
Bocage/AIpathFinding.con
I did a Ctrl+F (find) for that code in "AIpathfinding.con" and "AI.con" and didn't find the code (I even visually went through just in case).
Here is my code, so that there is a visual example of what I have:
[Edited: wrong map]
Bocage/AI.con
Code: Select all
if v_arg1 == host
rem ************** LEVEL SPECIFIC AI SETTINGS ***************************
aiSettings.setWorldMapSize 2048 2048
aiSettings.setViewDistance 305
aiSettings.setInformationGridDimension 32
rem ********************** START THE AI *********************************
rem *** Init AI using current settings ****
ai.init 2
rem *** init Botmanager ***
AIBotManager.setLodLevelTicks 6 6 6
AIBotManager.setLodLevelPriority 6 4 2
AIBotManager.setPlannedDecisionMakingThreshold 0.5 1.0 3.0
AIBotManager.setUnplannedDecisionMakingThreshold 0.3 0.8 2.0
AIBotManager.setDecisionMakingInterleave 2 2
AIBotManager.setSensingQuotient 2 1
AIBotManager.setSystemQuotient 30 40 30
rem *** Strategic map dimension, MUST BE DONE BEFORE CREATING SAI! ***
ai.saiMapXDimension 64
ai.saiMapYDimension 64
rem *** Create Strategic AI ***
ai.createSAI
rem *** Enabled or disabled as default ***
ai.saiEnable 1
game.showAIstats 1
ai.showBotStats 1
rem *** Bot statistic ***
ai.botStatisticUpdateSpeed 3
endif
run AIPathFinding.con v_arg1
rem *** Create strategically important areas ***
run ai/StrategicAreas v_arg1
rem *** Load and set strategies for each side ***
run ai/conditions v_arg1
run ai/prerequisites v_arg1
run ai/Strategies v_arg1
if v_arg1 == host
ai.addSAIStrategy 1 TeamAAttack
ai.addSAIStrategy 1 TeamADefend
ai.addSAIStrategy 1 TeamARepulse
ai.addSAIStrategy 2 TeamBAttack
ai.addSAIStrategy 2 TeamBDefend
ai.addSAIStrategy 2 TeamBRepulse
endif
Code: Select all
if v_arg1 == host
rem *** pathfinding debug mode
rem game.aiPathfindingDebuggingActive 1
rem *** Set number of maps ***
rem ai.setNSearchMaps 2 *** DEPRICATED ***
rem ai.setNSearchTypes 2 *** DEPRICATED ***
rem *** Set number of AStar resources ***
rem ai.numAStarResources 12
rem *** Setup map parameters ***
rem *** Tank ***
rem *** searchMap name/ waterHeight/ waterDepth/maxSlope/brush/lowClipLevel/hiClipLevel/
rem considerAITypes/createSecondLayerMap/ firstLevel-secondlevel-thirdlevel (for second layer map)
rem *** searchType name/mapNum/minSearchLevel
rem *** Tank ***
ai.addSearchMap Tank0 0 0 30 3.0 0.3 2.5 0 0 1.0/3.0/7.0
ai.addSearchType Tank 0 0
ai.setMapSpawnPoints 0 561/1082 , 611/1086 , 568/1043 , 843/716 , 1272/1414 , 702/1833 , 747/1853 , 768/1859 , 747/1849 , 596/1452 , 576/1466 , 576/1462 , 1249/1390 , 720/1876
ai.setSmoothing 0 20
rem *** Infantry ***
ai.addSearchMap Infantry1 0 1.5 40 1.0 0.4 2.0 1 0 1.0/3.0/7.0
ai.addSearchType Infantry 1 0
ai.setMapSpawnPoints 1 587/1122 , 626/1100 , 571/1059 , 582/1042 , 620/1040 , 650/1064 , 838/720 , 846/742 , 840/726 , 846/726 , 839/733 , 838/714 , 848/720 , 1260/1378 , 1233/1369 , 1237/1396 , 1247/1427 , 742/1896 , 754/1897 , 782/1851 , 764/1873 , 700/1852 , 759/1874 , 1211/576 , 1199/522 , 1236/533 , 1179/565 , 591/1437 , 583/1454 , 577/1458 , 587/1455 , 574/1471
ai.setSmoothing 1 10
rem *** Boat ***
ai.addSearchMap Boat2 1 1.4 30 4.0 0.3 2.5 0 0 0/0/0
ai.addSearchType Boat 2 2
ai.setMapSpawnPoints 2
ai.setSmoothing 2 20
rem *** Landingcraft ***
ai.addSearchMap LandingCraft3 1 1.4 30 4.0 0.3 2.5 0 0 0/0/0
ai.addSearchType LandingCraft 3 2
ai.setMapSpawnPoints 3
ai.setSmoothing 3 20
rem *** Car ***
ai.addSearchMap Car4 0 0 35 3.0 0.3 2.5 0 0 0/0/0
ai.addSearchType Car 4 0
ai.setMapSpawnPoints 4 665/1173 , 1272/1361 , 719/1855 , 721/1856 , 1234/541 , 1200/587 , 854/718 , 593/1436
ai.setSmoothing 4 6
rem *** Load maps ***
ai.loadMaps
run StaticObjects.con
ai.createAllMaps
endif
Last edited by Swaffy on Tue Sep 25, 2012 4:42 pm, edited 1 time in total.
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
Re: Map is crashing - Mostly figured out
No problem. You said it was a redone AI for Bocage, yet what you attached says Battleaxe. For starters, the AI.con is missing an 'Endif' at the bottom after the strategies are loaded. If the strategies are borrowed from another map, you need to ensure they are all relevant or the map will crash. Remove all your 'ai.setMapSpawnPoints' in AIPathfinding.com. They won't be doing you any favors. Also, reset all your clipping levels there to stock. In fact, it would be easier to spot your problem by resetting the AI to stock and the re-adding it one piece at a time. The only things i'd ever done to Bocage was add Landingcraft pathways, inflatable rafts to cruise between control points, restore the original extra CPs, and adjust the strategies to account for the them. Otherwise the stock strategies and pathfinding are fine. I guess the question is what are you looking to do?
Re: Map is crashing - Mostly figured out
Oops, I had the wrong map RFA opened when I was copying code.
I edited my previous post.
My goal is to add bases on the upper section of the map (the "blank/unused space") to make it a much larger map. The original map was small and very linear, which can become quite boring.
[Edit] I did find the "AI.CreateAllMaps" code in the AIpathfinding.con file. I deleted it and the map loaded, with the debugging thing active. I can shut off the debugging part though.
I edited my previous post.
My goal is to add bases on the upper section of the map (the "blank/unused space") to make it a much larger map. The original map was small and very linear, which can become quite boring.
[Edit] I did find the "AI.CreateAllMaps" code in the AIpathfinding.con file. I deleted it and the map loaded, with the debugging thing active. I can shut off the debugging part though.
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
Re: Map is crashing - Mostly figured out
Sweet. Sounds like you are good to go. But first, remove that 'run StaticObjects.con' at the bottom of AIPathfinding.con. That was put there to insure that statics are loaded prior to creating the pathmaps. By leaving it there, you are actually loading your statics twice.
Re: Map is crashing - Mostly figured out
Also, i forgot to mention, if you want to path the entire map, remove those ai.setMapSpawnPoints and regenerate your pathmaps before removing these:
run StaticObjects.con
ai.createAllMaps
What ai.setMapSpawnPoints does is restrict pathmapping to only those coordinates, and on a map like Bocage, those outer areas don't get pathed. By eliminating the setMapSpawnPoints, you are telling it to path the entire map, and the bots will now be able to attack each others main bases using the outer roads and bridges. Try it, you'll see what i mean.
run StaticObjects.con
ai.createAllMaps
What ai.setMapSpawnPoints does is restrict pathmapping to only those coordinates, and on a map like Bocage, those outer areas don't get pathed. By eliminating the setMapSpawnPoints, you are telling it to path the entire map, and the bots will now be able to attack each others main bases using the outer roads and bridges. Try it, you'll see what i mean.
Re: Map is crashing - Mostly figured out
Thank you, POTAmatt. You were a lot of help to me.
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™