Page 4 of 8

Re: [MOD 12.11+] Train Outposts

Posted: Wed Mar 23, 2016 10:12 pm
by orzelek
budgej wrote:Thank you for making this mod SirRichie. I really appreciate the incentive to use trains and travel further for resources.

I am experiencing an issue, however. It seems that as a save file's complexity grows, the time to load that file grows very quickly, whether I join my server or load the same save in single player. No issues once loaded; it just means that an end-game factory takes 60-120 seconds longer to load than with Train Outposts removed. Is this expected behavior? Is there a way to mitigate it?
I looked around the code and it's not the save complexity. It's a quirk of how the mod handles random number generation - it will get longer and longer as time passes.

Re: [MOD 12.11+] Train Outposts

Posted: Wed Mar 23, 2016 11:19 pm
by SirRichie
budgej wrote:Thank you for making this mod SirRichie. I really appreciate the incentive to use trains and travel further for resources.

I am experiencing an issue, however. It seems that as a save file's complexity grows, the time to load that file grows very quickly, whether I join my server or load the same save in single player. No issues once loaded; it just means that an end-game factory takes 60-120 seconds longer to load than with Train Outposts removed. Is this expected behavior? Is there a way to mitigate it?
That is interesting to know. I always thought that this is due to the general size of the map, not that it is TO-related. How long were you playing for in your comparison tests? 120 seconds seems a lot to me... in my private testing with 30+ hours games on multiplayer, it takes about 20 seconds to load the map.
The reason why I ask is because TO does not really do any heavy lifting during the loading phase. If I can pinpoint the issue I'll try to optimize the code.

Orzelek is right that re-initalization of the random number generator takes longer the more numbers it has generated (safety fix to avoid de-syncs). I would not expect that this is significant compared to everything else, but I will make sure to re-evaluate this.

And it seems like Orzelek knows my code pretty well ;)

Re: [MOD 12.11+] Train Outposts

Posted: Thu Mar 24, 2016 1:02 am
by budgej
Okay, I just did a quick test with a stopwatch. My apologies, as it seems I exaggerated (but it works out to about 110 seconds after my two friends join :D ). It's a 36 second pause at the end of the loading bar (100%) to load a 64-hour save. A new save has zero delay. This is with only Train Outposts, Factorio 0.12.29 64-bit, on Windows 7, with an SSD.

I can provide the save file via PM if that will help. Thanks for responding!

Edit: I should note that this is a delay introduced after the loading bar is at 100%. Without TO, the game is loaded as soon as the bar reaches the end.

Re: [MOD 12.11+] Train Outposts

Posted: Thu Mar 24, 2016 11:45 am
by orzelek
SirRichie wrote:
budgej wrote:Thank you for making this mod SirRichie. I really appreciate the incentive to use trains and travel further for resources.

I am experiencing an issue, however. It seems that as a save file's complexity grows, the time to load that file grows very quickly, whether I join my server or load the same save in single player. No issues once loaded; it just means that an end-game factory takes 60-120 seconds longer to load than with Train Outposts removed. Is this expected behavior? Is there a way to mitigate it?
That is interesting to know. I always thought that this is due to the general size of the map, not that it is TO-related. How long were you playing for in your comparison tests? 120 seconds seems a lot to me... in my private testing with 30+ hours games on multiplayer, it takes about 20 seconds to load the map.
The reason why I ask is because TO does not really do any heavy lifting during the loading phase. If I can pinpoint the issue I'll try to optimize the code.

Orzelek is right that re-initalization of the random number generator takes longer the more numbers it has generated (safety fix to avoid de-syncs). I would not expect that this is significant compared to everything else, but I will make sure to re-evaluate this.

And it seems like Orzelek knows my code pretty well ;)
I did a lot of analysing (and reading up) when figuring out Dark's code (original RSO author). He did a lot of stuff with rng to make sure it's deterministic.
You might be overdoing it a bit since you don't offer regen functionality from what I can see. So normal random generator provided by game would work for you - no need to handle it separately. Also regening of numbers is not needed to prevent desyncs I think.
And it might be significant - amount of random numbers generated might be easily in 100's of thousands or more on large map. And rng is a lot of calculations - that eats CPU cycles.

Re: [MOD 12.11+] Train Outposts

Posted: Thu Mar 24, 2016 7:18 pm
by SirRichie
orzelek wrote: And it might be significant - amount of random numbers generated might be easily in 100's of thousands or more on large map. And rng is a lot of calculations - that eats CPU cycles.
You might be right. The use of the custom library and the way it is handled actually pre-dates the are in which the native lua RNG was deterministic in MP. I never saw a need to change it, but now that I see this may be an issue, I might be inclined to fix this.

Re: [MOD 12.11+] Train Outposts

Posted: Sun Mar 27, 2016 1:31 am
by tetryon
How does having RSO installed at the same time as this mod affect things?

Re: [MOD 12.11+] Train Outposts

Posted: Sun Mar 27, 2016 1:33 am
by seronis
They're both trying to do the exact same task so you shouldnt even attempt that.

Re: [MOD 12.11+] Train Outposts

Posted: Sun Mar 27, 2016 7:45 am
by SirRichie
tetryon wrote:How does having RSO installed at the same time as this mod affect things?
Short Version: you will have more resources. And enemies.
Resources are generated by both Mods. Depending on which Mod loads first, resources will be infinite.

Truth to be told, I would not recommend this.

Re: [MOD 12.11+] Train Outposts

Posted: Sun Mar 27, 2016 11:52 am
by orzelek
Yeah - thats in not recommended practices. Maybe we should add some check to one of the mods to disable itself when other one is present?

Re: [MOD 12.11+] Train Outposts

Posted: Sun Mar 27, 2016 3:10 pm
by SirRichie
A warning might be a good idea.
Nothing breaks if you use both mods, but it is most likely not what you want.
I will put it on the feature list for the next release.

Re: [MOD 12.11+] Train Outposts

Posted: Mon Mar 28, 2016 6:04 pm
by Ringkeeper
on our multiplayer map with Trainoutpost we have sometimes desync while handling fluids.

According to a post of Rseding91 something is wrong for MP with TO. Don't ask me what ^^ I can only link to the thread:
viewtopic.php?f=49&t=22448&p=141598#p141598

I don't think that our desync problem comes from TO , but you might still want to check what he wrote.

Re: [MOD 12.11+] Train Outposts

Posted: Tue Mar 29, 2016 6:09 pm
by HeilTec
I really like this mod and have played a while with it.
I have noticed a serious delay after loading an existing map.
Xterminator commented on this too in a video.

As there are no error 'per se' I can not present any screen dumps or other data.
How can we help fix this?

Re: [MOD 12.11+] Train Outposts

Posted: Tue Mar 29, 2016 11:24 pm
by SirRichie
HeilTec wrote:I really like this mod and have played a while with it.
I have noticed a serious delay after loading an existing map.
Xterminator commented on this too in a video.

As there are no error 'per se' I can not present any screen dumps or other data.
How can we help fix this?
See a few posts up. You will basically have to wait for the next release in which I am going to replace legacy random number generation with the native one (which is MP-save for some time now, but was not in the beginning).

Re: [MOD 12.11+] Train Outposts

Posted: Wed Mar 30, 2016 8:10 pm
by budgej
SirRichie wrote:See a few posts up. You will basically have to wait for the next release in which I am going to replace legacy random number generation with the native one (which is MP-save for some time now, but was not in the beginning).
Thank you for taking the time to do this. My friends and I appreciate it very much!

Re: [MOD 12.11+] Train Outposts

Posted: Fri Apr 01, 2016 6:56 pm
by ALittleGreenStone
Olix wrote:
I was also surprised by the large empty area the algorithm generated in the area above and to the left of my starting location:

Image

I wonder why that would be?
For some reason, I'm having a similar, if not the same issue:

Image

At first I thought it was just my luck, a small area without anything, but as I explored more and more, it was getting clear that a great chunk of the map is devoid of resources and enemies. I explored more and finally found life ~70 chunks away (eye-balling the number) north-west.

Re: [MOD 12.11+] Train Outposts

Posted: Tue Apr 05, 2016 5:58 pm
by VDOgamez
I'm having a problem with the resource generation, in that the map has apparently not been placing any ore deposits more than a certain distance away from the starting area. I suspect that the reason for this is related to the way that the mod selects locations to place deposits: I have the map generation settings set to produce a bunch of small islands, and all of the existing deposits seem to be carefully placed to fit entirely within an island. Other people's screenshots seem to show the deposits getting bigger in radius as you move farther away from the starting area. Did you set the resource generation algorithm up such that if there isn't room to fit an entire deposit, it won't be placed? That would result in anything far enough away from the starting area trying to generate deposits of a radius greater than the size of any of the islands, and thus never being able to place them. Smaller resource types, such as oil and biter nests, are being placed, though I notice the same issue as the previous posters in the top-left quadrant of the map.

Aside from that fairly serious issue, I really like the idea behind this mod, so any way to fix that would be appreciated.

Re: [MOD 12.11+] Train Outposts

Posted: Tue Apr 05, 2016 7:57 pm
by SirRichie
VDOgamez wrote:I'm having a problem with the resource generation, in that the map has apparently not been placing any ore deposits more than a certain distance away from the starting area. I suspect that the reason for this is related to the way that the mod selects locations to place deposits: I have the map generation settings set to produce a bunch of small islands, and all of the existing deposits seem to be carefully placed to fit entirely within an island. Other people's screenshots seem to show the deposits getting bigger in radius as you move farther away from the starting area. Did you set the resource generation algorithm up such that if there isn't room to fit an entire deposit, it won't be placed? That would result in anything far enough away from the starting area trying to generate deposits of a radius greater than the size of any of the islands, and thus never being able to place them. Smaller resource types, such as oil and biter nests, are being placed, though I notice the same issue as the previous posters in the top-left quadrant of the map.

Aside from that fairly serious issue, I really like the idea behind this mod, so any way to fix that would be appreciated.
Hi and thanks for the feedback.
I am afraid that you are quite right. The mod tries to fit a resource patch and will retry several positions, but eventually give up as not to produce infinite loops.
One could of course go for using some other kind of failure-handling model than "not do anything". I just figured that an island-like game would not be very train-friendly...

Re: [MOD 12.11+] Train Outposts

Posted: Wed Apr 06, 2016 12:31 am
by VDOgamez
SirRichie wrote:
VDOgamez wrote:I'm having a problem with the resource generation, in that the map has apparently not been placing any ore deposits more than a certain distance away from the starting area. I suspect that the reason for this is related to the way that the mod selects locations to place deposits: I have the map generation settings set to produce a bunch of small islands, and all of the existing deposits seem to be carefully placed to fit entirely within an island. Other people's screenshots seem to show the deposits getting bigger in radius as you move farther away from the starting area. Did you set the resource generation algorithm up such that if there isn't room to fit an entire deposit, it won't be placed? That would result in anything far enough away from the starting area trying to generate deposits of a radius greater than the size of any of the islands, and thus never being able to place them. Smaller resource types, such as oil and biter nests, are being placed, though I notice the same issue as the previous posters in the top-left quadrant of the map.

Aside from that fairly serious issue, I really like the idea behind this mod, so any way to fix that would be appreciated.
Hi and thanks for the feedback.
I am afraid that you are quite right. The mod tries to fit a resource patch and will retry several positions, but eventually give up as not to produce infinite loops.
One could of course go for using some other kind of failure-handling model than "not do anything". I just figured that an island-like game would not be very train-friendly...
The way I was making islands was by setting the water size and terrain segmentation to max, which creates snakey archipelagos like this:
image
which are surprisingly fun with trains, using this mod to cross the small gaps. As you can see, the size of the islands is too small to fit the deposits. I think the best way to handle resource generation in a situation like that would be to just try to place them down anyway on the non-water tiles covered by the last attempt when the generator can't find a spot, perhaps as an option in a config file somewhere if most people wouldn't want messy deposits.

Re: [MOD 12.11+] Train Outposts

Posted: Mon Apr 11, 2016 5:32 pm
by Marchombre
Hi everyone. I was wondering if it was possible to add an option to not make ores infinite ? I really like the long distance between ore spawn and the cheaper rail cost, but the % thing with ore bother me a lot. I prefer when the ore disappear once emptied instead of just running at very slow pace. I asked on RSO if there was a way to change that by combining both mods or another, but they said it would be better to simply ask here if it was possible to add the option or not.

Thanks in advance o>

Re: [MOD 12.11+] Train Outposts

Posted: Mon Apr 11, 2016 10:17 pm
by SirRichie
Hi,

I can make a switch in the config. Resources should still be somewhat balanced, but I will not design the balancing for the non-endless mode.