Starship Corporation

Support Forum
It is currently Wed 24. Apr 2024, 17:18

All times are UTC [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Mon 3. Jun 2013, 22:18 
Offline

Joined: Tue 16. Apr 2013, 21:55
Posts: 195
Power grids
Each power grid square laid doesn't have an affect individually. They really don't look like much. But it seems that a lot is going on in the code. Try loading a small ship and laying a lot of power grid on a single floor. I have observed a loss of FPS (via notably less smooth screen scrolling). I also observed that deleting any power grid square caused a brief, but strong, delay while the computer recalculated the power distribution (no ship modules were present except for a single small generator). I noticed that drawing a long snake highlighted the process of distributing power, as the power slowly makes its way down the snake. But this progressive, rather than instant change from red to green doesn't, in and of itself, cause loss of FPS. It's the number of power grid squares placed that is having the affect. It must be either graphical or a result of constant algorithmic checks, even without user interaction.

It looks like every power grid square is checked for adjacent power grid squares. If squares are adjacent - turn them green. Hence the progressive snake effect and the extremely rapid red to green colour change of a mass blob of power grid squares. This check is performed every time a power grid square is removed.

Attachment:
PowerGridBlobNSnake.jpg
PowerGridBlobNSnake.jpg [ 130.94 KiB | Viewed 4164 times ]


This is a per floor effect. A large power grid on one floor will not affect game performance on another floor.

I observed that deletion of a power grid using the "Delete entire powergrid?" option caused a temporary game freeze, followed by a game slow down for several seconds after the deletion. This suggests that every square of the ship is begin checked for the presence of a power grid square, perhaps?

Efficiency improvement suggestion:
An already available improvement to game efficiency is to turn off visibility for that power grid, once it is complete.

Possible efficiency improvement suggestion:
Find out whether it's a graphical issue or a coding issue that is causing the continuous slowdown. Graphically, they are very simplistic 2D sprites, there shouldn't be any slowdown coming from the graphics side. That leaves algorithms that must be running constantly, even without any user interaction. But there shouldn't be anything to check until the user triggers a check by placing or removing a module?

Each power grid square is an instance of an object. There could be all manner of instance related checks constantly going on in the background. It might not be directly related to power grids.

Another possible efficiency improvement suggestion:
Make grid squares into a 4x4 block. This would reduce the number of instances by half or greater. Accordingly increase the size of the red power ports on modules to 1x2 or to 4x4.

Side Note: If only power grid squares weren't individual object instances. Since ship exports export every object individually, it's making very inefficient ship design loading.

Example: USS Lolipop design as is (with power grids) 149Kb filesize. Takes a very long time to save.
USS Lolipop design with all power grids removed 69.5Kb filesize. Took 15 seconds to save.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group