BF2 Limitations (FAQ)

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
AnthonyBF2
Sith
Sith
Posts: 1254
Joined: Wed Aug 21, 2013 3:55 pm
Projects :: PS2+PSP Overhaul

Re: BF2 Limitations (FAQ)

Post by AnthonyBF2 »

correctmushroom2013 wrote:Sometime ago I had a crash of my map because of it has a lot of simple prop objects. I think what this is another limitation, of course idk how many objects can have a map. Any way to count them in ZE or somewhere... somehow...? :cpu: :)
I have a personal method of counting total stuff loaded in a layer or base layer. I open the .LYR or .WRD file in Notepad++ then I open the replace function, and change every instance of the text string "object" with anything else like "objact" and then click "replace all" and Notepadd++ will tell you the total amount of instances replaced.

Just make sure you DON'T save changes to the file when you do this. Just do it, then undo it, and close the file.
Marth8880
Resistance Leader
Posts: 5042
Joined: Tue Feb 09, 2010 8:43 pm
Projects :: DI2 + Psychosis
Games I'm Playing :: Silent Hill 2
xbox live or psn: Marth8880
Location: Edinburgh, UK
Contact:

Re: BF2 Limitations (FAQ)

Post by Marth8880 »

Hidden/Spoiler:
I actually made a tool that will count the total number of objects in a map: https://github.com/marth8880/ZeroWorldS ... tag/v0.2.0
In script, creating more than 64 timers causes the game to freeze.
correctmushroom2013
Second Lance Corporal
Second Lance Corporal
Posts: 102
Joined: Fri Jul 19, 2013 11:10 am
Projects :: Droid Factory Conquest
Games I'm Playing :: SWBF2 BDO
xbox live or psn: No gamertag set
Location: Russian Federation

Re: BF2 Limitations (FAQ)

Post by correctmushroom2013 »

Maximum 4 ambush teams for MP. All 6 teams with ATT DEF and 3th local's team. Now on map I have ATT DEF (2 teams), 3th local team, and 3 ambush teams. If you create one more ambush team, MP game get crash.
Sporadia
Corporal
Corporal
Posts: 151
Joined: Thu Jan 24, 2019 11:02 pm
Projects :: No Mod project currently
Games I'm Playing :: None
xbox live or psn: No gamertag set

Re: BF2 Limitations (FAQ)

Post by Sporadia »

It might not be the most important limitation but if you use the fake console command mem, you will see that each mission can load up to 32MB of sound (then it starts skipping sounds because they don't fit; technically it states 32 Mebibytes as 33554432 bytes). I think I've read somewhere that consoles have a smaller limit, but it's been a long time. 32MB is the limit for PC.
Isaac1138
Corporal
Corporal
Posts: 158
Joined: Thu Jan 15, 2015 12:05 am
Projects :: No Mod project currently.
Games I'm Playing :: BF1+2 stronghold
xbox live or psn: No gamertag set
Location: Connecticut

Re: BF2 Limitations (FAQ)

Post by Isaac1138 »

New limitation discovered for sounds:

Between 445-450 max streams in the global music.
That includes both gcw and cw streams
User avatar
AnthonyBF2
Sith
Sith
Posts: 1254
Joined: Wed Aug 21, 2013 3:55 pm
Projects :: PS2+PSP Overhaul

Re: BF2 Limitations (FAQ)

Post by AnthonyBF2 »

I have figured out that SWBF2 has a limit how many AddCameraShot lines we are allowed to have in our mission scripts.

I originally wanted to create a lot of new camera shot angles for Polis Massa that cover just about every aspect of the level including the outside areas.
I began with the first camera shot starting in the northeast hangar then worked my way around the map in a clock-wise fasion, finishing off with the outside areas.
When I tested these new camera shots, I noticed that the only camera shots I were seeing were from the northeast hangar area to around the middle of the map and hallway areas.
None of my camera shots from the western half section of the level were ever being displayed, despite clicking through a few thousand times total over the course of several minutes.

My camera shots were 46 total:
AddCameraShot(-0.193204, 0.020136, -0.975667, -0.101688, 112.649200, 17.623613, -117.789055);
AddCameraShot(0.584935, -0.031815, 0.809260, 0.044016, 113.651199, 15.829309, -115.886131);
AddCameraShot(0.736033, -0.065748, 0.671074, 0.059945, 153.837189, 20.048080, -63.497570);
AddCameraShot(0.790976, -0.073693, -0.604774, -0.056345, 64.175720, 21.036154, -56.964710);
AddCameraShot(-0.185849, 0.018834, -0.977392, -0.099047, 111.285927, 28.223373, -54.238270);
AddCameraShot(-0.001280, 0.000083, -0.997900, -0.064766, 109.011116, 28.223373, -22.601974);
AddCameraShot(-0.183012, 0.013717, -0.980266, -0.073470, 113.267677, 30.263466, 29.434828);
AddCameraShot(0.964453, -0.104699, 0.241211, 0.026185, 114.457832, 30.263466, 63.073421);
AddCameraShot(0.992400, -0.107255, 0.059970, 0.006481, 108.915672, 30.263466, 88.068588);
AddCameraShot(0.959905, -0.092199, 0.263515, 0.025311, 74.257927, 29.590170, 73.609756);
AddCameraShot(0.683231, -0.082409, -0.720316, -0.086882, 31.704250, 31.202438, 26.538410);
AddCameraShot(0.830298, -0.055477, 0.553318, 0.036970, 39.720638, 28.345638, 84.253395);
AddCameraShot(0.561187, -0.031328, 0.825810, 0.046100, 36.971157, 28.345638, 48.274956);
AddCameraShot(0.735050, -0.056499, -0.673667, -0.051781, 11.336551, 29.386257, 65.714912);
AddCameraShot(0.707775, -0.053725, 0.702372, 0.053315, -29.159868, 27.243788, 66.175629);
AddCameraShot(0.823174, -0.069979, -0.561436, -0.047728, -55.811001, 27.243788, 83.084099);
AddCameraShot(0.573029, -0.049538, -0.814997, -0.070456, -55.937042, 27.243788, 49.701363);
AddCameraShot(0.982240, -0.090099, -0.163892, -0.015033, -61.295517, 29.610790, 85.892136);
AddCameraShot(0.173008, -0.017782, -0.979599, -0.100685, -61.614410, 29.610790, 45.912346);
AddCameraShot(0.807021, -0.078290, -0.582575, -0.056517, -121.689636, 29.610790, 25.724768);
AddCameraShot(-0.383000, 0.046196, -0.915954, -0.110479, -48.431633, 29.610790, 12.872742);
AddCameraShot(0.557964, -0.057617, 0.823484, 0.085035, -41.858772, 29.610790, 22.620537);
AddCameraShot(-0.182955, 0.020038, -0.977075, -0.107011, -58.829170, 29.610790, 6.798736);
AddCameraShot(-0.388796, 0.032306, -0.917595, -0.076246, -69.086578, 29.610790, 33.191689);
AddCameraShot(0.920115, -0.073810, -0.383400, -0.030756, -78.830750, 30.425386, 42.888916);
AddCameraShot(0.457012, -0.048952, -0.883061, -0.094588, -87.543770, 29.976128, 19.184814);
AddCameraShot(0.929891, -0.102292, 0.351207, 0.038634, -54.797810, 29.976128, 51.905849);
AddCameraShot(0.706788, -0.058730, -0.702562, -0.058379, -115.377319, 27.573608, 16.620588);
AddCameraShot(0.993194, -0.116439, 0.002627, 0.000308, -101.796677, 23.019112, 9.886441);
AddCameraShot(0.988687, -0.085472, -0.122799, -0.010616, -111.977242, 20.063837, -16.614649);
AddCameraShot(0.971906, -0.087752, 0.217513, 0.019639, -89.960732, 20.063837, -18.757191);
AddCameraShot(-0.433208, 0.001266, -0.901289, -0.002635, -82.926857, 17.222723, -42.276718);
AddCameraShot(0.432160, 0.008202, -0.901597, 0.017111, -120.614128, 16.188404, -41.560928);
AddCameraShot(0.988644, -0.025017, 0.148129, 0.003748, -103.900917, 17.786942, -62.822586);
AddCameraShot(0.004667, -0.000408, -0.996191, -0.087077, -107.905487, 20.777037, -91.118042);
AddCameraShot(0.859376, -0.080893, -0.502683, -0.047318, -138.680084, 27.347904, -102.857193);
AddCameraShot(0.835842, -0.085508, -0.539454, -0.055187, -111.555107, 27.347904, -124.002724);
AddCameraShot(-0.203931, 0.019686, -0.974259, -0.094047, -86.849838, 27.347904, -149.211700);
AddCameraShot(0.221774, -0.013758, -0.973130, -0.060369, -88.128891, 27.347904, -139.433487);
AddCameraShot(0.919751, -0.099405, 0.377508, 0.040800, -76.611458, 27.347904, -113.546669);
AddCameraShot(-0.365374, 0.093483, -0.897252, -0.229567, -68.512276, 48.999775, 32.186607);
AddCameraShot(-0.374301, 0.064261, -0.911739, -0.156531, -80.808182, 40.863174, 44.598972);
AddCameraShot(0.787426, -0.124791, 0.596205, 0.094486, 100.166710, 49.583767, 7.743818);
AddCameraShot(0.442534, -0.054447, -0.888399, -0.109303, -99.501755, 61.293411, -160.744293);
AddCameraShot(0.546671, -0.082106, 0.824069, 0.123769, 122.037178, 61.293411, -135.296982);
AddCameraShot(0.940030, -0.341091, 0.000512, 0.000186, 109.009598, 43.900810, -36.755657);

So next I ran a test. I created a new set of camera shots, 16 total. 15 of the camera shots are 100% exactly the same.
The 16th camera shot will be in the northwest hangar, a totally different area of the level.

This test was successful.
All 16 camera shots were available but of course, the 16th camera shot from the northwest hangar was rare to see since the other 15 camera shots were in the exact same location.

The next part of the test I did was add a 17th camera shot that appears in the central hangar.
I spent about ten minutes clicking through the camera shots nonstop. The 17th camera shot never ever appears.
The 16th camera shot still appeared sometimes whereas most of the camera shots displayed were among the first 15.

At this point, the 17 total camera shots were:
AddCameraShot(-0.193204, 0.020136, -0.975667, -0.101688, 112.649200, 17.623613, -117.789055);
AddCameraShot(-0.193204, 0.020136, -0.975667, -0.101688, 112.649200, 17.623613, -117.789055);
AddCameraShot(-0.193204, 0.020136, -0.975667, -0.101688, 112.649200, 17.623613, -117.789055);
AddCameraShot(-0.193204, 0.020136, -0.975667, -0.101688, 112.649200, 17.623613, -117.789055);
AddCameraShot(-0.193204, 0.020136, -0.975667, -0.101688, 112.649200, 17.623613, -117.789055);
AddCameraShot(-0.193204, 0.020136, -0.975667, -0.101688, 112.649200, 17.623613, -117.789055);
AddCameraShot(-0.193204, 0.020136, -0.975667, -0.101688, 112.649200, 17.623613, -117.789055);
AddCameraShot(-0.193204, 0.020136, -0.975667, -0.101688, 112.649200, 17.623613, -117.789055);
AddCameraShot(-0.193204, 0.020136, -0.975667, -0.101688, 112.649200, 17.623613, -117.789055);
AddCameraShot(-0.193204, 0.020136, -0.975667, -0.101688, 112.649200, 17.623613, -117.789055);
AddCameraShot(-0.193204, 0.020136, -0.975667, -0.101688, 112.649200, 17.623613, -117.789055);
AddCameraShot(-0.193204, 0.020136, -0.975667, -0.101688, 112.649200, 17.623613, -117.789055);
AddCameraShot(-0.193204, 0.020136, -0.975667, -0.101688, 112.649200, 17.623613, -117.789055);
AddCameraShot(-0.193204, 0.020136, -0.975667, -0.101688, 112.649200, 17.623613, -117.789055);
AddCameraShot(-0.193204, 0.020136, -0.975667, -0.101688, 112.649200, 17.623613, -117.789055);
AddCameraShot(0.912267, -0.135238, 0.382447, 0.056695, -76.756111, 30.076214, -114.305008);
AddCameraShot(0.555123, -0.064545, 0.823711, 0.095773, -42.186226, 30.475630, 22.398804);

Conclusion: SWBF2 has a 16 camera shot limit.
I would recommend all future modders who want a lot of camera shots to make different camera shots for different game modes.
For example, in CTF mode, have 16 total camera shots that focus on only CTF areas, such as the flag goals, flag locations, command posts, and the paths that AI use.
In other modes, like conquest, have a set of 16 different camera shots that focus more on command post locations and main pathways, perhaps vehicle spawns if applicable.

Also note that the debugger game exe doesn't print any error messages when you go over the 16 limit.
Sporadia
Corporal
Corporal
Posts: 151
Joined: Thu Jan 24, 2019 11:02 pm
Projects :: No Mod project currently
Games I'm Playing :: None
xbox live or psn: No gamertag set

Re: BF2 Limitations (FAQ)

Post by Sporadia »

Heroes can't have invisibility weapons. This has probably been discovered before, but when I add units with SetHeroClass() they don't turn invisible. When I add the same units to SetUpTeams the invisibility works. The weapon always triggers; it's the msh that doesn't go transparent. I tried this with the Bothan Spy in the end to check that I hadn't set up the invisibility odf wrong. There might be clever workarounds with lua and the msh file.
Marth8880
Resistance Leader
Posts: 5042
Joined: Tue Feb 09, 2010 8:43 pm
Projects :: DI2 + Psychosis
Games I'm Playing :: Silent Hill 2
xbox live or psn: Marth8880
Location: Edinburgh, UK
Contact:

Re: BF2 Limitations (FAQ)

Post by Marth8880 »

Sporadia wrote:
Sat Aug 19, 2023 10:25 am
Heroes can't have invisibility weapons. This has probably been discovered before, but when I add units with SetHeroClass() they don't turn invisible. When I add the same units to SetUpTeams the invisibility works. The weapon always triggers; it's the msh that doesn't go transparent. I tried this with the Bothan Spy in the end to check that I hadn't set up the invisibility odf wrong. There might be clever workarounds with lua and the msh file.
This might be because they're constantly getting "damaged" by the hero time limit, so invisibility capability was probably just disabled for hero units entirely.
Sporadia
Corporal
Corporal
Posts: 151
Joined: Thu Jan 24, 2019 11:02 pm
Projects :: No Mod project currently
Games I'm Playing :: None
xbox live or psn: No gamertag set

Re: BF2 Limitations (FAQ)

Post by Sporadia »

I didn't think about it that way. I've just ruled out InvisibilityMin = "1.0" though. There's no odf fix.
Post Reply