Posts: 6,485
Threads: 176
Joined: Jan 2012
Thanks: 131
Given 1074 thank(s) in 852 post(s)
Yes, that's a naive algorithm for Perlin noise; MCServer uses more advanced stuff, for performance reasons.
Posts: 4,628
Threads: 115
Joined: Dec 2011
Thanks: 693
Given 494 thank(s) in 423 post(s)
03-23-2014, 07:14 AM
(This post was last modified: 03-23-2014, 08:48 AM by NiLSPACE.)
We really need a better way of making plugins that generate terrain. Lua is too slow to create a complete new generator. With this generator I'm baraly doing 18 ch/s which is quite allot if you also think this generates: the heightmap, the biomes, the composition and the finisher.
I've heard quite allot about LuaJit being faster. I have no idea in what aspect it is faster or why it's faster but if I remember correctly a while ago some people here on the forum were also discussing LuaJit.
EDIT:
I see why you enjoy working on the world generator. It's awesome to see the new terrain generate before you without really knowing how the result would look like.
Posts: 783
Threads: 12
Joined: Jan 2014
Thanks: 2
Given 73 thank(s) in 61 post(s)
LuaJIT is faster for code that is run multiple times like a world generator because it compiles the scrits to native code. It claims to be drop in compatible with lua 5.1 so its probably worth giving it a try.
If your writting world generators in lua then we need to rethink how the bindings should work for better performance. I would think we should create an object similar to cluatask as a generator. A plugin would then construct one of these with call backs for the various generating functions. This would avoid the overhead of the hooks system.
If the bottleneck is still the bindings after that then we need to look at a limited form of c++ plugins.
Posts: 6,485
Threads: 176
Joined: Jan 2012
Thanks: 131
Given 1074 thank(s) in 852 post(s)
I think plugins are altogether not the place to build brand new generators. Some things just need to be done properly, and for a real generator you need to go C++. The current interface is meant for plugins that want to disable parts of the generator, for example the Gallery plugin; it is not supposed to be used for implementing a real generator, and even if we did in fact use LuaJIT, it would still be much slower than native C++.
Posts: 783
Threads: 12
Joined: Jan 2014
Thanks: 2
Given 73 thank(s) in 61 post(s)
Then we need some form of limited c++ plugins so that people like STRWarrior can develop generators seperatly from MCServer. We do not want to require that generators all have to be part of the main server. C++ plugins would involve all the maintance overhead of another set of bindings and a loader when luaJIT is not much slower.
Posts: 6,485
Threads: 176
Joined: Jan 2012
Thanks: 131
Given 1074 thank(s) in 852 post(s)
Actually, we DO want to require tight coupling. It makes sense to require it when the code needs top performance.