ID:1948675
 
At 60 FPS, when I have even 16 players on the screen at once, the client starts to lag. This happens whether I use images for parts, overlays for parts, or one single icon. But the thing is, it doesn't SEEM to get any slower once it hits a certain cap (though I'm sure that's just my eyes decieving me). So 100 players lags about the same as 32 players. And it is definitely the client, because even when I turn off all logic, it still happens, only when the multiple players are on the screen. What's even funnier is that it only happens with my players. Everything else renders quickly. Should I put in a feature request for this? How feasible would it be? I heard Dream Seeker uses blitting. Perhaps the next version of the webclient will improve things, because I heard that Lummox found something that might fix the FPS issues with it. But what about Dream Seeker? I plan on using solely the webclient once everything is fixed (mainly the animate() not working with images that aren't showing) with it, but for now, I'm also supporting Dream Seeker. My icons are 64x64. Do you think that has anything to do with it?
Have you tried lowering the FPS to 30? Could it be some section of your code that is introducing the problem?
Do a CPU Profile of your game and post the screenshot.

I would definitely focus on that next update that fixes the FPS issue (I am not even touching webclient until that update is out). Clearly it isn't a logic related issue if, upon turning it off, there is no change in the result.

I would suggest that it has to do with the animate/image bugs and the FPS bug in the webclient.
Do you reproduce these same results in Dream Seeker?

Have you tried doing any debugging by disabling the image/animate system and testing the player count then? What byond version are you using and is hardware acceleration turned on or off for you?
My CPU is 100% fine. At 101 players, it averages out to 75% CPU usage, so I really doubt it would be server CPU usage if it were possible to be anyway. "And it is definitely the client, because even when I turn off all logic, it still happens, only when the multiple players are on the screen." - That rules out the server CPU usage issue as well. Also, I'm not using animate() much at all. And I'm using Dream Seeker, not the webclient. Of course the webclient currently has a bad FPS rate, we all know that, I think. I have tried disabling the animation system I have in place, which doesn't even use animate() anymore. I'm using either 508.1299 or 509.1301, it happens in both. Hardware acceleration is turned on.
In response to Kamuna
You can find your version info in the gear icon on the byond program and under "about byond".

Have you tried using any versions prior to the animate implementation? There are bugs with animate and images that have been recently fixed and they could very well be apart of this problem. Have you tried turning Hardware accel. off?
75% usage is pretty high so it would seem counter-intuitive to turn hardware accel. off, but it is byond so you never know.

Have you tried disabling the culprit systems entirely? Try running that many characters without any image overlays or otherwise and check the results.

The profiling during hosting would be helpful to see so that people can determine which procs or globals (or whatever) are using the most resources and perhaps track down a further route to the solution. Host a game and go into options and start a profiling of the game, maybe it will offer some kind of insight for someone.

Have you tried a 507 version?
My thoughts are disabling the image system entirely and checking the results (that would narrow down if it is indeed the system or not). Do you get the same results with software mode? Have you tried checking any of the differences of renderers in the webclient? Hmm...

There is also a bug with big graphics but I don't know if that would apply to this case.
I already know which version I'm using, I'm just saying it happens in both. I'm using version 509.1301 right now. Did not try any 507 versions. 75% is definitely not high for 101 players at 60 FPS with pixel movement. I have disabled the culprit systems before. I tried turning HW acceleration off. It wouldn't show up in the server profiler because it is client-sided.
In response to Kamuna
Would it be possible to toss a demo/source to Lummox? I think that might be required because there isn't really enough information about the issue to provide enough answers to help! It could be code, it could be the client, or some other strange thing we haven't thought of yet.

Lummox could probably figure it out if he had the project, though. You've got me stumped! Clearly there is some kind of issue and a good hint is that it reaches a cap and doesn't get progressively (or noticeably) worse even with more players. However, whatever it may be is a mystery to me. Without some sort of code to look over or some other tangible problem that could be associated with your situation, I'd say that only someone extremely experienced with Byond could figure it out (such as lummox!).

I would like to see the results of trying his fixed version and see what that does for you; However, beyond that I don't really have any more thoughts to share. Hope somebody can track it down for you! :)
I've found the culprits. My vision code, and changing layers of too many objects at once, both frequently called. It doesn't cause any server lag, but it does cause much client lag. Now that we have the plane variable, I can put the map on SIDE_MAP and don't have to do the layering trick anymore, but now I gotta figure out how to fix up vision.
In response to Kamuna
Great! Can't argue with progress! :)
If you have a large view size (in terms of tiles) and you don't have any visible areas, it helps to set area.invisibility to 101. It shouldn't help, but last I checked, it actually does ease client rendering by decreasing the number of atoms being considered for drawing.
Oh wow, that's good to know. Thanks. I "fixed" the problem by having the server skip my visibility code in single-user mode, and instead just let every mob see every other mob no matter what (not like it matters in single-user mode), and not render the pretty effects for vision culling. I also did tiny but effective optimizations on the movement, combat, and sleep logic. (my crappy CPU can hold 101 players now!). The client was rendering fine in multi-user mode.