[12:33pm] <yellowperil> [14:24] <yellowperil> did u hear my idea, the one I was talking to rolorga about
[12:33pm] <yellowperil> [14:24] <yellowperil> we spilt the world into a grid
[12:33pm] <yellowperil> [14:25] <yellowperil> when a mob is spawned it doesnt have any AI assigned to it, eg its not in the ai thread
[12:33pm] <yellowperil> [14:25] <yellowperil> when a player enters a grid, all the mobs in that grid will be activated, and added into the ai thread
[12:33pm] <yellowperil> [14:26] <yellowperil> my thinking on this was that we could cut down heavily on alot of work if the AI thread was only working on mobs it requires
[12:33pm] <yellowperil> [14:26] <yellowperil> eg you wont ever find every part of the map being all used at the same time
[12:33pm] <yellowperil> [14:27] <yellowperil> depending on your grid 10x10, 100x100, 50x50
[12:33pm] <yellowperil> [14:27] <yellowperil> you could actually half the number of mobs in the AI thread
[12:33pm] <yellowperil> [14:27] <yellowperil> all you would have is a check on the player movement
[12:33pm] <yellowperil> [14:28] <yellowperil> if they enter or attack a mob in a de-activated grid, all the mobs in that grid are activated (added to the ai thread)
[12:34pm] <yellowperil> [14:28] <yellowperil> say after 10 mins, the grid is checked to see if anyone is in it, if not remove the mobs AI from the ai thread
[12:34pm] <yellowperil> [14:29] <yellowperil> so instead of 18k+ active ai mobs, moving walking around, you may actually only have 5k active ai mobs
[12:34pm] <yellowperil> [14:30] <yellowperil> say you run a big siege, 90% of players go into that grid, you may actually end up with maybe 5 grids, with maybe 1k mobs that are actually active
[12:34pm] <yellowperil> [14:30] <yellowperil> so for a siege you have really cut down the number in the mobs ai from 18k to maybe 2k
[12:34pm] <yellowperil> [14:31] <yellowperil> the more grids you define the less grids that will be activated
[12:34pm] <yellowperil> [14:31] * godson has quit IRC (Nick collision from services.)
[12:34pm] <yellowperil> [14:31] <yellowperil> shoudll 18k mobs be moving around when you may only have 10 or so grids actually being used
[12:35pm] <godson> i like this idea
[12:36pm] <godson> but how would you split it in grids?
[12:36pm] <godson> thats quite alot of work on its on also
[12:36pm] <yellowperil> simple
[12:36pm] <godson> when spawned, doing a check on the mob etc
[12:37pm] <yellowperil> we have a x,y loop
[12:37pm] <yellowperil> basically we start at top left
[12:37pm] <godson> ahh got ya
[12:37pm] <yellowperil> break the world into x,y
[12:37pm] <godson> <-- noob hehe
[12:37pm] <yellowperil> I want my world to be 10,10
[12:38pm] <godson> ya
[12:38pm] <yellowperil> the bigger the grid the less mobs will be in the AI thread
[12:38pm] <godson> true
[12:38pm] <yellowperil> we basically have the AIGRID as a .properties value
[12:38pm] <godson> so where would you add the check for players movement to activate a grid?
[12:39pm] <yellowperil> so you can either disable eg 1x1 or have as many as you want
[12:39pm] <yellowperil> every move
[12:39pm] <yellowperil> but its done already
[12:39pm] <yellowperil> zonecheck
[12:39pm] <yellowperil> basically this works exactly like zones
[12:39pm] <godson> wont that be uhmm cpu intensive?
[12:39pm] <godson> uhm..
[12:39pm] <godson> k
[12:39pm] <yellowperil> 1 when a mob is spawned its added into a fastlist for that grid
[12:40pm] <yellowperil> so each grid has a fastlist of mobs
[12:40pm] <yellowperil> but no ai
[12:40pm] <godson> ya
[12:40pm] <yellowperil> when a player moves all we do is get the zone its in
[12:40pm] <yellowperil> or AIGRID its in
[12:40pm] <yellowperil> if the grid is not activated
[12:41pm] <godson> also add a check that if a grid is already active, return;
[12:41pm] <godson> ya
[12:41pm] <godson> cool ;)
[12:41pm] <yellowperil> activate grid, when a grid is activated, all the mobs in the fastlist for that grid are added into AI
[12:41pm] <godson> and when deactive, then remove all mobs in that grid from AI thread?
[12:41pm] <yellowperil> if a mob is attacked and AIGRID is deactivated, then activate grid
[12:41pm] <yellowperil> yep
[12:41pm] <godson> :))
[12:42pm] <yellowperil> say start a timer to say check this grid again in 10 mins
[12:42pm] <yellowperil> or we have a dedcated thread to look after the timer for all grids
[12:42pm] <godson> ya
[12:42pm] <yellowperil> basically all we need to do it, make a AIGRID, add the mobs into that AIgrid at spawn
[12:43pm] <godson> yap, when you going to start on this feature?
[12:43pm] <yellowperil> when grid is activated we turn on the AI/ add the AI into the ai thread
[12:43pm] <yellowperil> beyond my coding skills
[12:43pm] <yellowperil> I am better at theory and ideas
[12:43pm] <yellowperil> sorry :(
[12:43pm] <yellowperil> I would say the steps are like this
[12:44pm] <yellowperil> 1-create a fastlist of AIgrid dependant on your x,y
[12:44pm] <godson> ah
[12:44pm] <yellowperil> 2-add the mob entry into the fastlist for that gird at spawn
[12:45pm] <yellowperil> when a player moves we activate a ai grid, this either activates or adds the AI in the thread for that mob
[12:45pm] <yellowperil> 3 when a mob is attacked do like 2
[12:45pm] <yellowperil> 4 deactivate AIgrid when no one is in it
[12:46pm] <yellowperil> basically all we are adding is an on/off switch for AI or on/off, add/remove
[12:46pm] <godson> ok i will have to speak to wooden about this
[12:46pm] <godson> his working on AI
[12:46pm] <yellowperil> I think you could actually get better performance overall with removing 18k cycles in ai thread by replacing it with maybe x,y cycles for aigrid
[12:47pm] <yellowperil> well if you did this before woodens stuff
[12:47pm] <yellowperil> this is a big change in the process, but not code wise
[12:47pm] <yellowperil> I dont see it taking someone with knowledge that long to do at all
[12:48pm] <godson> thats true