English When minimizing, everything slows down

12 replies
Goto Page
To the start Previous 1 Next To the start
Up
The Dark Shadow
User
Offline Off
As soon as i minimize CS2D, my PC slows down a little bit, and the CPU usage of CS2D goes crazy. Is it installing something on my PC? What is it doing?
20.09.21 07:08:57 pm
Up
Mami Tomoe
User
Offline Off
CS2D is an old game, with an even older engine.
It's just going crazy, it's not doing anything.
20.09.21 07:20:05 pm
Up
The Dark Shadow
User
Offline Off
Back in years, it wasn't like that. I never noticed anything like that
20.09.21 07:30:09 pm
Up
Mami Tomoe
User
Offline Off
Do you somehow find the idea of CS2D installing software in the background while minimised more likely than it just being old and not responsive enough to handle newer operating systems?
20.09.21 08:10:22 pm
Up
mrc
User
Offline Off
@user Mami Tomoe: ofc he did, its obvious
CS2DBR @ Comunidade Brasileira de CS2D | https://www.cs2dbr.com
22.09.21 04:16:46 pm
Up
MikuAuahDark
User
Offline Off
TL;DR: Engine limitation.

From Discord
user SQ has written:
Most likely just running endless loop without waiting for frame buffer since it's not active. You can find that easily on BMax engine code.
I've been looking at it and other stuff to fix some issues we had with memory exceptions after window got minimized or inactive.
That might be due to their FLIP() implementation and lack of track of window states.
file cs2d LuaJIT for Dedicated Server (13) JIT POWER! | Know your Lua errors! | Part of LÖVE development team since 11.3
22.09.21 07:02:45 pm
Up
DC
Admin
Offline Off
I didn't look into it but probably what user SQ said on Discord. Maybe try windowed mode (if you aren't already) or try to switch between OpenGL/DirectX.

Also @user The Dark Shadow I can assure you that CS2D doesn't do anything bad with your system. It does not secretly download/upload/install malicious stuff in the background or anything like that.

I guess it would have been removed from Steam by now if anyone would have noticed such a thing.
www.UnrealSoftware.de | www.CS2D.com | www.CarnageContest.com | Use the forum & avoid PMs!
23.09.21 01:37:54 pm
Up
The Dark Shadow
User
Offline Off
user MikuAuahDark has written:
user SQ has written:
Most likely just running endless loop without waiting for frame buffer since it's not active. You can find that easily on BMax engine code.
I've been looking at it and other stuff to fix some issues we had with memory exceptions after window got minimized or inactive.
That might be due to their FLIP() implementation and lack of track of window states.
I didn't know people talked about it in past in Discord. I'll try to be active in Discord. I doubt that's true, I can't convince myself that it's engine limitation. We never had issue with cs2d CPU usage in old versions of CS2D. It's quite a new issue. I just watched a very old video of CS2D where a player was on task manager and minimized CS2D and simply GPU didn't go crazy.

user DC has written:
I didn't look into it but probably what user SQ said on Discord. Maybe try windowed mode (if you aren't already) or try to switch between OpenGL/DirectX.

Also @user The Dark Shadow I can assure you that CS2D doesn't do anything bad with your system. It does not secretly download/upload/install malicious stuff in the background or anything like that.
I guess it would have been removed from Steam by now if anyone would have noticed such a thing.

@user DC: I tried all of them, nothing changed.

Is there a way to track what its doing? My PC really goes a little crazy when I minimize CS2D, It keeps freezing sporadically.

EDIT: It even uses 100% GPU when minimized.
edited 2×, last 23.09.21 02:11:30 pm
23.09.21 02:55:46 pm
Up
MikuAuahDark
User
Offline Off
user The Dark Shadow has written:
We never had issue with cs2d CPU usage in old versions of CS2D. It's quite a new issue.

Not really. thread cs2d 【東方】Bad Apple!! 【影絵】 in CS2D was posted on 2017 and the issue of CS2D eating CPU has been noted in that thread.
user VADemon has written:
There's a bug within CS2D: the game will need much more CPU resources when the game window is not active.
file cs2d LuaJIT for Dedicated Server (13) JIT POWER! | Know your Lua errors! | Part of LÖVE development team since 11.3
23.09.21 03:22:57 pm
Up
The Dark Shadow
User
Offline Off
@user MikuAuahDark: Maybe, I never noticed that then.

Anyways, It's fixed now after using Cheat Engine and modifying some addresses somehow. Thanks to a few of discord members.
https://media.discordapp.net/attachments/584404008848850947/890585937564815430/Capture.PNG

Even memory usage reduced by 200MB

EDIT:
BOT AI has written:
One of the things it does is opening all existing local process objects and retrieving the base name of modules in a loop, and uses it for something else or something like that

it doesn't even have access to all of em unless you run CS2D as administrator (for some more)

Quote:
just simply replace address 006366DD to 006366E4 with NOP or 0x90 then you won't have to deal with it anymore, no big deal lol

0|006366DD:83->90
0|006366DE:C4->90
0|006366DF:04->90
0|006366E0:E8->90
0|006366E1:06->90
0|006366E2:A7->90
0|006366E3:F8->90
0|006366E4:FF->90

Quote:
basically it was pretty much caused by the CS2D naive usermode anti-cheat

Quote:
As soon as you minimize the game or unfocus, it will start calling OpenProcess about 5000 times in a second, 300K in a minute, 3 million in 10 minutes. (if i did the math correctly lol) (at least for me)
to detect "banned" processes names
Replacing these addresses with NOP makes it when you unfocus to not call the "SearchForBannedProcesses" function
if you dont know whats OpenProcess, it opens an existing local process object.
that anti-cheat is so bad and quite useless, as not only it ruins your game experience, but it also cant access to all processes
so cant detect some of the hacks or banned processes lol

also its not only that, there are many more calculations and calls it does
edited 3×, last 23.09.21 04:52:42 pm
23.09.21 04:59:38 pm
Up
mrc
User
Offline Off
oh, so the issue was found. @user DC: it will be fixed?
CS2DBR @ Comunidade Brasileira de CS2D | https://www.cs2dbr.com
23.09.21 08:32:57 pm
Up
SQ
Moderator
Offline Off
@user The Dark Shadow: you are right.

@user DC:
There is old ac_chckprc() function that calls active processes every frame. Probably should be disabled as it is not even effective anymore.
edited 1×, last 24.09.21 08:03:58 am
25.09.21 03:47:07 pm
Up
The Dark Shadow
User
Offline Off
When will CS2D be updated?
To the start Previous 1 Next To the start