Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/robust-file-saving into lp:widelands

2019-02-16 Thread Klaus Halfmann
Review: Resubmit Uhm, why dont we get another build? I foundd soum compile warnigns about the new JSON Objects not having virtual DTors. but that is some other story. -- https://code.launchpad.net/~widelands-dev/widelands/robust-file-saving/+merge/358718 Your team Widelands Developers is subscr

Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1810062-territorial-calculations into lp:widelands

2019-02-16 Thread Toni Förster
I think I had an eureka moment. get_valuable_fields() is in a coroutine and gets calculated in the background. The sleep time can be adjusted, but I think 50ms is a good value. I tested 25ms which cut the time in half but the game was a little choppy. -- https://code.launchpad.net/~widelands-d

[Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1810062-territorial-calculations into lp:widelands

2019-02-16 Thread bunnybot
Continuous integration builds have changed state: Travis build 4482. State: passed. Details: https://travis-ci.org/widelands/widelands/builds/494349394. Appveyor build 4270. State: success. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_bug_181006

Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1810062-territorial-calculations into lp:widelands

2019-02-16 Thread Toni Förster
I think I found the sweet-spot. It is a radius of 6 for medium and big buildings. Let me explain: Before hessenfarmer introduced the max_caps we had to calculate up to 12 fields to make sure the immovable was accessible. This isn't the case any more. Here are some maps I tested with different c

Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1810062-territorial-calculations into lp:widelands

2019-02-16 Thread Toni Förster
You're welcome. The question though, should we really evaluate big fields? We currently stop after 10 fields, because I think 12 is too far away and adds fields that are only accessible under extreme circumstances. -- https://code.launchpad.net/~widelands-dev/widelands/bug-1810062-territorial-ca

Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1810062-territorial-calculations into lp:widelands

2019-02-16 Thread hessenfarmer
we are getting better, at least my machine (Core2Duo T7500 6GB) is able to calculate oasis triangle with about 14000 valuable fields. Problem is it still took 20+ seconds. I don't know the table beahviour in lua exactly, but if we could exclude/remove duplicates it would make sense to simply eva

Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1810062-territorial-calculations into lp:widelands

2019-02-16 Thread hessenfarmer
confirmed this is killing old machines on oasis triangle. How about just checking the map for fields with maximum buildcaps small, medium, big, port, and mine. this isn't exakt as well but far less consuming. -- https://code.launchpad.net/~widelands-dev/widelands/bug-1810062-territorial-calculat

Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1810062-territorial-calculations into lp:widelands

2019-02-16 Thread kaputtnik
Forgot to mention: Tested a release build. Here the output for map Glacier Lake: Starting get_valuable_fields: get_valuable_fields took: 6410ms 6 seconds sitting in front of a black screen ;) -- https://code.launchpad.net/~widelands-dev/widelands/bug-1810062-territorial-calculations/+merge/3613

Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1810062-territorial-calculations into lp:widelands

2019-02-16 Thread kaputtnik
This branch does not work for me on my poor laptop (Celeron 900 with 3,8Gb Memory). E.g. trying to load map Oasis Triangle will last forever while memory usage increases until no memory is available anymore. I have put a print statement at the beginning and the end of the function get_valuable_f