Chunks pre-generation
#11
Do you have mobs turned on? There've been crashes observed concerning that (mobs + generating chunks), and Rev 521 should have fixed it.

The queue size is arbitrary, there's no actually problem enlarging it. The log message was mainly meant as a means for us devs to know if the chunk generation is fast enough.
I think what you'd need more is a means to know when a chunk has been generated, some sort of a hook, perhaps? But I'm not sure if I can do such a thing, after all, Lua integration has been done by FakeTruth. I'd prefer if he did that Smile

FakeTruth, could you make a new hook, "chunk ready", that is triggerred in cWorld::SetChunkData() ? I know that hook would be called for chunks loaded as well as generated, but then the plugin can check the size of the generator queue to decide whether to queue more chunks.
I can make a simple query function that would return the number of chunks in the generator queue (and possibly in the lighting queue as well), that should be as simple as marking a function "tolua_export", shouldn't it?

EDIT: The query functions have been done (Rev 524):
cWorld::GetGeneratorQueueLength();
cWorld::GetLightingQueueLength();
cWorld::GetStorageLoadQueueLength();
cWorld::GetStorageSaveQueueLength();
You might want to check the lighting queue as well as the generator queue, because lighting is actually done right after generating a chunk (if it has all neighbors).
Reply
Thanks given by:
#12
Quote:Do you have mobs turned on?
Yes I do)
Quote:I think what you'd need more is a means to know when a chunk has been generated, some sort of a hook, perhaps?
I'm not sure if "hook" concept is familiar to me, I'll look more about them
Quote:I can make a simple query function that would return the number of chunks in the generator queue (and possibly in the lighting queue as well)
Exactly my thought!

Thanks a lot for your help Smile
Reply
Thanks given by:
#13
Hook = your Lua function that gets called if something happens. For example, "OnBlockDig" is a hook that is called when a player holds left mouse button and the client decides that the block should be dug up.
Reply
Thanks given by:
#14
Oh, yes, got it Smile
Now I need some time to write some stuff, and first ChunkWorx release will be there!
Reply
Thanks given by:
#15
Ran into problems accessing worlds through plugin (I want to make a table, like in "Playerlist", for selecting world for operations) - all worlds (except default one) have same ValueName. How do I get a list of all worlds then? (I expect cIniFile to return first world name found).
Reply
Thanks given by:
#16
Maybe is it possible to let the server generate terain when nobody is in the server
Reply
Thanks given by:
#17
Quote:Maybe is it possible to let the server generate terain when nobodyis in the server
Already done, see ChunkWorx somewhere nearby Wink
One more tiny issue: how to convert cWorld to string? GetWorld() needs world name and won't accept world pointer, and cWorld seems to have no GetName() method...
Reply
Thanks given by:
#18
cWorld:GetName() should work. If not, there's something rotten in the codeTongue
I think what STR_Warrior meant is that the plugin should stop pre-generating if someone joins, and continue when they disconnect. And possibly that the pre-generation should run without the coords being specified, just when the server is "idling", let it generate chunks around the spawn a bit.

This could be useful for a few days, but then the chunks would surely be generated uselessly and the world would grow too much without players actually exploring the it. I don't know, it's about finding the balance... Perhaps a limit that can be pushed further once players go further away.
Reply
Thanks given by:
#19
Quote:there's something rotten in the code
Uh... It worksBig Grin
Now, point regeneration - and v2 ChunkWorkx is there!

Still, how do I get a list of worlds (similar to players list)? Not that I need it much... But it would be nice to have.
Reply
Thanks given by:
#20
I think most of your API questions can be answered easily by looking at the C++ code. Can you have a look at it? In the cWorld.h, cRoot.h, cPlayer.h etc. files, you'll find the C++ declarations for the classes, and functions marked with "// tolua_export" are exported to Lua. Simple as that Smile

-- or --
Have a look at source/Bindings.cpp, at the very bottom there's a function
Code:
TOLUA_API int tolua_AllToLua_open (lua_State* tolua_S)
And in this function all the Lua objects are defined, so you can see what objects there are and what functions they support.
Reply
Thanks given by: Taugeshtu




Users browsing this thread: 7 Guest(s)