What's the Object limit?

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
Ace_Azzameen_5
Jedi
Jedi
Posts: 1119
Joined: Sat Apr 23, 2005 8:52 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

What's the Object limit?

Post by Ace_Azzameen_5 »

Because I think I just spawned a row of MTT's 1.5 MTT widths appart that is 10000 MTT's wide...
This is an encouraging development....I might return to mapping now that I can properly add a billion props to my map without it freezing (I'm thinking of programming a scaled up, full collision version of foliage...)
But first I'm going to use timers to make a neat little animation with this type of code...
Another thing Create Matrix makes feasible is some odd cutscene involving objects appearing and disappearing etc...
This thread really tells you how open up a whole new level of modding potential for SWBF2...

Code: Select all

--Spawn objects in a pattern	
Matrix = GetPathPoint("StartMatrix")
--CreateMatrix(Rotation in Radians for Chosen axis, Rotation X, Rotation Y, Rotation Z, Move X, Move Y, Move Z, initial matrix)
NumObjsToSpawn = 10001
NumObjsSpawned = 0
XTranslate = 2
--(- 1)

while NumObjsToSpawn > NumObjsSpawned do
Matrix = CreateMatrix(0, 0, 0, 0, XTranslate, 0, 0, Matrix)
CreateEntity("cis_prop_mtt", Matrix, "Mtt",8)
XTranslate = XTranslate + 2
NumObjsSpawned = NumObjsSpawned + 1
end	
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Re: What's the Object limit?

Post by [RDH]Zerted »

Just a warning that things created with CreateEntity are not the same as those normally placed in the game. I can't say how/why they are different, but for some reason they are. It may or may not matter depending on the objects and how they are used.
User avatar
Sky_216
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2086
Joined: Mon Feb 13, 2006 3:28 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: What's the Object limit?

Post by Sky_216 »

Yep, used this to spawn a whole line of stormtroopers, even though they had a team they didn't do anything, just sat there and let me shoot them.

Although thanks to that little experiment I now have an awesome puzzle design, so thanks. :D
Ace_Azzameen_5
Jedi
Jedi
Posts: 1119
Joined: Sat Apr 23, 2005 8:52 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Re: What's the Object limit?

Post by Ace_Azzameen_5 »

Hehe neat.
LoL, Zerted, thanks for the horror movie cliché warning...
As long as they let the Droids spawn and also blow up, its fine.
(Actually...I can't get them to spawn despite it being the right team, but I think its because of the conquest script, not Demon Spawn...anyway, I can work around it with a hidden command post...)

Oh and by the way: 33430, at least for this particular armed building odf and MTT msh. AT least I think it is higher than wld/lyr objects...

Then its

Code: Select all

Message Severity: 2
C:\Battlefront2\main\RedEngineFL\Memory\RedMemory.cpp(634)
Allocating 384 bytes attempt failed - no free blocks left in Heap 5 (Runtime)

Message Severity: 3
C:\Battlefront2\main\RedEngineFL\Memory\RedMemory.cpp(538)
Allocating 384 bytes failed - no free blocks left in Heap 5 (Runtime)
after each spawn, and the game freezes just after 33420 is printed in my BF2 log...*Edit* Its not a looping Freeze error....Its just a very, very long load (comparatively)

I cannot verify the presence of all 33K in game visually.

On a second try I tried to cap the spawns and the game froze at 22K something.
The cause could also be related to overlapping meshes, or Placing objects outside of the world (500 Terrains away from the Terrain...)

I just had a trippy freecam moment - I'm currently navigating past 15K Mtts. Oddly enough no framerate lag (Lows settings on a 8200M Nvidia GPU...I'm away from my desktop ATM... when Im back at it, VIDEO! :P
"My God....Its full of MTT's"

For some reason, they spawn at increasing distance. *Edit* That reason would be my code. I was performing math on the X translate value when I didn't need to because the previous matrix is used, not the original.

I goofed and didn't get to the end, freecams pretty clumsy at those speeds - maybe I'll wire up a teleporter...
Silly Rant
Hidden/Spoiler:
Anyway, its funny how such a mundance situation (for anyone familiar with 3D programming, I guess...) is so interesting to me.
It is with that I will announce that I am leaving gametoast.com and my life pursuits to commence a career in massively procedural programming. DEUS. EX. MACHINA.
MUHAHAHAAHAHHAAHHAAAHAHHHAHAHAHHAHAHAAHAHAHAH AHAHAHAHAHHAHHAAHAAHAHAHAHHAHHAHAHHAAHHAHAHAHAHAHAAHHAHAHHHAHAHAHAHAHAHAHAAHAHHAAHHAHAHAAHHAHAAHHAAHHAHAHAHHAHHAHHAHAHAHAHHAHAHAHAHHAHAHHAHA H
I RULE OVER YOU LITTLE STORMTROOPERS LIKE ANTS, NAY MITES, NAY SUBATOMICS!!!
brb.
*Edit*
I successfully capped object spawns at 33400, but the game crashed soon after due to a lack of memory (in the hardcoded limit?!??! or maybe my Graphics Ram? Can't wait to multi-system test this...) for cloth.
So it isn't the same old Object Limit-freeze glitch that you can get. Its actually maxing out (allotted by cpp?) system resources.
Post Reply