Page 2 of 2

Posted: 25 May 2006 16:57
by Wolf01
get a faster computer
that is not a solution, i bought this laptop a year and some monts ago and it can run new games very well
a solution is to optimize the code instead!
the map is already auto-generated with small number of towns, those games on large maps starts well, when towns start to grow, the game starts to slow down

Posted: 25 May 2006 17:22
by Bjarni
Wolf01 wrote:
get a faster computer
that is not a solution, i bought this laptop a year and some monts ago and it can run new games very well
a solution is to optimize the code instead!
the map is already auto-generated with small number of towns, those games on large maps starts well, when towns start to grow, the game starts to slow down
you missed out the :P in the quote. It was not a serious statement.

I didn't learn what needed to calculate the distance to the town all the time, and that is a must before we can do anything about this. The distance calculation on it's own can't be made any faster, so a speedup can only be to call it less times.

Posted: 26 May 2006 07:46
by Brianetta
Can't the distance to the town be cached in the map array?

Posted: 26 May 2006 12:42
by Bjarni
Brianetta wrote:Can't the distance to the town be cached in the map array?
it needs a pointer to the nearest town, not just a distance and the current map array haven't got room for a whole pointer.
I did wonder about adding more room for such a pointer, but I didn't get past the "starting to wonder" stage.