Error calculating MaxUnits?

Error calculating MaxUnits?

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

Post Reply
SpikedHelmet
MC: Legacy & Spring 1944 Developer
Posts: 1948
Joined: 21 Sep 2004, 08:25

Error calculating MaxUnits?

Post by SpikedHelmet »

Getting odd errors in our game. When trying to set MaxUnits the game appears to use that -5 for an actual maxunit number, ie if I set Max Units to 10 we can only actually get 5 units, and if I set it to 20, we get 15 units max.

infolog:

Code: Select all

LogOutput initialized.
Spring 0.82.7.0 (0.82.7)
Build date/time: Jan  2 2011 14:08:40
Available log subsystems: CollisionVolume, unit, ArchiveScanner, VFS-detail, VFS, Sound
Enabled log subsystems: Sound
Enable or disable log subsystems using the LogSubsystems configuration key
  or the SPRING_LOG_SUBSYSTEMS environment variable (both comma separated).
  Use "none" to disable the default log subsystems.
using configuration source "C:\Users\Main\AppData\Local\springsettings.cfg"
[CMyMath::Init] CPU SSE mask: 126, flags:
	SSE 1.0:  1,  SSE 2.0:  1
	SSE 3.0:  1, SSSE 3.0:  1
	SSE 4.1:  1,  SSE 4.2:  0
	SSE 4.0A: 0,  SSE 5.0A: 0
	using streflop SSE FP-math mode, CPU supports SSE instructions
OS: Microsoft Windows
Microsoft Windows 7 Ultimate Edition, 64-bit (build 7600)
Intel(R) Core(TM)2 Duo CPU     E7500  @ 2.93GHz; 4095MB RAM, 8188MB pagefile
OS: emulated 32bit mode
Using read-write data directory: D:\Spring\
Scanning: D:\Spring\maps
Scanning: D:\Spring\base
Scanning: D:\Spring\games
Scanning: D:\Spring\mods
Scanning: D:\Spring\packages
Supported Video modes: 1366x768, 1360x768, 1280x1024, 1280x960, 1280x800, 1280x768, 1280x720, 1152x864, 1024x768, 800x600, 720x576, 720x480, 640x480
Video mode set to 1280x800/32bit
[f=0000000] SDL:  1.2.10
[f=0000000] GL:   3.3.0
[f=0000000] GL:   NVIDIA Corporation
[f=0000000] GL:   GeForce 8500 GT/PCI/SSE2
[f=0000000] GLSL: 3.30 NVIDIA via Cg compiler
[f=0000000] GLEW: 1.5.4
[f=0000000] Joysticks found: 0
[f=0000000] Joystick 0 not found
[f=0000000] Loading startscript from: D:\Spring\\script.txt
[f=0000000] Connecting to 188.165.214.142:9003 using name [MW]SpikedHelmet
[f=0000000] [Sound] OpenAL info:
[f=0000000] [Sound]   Vendor:     OpenAL Community
[f=0000000] [Sound]   Version:    1.1 ALSOFT 1.11.753
[f=0000000] [Sound]   Renderer:   OpenAL Soft
[f=0000000] [Sound]   AL Extensions: AL_EXTX_buffer_sub_data AL_EXT_EXPONENT_DISTANCE AL_EXT_FLOAT32 AL_EXT_IMA4 AL_EXT_LINEAR_DISTANCE AL_EXT_MCFORMATS AL_EXT_OFFSET AL_EXTX_sample_buffer_object AL_EXT_source_distance_model AL_LOKI_quadriphonic
[f=0000000] [Sound]   ALC Extensions: ALC_ENUMERATE_ALL_EXT ALC_ENUMERATION_EXT ALC_EXT_CAPTURE ALC_EXT_disconnect ALC_EXT_EFX ALC_EXTX_thread_local_context
[f=0000000] [Sound]                   ALC_EXT_EFX found (required for air absorption): yes
[f=0000000] [Sound]   Device:     DirectSound Software
[f=0000000] [Sound]   Available Devices:  
[f=0000000] [Sound]                       DirectSound Software
[f=0000000] [Sound] air absorption enabled: 0.1
[f=0000000] Starting demo recording
[f=0000000] Using map 1944_Red_Planet
[f=0000000] Recording demo demos/20110320_182711_1944_Red_Planet_0.82.7.sdf
[f=0000000] Using mod MW:S
[f=0000000] Using mod archive MW.sdd
[f=0000000] Loading client data: 162 ms
[f=0000000] User number 0 (team 0, allyteam 0)
[f=0000000] [Sound]  parsed 4 sounds from gamedata/sounds.lua
[f=0000000] Loading sounds: 1 ms
[f=0000000] Camera and mouse: 36 ms
[f=0000000] Parsing unit icons
[f=0000000] Loading GameData Definitions
[f=0000000] Loading all definitions:  0.077000
[f=0000000] Loading GameData Definitions: 85 ms
[f=0000000] Parsing Map Information
[f=0000000] Loading SMF
[f=0000000] Loading Map
[f=0000000] Calculating smooth height mesh
[f=0000000] Calculating smooth mesh: 39 ms
[f=0000000] Number of damage types: 5
[f=0000000] Creating unit textures
[f=0000000] Loading weapon definitions
[f=0000000] [Sound] WAV file sounds/AC10_Fire.wav has data length -1320656524 greater than actual data length 176458
[f=0000000] [Sound] WAV file sounds/AC2_Fire.wav has data length 571892084 greater than actual data length 74264
[f=0000000] [Sound] WAV file sounds/AC20_Fire.wav has data length 981492084 greater than actual data length 146050
[f=0000000] [Sound] WAV file sounds/AC5_Fire.wav has data length 428761460 greater than actual data length 137616
[f=0000000] [Sound] WAV file sounds/Arrow_Fire.wav has data length 2055233908 greater than actual data length 162434
[f=0000000] [Sound] WAV file sounds/GEN_Explode5.wav has data length 291939 greater than actual data length 75192
[f=0000000] [Sound] WAV file sounds/LRM_Fire.wav has data length 771776884 greater than actual data length 142850
[f=0000000] [Sound] WAV file sounds/ATM_Fire.wav has data length -310353548 greater than actual data length 126338
[f=0000000] [Sound] WAV file sounds/LBL_Fire.wav has data length -238657164 greater than actual data length 61896
[f=0000000] [Sound] WAV file sounds/MBL_Fire.wav has data length 96887156 greater than actual data length 67016
[f=0000000] [Sound] WAV file sounds/PPC_Fire.wav has data length -2113904268 greater than actual data length 164354
[f=0000000] [Sound] WAV file sounds/PPC_Hit.wav has data length 847274356 greater than actual data length 144002
[f=0000000] [Sound] WAV file sounds/SBL_Fire.wav has data length -1538891404 greater than actual data length 42056
[f=0000000] [Sound] WAV file sounds/LPL_Fire.wav has data length 1452171636 greater than actual data length 22160
[f=0000000] Could not load sound from def: GEN_Pulse_Explode1
[f=0000000] [Sound] WAV file sounds/MPL_Fire.wav has data length 1248485748 greater than actual data length 19052
[f=0000000] Could not load sound from def: GEN_Pulse_Explode1
[f=0000000] [Sound] WAV file sounds/SPL_Fire.wav has data length 1335779700 greater than actual data length 20384
[f=0000000] Could not load sound from def: GEN_Pulse_Explode1
[f=0000000] Could not load sound from def: MG_Hit
[f=0000000] [Sound] WAV file sounds/Gauss_Fire.wav has data length -1433509516 greater than actual data length 109200
[f=0000000] [Sound] WAV file sounds/LightGauss_Fire.wav has data length 910713204 greater than actual data length 144970
[f=0000000] [Sound] WAV file sounds/LBX10_Fire.wav has data length 885547380 greater than actual data length 144586
[f=0000000] [Sound] WAV file sounds/LBX20_Fire.wav has data length 905077108 greater than actual data length 144884
[f=0000000] Could not load sound from def: GEN_Pulse_Explode1
[f=0000000] [Sound] WAV file sounds/MG_Fire.wav has data length -2058985100 greater than actual data length 34120
[f=0000000] Could not load sound from def: MG_Hit
[f=0000000] Could not load sound from def: GEN_Pulse_Explode1
[f=0000000] [Sound] WAV file sounds/MRM_Fire.wav has data length -268410508 greater than actual data length 61442
[f=0000000] Could not load sound from def: GEN_Pulse_Explode1
[f=0000000] [Sound] WAV file sounds/SRM_Fire.wav has data length 83911028 greater than actual data length 132354
[f=0000000] Loading unit definitions
[f=0000000] Loading feature definitions
[f=0000000] Initializing map features
[f=0000000] Reading Estimate PathCosts [8]
[f=0000000] Reading Estimate PathCosts [32]
[f=0000000] [CPathManager] pathing data checksum: 07f255ac
[f=0000000] You are missing the "ARB_shadow_ambient" extension (this will probably make shadows darker than they should be)
[f=0000000] Loading .smt tile-file "maps/1944_Red_Planet.smt"
[f=0000000] Loading 15751 tiles from file 1/1
[f=0000000] Reading tiles
[f=0000000] Reading tile map
[f=0000000] generating MipMaps: 2 ms
[f=0000000] Generating 3D trees
[f=0000000] [Sound] WAV file sounds/beep6.wav has data length 398877044 greater than actual data length 71624
[f=0000000] Creating Projectile Textures
[f=0000000] Creating sky
[f=0000000] Loading console: 7 ms
[f=0000000] [Sound] Unable to open audio file: FailedCommand
[f=0000000] [Sound] CSound::GetSoundId: could not find sound: FailedCommand
[f=0000000] Loading LuaRules
[f=0000000] Jump Jet Defs error checking begining..
[f=0000000] .. Jump Jet Defs error checking complete
[f=0000000] Loaded gadget:  Delay API           <api_delay.lua>
[f=0000000] Loaded gadget:  Turn Command        <unit_turn.lua>
[f=0000000] Loaded gadget:  Jumpjets            <unit_jumpjets.lua>
[f=0000000] Loaded gadget:  LUS Helper          <lus_helper.lua>
[f=0000000] Loaded gadget:  Armour Hit Volumes  <unit_piecehitvols.lua>
[f=0000000] Loaded gadget:  Auras               <unit_auras.lua>
[f=0000000] Loading gadget: Lua unit script framework  <unit_script.lua>
[f=0000000]   Loading unit script: scripts/beacon.lua
[f=0000000]   Loading unit script: scripts/vehicles/cl_ares.lua
[f=0000000]   Loading unit script: scripts/mech.lua
[f=0000000]   Loading unit script: scripts/dropship.lua
[f=0000000]   Loading unit script: scripts/vehicles/cl_enyo.lua
[f=0000000]   Loading unit script: scripts/vehicles/cl_hephaestus.lua
[f=0000000]   Loading unit script: scripts/vehicles/cl_huit.lua
[f=0000000]   Loading unit script: scripts/vehicles/cl_mars.lua
[f=0000000]   Loading unit script: scripts/vehicles/cl_morrigu.lua
[f=0000000]   Loading unit script: scripts/vehicles/cl_oro_hag.lua
[f=0000000]   Loading unit script: scripts/vehicles/cl_oro_lbx.lua
[f=0000000]   Loading unit script: scripts/vehicles/is_challenger.lua
[f=0000000]   Loading unit script: scripts/vehicles/is_demolisher.lua
[f=0000000]   Loading unit script: scripts/vehicles/is_goblin.lua
[f=0000000]   Loading unit script: scripts/vehicles/is_harasser.lua
[f=0000000]   Loading unit script: scripts/vehicles/is_lrmcarrier.lua
[f=0000000]   Loading unit script: scripts/vehicles/is_schrek.lua
[f=0000000]   Loading unit script: scripts/vehicles/is_scorpion_ac5.lua
[f=0000000]   Loading unit script: scripts/vehicles/is_scorpion_lgauss.lua
[f=0000000]   Loading unit script: scripts/vehicles/is_sniper.lua
[f=0000000] Loaded gadget:  Lua unit script framework  <unit_script.lua>
[f=0000000] Loaded gadget:  Spawn               <game_spawn.lua>
[f=0000000] Loaded gadget:  Beacon Manager      <game_flagmanager.lua>
[f=0000000] Loaded gadget:  Does Not Count      <game_doesnotcount.lua>
[f=0000000] Loaded gadget:  Game Money          <game_money.lua>
[f=0000000] Loaded gadget:  Game Radar          <game_radar.lua>
[f=0000000] Loaded gadget:  Delay API           <api_delay.lua>
[f=0000000] Loaded gadget:  Turn Command        <unit_turn.lua>
[f=0000000] Loaded gadget:  LUS Helper          <lus_helper.lua>
[f=0000000] Loaded gadget:  Armour Hit Volumes  <unit_piecehitvols.lua>
[f=0000000] Loaded gadget:  Auras               <unit_auras.lua>
[f=0000000] Loaded gadget:  Beacon Manager      <game_flagmanager.lua>
[f=0000000] Loaded gadget:  Game Money          <game_money.lua>
[f=0000000] Loaded gadget:  Game Radar          <game_radar.lua>
[f=0000000] Loading LuaGaia
[f=0000000] Loading LuaUI
[f=0000000] Using LUAUI_DIRNAME = LuaUI/
[f=0000000] Reloaded ctrlpanel with: LuaUI/ctrlpanel.txt
[f=0000000] LuaUI: bound F11 to the widget selector
[f=0000000] LuaUI: bound CTRL+F11 to tweak mode
[f=0000000] Jump Jet Defs error checking begining..
[f=0000000] .. Jump Jet Defs error checking complete
[f=0000000] Loading widget from mod:   HealthBars          <unit_healthbars.lua> ...
[f=0000000] Loading widget from mod:   NARC indicator      <gui_narc_marker.lua> ...
[f=0000000] Loading widget from mod:   1944 Flag Ranges    <gui_flagradiusalt.lua> ...
[f=0000000] Loading widget from mod:   Team Platter Expanded  <gui_team_platter_ex.lua> ...
[f=0000000] Reloaded cmdcolors with: cmdcolors.tmp
[f=0000000] Loading widget from user:  Mouse Buildspacing  <gui_buildspacing.lua> ...
[f=0000000] Loading widget from mod:   CustomFormations2   <unit_customformations2.lua> ...
[f=0000000] Loading widget from mod:   Jumpjet GUI         <gui_jumpjets.lua> ...
[f=0000000] LuaUI v0.3
[f=0000000] Finalizing...
[f=0000000] Connection attempt from [SIN]Godde
[f=0000000]  -> Version: 0.82.7.1
[f=0000000]  -> Connection established (given id 2)
[f=0000000] Connection attempt from [MW]SpikedHelmet
[f=0000000]  -> Version: 0.82.7.0 (0.82.7)
[f=0000000]  -> Connection established (given id 0)
[f=0000000] Connection attempt from [S44]FLOZi
[f=0000000]  -> Version: 0.82.7.1 (0.82.7.1)
[f=0000000]  -> Connection established (given id 1)
[f=0000000] GameID: 427f864d07f3181ae1aa129a1cdf4421
[f=0000000] [MW]SpikedHelmet added point: Start 0
[f=0000210] Speed set to 1.1 [[MW]SpikedHelmet]
[f=0000229] Speed set to 1.2 [[MW]SpikedHelmet]
[f=0000244] Speed set to 1.3 [[MW]SpikedHelmet]
[f=0000261] Speed set to 1.4 [[MW]SpikedHelmet]
[f=0000281] Speed set to 1.5 [[MW]SpikedHelmet]
[f=0000301] Speed set to 1.6 [[MW]SpikedHelmet]
[f=0000323] Speed set to 1.7 [[MW]SpikedHelmet]
[f=0000348] Speed set to 1.8 [[MW]SpikedHelmet]
[f=0000374] Speed set to 1.9 [[MW]SpikedHelmet]
[f=0000401] Speed set to 2.0 [[MW]SpikedHelmet]
[f=0000431] Speed set to 2.2 [[MW]SpikedHelmet]
[f=0000461] Speed set to 2.4 [[MW]SpikedHelmet]
[f=0000496] Speed set to 2.6 [[MW]SpikedHelmet]
[f=0000527] Speed set to 2.8 [[MW]SpikedHelmet]
[f=0003796] <[MW]SpikedHelmet> TRY TO BUILD
[f=0004838] <[SIN]Godde> 4
[f=0005204] <[SIN]Godde> firemoths
[f=0006933] <[SIN]Godde> 4
[f=0007209] Dropship: Self destruct in 4 s
[f=0007241] Dropship: Self destruct in 3 s
[f=0007273] Dropship: Self destruct in 2 s
[f=0007305] Dropship: Self destruct in 1 s
[f=0007443] <[SIN]Godde> can you turn cheat on?
[f=0007714] /cheat
[f=0007741] Player 0 is not allowed to execute command cheat
[f=0007940] <[MW]SpikedHelmet> faggot
[f=0008105] <[SIN]Godde> :P
[f=0008270] <[SIN]Godde> !cheat
[f=0008272] <[MW]SpikedHelmet> !cheat
[f=0008274] Cheating!
[f=0008609]   is_atlas   is_awesome   is_bushwacker   is_catapult   is_challenger   is_chimera   is_demolisher   is_dropship   is_goblin   is_harasser   is_locust   is_lrmcarrier   is_mauler   is_osiris   is_owens   is_raven   is_schrek   is_scorpion_ac5   is_scorpion_lgauss   is_sniper   is_warhammer   is_wolfhound 
[f=0008876]   cl_ares   cl_cougar   cl_direwolf   cl_dropship   cl_enyo   cl_firemoth   cl_hephaestus   cl_huit   cl_iceferret   cl_kitfox   cl_maddog   cl_mars   cl_mistlynx   cl_morrigu   cl_nova   cl_oro_hag   cl_oro_lbx   cl_stormcrow   cl_summoner   cl_timberwolf   cl_warhawk 
[f=0008930] /give cl_dropship 
[f=0008938] Unable to give any more units to team 1(current: 5, max: 30)
[f=0008951] Giving 1 cl_dropship to team 0
[f=0009541] Unable to give any more units to team 1(current: 5, max: 30)
[f=0009804] <[SIN]Godde> ?
[f=0010075] <[SIN]Godde> max 3?
[f=0010358] <[SIN]Godde> max 30?
[f=0010477] <[MW]SpikedHelmet> max 30
[f=0010754] <[MW]SpikedHelmet> i dunno
[f=0010934] Dropship is being attacked
[f=0011188] <[SIN]Godde> max 3?
[f=0011467] Couldnt find wreckage info firemoth
[f=0011467] firemoth is not a valid unitname
[f=0012024] <[MW]SpikedHelmet> cl_
[f=0012336] <[MW]SpikedHelmet> cl_firemoth
[f=0012665] Giving 1 cl_firemoth to team 1
[f=0012889] Unable to give any more units to team 1(current: 5, max: 30)
[f=0013137] Dropship: Self destruct in 4 s
[f=0013169] Dropship: Self destruct in 3 s
[f=0013201] Dropship: Self destruct in 2 s
[f=0013233] Dropship: Self destruct in 1 s
[f=0013453] <[SIN]Godde> 5 firemoths
[f=0013897] Dropship: Self destruct in 4 s
[f=0013929] Dropship: Self destruct in 3 s
[f=0013961] Dropship: Self destruct in 2 s
[f=0013993] Dropship: Self destruct in 1 s
[f=0014275]   cl_ares   cl_cougar   cl_direwolf   cl_dropship   cl_enyo   cl_firemoth   cl_hephaestus   cl_huit   cl_iceferret   cl_kitfox   cl_maddog   cl_mars   cl_mistlynx   cl_morrigu   cl_nova   cl_oro_hag   cl_oro_lbx   cl_stormcrow   cl_summoner   cl_timberwolf   cl_warhawk 
[f=0014332] /give cl_firemoth 
[f=0014353] Giving 1 cl_firemoth to team 0
[f=0014466] /give cl_firemoth 
[f=0014490] Unable to give any more units to team 0(current: 5, max: 30)
[f=0014597] /give cl_firemoth 
[f=0014619] Unable to give any more units to team 0(current: 5, max: 30)
[f=0015109] Fire Moth (Dasher): Self destruct in 4 s
[f=0015110] Fire Moth (Dasher): Self destruct in 4 s
[f=0015111] Fire Moth (Dasher): Self destruct in 4 s
[f=0015112] Fire Moth (Dasher): Self destruct in 4 s
[f=0015120] Fire Moth (Dasher): Self destruct in 4 s
[f=0015141] Fire Moth (Dasher): Self destruct in 3 s
[f=0015142] Fire Moth (Dasher): Self destruct in 3 s
[f=0015143] Fire Moth (Dasher): Self destruct in 3 s
[f=0015144] Fire Moth (Dasher): Self destruct in 3 s
[f=0015152] Fire Moth (Dasher): Self destruct in 3 s
[f=0015173] Fire Moth (Dasher): Self destruct in 2 s
[f=0015174] Fire Moth (Dasher): Self destruct in 2 s
[f=0015175] Fire Moth (Dasher): Self destruct in 2 s
[f=0015176] Fire Moth (Dasher): Self destruct in 2 s
[f=0015184] Fire Moth (Dasher): Self destruct in 2 s
[f=0015205] Fire Moth (Dasher): Self destruct in 1 s
[f=0015206] Fire Moth (Dasher): Self destruct in 1 s
[f=0015207] Fire Moth (Dasher): Self destruct in 1 s
[f=0015208] Fire Moth (Dasher): Self destruct in 1 s
[f=0015216] Fire Moth (Dasher): Self destruct in 1 s
[f=0015250] Team0([MW]SpikedHelmet) has been driven from the combat area.
[f=0015435] Game has ended
[f=0015436] Server shutdown
[f=0015436]   cl_ares   cl_cougar   cl_direwolf   cl_dropship   cl_enyo   cl_firemoth   cl_hephaestus   cl_huit   cl_iceferret   cl_kitfox   cl_maddog   cl_mars   cl_mistlynx   cl_morrigu   cl_nova   cl_oro_hag   cl_oro_lbx   cl_stormcrow   cl_summoner   cl_timberwolf   cl_warhawk 
[f=0015436] /give cl_firemoth 
[f=0015436] Path cache hits 31 32%
[f=0015436] Path cache hits 41 10%
[f=0015436] Statistics for UDP connection:
Received: 68224 bytes in 2156 packets (31.6438 bytes/package)
Sent: 184485 bytes in 3638 packets (50.7106 bytes/package)
Relative protocol overhead: 0 up, 0.158009 down
0 incoming chunks had been dropped, 17 outgoing chunks had to be resent
As you can see, this line:
[f=0014490] Unable to give any more units to team 0(current: 5, max: 30)
makes no sense. It counts that we only have 5 units (we thought maybe it was counting duplicates), and says "Max:30" (even though its set to 10).
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Re: Error calculating MaxUnits?

Post by Kloot »

Combine these four factoids for an explanation:
  • the limit you set in the lobby (call it 'Lt') is the maximum number of units allowed per team
  • the global unit limit is equal to Lg = min(32000, Lt * k), where 'k' is the number of active teams
  • because Lt * k can be > 32000, the engine (always) recalculates Lt as floor(Lg / k) - 5
  • the message shows the adjusted Lt along with Lg
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Re: Error calculating MaxUnits?

Post by FLOZi »

the engine (always) recalculates Lt as floor(Lg / k) - 5
But why -5?

Or am I being dense
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Re: Error calculating MaxUnits?

Post by Kloot »

Back when the global unit limit was 5000, the engine would (supposedly) crash if more than 4998 came into play, so someone added the -5 as a quick hack instead of fixing the real problem (whatever that may have been at the time, this dates back as far as december 2005) and it stuck.

I'll get rid of it for 0.83.
User avatar
bobthedinosaur
Blood & Steel Developer
Posts: 2702
Joined: 25 Aug 2004, 13:31

Re: Error calculating MaxUnits?

Post by bobthedinosaur »

You found an artifact, spike!
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Re: Error calculating MaxUnits?

Post by FLOZi »

Kloot wrote:I'll get rid of it for 0.83.
Image
Post Reply

Return to “Game Development”