Forum

> > CS2D > General > Please Report All Current CS2D Issues
Forums overviewCS2D overviewGeneral overviewLog in to reply

English Please Report All Current CS2D Issues

37 replies
Page
To the start Previous 1 2 Next To the start

old Re: Please Report All Current CS2D Issues

SQ
Moderator Off Offline

Quote
More like performance on low & medium settings. Optimized game engine so it draws about 2-3 times less of images.
edited 1×, last 07.03.17 10:01:04 am

old Re: Please Report All Current CS2D Issues

BCG2000
User Off Offline

Quote
user Starkkz has written
@user BCG2000: It's just impossible that this could happen because the Lua engine wasn't even touched, it's just the import that was changed back then.

Edit: LuaJIT's garbage collector performs minor and major collections, minor collections just release little memory spaces while the major releases everything else.

If you tried the jit-version perhaps you could've only experienced the minor garbage collection.

1
2
3
4
5
6
7
8
9
addhook("always", "_always")
function _always()
     local PList1 = player(0, "table")
     local PList2 = player(0, "table")
     local PList3 = player(0, "table")
     local PList4 = player(0, "table")
     local PList5 = player(0, "table")
	msg(collectgarbage("count"))
end
I only used a slightly modified version of your code to visualize that.


I wouldn't be reporting this if it was impossible. It is not instantly visible, you need to leave the server running for quite a while to notice it.

If you still doubt me, here is a proof:

IMG:https://i.imgur.com/PdPT3KH.png


The dedicated server using 5.8 MB RAM was opened just before taking the screenshot while the server using 204 MB RAM has been running for almost two hours (same thing for the client). No scripts were added, no files were modified, only bots were used (because bots are Lua too).

Here is what I did:

1) Downloaded latest client and dedicated server from Unreal Software, no files were modified, vanilla game.
2) Started the game, the only setting changed was to fill the server with bots, nothing else was changed.
3) Confirmed changes and closed the game.
4) Started the dedicated server and left it running for almost 2 hours to show the (very visible) memory leak.

I also opened the client after running the dedicated server to show that it happens on the client too. Since I used bots, you can see that it's really the game's fault. And to make it clear, it can happen on any script, not just bots. The same thing happens on Linux.

This is a real issue, and must be fixed. It's really a problem for dedicated servers because they are left running for days. If in almost 2 hours it can reach 200+ MB RAM usage, imagine on a whole day, especially if it's running other big scripts.

old Re: Please Report All Current CS2D Issues

SQ
Moderator Off Offline

Quote
Might look into this problem with memory leaks. Though if the issue is related with Lua lib, I won't spend time fixing that.

Found out that many particles and other visual objects are being created in dedicated (which takes a lot of memory), might find a solution to disable it.
edited 2×, last 07.03.17 01:03:24 pm

old Re: Please Report All Current CS2D Issues

Starkkz
Moderator Off Offline

Quote
@user BCG2000: Are you sure that this is actually the Lua memory and not the overall dedicated server memory usage?

You should perhaps generate some logs every minute based on the
collectgarbage("count")
function, BlitzMax is still known for leaking memory on cyclic objects.

old Re: Please Report All Current CS2D Issues

BCG2000
User Off Offline

Quote
@user Starkkz: Yes, I'm sure. If no Lua scripts are used, the memory never leaks, which is something I also tested before.

You can easily test it yourself too, run 2 dedicated servers, one with bots and one without bots, no other scripts, leave them running for a while. The one without bots will have normal RAM usage because it's not using any Lua scripts.

old Re: Please Report All Current CS2D Issues

SQ
Moderator Off Offline

Quote
@user BCG2000: That is incorrect. Bots in the server triggers a lot of events including shooting, killing, making particles and other things. Server does take that into account. Get 32 people playing in server without lua script and see if memory leak appears. hehe.

old Re: Please Report All Current CS2D Issues

BCG2000
User Off Offline

Quote
@user SQ: I was only using the bots as example because they are a script that all CS2D clients come with and thus discards the argument that it's my own code causing the problem.

You can even just leave the server running with the test code I posted earlier (the one that creates 5 player tables on hook always), leave it running for a hour at least, see how it leaks memory. But it will be slower since it's not as complex as the bots' script.

It even happens with your achivements script, any big script suffers from this. So I can say that the player count is irrelevant, a full server with 32 players and no scripts won't leak memory.

But if you guys wanna insist that the issue I reported doesn't exist and that I'm wrong, OK. I already did more than enough to report it and prove that it exists.

I'm not gonna post about it here anymore because it's been dragged on for too long. Good luck.

old Re: Please Report All Current CS2D Issues

Starkkz
Moderator Off Offline

Quote
The changes aren't that much, it's just necessary to change the 'src' folder of the Pub.Lua module with a newer one. Major changes happened on Lua 5.2, where I think, some functions were removed but I'm pretty sure they're not even used on CS2D's source code.

Usually the best solution is just to rewrite the necessary macros on BlitzMax, there are some functions which are surely going to stay always the same.

If you ever consider changing to Lua 5.1.5 >

old Re: Please Report All Current CS2D Issues

Hajt
User Off Offline

Quote
@user SQ: Can you consider adding a new hook?

prejoin - trigger if someone trying to join, didn't load the map
join - trigger if someone is fully connected with the server and is in-game mode

old Re: Please Report All Current CS2D Issues

Ahmad
User Off Offline

Quote
what about gas grenade damage through walls? maybe add an option to disable it in server settings..if that makes sense

when you use /quit, you actually stay connected to the server for a few seconds then you disappear (that's what other players see), it's enough time for you to open cs2d again, join the server and see your ghost player standing there before he disappears.. is this how it's supposed to work?
To the start Previous 1 2 Next To the start
Log in to replyGeneral overviewCS2D overviewForums overview