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