Chunks pre-generation
#1
Hi there.
I found it pretty perfomance-boosting to generate chunks before "using" server (especially if one is going to bound players somehow), so I suppose making a plugin for that purpose could be useful.

Question is - what's the best way to do it?
So far, digging in sources showed me, that cWorld uses "TouchChunk" to generate spawn area.
Is it good method or is it bad method?
I'm speaking of cWorld::TouchChunk function.

I'm planning to make a web-plugin.
Reply
Thanks given by:
#2
It would be a good method, but right now it is not exported into the Lua interface. Also the name is somewhat misleading.

In my composable_generator branch, I've added a cWorld::GenerateChunk() function exactly for this purpose, and it is exported into the Lua interface. Since the composable_generator branch is nearing its development cycle and will be merged into the trunk soon(ish), I'd prefer if you used that function - if there are no other obstacles for you Smile The only problem is that you'd need to compile mcserver from svn sources to get that branch working. I can provide Windows binaries, if it helps - I'm already doing the nightbuilds anyway.
And while you're at it, perhaps you could make a similar webplugin that could regenerate an area of chunks (= clear all player-made changes), same principle, just use the cWorld::RegenerateChunk() function.
Reply
Thanks given by: Taugeshtu
#3
First of all, thank you for your reply Smile
I already use your night builds as "basis". Problem is: I don't have any descent coding tools (since I'm using Unity normally with UniSciTe minimatistic code editor) - no MS VS of any kind, and my internet connection is too slow to download it.

Thus I can't compile server on my own, and would greatly appretiate if you'll make any guess about merging time (like 1 week or 1 month or what?). Or you can just compile that branch for me ^_^" (Windows, x86)

Actually, now I'm thinking about making something more useful and calling it "ChunkWorks" - generation, regeneration of chunks, chunk areas, maybe world bounding (just players teleportation, I guess, nothing too complicated); any more ideas for such a web plugin are appretiated.
Reply
Thanks given by:
#4
Sorry for the late answer, I've been a bit busy in the last few days.

MS VS Express is a 700MB download (complete offline ISO); the online installer will probably download even less. I had no idea there are still connections out there which would be too slow for such sizes to download.
Okay, maybe not slow, but costly (remembered local cell operators' internet tariffsTongue )

I estimate the merge to be somewhere around the 1 month / 2 months timeframe. The generator is more or less complete, but there's still the lighting to rewrite.

I've compiled several snapshots of the branch, they are at the same web address, in the composable_generator subfolder. I'll compile the newest revision for you, soonish Wink

I'm not sure if making a huge plugin for that everything is a good idea. Most people would want only a subset of those features. Also I think a web-plugin won't be able to interact with the players in-game like normal plugins do, but I don't know, I'm not the guy who wrote the plugin framework, perhaps FakeTruth can shed some light on this.
Anyway, I'd say, start little, make sure it works, and then add to it. Better than starting large and losing time / interest / ... in the middle.
Rev 479 is there, it's the newest from that branch. Hopefully it'll run Wink
Reply
Thanks given by:
#5
(05-08-2012, 09:56 PM)xoft Wrote: Also I think a web-plugin won't be able to interact with the players in-game like normal plugins do, but I don't know, I'm not the guy who wrote the plugin framework, perhaps FakeTruth can shed some light on this.

Web plugins can do everything in-game plugins can, and more ( have websitesBig Grin ). This is because it's basically an extension of regular plugins
Reply
Thanks given by:
#6
Taugeshtu, the branch has been merged Smile
Reply
Thanks given by:
#7
Quote:Taugeshtu, the branch has been merged
Thanks a lot! And great cheers to you, new generation is lightning-fast! I also liked new finishers and Voronoi biomes a lotBig Grin

Now, back to business)
I've figured out how to make a web plugin, handle form entries and so on, BUT!
I'm wondering, how do I get access to a world instance through a web plugin?

I assume there could be some sort of walk-around: setting some bool variable in web plugin script and then using it in "normal" plugin, but still: how do I get a world instance if there're no players online?
(I appologize for not digging sources still)
And one more thing: what if I have multiple worlds?

UPD:
Getting an instance solved! Through cRoot:Get():GetWorld().
But still, how do I get access to a specific world?
UPD2:
Regenerating chunk causes server to crash O_o
Reply
Thanks given by:
#8
(05-29-2012, 05:49 AM)Taugeshtu Wrote: Getting an instance solved! Through cRoot:Get():GetWorld().
But still, how do I get access to a specific world?

cRoot:Get():GetWorld( [WorldName] )
Reply
Thanks given by: Taugeshtu
#9
(05-29-2012, 05:49 AM)Taugeshtu Wrote: Regenerating chunk causes server to crash O_o

Re-generating or pre-generating? The Core plugin uses re-generation, and I haven't seen it crash.

Anyway, if you are on Windows, there's a detailed guide on how to report the most information for a crash. Could you please take the time and provide us with as much detail as possible? Thanks.
https://forum.cuberite.org/showthread.php?tid=400
Reply
Thanks given by:
#10
Quote:Re-generating or pre-generating? The Core plugin uses re-generation, and I haven't seen it crash.

Anyway, if you are on Windows, there's a detailed guide on how to report the most information for a crash. Could you please take the time and provide us with as much detail as possible? Thanks.
Re-generating, /regeneratechunk command. Strange, but I can't reproduce this bug, now everything is fine.
Unfortunately, I have deleted all logs. Let's count it as an unique crashBig Grin

Generation seems to work now, but I just need to do some work on making it soft and smooth (right now it goes out of queue sizeBig Grin) and then I'll upload it on forum Smile
Reply
Thanks given by:




Users browsing this thread: 5 Guest(s)