News:

Simutrans Tools
Know our tools that can help you to create add-ons, install and customize Simutrans.

No control for over a day upon loading a saved game

Started by Severous, June 01, 2009, 10:39:10 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Severous

Hi

V102 Pak64

When I first load my saved game it runs for more than a day of game time before it becomes responsive to keyboard commands.

A possible explanation.   I have several hundred sailing ships. I notice that they are all stationary upon first loading. As the time passes progressively more ships start to move..continuing the journey they were making when the game was saved. My hunch is that the game is doing some routing and wont start properly until its finished. 

I would prefer it to pause whilst it does this initial routing rather than lock me out.
Regards
Sev.

Combuijs

Yes, a ship takes a long time to find its route in complicated cases. You can even notice it when you have 10 ships that have to sail from one side of a big island to the other and then going upriver.

I know Prissi has improved ship-routing on his todo-list, but I'm afraid his todo-list is far longer than he has time to spend for.
Bob Marley: No woman, no cry

Programmer: No user, no bugs



jamespetts

Does the A* routing algorithm used by moving vehicles use the freelist class?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

gerw

Quote from: jamespetts on June 02, 2009, 12:47:37 PM
Does the A* routing algorithm used by moving vehicles use the freelist class?
No. It uses only the route_t::nodes, which are always allocated.

jamespetts

Would there be any benefit in allocating them from freelist?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

gerw

I don't think so. You will waste some space, if you have them always allocated, but they are needed every now and then.

What kind of benefits do you think of?

jamespetts

I thought that it might reduce memory fragmentation.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

prissi

Actually the ships should not do a route recalculation, their route is saved. Maybe there are thousands of pedestrian at one stop. Those take a long time for the initial sync step. (This mostly happens for autosaved games.)

Simutrans tries a complex internal algorithm to adjust the frame rate to certain values. When going from no load (initial map) to heavy load (big map) the algorithm does need some time to adapt. You can try to rest the algorithm by pressing p twiche during loading. But this might make things worse.

Severous

Hi

On occassion there are a thousand passengers at some stops.  There is over 50,000 wood/planks at some of my warehouse stops..would that make a difference?

My ships..and I suspect there are well over 300..have a loop route with 19 stops.

I often press 'p'..as it is the pause command. As I micro manage I do a lot in pause mode.  I doubt that is making any differnece to the load time. Pause works fine normally. Its just that initial load of a save game..and the delay seems to be getting progressively worse as I add more ships.
Regards
Sev.

prissi

What is done after a day might be a rerouting of goods; although I do not see why.

I could heve a look at your savegame; but it may run fine on my computer.

whoami

Quote from: Severous on June 04, 2009, 07:01:35 PM
On occassion there are a thousand passengers at some stops.  There is over 50,000 wood/planks at some of my warehouse stops..would that make a difference?
It's actually not the number of passengers / amount of goods, but the number of aggregation items which are grouped according to the destinations of passengers/goods. For goods of a given category, there are usually very few destinations and valid routes, so this part should hardly matter. For passengers, there is often a big interconnected network with many stops, so there it will matter.

QuoteMy ships..and I suspect there are well over 300..have a loop route with 19 stops.
Nobody mentioned the obvious, so I will: if you use waypoints between the other stops, at least for longer distances, time for route (re-)calculation may drop vastly.