The International Simutrans Forum

 

Author Topic: No control for over a day upon loading a saved game  (Read 3675 times)

0 Members and 1 Guest are viewing this topic.

Offline Severous

  • *
  • Posts: 377
No control for over a day upon loading a saved game
« on: June 01, 2009, 10:39:10 PM »
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.

Offline Combuijs

  • Web Team
  • Devotee
  • *
  • Posts: 1392
  • Maintainer of maps.simutrans.com
    • Combuijs
  • Languages: EN, NL
Re: No control for over a day upon loading a saved game
« Reply #1 on: June 02, 2009, 07:11:30 AM »
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.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 18565
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: No control for over a day upon loading a saved game
« Reply #2 on: June 02, 2009, 12:47:37 PM »
Does the A* routing algorithm used by moving vehicles use the freelist class?

Offline gerw

  • Coder/patcher
  • *
  • Posts: 618
Re: No control for over a day upon loading a saved game
« Reply #3 on: June 02, 2009, 12:59:23 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.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 18565
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: No control for over a day upon loading a saved game
« Reply #4 on: June 02, 2009, 02:25:06 PM »
Would there be any benefit in allocating them from freelist?

Offline gerw

  • Coder/patcher
  • *
  • Posts: 618
Re: No control for over a day upon loading a saved game
« Reply #5 on: June 02, 2009, 03:09:11 PM »
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?

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 18565
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: No control for over a day upon loading a saved game
« Reply #6 on: June 02, 2009, 07:06:45 PM »
I thought that it might reduce memory fragmentation.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9460
  • Languages: De,EN,JP
Re: No control for over a day upon loading a saved game
« Reply #7 on: June 03, 2009, 09:49:09 PM »
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.

Offline Severous

  • *
  • Posts: 377
Re: No control for over a day upon loading a saved game
« Reply #8 on: June 04, 2009, 07:01:35 PM »
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.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9460
  • Languages: De,EN,JP
Re: No control for over a day upon loading a saved game
« Reply #9 on: June 04, 2009, 07:24:11 PM »
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.

Offline whoami

  • Devotees (Inactive)
  • *
  • Posts: 693
Re: No control for over a day upon loading a saved game
« Reply #10 on: June 04, 2009, 07:40:07 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.

Quote
My 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.