ID:135586
![]() Jun 1 2004, 12:13 am
|
|
Why has Dreamseeker been resently taking over half my CPU Usage PER dreamseeker? It used to take like 10% for 2 put together. Can someone make sense of this?
|
Regular ticker with spawned() stuff. If your ticker event takes longer than your ticker delay, you get a build up.
50%? Bah. I once saw a game eating a full 98% of a CPU. And that was through a Linux shell command, not the odd CPU var. |
Yeah, Aaiko hates hosting Seika 2 because his CPU Usage jumps to 100% and doesn't wanna move from it. And when someone joins, you can't do anything for about 10 minutes.
|
That's actually painful. If it jumps to 100%, it's probablary because of several infinate loops, several NPCs and an inefficient character generation and world/New().
|
Then, theoretically, there shouldn't be a problem. Just as long as you don't have a while(1) loop or anything like that.
|
well actually I recently changed it to
proc/met_step_rand(atom/movable/a) But that should basically do the same as step_rand without the diagnal walking. |
Metroid wrote:
well actually I recently changed it to Nope, not quite. step_rand() uses an edge-following system which makes the AI only change direction at semi-random intervals or when the next step would take it into a dense object. This usually produces a more "aimless" random movement system, instead of a "mindless" random movement system, but has a disadvantage that, unless you force the AI to pause and change its direction manually, it can -- possibly -- eventually wind up just walking in a fairly continuous loop around the edges of the map. Deadron has his own routine, dd_step_rand(), which provides an excellent mix between random mindlessness and deterministic aimlessness -- and offers more parameters than the typical step_rand() proc, allowing you more flexibility. I'm not sure which library it's in, however, so you might have to do some digging. |
Poor programming.