Open Terrain Generator (OTG)

Open Terrain Generator (OTG)

10M Downloads

Feature: Adaptive generation speed

Aaron2550 opened this issue ยท 11 comments

commented

When on a forge server you have to specify the chunks/tick "speed" at which OTG will generate chunks. It would be really nice if there was an automatic speed adjustment.

For example: Test with 1, if TPS high then try 2. If TPS high try 3. If TPS low go back to 2.

I hope I explained that ok. This would be nice to have for new OTG users too, since some people will not notice the "Speed" setting in the config.

commented

Hey @Aaron2550 , I think that's a great idea. For a first version I'll add a pre-generator speed setting to the "O" menu, can look at adaptive speed later. Don't think I'll include this in the v8 release though, we will be doing another 1.12.2 minor release though, so may include it there.

commented

Isn't it easier to implement adaptive speed over the "Manual" setting?
Also does adaptive speed take into account the "Game Lag"?
If you want a simple & quick implementation of it (example) I can provide one.

commented

TPS is ticks per second, 1 tick has 50ms,
Chunk Pregenerator has a dynamic calculation on how much lag it should eat.
If the game eats 30ms and the pregenerator has 40ms of work time, that would be on pregeneration priority (which most pregenerators run on) 70ms. So laggy.
So what Chunk Pregen does is this: 40ms - 30ms = pregenerator runtime.
(thats a toggle mode)

Does this answer your question?
Also tracking the game time is just subscribing to the server event and setting a time on the tick start and calculating time it took at the end of the server tick. (currentTime - startTime)
And if you want to be fancy you add it to a averager so you see it for multiple ticks.

commented

Why didnt i get a notification about @PG85's reply until now?!

commented

@Speiger Dont TPS correspond to Game Lag?

commented

Thinking about it, TPS will likely fluctuate for quite a lot of reasons, also those unrelated to the pregenerator, that are not constant. Some chunks are also much slower to generate than others, which also makes TPS less reliable. The pregenerator would go faster/slower in response, in turn affecting the TPS, which wil llikely lead to frequently or constantly increasing/decreasing the speed. I also can't just change the speed while the pregenerator is running, so I'd have to change it while the pregenerator is paused and make sure it doesn't cause any problems.

So it may be quite a bit of work getting this to work in a way that is actually reliable and helpfull to players. To be honest, I don't recommend playing on any server while it's pregenerating, it's bound to cause lag. Since the pregenerator already has a speed setting in OTG.ini, this can be worked around for now, and can wait until after v9 / 1.13 / 1.14 / 1.15 update.

commented

Adaptive speed could be easily a ingame config/command setting.
Also I doubt that you should do a pregenerator in 1.14.x or 1.15.x because mc has implemented so many issues that you need to be aware of if you are massgenerating chunks. (Anything above a 1600 blocks radius becomes unstable unless you implement fixes)

Edit: Though thats just my opinion, since it easily could go wrong. Also the current 1.12 method is laggy as fuck in 1.14.4.

commented

@PG85 https://www.reddit.com/r/feedthebeast/comments/klbjmp/chunk_pregen_2430_update_now_with/
It took longer then i wanted but now it is out. This is the changelogs on what i achieved.

commented

For 1.16, will have to see if we implement our own pregenerator or can rely on another (dedicated) mod. If we implement our own, will see if we can add a speed setting. For 1.12.2, we won't be implementing this anymore.

commented

@PG85 my pregenerator for 1.14-1.16 is almost done, it has a lot of new features that are not implemented in any other pregenerator that i have seen so far.
(Release date is this year)

commented

Very nice, let us know when it's out! :)