• Making entities think faster?
    5 replies, posted
Is there a way to make entities think faster? Is there an alternative to entity thinks (that isn't Gamemode's think.)
[QUOTE=Hentie;26352363]Is there a way to make entities think faster?[/QUOTE] [b][url=http://wiki.garrysmod.com/?title=Entity.NextThink]Entity.NextThink [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] to make a lua entity think faster,just set self:NextThink(CurTime()) and it will run pretty fast. [QUOTE=Hentie;26352363]Is there an alternative to entity thinks (that isn't Gamemode's think.)[/QUOTE] Not sure what do you mean there,but if you need this for your H.A.T tool,i think the best way is to create a lua entity and via parenting it to the ragdoll/entity you need to control,you will use its think function to do whatever you want on the target entity.
[QUOTE=Jvs;26352447][b][url=http://wiki.garrysmod.com/?title=Entity.NextThink]Entity.NextThink [img_thumb]http://wiki.garrysmod.com/favicon.ico[/img_thumb][/url][/b] to make a lua entity think faster,just set self:NextThink(CurTime()) and it will run pretty fast. Not sure what do you mean there,but if you need this for your H.A.T tool,i think the best way is to create a lua entity and via parenting it to the ragdoll/entity you need to control,you will use its think function to do whatever you want on the target entity.[/QUOTE] Thanks, I'm already doing that. Entities are moving fine, except for how they think really slowly. :/ Thought it would work, but this wouldn't solve my framerate issues.
[QUOTE=Hentie;26352496]Thought it would work, but this wouldn't solve my framerate issues.[/QUOTE] The low framerate issue might have been caused by too many loop operations done in the think function. From the thread i have read that you are recording all the physical objects movement of every entity in the map,might be that?
[QUOTE=Jvs;26352698]The low framerate issue might have been caused by too many loop operations done in the think function. From the thread i have read that you are recording all the physical objects movement of every entity in the map,might be that?[/QUOTE] Yeah, I already knew that. I was kind of hoping that the entity's thinking were multithreaded, but it's unfortunately not. I might be able to hook onto the physics thinking, though.
Yeah, unfortunately lua is only single threaded.
Sorry, you need to Log In to post a reply to this thread.