1. Trouble with the game?
    Try the troubleshooter!

    Dismiss Notice
  2. Issues with the game?
    Check the Known Issues list before reporting!

    Dismiss Notice
  3. Before reporting issues or bugs, please check the up-to-date Bug Reporting Thread for the current version.
    0.30 Bug Reporting thread
    Solutions and more information may already be available.

Limit of the numbers of cars in BeamNG now?

Discussion in 'Troubleshooting: Bugs, Questions and Support' started by 1185323118, Sep 1, 2016.

  1. 1185323118

    1185323118
    Expand Collapse

    Joined:
    Oct 11, 2015
    Messages:
    868
    Well, I just found out that BeamNG have a limit on cars you can spawn at the same time now? When I spawn the 11th car, the game crash just before the car shows up. I remember that I used to do screenshots with tons of cars on the streets of Firwood, but seems that I can't do it anymore. Any one having the same problem?
     
  2. torsion

    torsion
    Expand Collapse

    Joined:
    May 31, 2015
    Messages:
    1,600
    I have just tried. I spawned 17 vehicles (in groups of 5 of the same type) and on my 18th vehicle the game crashed. v0.6.1.0

    Code:
    220.69193|D|libbeamng.engine|creating new object in slot 18 ...
    220.69229|E|luamem|Couldn't allocate 512 KB block (all blocks used or other failure)
     

    Attached Files:

    • Like Like x 1
  3. CreasingCurve

    CreasingCurve
    Expand Collapse

    Joined:
    Jan 19, 2016
    Messages:
    940
    watch some of Insanegaz's youtube videos, he loads up close to 30 vehicles at one time for his videos
     
  4. Sagarci

    Sagarci
    Expand Collapse

    Joined:
    Sep 12, 2015
    Messages:
    881
    I think It just depends on what Computer you have. If you have a Good computer, you can Have more. But if you have a worse computer, the less you can have
     
  5. NGAP NSO Shotgun Chuck

    NGAP NSO Shotgun Chuck
    Expand Collapse

    Joined:
    Mar 6, 2015
    Messages:
    1,411
    Indeed. Everything I've heard indicates such crashes would be your computer overloading, not a hardcoded limit in the game itself.
     
  6. NoxiousFumes

    NoxiousFumes
    Expand Collapse

    Joined:
    Apr 24, 2016
    Messages:
    675
    I ran the benchmark. It tells you the maximum number of vehicles you can have. Mine is 9
    It's accurate, too. I just tested it.
     
    • Like Like x 1
  7. Car8john

    Car8john
    Expand Collapse

    Joined:
    May 12, 2016
    Messages:
    6,289
    Sadly, my limit is 7....

    That's why I'm upgrading
     
  8. Nadeox1

    Nadeox1
    Expand Collapse
    Spinning Cube
    BeamNG Team

    Joined:
    Aug 5, 2012
    Messages:
    14,683
    IIRC the hard limit is 64 (May be wrong, I don't recall exactly where I read that)

    What you can achieve depends from your hardware mainly.
     
    • Like Like x 4
  9. Car8john

    Car8john
    Expand Collapse

    Joined:
    May 12, 2016
    Messages:
    6,289
    64! That's incredible!
    Do you guys have a NASA Super computer?
     
  10. 1185323118

    1185323118
    Expand Collapse

    Joined:
    Oct 11, 2015
    Messages:
    868
    I have quite a good one, you can see specs in my signature.
    Well I could spawn like 20 cars and do 10fps in ECA several updates ago, but no matter whatever the map I'm using, I can only spawn 10 now
    --- Post updated ---
    Going to try it tonight then:rolleyes:
     
  11. firestarspelt

    firestarspelt
    Expand Collapse

    Joined:
    Aug 4, 2013
    Messages:
    99
    ya i used to be able to spawn allot more but now 12 is the crashing number for me says something about memory yet its not even using 50% and its 64 bit and it doesn't matter if its walls or t series as soon as it hits 12
    oh and the 11th cars engine didn't work
     
  12. Drivver

    Drivver
    Expand Collapse

    Joined:
    May 1, 2015
    Messages:
    233
    I can spawn on my i5 4690K up to 15 cars, 16th will cause crash. i7 4790K should do just a bit better up to 19-23 I guess. I don't think there's PC and I mean personal computer not server or super computer that could spawn up to 64pickups so I guess 64 is game engine limit, I could try with cones or something.
     
    • Like Like x 1
  13. Spaceballs the Username

    Spaceballs the Username
    Expand Collapse

    Joined:
    Oct 13, 2015
    Messages:
    568
    I have 64 GB of ram on my desktop at home. If my FPS can keep up, i'll try to spawn as many cars as i can
    --- Post updated ---
    I'm assuming the limit is hard-coded, not an actually tested value.

    For example, somewhere in their code, they might have:
    Code:
    const int MAX_VEHICLES = 64;
    ....
    Vehicle[] playerSpawns = new Vehicle[MAX_VEHICLES];
    
    So they would be limited to 64 because they defined a static storage allotment of 64 spawns.
     
  14. torsion

    torsion
    Expand Collapse

    Joined:
    May 31, 2015
    Messages:
    1,600
    I think we'd all like to know what resource we are running out of. The log messages seem pretty specific... but they refer to a failure to allocate memory and I don't think it's RAM. Maybe CPU cache or resource which the game virtualizes?
     
  15. Drivver

    Drivver
    Expand Collapse

    Joined:
    May 1, 2015
    Messages:
    233
    Well I'm back at home so I tested it, twice to be sure.

    Big one is always next fifth, 9 big ones on screenshot = 45 "vechicles" I can add 2 more, but 48th will crash game. All the time steady 60fps (Vsync). So the hard limit is 47, 48 will cause crash. Fun fact: all this tubes together uses less CPU computing power than one T-series :D
     
    • Like Like x 4
  16. torsion

    torsion
    Expand Collapse

    Joined:
    May 31, 2015
    Messages:
    1,600
    Which machine did you run the test on?

    Also, if you check your beamng.log file you can determine which vehicle slot # it crashed on so that you can skip counting.
     
  17. Spaceballs the Username

    Spaceballs the Username
    Expand Collapse

    Joined:
    Oct 13, 2015
    Messages:
    568
    My system is as follows:

    i7 5820k @ 4.0GHz
    64GB RAM @ 2400MHz
    GTX 1080 EVGA FTW Edition

    I loaded up gridmap small pure and started spawning the default Barstow. At 12 cars, I was getting just under 20 fps. When I spawned the 13th, my game crashed. Not even using 10% of my memory.

    Here is some relevant log from beamng.log:
    Code:
    116.75716|E|luamem|Couldn't allocate 1 MB block (all blocks used or other failure)
    116.75718|E|luamem|Couldn't allocate 1 MB block (all blocks used or other failure)
    
     
  18. torsion

    torsion
    Expand Collapse

    Joined:
    May 31, 2015
    Messages:
    1,600
    Hey, that's interesting. I wonder what determines the block size for whatever this is? (Note that mine was allocating a block of half that size!)
    --- Post updated ---
    EDIT: here's a quick way to test the max number of traffic tubes you can spawn. Note that for most people this will crash the game. Copy this code and paste it into the GE - Torquescript console (not the GE - Lua console!) then hit enter.
    Code:
    for(%a = 0; %a < 64; %a++) {spawnVehicleInplace("tube", "", "");}
    Once the game crashes you should go check the your beamng.log - starting from the bottom look for lines such as these to determine how many slots you were able to fill:
    Code:
     53.70356|D|libbeamng.engine|creating new object in slot 45 ...
    53.70382|E|luamem|Couldn't allocate 512 KB block (all blocks used or other failure)
    Other notes:
    • Of course if you start with 1 vehicle already present this will attempt to spawn 64 more - one more than the game engine supports due to the hard limit. I doubt that this will be a problem for anyone.
    • Also note that while you can reduce the value 64 to something that won't crash the game... the loop spawns all these vehicles in the same physical space, so the physics will do unhappy things to the vehicles/props.
     
  19. Spaceballs the Username

    Spaceballs the Username
    Expand Collapse

    Joined:
    Oct 13, 2015
    Messages:
    568
    Interesting script. It is possible to modify the spawn location by calling a function to move the player between spawns?
    --- Post updated ---
    Okay so it appears that the memory allocation depends on the thing being spawned. My log when using your script:
    Code:
    45.22058|I|BeamNGVehicle::spawnObject|Spawning object 'tube' with config:
    
    
    45.25085|D|libbeamng.engine|creating new object in slot 37 ...
    45.25114|E|luamem|Couldn't allocate 512 KB block (all blocks used or other failure)
    
    
    45.25115|E|libbeamng.lua.V|*** FATAL LUA INITIALIZATION ERROR
    55.45431|E|Crashreport|*** Trying to get Lua callstack
    55.45433|E|Crashreport|*** this is not the error, look above
    55.45438|E|GameEngineLua|*** FATAL LUA ERROR: [string "line"]:1: Lua C++ CrashRpt stacktrace
    =============== Stack Traceback >> START >>
    (1) global C function 'error'
    (2) main chunk of [string "line"] at line 1
    --------------- << END <<
    
    55.45440|E|GameEngineLua|*** while executing this line: error('Lua C++ CrashRpt stacktrace')
    55.45441|E|GameEngineLua|*** in chunk: line
    
     
  20. torsion

    torsion
    Expand Collapse

    Joined:
    May 31, 2015
    Messages:
    1,600
    Good catch - I didn't notice that because when I did my first test earlier in the thread I worked my way down to the Pigeon before crashing, which also uses a 512 block size.

    RE: the other thing... yes. What you want is possible, but we don't need to move the player position.
    Code:
    %j="pickup";%cfg="vehicles/pickup/offroad.pc";%c="0.93 0.56 0.56 1.2";%pos = ServerConnection.getCameraObject().position; for(%a = 0; %a < 8; %a++) {%pos = VectorAdd(%pos, "5 0 0"); spawnSpecificVehicleAtPos(%j,%cfg,%pos,%c);}
    This is largely ripped from existing stuff in the game. I've left declarations for vehicle, configuration, and color at the beginning - I think that they are self explanatory. Just leave empty quotes if you don't want a config or color ("").
     

    Attached Files:

    • screenshot_00368.png
    • 20160901224038_1.jpg
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice