So, I was playing around with BYOND and I noticed it was using a lot of CPU, for basically doing nothing.
After playing around, I pinned it down to what it is exactly.
1. The view size needs to be 9 or larger.
2. A mob with a client attached to it needs to be moving.
3. There needs to be a lot of turfs in the view with over/underlays. (These can just be placed using the map editor, a tree for example would suffice).
4. These turfs need to have fairly large icons (bigger than 96x160, I just tried 96x128 and nothing)
If these 4 conditions are met, a single client moving, while doing nothing else will cause cpu usage to jump to 3-6%.
I haven't tried it with more than one player, but if this CPU increase is per player, that is kind of worrying.
Is there any actual reason this happens? And is there anything that can be done to lessen it?
If you need proof of this happening, you can find it here http://files.byondhome.com/TheMagicMan/Test_src.zip
On my computer this uses upto 5-6% cpu when moving around.
ID:1408991
Oct 29 2013, 8:43 am
|
|
Oct 29 2013, 8:52 am
|
|
Are you sure you're not using software rendering instead of hardware rendering? The amount of pixels needing to be drawn is exponential in relation to world.view
|
In response to Topkasa
|
|
Hardware mode. But I just tried in software mode, it's exactly the same.
|
I have noticed this, even with large view sizes and nothing but default 32x32 turfs. Actually I had to shrink the view size when I was making ASCII because even in text mode, the game was slowing down with too large of a view. Of course, my computer is very old and slow, so that compounds the problem. But that has given me a nice strict rule to follow - if it runs great on my computer, it probably runs even better on everyone else's...
EDIT: When I run your test, CPU only read 2 at maximum EDIT 2: Try setting fps to 60. My CPU reading jumps up to max 15 |
With the view-port that large and with that many appearances and whatnot visible you're causing a ton of communications chatter and information to be passed back and forth, it's not surprising you're seeing high CPU usage.
|
If you want to create a bigger view, you could try increasing the icon size. I tried this and it runs just fine - what I mean is, it seems that the number of atoms on the screen is what makes the difference, not the number of pixels. But I haven't really looked into this deeply so I don't know what I'm talking about :P
|