taskLordsAWar! - Tasks: task #14434, making large maps is slow

 
 

You are not allowed to post comments on this tracker with your current authentication level.

task #14434: making large maps is slow

Submitter:  Ben Asselstine <benasselstine>
Submitted:  Wed 29 Mar 2017 11:29:16 PM UTC
   
 
Should Start On:  Wed 29 Mar 2017 04:00:00 AM UTC Should be Finished on:  Wed 29 Mar 2017 04:00:00 AM UTC
Category:  None Priority:  5 - Normal
Status:  None Privacy:  Public
Assigned to:  None Percent Complete:  0%
Open/Closed:  Closed Effort:  0.00

Fri 31 Mar 2017 12:12:17 PM UTC, comment #2: 

fixed by:

skipping over some tiles when doing certain loops in makeRivers, as outlined by Janek.

limiting the main loop in makeRivers from 20 down to 4.

limiting the how_many variable in makeRivers to 40.

using pathcalculator more when making cities accessible, so that we're not recalculating paths.

when laying bridges, we don't bother if the two points are farther away than 1/6th of the map (and the map is large).

also using path calculator when making bridges, so that we're not recalculating paths.

loading maps was slow due to Glib::ustring slowness, so we now use a C string instead.  See the XML constructor in GameMap.

also revamped Maptile so that it's new'ing stacktile and map_backpack as we need them.  smalltile has been completely removed, and points to the smalltile in tile.

GameMap now holds an array of Maptiles, instead of an array of pointers to Maptiles.

Ben Asselstine <benasselstine>
Group administrator
Thu 30 Mar 2017 01:00:49 AM UTC, comment #1: 

makeRivers is slow because there are so many "lakes" to consider connecting with a river.

one answer is to sort the lake boxes by area and only consider at most the 50 largest lakes -- or some other number that makes it go quickly.

the main loop stops when there are 3 distinct (unconnected) lakes left.  perhaps this number should be a sliding number given the number of lakes, or size of map.

maybe 10% or something.

Ben Asselstine <benasselstine>
Group administrator
Wed 29 Mar 2017 11:29:16 PM UTC, original submission:  


These methods seem to take a long time in MapGenerator:
makeRivers
makeRoads
makeBridges

The size of map I'm trying to generate is 500x500.

Ben Asselstine <benasselstine>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by benasselstine (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-03-31 benasselstine Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code