Networkable Optimizations
Posted: 2015-02-17 09:19
*Update*
Special Thanks to the PR Team, Battlefield 2 SP Forum & the BF2Editor Forum community for their knowledge
Not too long ago I've been testing out which dummy networkables can be disabled. I made an editable list for anyone to test the tweaks to type in if it works or not.
To help out, test by modifying the files on the spreadsheet that need feedback and launch the mod as a Dedicated Server and test what's on the spreadsheet. (Edit your maplist in the Settings folder) to test it out. The server is private as modifying the files won't let you play online.
Here it is: https://docs.google.com/spreadsheets/d/ ... sp=sharing
Special Thanks to the PR Team, Battlefield 2 SP Forum & the BF2Editor Forum community for their knowledge
Not too long ago I've been testing out which dummy networkables can be disabled. I made an editable list for anyone to test the tweaks to type in if it works or not.
To help out, test by modifying the files on the spreadsheet that need feedback and launch the mod as a Dedicated Server and test what's on the spreadsheet. (Edit your maplist in the Settings folder) to test it out. The server is private as modifying the files won't let you play online.
Here it is: https://docs.google.com/spreadsheets/d/ ... sp=sharing
Note: It's not a silver bullet to all crashes for vehicles with non-related problems but it will help immensely with the server so it can properly prioritize things. It will increase the chance of a server not crashing immensely, and I'm guessing hit detection will be fixed/less common and CTD's will be much much less or even removed on most vehicles.
This may be Anecdotal Evidence unless proven, but when I run the Dedicated Server on local and run any map, the 'O:' number in the Dedicated Server tool is low when I used the Networkable Tweak compared to how high it got when it didn't. 'O' probably means Overgrowths, like trees, grass, foliage.
So what are Statemasks?
They are the basic things added to the vehicles. They are the parts that are in a model's file that must be networked.
Basically they are templates. You want an additional seat? You add that in.
Examples:
- Sounds. Engine Idle, Rev, Horn
- Passenger and Vehicle Seats
- Visual Effects
- Features, like deploying crates
Any objects that need to be transmitted to everyone by adding it to the networkable manager of the engine to auto-prioritize based on what it is. Like projectiles have a high priority.
They are Networkable Objects/Abilities in a vehicle that move on it's own, has abilities that affects the object in different states like a Forward Outpost being damaged that the players can rebuild, or that works together with another object as they move through the world. Things like Vehicles, Missiles, Engines, Aileron etc.
It's what needs to be transmitted and prioritized. Player Controlled Objects need them and nearly everything related to gameplay needs it.
Additional Information by [R-DEV]Mats391:
There is also need for network information based on the physics type:
Mesh: Must have it or else it'll crash
RotationalPoint (Wheels): Needs to have it or else it won't update position (does not crash)
Point: Does not need any network information to work
Then there is also things that need it for certain components to work on a dedicated server.
GenericProjectiles need BasicInfo if you want it to be guided. So Seek/Follow component require to have a BasicInfo otherwise the server won't track the projectile and it won't work as intended.
More detailed information can be found on this link at the bottom:
Networkables & Dummy Objects - Battlefield SinglePlayer Forum
The template looks like this:
Code: Select all
[size=150]rem -------------------------------------
ObjectTemplate.addTemplate S_us_trk_support_Ambient
ObjectTemplate.addTemplate S_us_trk_support_AmbientDamaged
ObjectTemplate.addTemplate us_trk_support_Entrypoint_front
ObjectTemplate.setPosition 0/0.25/1.25
ObjectTemplate.addTemplate us_trk_support_EntryPoint_rear
ObjectTemplate.setPosition 0/0.2/-2.75
ObjectTemplate.addTemplate e_amphib_wake
ObjectTemplate.setPosition 0/-0.1/2.8
ObjectTemplate.addTemplate e_amphib_wake
ObjectTemplate.setPosition 0/-0.1/-2.2
ObjectTemplate.setRotation 180/0/0
ObjectTemplate.addTemplate e_amphib_wake_sound
ObjectTemplate.addTemplate e_sinking_vehicle
ObjectTemplate.addTemplate us_trk_support_Codriver
ObjectTemplate.addTemplate us_trk_support_Passanger_RearL1
ObjectTemplate.setPosition -0.6/1.8/0.15
ObjectTemplate.setRotation 87.7/-15.9/0
ObjectTemplate.addTemplate us_trk_support_Passanger_RearR1
ObjectTemplate.setPosition 0.625/1.8/0
ObjectTemplate.setRotation -89.9/-18.5/-1.6
ObjectTemplate.addTemplate us_trk_support_Passanger_RearL2
ObjectTemplate.setPosition -0.59/1.82/-0.85
ObjectTemplate.setRotation 89.2/-14.1/1
ObjectTemplate.addTemplate us_trk_support_Passanger_RearR2
ObjectTemplate.setPosition 0.6/1.8/-2.1
ObjectTemplate.setRotation -100.1/-21.8/0
ObjectTemplate.addTemplate us_trk_support_Passanger_RearL3
ObjectTemplate.setPosition -0.65/1.8/-2.16035
ObjectTemplate.setRotation 134.6/-18.5/0
ObjectTemplate.addTemplate us_trk_support_Passanger_RearR3
ObjectTemplate.setPosition 0.64947/1.8/-2.25702
ObjectTemplate.setRotation -133.7/-13.1/0
ObjectTemplate.addTemplate truck_horn
ObjectTemplate.setPosition 0/1/2
ObjectTemplate.addTemplate us_trk_support_Camera
ObjectTemplate.setPosition -0.45/1.51/1.23
ObjectTemplate.addTemplate truck_dummy_weapon
ObjectTemplate.addTemplate supply_drop_smalltruck
ObjectTemplate.setPosition 0/0.5/-3.8
ObjectTemplate.addTemplate supply_drop_light_truck_us
ObjectTemplate.setPosition 0/0.5/-3.8
ObjectTemplate.addTemplate e_military_truck_open
ObjectTemplate.setPosition -0.782146/1.12534/1.06372
ObjectTemplate.addTemplate e_military_truck_close
ObjectTemplate.setPosition -0.765984/1.1097/1.05884
rem -------------------------------------The main thing are the templates that are underneath.
Here's an example of a BF2Editor error for the us_trk_support:
Code: Select all
[Network] : Object us_trk_support has to many statemasks (16) and will crash the network. Please fix!
0 unique networkableObject:us_trk_support
1 unique networkableObject:us_trk_support_asteeringwheel
2 unique networkableObject:us_trk_support_zMotor
3 unique networkableObject:us_trk_support_whl_BL
4 unique networkableObject:us_trk_support_whl_BLMiddle
5 unique networkableObject:us_trk_support_whl_BR
6 unique networkableObject:us_trk_support_whl_BRMiddle
7 unique networkableObject:us_trk_support_whl_Nav_FL
8 unique networkableObject:us_trk_support_whl_FL
9 unique networkableObject:us_trk_support_whl_FR
10 unique networkableObject:truck_horn
11 unique networkableObject:truck_dummy_weapon
12 unique networkableObject:supply_drop_smalltruck
13 unique networkableObject:supply_small
14 unique networkableObject:supply_drop_light_truck_us
15 unique networkableObject:light_supply_crate_us
The way it works is that the ObjectTemplate.addTemplate looks inside all server archives\common folder, grabs the object referenced which takes from the server archives version of the folders where it adds it to the vehicle.
Causes of Too many Statemask Errors
- Template is over the Max Limit of 12
- Name Conventions are duplicated in the model heirarchy
- Problems with the Model Hierarchy (The Networkables that you tell to the system doesn't match up to the models you are referring to)
- Wrong Template added as a Networkable
- Missing Networkable
- Duplicate Templates with extra Networkable
- Invalid Template Name (?)
Error. Help Plz - Battlefield SinglePlayer Forum
Battlefield SinglePlayer Forum > Exporting a Tank for BF2/2142
Battlefield 1942 Mods, Modding Tutorials. Forums and Mod Downloads. ? View topic - Debugging "too many statemasks" error
Hello - Battlefield SinglePlayer Forum
My own small fixes for this mod.... (Superdc)
Solutions for StateMasks & Networkables:
One solution is to merge several templates into one. This part I'm not quite sure if it's as simple as combining all codes into one, or there is a special way of doing so.
We could combine the supply crate and the vehicle repair kit with left click and right click although I'm not sure if it's possible.
-Update: Simply renaming all vehicle files, including the code inside .con and .tweak and the textures can fix the networkables, strangely.
-Remove these things (Backup files always!)
Code: Select all
ObjectTemplate.addTemplate e_amphib_wake
ObjectTemplate.addTemplate e_amphib_wake
ObjectTemplate.addTemplate e_amphib_wake_sound
ObjectTemplate.addTemplate e_sinking_vehicle (Not sure about this one)
-Only network the wheels on each corner, with springinfo. There's a thread at BF2Editor (Site is dead, but you can search for 'Site:BF2Editor.org' on Google) and at Battlefield 2 SP Forum that had an advise to link the corner wheels with the others, and have them spin at the same time. Battlefield SinglePlayer Forum > Exporting a Tank for BF2/2142
-Steering wheel doesn't have to be added as a networkable. Only effect as far as I know is when the driver turns, it will have a short delay before the other passenger sees it for whoever is turning.
-Merge templates like all
Code: Select all
supply_drop_smalltruck with supply_drop_light_truck_us,
supply_small with light_supply_crate_us-Removing any dummies using this list: https://docs.google.com/spreadsheets/d/ ... sp=sharing
Also, another error that you may get in the Debugger (The outdated debugger based on BF2 1.3)
Error: Networkable already added to network manager, netId=0
Solution: Read Error. Help Plz - Battlefield SinglePlayer Forum
I'm still kind of understanding how this system works. It's really interesting. Will try to update.