StarMade v0.199.169 - Faster Chunk Loading, Lag Correction, Physics Optimization, Cannon/Beam Hit Optimization
Greeting citizens, ~
Since mainly we are working on the NPC factions feature at the moment, which is a big update with a lot of planning, design, and architecture, the updates during this period will contain smaller features, fixes, and optimizations.
However, this doesn’t mean that the updates won’t have any impact. The latest optimizations make ship battles, including capital ship fights a lot more fluent.
Faster Chunk Loading
One major bottleneck of the old system (even more so with the new chunk32 system) was the final step of loading or generating chunks for the game. The step of putting the blocks in the game physically and updating all logical dependencies as well as center of mass, tensors, and other metadata.
Since this step was done in the main thread, it often caused fps drops, and/or stalling (small freezes). This was mostly visible when starting up.
Most of the work has now been put into the generator threads that load the chunks. This archives much faster chunk loading as it utilizes multicore processors.
The data that needs to be in sync with the main thread is prepared and applied in one step per chunk.
It doesn’t eliminate all the short freezes on startup, but it makes it considerably better. It also improves general loading speed by about 30%-40% (reported by our testing team).
Positional data is now sent dynamically based on where the players are. The further away an object is from you, the fewer position updates you will receive. This will improve bandwidth usage on bigger servers by a lot since the positional data is at least 50% of the total data sent.
As you all know, when going fast and trying to hit an equally fast ship, stuff starts to jitter around. This is now fixed. The new lag correction algorithm does a much better job at smoothing client and server differences out. Speeds up to 300m/s had no noticeable jitter on the official test server.
However, sector changes still cause your ships to jitter, that’s a different issue.
Although physics performance on single entity ships is in a much better place now, stuff gets to a crawling halt when two bigger ships with docked entities meet.
This is now optimized to run several times faster (from around 1fps on two big ships with 200+ entities colliding to around 40-60, coming from 80 fps).
Cannon/Beam Hit Optimization
Block modifications in general, but especially block damage and removal caused by cannons, damage and salvage beams have been sped up considerably.
Volleys from capital ships will no longer turn the game into a slide show. From testing results, weapons that used to freeze your game for several seconds per volley, barely affect your FPS now.
This combined with the physics optimization should make ship battles a lot more enjoyable.
T1830 Block information for Russian/Traditional Chinese cause freezes
T1025 Joystick and Gamepad support broken
Fixed a layout issue for the Pixel texture pack.
Turret power sharing (for AI) now looks at every chain before it stops firing. The threshold is still 35% of max power capacity (but per chain now).
Fixed an issue where destroyed blocks would re-appear (client side only) in some cases.
Thanks for playing StarMade,
~ The Schine Team
Hello citizens ~
we just uploaded a small update that will increasy lighting calculation speed by ~30%. That's the time of a recalculation when you place a block, or turn light on/off. The chunk32 update introduced a bit of delay on it since it is doing 8 times the work now. There are more optimizations planned in that regard very soon.
Also, a lighting bug has been fixed. It caused the lighting switch to distance lighting to be a hard edge, so chunks appeared to be suddenly darker when coming closer.
Thanks for playing StarMade,
~ the Schine team
Greetings citizens, ~
this is just a small update to fix the resources in asteroids. They should be more than 8 times as much raw resources in asteroids, and the veins should be spread more evenly. This fix will only apply to unchanged asteroids of course.
Additionally there is a small fix to the light bars which blocked players from walking through its block sized hitbox. Also, there is a small fix to wireless logic when the recipient isn't loaded in yet.
Thanks for playing StarMade,
~ The Schine Team
This update should bring more stability to the game, and multiplayer servers in particular.
Physics are heavily upgraded now, as promised in the last update. Colliding or getting close to bigger structures should show a drastic improvement. This will bring down general load, and remove some of the high ping issues.
The only remaining bottleneck is two structures getting close with lots of smaller rail docked entities on them, but that should also be fixed soon.
There was a problem with blueprint handling in the last update, where a change to the Catalog would cause a full read of every entry, causing high pings for a long period of time.
Several memory issues have been fixed. One was that, as mentioned before, the catalog read and cached every ship, which resulted in a lot of wasted memory.
There were also some other minor to medium leaks that caused high memory usage such as when using lots of missiles at the same time, and physics data sets not being cleaned up properly when thrown back into the pool for reuse.
Ships can now be exported as 3D models (.obj format) that can be read by most common 3D editing programs (3ds max, maya, blender, etc). With how our game engine works, most of the necessary elements were already there so we decided to turn it into a feature.
To export a ship, go to your catalog as if you want to save a ship and click on the export as 3D model button. You can then choose a name for the export which will be added to the modelexport folder in your StarMade directory.
Make sure, when loading it up in a program to use the alpha channel of the textures to get transparency on blocks and sprites.
The game will now automatically set the resolution to what the desktop resolution is on first start on a fresh install.
The game will now warn you if you play with in 32bit.
T1807 Dropped meta items stack when picked up
T1791 Creative mode can’t be turned off in singleplayer
T1785 Shipyard fail to load designs
T1782 Can no longer dock to a shipyard with core beam
T1698 Log files have an unexpected file extension
T1692 Catalog manager deletes wrong blueprints when not sorted as numbered list
T1689 Settings reset when starting a dedicated server
T1641 Collision detection in docked entity pilot mode has severe performance issues
T1544 Shoot out rail undocks too soon after direction change
T1407 /destroy_entity and overheat despawning makes some entities non physical
T1198 unfactioned ships will get stuck on pickup rails when re-docked without a pilot inside
T1148 Tooltip shows incorrect names for swapping meta item places
T574 Improper orientation of blocks when using undo in advanced build mode
Several typo fixes
T1698 means that our log files have changed names.
~ log.txt.# changed into logstarmade.#.log
~ serverlog.txt.# changed into serverlog.#.log
We’ve also changed the asteroid size server config value from chunk to block radius.
Default value is set to 64:
~ ASTEROID_RADIUS_MAX = 64 //Asteroid max radius in blocks (from -x to +x)
Furthermore, due to fixes in the FactionConfig.xml, servers might have to adapt their custom configs. Should the custom config fail to load, the game uses the default as a fallback.
As always, all languages have been updated to the latest translations. Thanks to all the translators on http://translate.star-made.org/!
Thanks for playing StarMade,
~ The Schine Team
StarMade v0.199.132 - Huge performance upgrade for chunks, also now supporting Portuguese-Brazilian Language
Greetings, Citizens ~
As mentioned in our previous Dev Blog, this is an optimization update where we are improving the chunk system, among other changes. We expect performance gains of up to 50%, in the best cases even close to doubling frame rates on some structures.
With this update, all worlds will use the new chunk format, which (among other things) increases the chunk size from 16x16x16 to 32x32x32. Code wise, this was probably one of the biggest changes in a long time because it affects such a huge portion of the codebase: we needed to update pretty much every area that interacted with chunks. Not only that, but we also had convert old worlds and blueprints and make sure everything is still fully functional.
A new object always starts at the center of a chunk, so moving to 32-block chunks means all blocks in every object had to be shifted by 8 blocks in all dimensions. But not only that: all logic, connections, rails, and a lot more had to be adapted as well.
The reason for centering objects within their chunk is simple: small objects only consume one chunk (instead of eight), not only saving memory, but significantly improving the performance of nearly every operation (physics, lighting, etc.) as well.
This change also requires converting all files, which happens while initializing the universe. All existing blueprints are fully compatible with the new system, and are converted while initializing, or when used in-game if needed. They will also migrate on the fly if you upload an old version of a blueprint, or if you copy one directly to the blueprint directory.
Note: Converted blueprints are not backwards-compatible; however, the game retains backups of the chunk16 blueprints, so downgrading is not an issue.
The new format considerably reduces both the amount and size of files stored in the database, resulting in a significantly smaller overall size. As an example, the test server shrunk from 49GB to 9.2GB with the new format -- 81% smaller! Other servers can expect similar reductions.
The migration process automatically creates a backup of all old databases and blueprints in the installation directory before touching anything, preserving your data should anything go wrong. The migration might take awhile depending on the database size, so expect updating servers to be down for a bit. (The test server takes between 60 and 90 minutes)
Note for servers:
If you have already made backups yourself, you can turn off the automatic backup by adding the following lines in the server.cfg, if not already present:
BACKUP_WORLD_ON_MIGRATION = false
BACKUP_BLUEPRINTS_ON_MIGRATION = false
We’ve also renamed ASTEROID_SIZE to ASTEROID_SIZE_MAX. We’ve lowered its default value from 4 to 1 because of the new larger chunk sizes. (Addendum: as it’s a radius, it doesn’t include the center chunk. We will switch to a by block radius in upcoming versions)
On top of all the conversions, we needed to make sure the new system can work with every prior version of the game as well. One of the hardest things to adapt was the planet generation, which in its current state may not see performance gains. However, the update greatly improves frame rates while looking at already-generated planets.
The new chunk size also made it difficult to adapt physics, requiring large changes and improvements to get everything to work. However, we’ve already surpassed the previous performance for turrets and rails. The same performance update will follow for the regular (non-rail) physics in the coming update. This will improve performance for collisions, and things such as flying inside a hangar. There are still a lot of ways to optimize the physics engine, so we can continue to improve performance in the future.
You may ask, “Why stop at 32-block chunks? Why not 64, or even 128?” Apart from diminishing returns, the biggest reason against this is that the gains from larger chunks begin to negatively affect any operation that looks at chunks as a whole. Not only would a larger chunk have more wasted space, the size would significantly slow down other lighting calculations, meshing, etc. The 32-block chunk size is the sweet spot, providing significant gains with only minimal performance losses.
The only thing that may temporarily suffer a bit is the lighting calculations. If the slowdown is too much, or if you’re having too high CPU when objects are loaded in visually, you can reduce the ‘Block light quality’ in the in-game options. We’ve already planned methods to eliminate any performance loss from this issue, and will include them in a future update.
One last thing we did, was implementing and upgrading the shaders to be able to handle the larger chunks. The new shaders make use of more modern Open-GL calls, speeding up drawing even more. However, as always, there is a fallback for older graphics cards.
We’ve added Portuguese-brazilian to our supported languages. A big thank you to all the contributors on our Crowdin project!
Anyone can contribute translations, we’re currently working on 21 languages and need all the help we can get! Sign up to our translation site here: http://translate.star-made.org/
The gamma setting is now available in the ingame graphics options.
What comes next
We will be looking at NPC factions, and doing an overhaul of the the fleet system. We plan to make fleets much more stable and functional, and further: to also allow NPCs to use them for their own ends. Nefarious pirate armadas, here we come! We will also include bugfixing rounds along the way.
As always, thanks for playing StarMade!
~ the Schine Team