The International Simutrans Forum

Simutrans Extended => Simutrans-Extended bug reports => Simutrans-Extended development => Simutrans-Extended closed bug reports => Topic started by: MCollett on January 23, 2015, 10:06:06 AM

Title: [devel-new a7f1fe67d1] Problems with 'simsys_s2.cc'
Post by: MCollett on January 23, 2015, 10:06:06 AM
Trying to compile simsys_s2.cc generates the following errors:
Best wishes,
Matthew
Title: Re: [devel-new a7f1fe67d1] Problems with 'simsys_s2.cc'
Post by: jamespetts on January 23, 2015, 10:09:27 AM
That is interesting - I do not generally use SDL in Windows, and I have not quite worked out what simsys_s2.cc is for, exactly. For this reason, it has not been kept fully up to date. May I ask why it is that you are keen to compile this? Are there some circumstances in which it is necessary?
Title: Re: [devel-new a7f1fe67d1] Problems with 'simsys_s2.cc'
Post by: MCollett on January 23, 2015, 10:25:19 AM
Quote from: jamespetts on January 23, 2015, 10:09:27 AM
That is interesting - I do not generally use SDL in Windows, and I have not quite worked out what simsys_s2.cc is for, exactly. For this reason, it has not been kept fully up to date. May I ask why it is that you are keen to compile this? Are there some circumstances in which it is necessary?

I need some backend.  Up to now I've been using SDL; I thought the time had come to switch to SDL2.  I could try going to OpenGL, but that still has an SDL dependence, and also opens up a whole new chain of broken dependencies.

Anyhow, with either SDL (which compiles cleanly) or SDL2 (which requires some hackery to fix the above errors), actually trying to run the resulting executable produces:
Reading low level config data ...
Parsed simuconf.tab for directory layout; multiuser = 1
FATAL ERROR: loadsave_t::start_tag() - expected "env_t", got "umgebbool>

Best wishes,
Matthew
Title: Re: [devel-new a7f1fe67d1] Problems with 'simsys_s2.cc'
Post by: jamespetts on January 23, 2015, 11:10:04 AM
May I ask what OS that you are using? I must confess to not knowing much about the difference between SDL and SDL 2; presumably, the latter is a later version of it? If SDL is needed for some reasonably mainstream OS, then I suppose that it would make sense to keep SDL 2 up to date.

Incidentally, as to the error to which you refer, that is easily fixed by deleting settings.xml (or settings-debug.xml if you are using a debug build).
Title: Re: [devel-new a7f1fe67d1] Problems with 'simsys_s2.cc'
Post by: DrSuperGood on January 23, 2015, 04:29:25 PM
I believe this is an error in the current version of Simutrans (not just experimental).
Quote
simsys_s2.cc uses env_t, but does not include dataobj/environment.h, where the type is defined.

Do not bother using SDL2 on Windows. From my personal tests there was no noticeable in-game performance difference over GDI (exact same frame rate which were both higher than the pre-builds for standard Simutrans, experimental pre-built might be faster already). It also appears to suffer from a bug whereby it will make all progress bars painfully slow (it will take 5-10 times longer to load stuff).
Title: Re: [devel-new a7f1fe67d1] Problems with 'simsys_s2.cc'
Post by: MCollett on January 23, 2015, 10:05:04 PM
Quote from: jamespetts on January 23, 2015, 11:10:04 AM
May I ask what OS that you are using?

Mac OS X

Title: Re: [devel-new a7f1fe67d1] Problems with 'simsys_s2.cc'
Post by: jamespetts on January 23, 2015, 10:25:26 PM
Ahh, yes, I remember now that you have provided some useful compiling work in the past for that operating system. I have fixed the specific things that you have identified - can you try compiling again?
Title: Re: [devel-new a7f1fe67d1] Problems with 'simsys_s2.cc'
Post by: MCollett on January 24, 2015, 12:09:49 AM
Quote from: jamespetts on January 23, 2015, 10:25:26 PM
I have fixed the specific things that you have identified - can you try compiling again?

Yes, that's OK now.  World generation (or more specifically, city generation) seems to be the next headache, but that's a topic for a new thread.
Title: Re: [devel-new a7f1fe67d1] Problems with 'simsys_s2.cc'
Post by: jamespetts on January 24, 2015, 12:39:18 AM
Town generation is currently broken: the plan is to fix that when town growth has a major overhaul sometime this year. You can, however, manually add a few roads and then use the "grow city" tool to build them manually for the time being. I am not sure why this does not work automatically at this stage.
Title: Re: [devel-new a7f1fe67d1] Problems with 'simsys_s2.cc'
Post by: MCollett on January 24, 2015, 05:37:45 AM
Quote from: jamespetts on January 24, 2015, 12:39:18 AM
Town generation is currently broken: the plan is to fix that when town growth has a major overhaul sometime this year. You can, however, manually add a few roads and then use the "grow city" tool to build them manually for the time being. I am not sure why this does not work automatically at this stage.

I'm just about up to adding a few towns manually, but now I see that there is an further lack: we get lots of little lakes, but no rivers!  Painting an entire map's worth of rivers by hand strikes me as distinctly UnFun.

Regarding town generation, I note that the problem towns are those whose town halls have no roads adjacent (or even nearby).   Perhaps all that is needed is to ensure that a newly-created town has at least a couple of squares of road next to the town hall before trying to engage in town growth?   

Probably not connected: trying to sort the town list by population just results in it being sorted backwards by name.

Best wishes,
Matthew
Title: Re: [devel-new a7f1fe67d1] Problems with 'simsys_s2.cc'
Post by: jamespetts on January 24, 2015, 10:38:48 AM
Hmm - there appears to be a problem with way generation on map creation if both rivers and town roads are not being generated. I may need to look into this as its own issue.

Edit: I think that I have now fixed this, and town roads and rivers are now generated on map generation. Can you test to see whether it is working for you?
Title: Re: [devel-new a7f1fe67d1] Problems with 'simsys_s2.cc'
Post by: MCollett on January 29, 2015, 09:49:29 PM
Quote from: jamespetts on January 24, 2015, 10:38:48 AM
Edit: I think that I have now fixed this, and town roads and rivers are now generated on map generation. Can you test to see whether it is working for you?
I only spotted this this morning (edits don't show up in 'Unread posts since your last visit').

Anyway, yes it is much improved, but not yet completely right. 

Town roads now appear as expected, and in consequence town generation is basically OK.  There is still something fishy with the population counts though: the generated populations are systematically larger than they should be for the median requested (by about a factor of 2, I would say), and asking for a city list sorted by population results in a list approximately sorted by population, but with the occasional individual town badly misplaced.  I'm guessing that somewhere lurking in the code are two different ways of counting population: an 'internal' count that is used for generation and sorting, and a more inclusive 'external' count (perhaps counting jobs or visitors as well as inhabitants) that is displayed to the player.

Rivers are being generated, but only at the smallest size: no matter how long the streams are, and no matter how many of them combine together, they remain as just streams.   Also, with 'lakes' on, there are so many little lakes that the rivers tend to be cut short, and a very large number need to be generated to get a reasonable density; for the moment I'm just turning 'lakes' off, but it would be nice to be able to turn it down instead of completely off.  Separate buglet that I think has been around for a while: in Settings->Climate, the maximum river length is a reasonable 8196, but if you go directly to Climate settings from the Creation window, the maximum allowed is a mere 1024.

Best wishes,
Matthew
Title: Re: [devel-new a7f1fe67d1] Problems with 'simsys_s2.cc'
Post by: jamespetts on January 29, 2015, 11:09:24 PM
Thank you for that: I have now fixed the two river generation issues identified.

As to the towns, work on town generation is awaiting a complete overhaul of town growth, in which the two different systems for counting population will be reduced into the single (newer) system used for passenger generation.
Title: Re: [devel-new a7f1fe67d1] Problems with 'simsys_s2.cc'
Post by: MCollett on January 29, 2015, 11:48:24 PM
Quote from: jamespetts on January 29, 2015, 11:09:24 PM
Thank you for that: I have now fixed the two river generation issues identified.

As to the towns, work on town generation is awaiting a complete overhaul of town growth, in which the two different systems for counting population will be reduced into the single (newer) system used for passenger generation.

OK, I'm now getting playable maps.  (But I'm sticking with no lakes.)

Thanks,
Matthew
Title: Re: [devel-new a7f1fe67d1] Problems with 'simsys_s2.cc'
Post by: jamespetts on January 29, 2015, 11:53:40 PM
I don't think that I have changed the lakes code from Standard, so it may well be a calibration issue inherited from there.
Title: Re: [devel-new a7f1fe67d1] Problems with 'simsys_s2.cc'
Post by: DrSuperGood on January 30, 2015, 12:12:07 AM
Lakes have recently changed from the model used in the Experimental Server (a water level? Anything below a certain height becomes water) to water being a climate model (you can turn any tile to water even if it neighbours non-water tiles, and fill up depressions somehow resulting in all kinds of water and land heights).

Due to the extent that water has changed it is possible that anything from big to small changes/fixes can be missed. This might especially be the case if you were bulk merging code from standard involved with climate, water or cliffs.
Title: Re: [devel-new a7f1fe67d1] Problems with 'simsys_s2.cc'
Post by: jamespetts on January 30, 2015, 10:11:18 AM
It was Bernd Gabriel who merged the lakes code from Standard quite a while ago now. Is the lake behaviour notably different from Standard with the same settings?