Huge map - crashes partway through

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
User avatar
Superm9
Second Lance Corporal
Second Lance Corporal
Posts: 104
Joined: Thu Aug 23, 2007 8:41 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Huge map - crashes partway through

Post by Superm9 »

Ok, this is a problem I am having with my map, Xagobah: Mazarian Assault. I am currently having a crash happen at random, where the game just stops and does a ctd. Now, I have 100 units on the battlefield each, plus about 20 locals, plus a bunch of vehicles (including command walkers, hoverers, and flyers). I already checked the memory pool sizes for the walkers and command vehicles, so those should be fine. I have heard people say to "fill the memory pool"; how should I do that?
I am under the 16 cp limit, so it can't be that.

Thanks in advance! :thumbs:

Superm9
Aman/Pinguin
Jedi
Jedi
Posts: 1104
Joined: Tue Jan 30, 2007 6:04 am
Projects :: Inactive
Location: Germany

Re: Huge map - crashes partway through

Post by Aman/Pinguin »

Post your .LUA and your Bfront2.log.
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11080
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

Re: Huge map - crashes partway through

Post by Teancum »

Superm9 wrote:Ok, this is a problem I am having with my map, Xagobah: Mazarian Assault. I am currently having a crash happen at random, where the game just stops and does a ctd. Now, I have 100 units on the battlefield each, plus about 20 locals, plus a bunch of vehicles (including command walkers, hoverers, and flyers). I already checked the memory pool sizes for the walkers and command vehicles, so those should be fine. I have heard people say to "fill the memory pool"; how should I do that?
When you say 'at random', exactly when are we talking? If it's within the first two minutes of the game, a lot of time it's a secondary weapon. The AI doesn't use secondary weapons often, so you may not have an issue until they try to use it. Your best bet is to load shipped sides to start with. If it doesn't crash it's a side issue. Add one custom unit/vehicle in, munge, test, repeat. Once it starts crashing you will know which unit/vehicle is causing the issue.

As far as 'fill the memory pool goes', the most common one needing filled is SoldierAnimation. It's not actually in the list of memory pools in your lua, so we need to make a new pool, and add it with the other ones. It looks like this:

SetMemoryPool("SoldierAnimation", 2000)

Look for other SetMemoryPool verbs in your lua, then insert it somewhere above/below one of those.
FragMe!
Gametoast Staff
Gametoast Staff
Posts: 2244
Joined: Sat May 13, 2006 12:34 am
Projects :: Not sure keep changing my mind.
Games I'm Playing :: F1 and SWBF
xbox live or psn: No gamertag set
Location: Origin name GT_FragMe
Contact:

Re: Huge map - crashes partway through

Post by FragMe! »

Are any of the vehicles selfpiloted and/or locals?
If they are how are they being spawned? As units or as vehicles?

They is a weird quirk with the game that if they are spawned a certain way they work fine until they get destroyed and try to respawn. During the death animation and when they respawn is when it will do a CTD (found this out with the Bantha and the Dewback)

This may not be the problem but it is something to check into as a CTD won't necessarily indicate why as it happens too fast to be logged.

I was going to say something about custom weapons too but Teancum beat me to it while I was typing :D
User avatar
Superm9
Second Lance Corporal
Second Lance Corporal
Posts: 104
Joined: Thu Aug 23, 2007 8:41 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Re: Huge map - crashes partway through

Post by Superm9 »

Well, I just ran the BF2modtools.exe and guess what? First, the .txt is over 200 kilobytes. WOW. Most of that is "fill memorypool blablabla to blabla" requests. The last error, however, was something like this (I can't supply it exactly; I accidentally reran bf2modtools and it wiped the .txt clean):

Message Severity: 3
You exceeded 16 command posts!

Well, I know that in zeroeditor there is only supposed to be 16 possible command posts(and these do not all spawn at once):

5 regular cp's
4 attes
4 gunships
3 utats
That equals... 16! And by the time the last ATTE spawns, several of the gunships and at least one of the UTATs have usually been destroyed. Are there some objects that function like a command post? (for example: I have the rebel transport on my map, 1/2 buried in the ground, acting as a crashed ship; I also have several of the felucia supply box thingies (three boxes next to each other)). These both show up on my minimap as white boxes (or in the case of the rebel transport, the shape of a ship). Could these be counting as command posts?

As a note, do not expect me to be replying any time soon (I have to leave today for my sister's tournament in Canton, and won't get back until Sunday night).

I will try filling the memory pool things; thanks for the help so far!
:thumbs:


EDIT
Oh, and in responce to Teancum's secondary weapon thing:

The crash usually occurs about 5-7 minutes into the game, so I doubt that it is weapon-related. Oddly enough, there is a small weapon-related glitch: My version of the clone assassin, (using the skin/vibroblade/model from the assets page, thanks :wink: ) has a pistol as a secondary primary weapon (aka the second primary weapon). I cannot switch to it, but ai can. Odd...

Oh well, that's just a secondary question (literally :funny2: ). Please answer the other question first.

EDIT: Oops, here's the .lua:

Hidden/Spoiler:
[code]--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

-- load the gametype script
ScriptCB_DoFile("ObjectiveConquest")
ScriptCB_DoFile("setup_teams")

-- REP Attacking (attacker is always #1)
REP = 1;
CIS = 2;
-- These variables do not change
ATT = REP;
DEF = CIS;


function ScriptPostLoad()


--This defines the CPs. These need to happen first
cp1 = CommandPost:New{name = "cp1"}
cp2 = CommandPost:New{name = "cp2"}
cp3 = CommandPost:New{name = "cp3"}
cp4 = CommandPost:New{name = "cp4"}



--This sets up the actual objective. This needs to happen after cp's are defined
conquest = ObjectiveConquest:New{teamATT = ATT, teamDEF = DEF,
textATT = "game.modes.con",
textDEF = "game.modes.con2",
multiplayerRules = true}

--This adds the CPs to the objective. This needs to happen after the objective is set up
conquest:AddCommandPost(cp1)
conquest:AddCommandPost(cp2)
conquest:AddCommandPost(cp3)
conquest:AddCommandPost(cp4)

conquest:Start()

SetUberMode(1);

EnableSPHeroRules()

end


---------------------------------------------------------------------------
-- FUNCTION: ScriptInit
-- PURPOSE: This function is only run once
-- INPUT:
-- OUTPUT:
-- NOTES: The name, 'ScriptInit' is a chosen convention, and each
-- mission script must contain a version of this function, as
-- it is called from C to start the mission.
---------------------------------------------------------------------------
function ScriptInit()

ReadDataFile("ingame.lvl")


SetMaxFlyHeight(100)
SetMaxPlayerFlyHeight (100)

SetMemoryPoolSize ("ClothData",20)
SetMemoryPoolSize ("Combo",70) -- should be ~ 2x number of jedi classes
SetMemoryPoolSize ("Combo::State",750) -- should be ~12x #Combo
SetMemoryPoolSize ("Combo::Transition",760) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Condition",760) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Attack",650) -- should be ~8-12x #Combo
SetMemoryPoolSize ("Combo::DamageSample",7100) -- should be ~8-12x #Combo::Attack
SetMemoryPoolSize ("Combo::Deflect",110) -- should be ~1x #combo

ReadDataFile("sound\\geo.lvl;geo1cw")
ReadDataFile("dc:SIDE\\\\gun.lvl",
"gun_inf_soldier")

ReadDataFile("dc:SIDE\\rep.lvl",
"rep_inf_ep3_rifleman",
"rep_inf_ep3_rocketeer",
"rep_inf_ep3_engineer",
"rep_inf_ep3_sniper_felucia",
"rep_inf_ep3_officer",
"rep_inf_ep3_jettrooper",
"rep_hover_fightertank",
"rep_hero_kiyadimundi",
"rep_hover_barcspeeder",
"rep_walk_atte",
"rep_hover_utat",
"rep_fly_arc170fighter_sc",
"rep_fly_anakinstarfighter_sc",
"rep_walk_oneman_atst",
"rep_fly_gunship_sc")

ReadDataFile("dc:SIDE\\cis.lvl",
"cis_inf_rifleman",
"cis_inf_rocketeer",
"cis_inf_pilot",
"cis_inf_sniper",
"cis_inf_officer",
"cis_inf_droideka",
"cis_hero_grievous",
"cis_hover_aat",
"cis_tread_hailfire",
"cis_walk_spider",
"cis_hover_stap",
"cis_fly_tridroidfighter",
"cis_fly_droidfighter_sc",
"cis_walk_dwarfspider",
"kas_tread_snailtank",
"cis_fly_droidgunship")


ReadDataFile("SIDE\\tur.lvl",
"tur_bldg_laser",
"tur_bldg_tower",
"tur_bldg_geoturret",
"tur_bldg_built_chaingun",
"tur_bldg_cis_missle",
"tur_bldg_recoilless_kas")

SetupTeams{
rep = {
team = REP,
units = 100,
reinforcements = 1000,
soldier = { "rep_inf_ep3_rifleman",50, 200},
assault = { "rep_inf_ep3_rocketeer",10, 100},
engineer = { "rep_inf_ep3_engineer",10, 50},
sniper = { "rep_inf_ep3_sniper_felucia",10, 50},
officer = {"rep_inf_ep3_officer",5, 30},
special = { "rep_inf_ep3_jettrooper",5, 20},


},
cis = {
team = CIS,
units = 100,
reinforcements = 1100,
soldier = { "cis_inf_rifleman",15, 200},
assault = { "cis_inf_rocketeer",10, 100},
engineer = { "cis_inf_pilot",10, 50},
sniper = { "cis_inf_sniper",10, 50},
officer = {"cis_inf_officer",5, 30},
special = { "cis_inf_droideka",5, 20},
}
}

SetTeamName (3, "Xamsters")
AddUnitClass (3, "gun_inf_soldier", 10,15)
SetUnitCount (3, 15)
AddAIGoal(3, "Deathmatch", 100)

SetTeamAsFriend(ATT,3)
SetTeamAsFriend(3,ATT)
SetTeamAsFriend(DEF,3)
SetTeamAsFriend(3,DEF)


SetHeroClass(CIS, "cis_hero_grievous")
SetHeroClass(REP, "rep_hero_kiyadimundi")



-- Level Stats
-- ClearWalkers()
AddWalkerType(0, 4) -- special -> droidekas
AddWalkerType(1, 10) -- 1x2 (1 pair of legs)
AddWalkerType(2, 10) -- 2x2 (2 pairs of legs)
AddWalkerType(3, 10) -- 3x2 (3 pairs of legs)
local weaponCnt = 1024
SetMemoryPoolSize("Aimer", 75)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 1024)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("EntityCloth", 32)
SetMemoryPoolSize("EntityFlyer", 32)
SetMemoryPoolSize("EntityHover", 32)
SetMemoryPoolSize("EntityLight", 200)
SetMemoryPoolSize("EntitySoundStream", 4)
SetMemoryPoolSize("EntitySoundStatic", 32)
SetMemoryPoolSize("CommandWalker", 9)
SetMemoryPoolSize("CommandHover", 6)
SetMemoryPoolSize("CommandFlyer", 6)
SetMemoryPoolSize("MountedTurret", 32)
SetMemoryPoolSize("Navigator", 128)
SetMemoryPoolSize("Obstacle", 1024)
SetMemoryPoolSize("PathNode", 1024)
SetMemoryPoolSize("SoundSpaceRegion", 64)
SetMemoryPoolSize("TreeGridStack", 1024)
SetMemoryPoolSize("UnitAgent", 128)
SetMemoryPoolSize("UnitController", 128)
SetMemoryPoolSize("SoldierAnimation", 2000)
SetMemoryPoolSize("Weapon", weaponCnt)

SetSpawnDelay(10.0, 0.25)
--ReadDataFile("dc:XMA\\XMA.lvl", "XMA_conquest")
ReadDataFile("dc:XMA\\XMA.lvl", "XMA_conquest")
SetDenseEnvironment("false")




-- Sound
voiceSlow = OpenAudioStream("sound\\global.lvl", "rep_unit_vo_slow")
AudioStreamAppendSegments("sound\\global.lvl", "cis_unit_vo_slow", voiceSlow)
AudioStreamAppendSegments("sound\\global.lvl", "global_vo_slow", voiceSlow)

voiceQuick = OpenAudioStream("sound\\global.lvl", "rep_unit_vo_quick")
AudioStreamAppendSegments("sound\\global.lvl", "cis_unit_vo_quick", voiceQuick)

OpenAudioStream("sound\\global.lvl", "cw_music")
-- OpenAudioStream("sound\\global.lvl", "global_vo_quick")
-- OpenAudioStream("sound\\global.lvl", "global_vo_slow")
OpenAudioStream("sound\\geo.lvl", "geo1cw")
OpenAudioStream("sound\\geo.lvl", "geo1cw")

SetBleedingVoiceOver(REP, REP, "rep_off_com_report_us_overwhelmed", 1)
SetBleedingVoiceOver(REP, CIS, "rep_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(CIS, REP, "cis_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(CIS, CIS, "cis_off_com_report_us_overwhelmed", 1)

SetLowReinforcementsVoiceOver(REP, REP, "rep_off_defeat_im", .1, 1)
SetLowReinforcementsVoiceOver(REP, CIS, "rep_off_victory_im", .1, 1)
SetLowReinforcementsVoiceOver(CIS, CIS, "cis_off_defeat_im", .1, 1)
SetLowReinforcementsVoiceOver(CIS, REP, "cis_off_victory_im", .1, 1)

SetOutOfBoundsVoiceOver(1, "repleaving")
SetOutOfBoundsVoiceOver(2, "cisleaving")

SetAmbientMusic(REP, 1.0, "rep_GEO_amb_start", 0,1)
SetAmbientMusic(REP, 0.8, "rep_GEO_amb_middle", 1,1)
SetAmbientMusic(REP, 0.2, "rep_GEO_amb_end", 2,1)
SetAmbientMusic(CIS, 1.0, "cis_GEO_amb_start", 0,1)
SetAmbientMusic(CIS, 0.8, "cis_GEO_amb_middle", 1,1)
SetAmbientMusic(CIS, 0.2, "cis_GEO_amb_end", 2,1)

SetVictoryMusic(REP, "rep_geo_amb_victory")
SetDefeatMusic (REP, "rep_geo_amb_defeat")
SetVictoryMusic(CIS, "cis_geo_amb_victory")
SetDefeatMusic (CIS, "cis_geo_amb_defeat")

SetSoundEffect("ScopeDisplayZoomIn", "binocularzoomin")
SetSoundEffect("ScopeDisplayZoomOut", "binocularzoomout")
--SetSoundEffect("WeaponUnableSelect", "com_weap_inf_weaponchange_null")
--SetSoundEffect("WeaponModeUnableSelect", "com_weap_inf_modechange_null")
SetSoundEffect("SpawnDisplayUnitChange", "shell_select_unit")
SetSoundEffect("SpawnDisplayUnitAccept", "shell_menu_enter")
SetSoundEffect("SpawnDisplaySpawnPointChange", "shell_select_change")
SetSoundEffect("SpawnDisplaySpawnPointAccept", "shell_menu_enter")
SetSoundEffect("SpawnDisplayBack", "shell_menu_exit")


--ActivateBonus(CIS, "SNEAK_ATTACK")
--ActivateBonus(REP, "SNEAK_ATTACK")

SetAttackingTeam(ATT)

--Opening Satalite Shot
--Geo
--Mountain
AddCameraShot(0.996091, 0.085528, -0.022005, 0.001889, -6.942698, -59.197201, 26.136919)
--Wrecked Ship
AddCameraShot(0.906778, 0.081875, -0.411906, 0.037192, 26.373968, -59.937874, 122.553581)
--War Room
--AddCameraShot(0.994219, 0.074374, 0.077228, -0.005777, 90.939568, -49.293945, -69.571136)
end[/code]
Fingerfood
Sith
Sith
Posts: 1262
Joined: Fri Nov 30, 2007 9:40 pm

Re: Huge map - crashes partway through

Post by Fingerfood »

While, just glancing over your .lua, you need to add the CPs to the list. And, also, try lowering your unitcount a bit to see if that helps.
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11080
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

Re: Huge map - crashes partway through

Post by Teancum »

ReadDataFile("dc:SIDE\\\\gun.lvl",
"gun_inf_soldier")
There should only be two \\, you have four. Also, only load what you have to from a custom side. Everything else can be loaded from a default side so that you can save on filespace.
User avatar
Superm9
Second Lance Corporal
Second Lance Corporal
Posts: 104
Joined: Thu Aug 23, 2007 8:41 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Re: Huge map - crashes partway through

Post by Superm9 »

Well, I don't have my map in front of me (it's at a different computer miles away) But I do know these things: First, I need to add the cps to the lua (I saw that and went "oh boy, I'm a n00b" :roll: ), I have 5 cps, but I never noticed the glitch because first, I rarely finish a match on this map (it takes about 15-20 minutes to play right now) and a side NEVER captures all of the cps. I'll fix that as soon as I get home.

Second, the gungan local sides (currently being reskinned to look more like the natives, Xamsters (wookipedia:
http://starwars.wikia.com/wiki/Xamster))
Work fine with the 4 slashes... does the amount matter? I know that it works, even with new skins. And th gungan soldier is the only unit I'm using, so I know that I'm not loading an extra unit.

Thanks!

Superm9
User avatar
Eggman
Master Bounty Hunter
Master Bounty Hunter
Posts: 1516
Joined: Mon Jul 16, 2007 1:30 pm
Projects :: Battlefront Chronicles
Location: Las Vegas

Re: Huge map - crashes partway through

Post by Eggman »

Do you have water in your map and a high view distance in the .sky file? Although individually those two usually aren't a problem, when put together they can cause crashing whenever you look in the direction of the water.
User avatar
Superm9
Second Lance Corporal
Second Lance Corporal
Posts: 104
Joined: Thu Aug 23, 2007 8:41 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Re: Huge map - crashes partway through

Post by Superm9 »

No, that's not causing the crash... the cp count is going over 16. The thing is that I only have a max possible cp count of 16! (including mobile cps; see post above).
FragMe!
Gametoast Staff
Gametoast Staff
Posts: 2244
Joined: Sat May 13, 2006 12:34 am
Projects :: Not sure keep changing my mind.
Games I'm Playing :: F1 and SWBF
xbox live or psn: No gamertag set
Location: Origin name GT_FragMe
Contact:

Re: Huge map - crashes partway through

Post by FragMe! »

Try taking away either a fixed CP or one of the vehicle CP's see if that stops the crash.
Also you did name them all in the lua now right?
User avatar
Superm9
Second Lance Corporal
Second Lance Corporal
Posts: 104
Joined: Thu Aug 23, 2007 8:41 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Re: Huge map - crashes partway through

Post by Superm9 »

Ok, reducing the # of mobile cps fixed it. Thanks!
Post Reply