Hook Question
#22
(11-22-2013, 07:18 AM)xoft Wrote: I fear that such a hook would seriously affect the server performance - it would be called several thousand times per tick (there are about 50 ticked blocks per loaded chunk per tick; a player normally loads 19*19 chunks -> 18k hook calls per player). We might have to accept that *some* kinds of plugins are just unreachable with current architecture.

Perhaps it's possible when calling a hook just once and supply a list of ticked blocks. This could require storing the ticked blocks. I'm not sure how much performance that costs but since there's a fixed amount of block ticks each server tick it could be stored in a fixed size array which should be pretty fast.

If you want to make mossy cobblestone grow I don't think this is the appropriate way to do it though, Lua is simply too slow to handle 18k block checks per tick. A more suitable way without needing the random tick hook would be inspecting each loaded chunk once and storing each (potentially growable) mossy cobblestone block after which the plugin manually selects a random stored block each tick to grow.
Reply
Thanks given by:


Messages In This Thread
Hook Question - by bearbin - 12-29-2012, 04:04 AM
RE: Hook Question - by xoft - 12-29-2012, 06:14 AM
RE: Hook Question - by bearbin - 12-29-2012, 06:53 AM
RE: Hook Question - by NiLSPACE - 08-08-2013, 04:14 AM
RE: Hook Question - by xoft - 08-08-2013, 05:54 AM
RE: Hook Question - by bearbin - 08-08-2013, 05:56 AM
RE: Hook Question - by xoft - 08-08-2013, 06:24 AM
RE: Hook Question - by NiLSPACE - 08-08-2013, 05:57 AM
RE: Hook Question - by bearbin - 08-08-2013, 05:58 AM
RE: Hook Question - by NiLSPACE - 08-08-2013, 08:08 PM
RE: Hook Question - by xoft - 08-08-2013, 08:43 PM
RE: Hook Question - by NiLSPACE - 08-08-2013, 08:44 PM
RE: Hook Question - by NiLSPACE - 08-08-2013, 11:43 PM
RE: Hook Question - by xoft - 08-09-2013, 12:21 AM
RE: Hook Question - by NiLSPACE - 08-09-2013, 08:08 PM
RE: Hook Question - by xoft - 08-10-2013, 04:25 AM
RE: Hook Question - by xoft - 08-11-2013, 08:26 PM
RE: Hook Question - by NiLSPACE - 11-22-2013, 06:29 AM
RE: Hook Question - by xoft - 11-22-2013, 07:18 AM
RE: Hook Question - by FakeTruth - 11-22-2013, 08:14 AM
RE: Hook Question - by xoft - 11-22-2013, 03:51 PM
RE: Hook Question - by FakeTruth - 11-22-2013, 09:47 PM
RE: Hook Question - by NiLSPACE - 11-22-2013, 07:38 AM
RE: Hook Question - by xoft - 11-22-2013, 07:52 AM
RE: Hook Question - by xoft - 11-22-2013, 09:54 PM
RE: Hook Question - by FakeTruth - 11-23-2013, 06:51 AM
RE: Hook Question - by tigerw - 11-23-2013, 06:33 AM
RE: Hook Question - by NiLSPACE - 11-23-2013, 06:44 AM
RE: Hook Question - by tigerw - 11-23-2013, 07:12 AM
RE: Hook Question - by NiLSPACE - 11-23-2013, 07:17 AM
RE: Hook Question - by xoft - 11-23-2013, 07:19 AM
RE: Hook Question - by FakeTruth - 11-23-2013, 07:37 AM
RE: Hook Question - by tonibm19 - 12-31-2013, 05:11 AM
RE: Hook Question - by NiLSPACE - 12-31-2013, 05:20 AM
RE: Hook Question - by tonibm19 - 12-31-2013, 06:53 AM
RE: Hook Question - by xoft - 12-31-2013, 07:04 AM
RE: Hook Question - by NiLSPACE - 12-31-2013, 07:12 AM
RE: Hook Question - by NiLSPACE - 01-02-2014, 12:35 AM
RE: Hook Question - by tonibm19 - 02-03-2014, 03:28 AM
RE: Hook Question - by xoft - 02-03-2014, 05:16 AM
RE: Hook Question - by tonibm19 - 02-03-2014, 05:19 AM
RE: Hook Question - by xoft - 02-03-2014, 07:11 AM
RE: Hook Question - by NiLSPACE - 08-17-2014, 09:12 PM
RE: Hook Question - by ThuGie - 08-17-2014, 10:24 PM
RE: Hook Question - by xoft - 08-18-2014, 06:14 AM
RE: Hook Question - by NiLSPACE - 08-18-2014, 06:20 AM
RE: Hook Question - by xoft - 08-18-2014, 06:30 AM
RE: Hook Question - by NiLSPACE - 08-18-2014, 06:32 AM
RE: Hook Question - by NiLSPACE - 12-04-2014, 04:36 AM
RE: Hook Question - by xoft - 12-04-2014, 06:34 PM



Users browsing this thread: 1 Guest(s)