ID:169735
 
My Problem: I am working on a rather large game at the moment. I will currently have an estimated 1.2k mobs, and more later. In the past I had this many (Same game) and the CPU was still fine, in the 30s area. Now I have put different mobs in and the cpu is at 80 and not going down past that. I even tried removing all running procs from the game, (even checked with profilling, only 3 procs goin and they werent doing anything)and the cpu still remained high.

My question: Why is the game's CPU acting up? How do I fix it? ((Let me remind you that this is with basically no procs running.... WITH monster procs running the cpu was about 120ish, but I have lagsaver codes in my monster procs so it isnt as high as it could be))

In Closing: Thanks for your time.
No one replied, so I bounced it back up again.
The only thing we can guess at is that it probably has to do with your code.

Perhaps you could only have things exist in the world when need be. Stash things away in savefiles when they are not in use, then bring them back shortly before they may be needed. Other than that, I don't know.
What's a 'lag-saver' code?
Lummox JR has just posted a new article over at BYONDscape, maybe you can get some ideas from there.

Dream Tutor: Green Programming
In response to Elation
Elation wrote:
What's a 'lag-saver' code?

That thing vakir wrote that does a bunch of crap.

~>Jiskuha
In response to Jiskuha
Jiskuha wrote:
Elation wrote:
What's a 'lag-saver' code?

That thing vakir wrote that does a bunch of crap.

~>Jiskuha

A "lag-saver" isn't real though (atleast at runtime, unless you totally change the DM language). What Lummox did, it's a "lag-saver", yet not at runtime. :p
AJX, if an NPC can't be seen by a player in a given moment, or isn't on the brink of being seen, then it shouldn't exist in that moment.
In response to Hell Ramen
Actually, both of you are wrong. My lag saver code is just little tidbits in the code that save CPU usage one way or another.

Anyway-- Thank you everyone for your input, someone else suggested Lummox's entry, and that worked fairly well. Thanky
In response to AJX
AJX wrote:
My lag saver code is just little tidbits in the code that save CPU usage one way or another.

i'm curious- how do you do that? if it works out as you claim, then 'spreading the word' on how to reduce lag in our games is *definitely* a subject for this section of the forums!

spill the code, man! we demand lagless...ness...
In response to digitalmouse
Lmao... When I say that I mean little things like cutting off unnecessary parts of code, or throwing in sleep(0) and sleep(-5) here and there. Nothing special, and nothing that can be applied to other bits of code (Not counting the sleep(0) and sleep(-5) thing, that works everywhere)