Posts: 313
Threads: 32
Joined: Feb 2012
Thanks: 98
Given 14 thank(s) in 13 post(s)
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.
Posts: 6,485
Threads: 176
Joined: Jan 2012
Thanks: 131
Given 1074 thank(s) in 852 post(s)
05-03-2012, 08:50 PM
(This post was last modified: 05-03-2012, 08:54 PM by xoft.)
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 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.
Posts: 313
Threads: 32
Joined: Feb 2012
Thanks: 98
Given 14 thank(s) in 13 post(s)
First of all, thank you for your reply
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.
Posts: 6,485
Threads: 176
Joined: Jan 2012
Thanks: 131
Given 1074 thank(s) in 852 post(s)
05-08-2012, 09:56 PM
(This post was last modified: 05-08-2012, 10:03 PM by xoft.)
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 tariffs )
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
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
Posts: 1,450
Threads: 53
Joined: Feb 2011
Thanks: 15
Given 120 thank(s) in 91 post(s)
(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 websites ). This is because it's basically an extension of regular plugins
Posts: 6,485
Threads: 176
Joined: Jan 2012
Thanks: 131
Given 1074 thank(s) in 852 post(s)
Taugeshtu, the branch has been merged
Posts: 313
Threads: 32
Joined: Feb 2012
Thanks: 98
Given 14 thank(s) in 13 post(s)
05-29-2012, 05:49 AM
(This post was last modified: 05-29-2012, 06:17 AM by Taugeshtu.)
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 lot
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
Posts: 1,450
Threads: 53
Joined: Feb 2011
Thanks: 15
Given 120 thank(s) in 91 post(s)
(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] )
Posts: 6,485
Threads: 176
Joined: Jan 2012
Thanks: 131
Given 1074 thank(s) in 852 post(s)
(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
Posts: 313
Threads: 32
Joined: Feb 2012
Thanks: 98
Given 14 thank(s) in 13 post(s)
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 crash
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 size ) and then I'll upload it on forum
|