Lua Execution / Alternative to in-game execution?

Hey there.

Running garry’s mod for 8-12 hours while on-and-off programming Lua, my laptop tends to start reaching max temperature (203F) due to not only running the code, but calculating graphics, bot movements, etc. This led me to research a possibility, which I couldn’t find said question being asked previously.

Is it possible to run Lua code, even if it’s just derma, outside of the client? Such as a webpage that tests the code, or an application that isn’t as CPU/GPU dependent?
If not, what ways can I reduce my heat generation and CPU demand while testing the code without opening/closing/opening/closing/opening/closing Garry’s Mod every 15-30 minutes?

If it doesn’t require anything gLua specific I use this:

Running your code is most likely not contributing to this at all, and the problem is simply rendering the game for a long period of time.

You should turn VSync on and lower your graphics settings to start.

If you can separate your code out into non-gmod dependent stuff, you can use busted. This still won’t let you run a game instance for 8-12 hours though. You mention bot movements and graphics, can you clean up the server every time your code is refreshed? Is there anything specific going on that you can’t just restart the instance, and not close down/restart the game?

You could cap your fps at 10, 15, or 20, that will keep your computer at a low temperature and put less load on your gpu.

There’s no option to do that, which is why I suggested VSync which will cap at your monitor’s refresh rate (most likely 60).

fps_max in console

You should also look into better cooling for your laptop. For a game like Garry’s Mod, there’s no reason your laptop should be getting that hot.

I’m starting to think that. I’ve been running GMod for 2 hours and my CPU temp went from 37 -> 56 -> 67. I’m going to try out VSync.

Thanks for the recommendation. I will definitely use that for basic Lua related things.
I added a cleanup call, that net.Send’s to the server when I save client code. Helps keep the lag down.
I usually just close the game when CPU gets up to around 85, and then go get a drink and it’s back down to the 50s by then.

I’ll try that out as well as VSync, thank you!

Garry’s mod is an event driven game. To run code outside of it, to test for it, is meaningless in this case. You could implement a system whereby you trigger events manually outside of the game, but as most functions are reliant on engine code we can’t see, there’s no way to replicate it.

TLDR: You could, but what’s the point if it doesn’t give you any usefulness.

You can get some pretty cheap laptop coolers on amazon
Its better for the longivitey of your device

Setting my FPS cap to 25 has kept my CPU temp below 73’C, whereas I was pushing 85 to 95 earlier. Thanks for the feedback!