![]() |
What consumes RAM Client side? - Printable Version +- Mirage Source (https://mirage-engine.uk/forums) +-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61) +--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18) +---- Forum: General (https://mirage-engine.uk/forums/forumdisplay.php?fid=17) +---- Thread: What consumes RAM Client side? (/showthread.php?tid=1451) |
What consumes RAM Client side? - Rezeyu - 10-12-2007 For some reason, starting this morning, my client takes up 78k kb, using 81-100% of my CPU. I'm not sure why. Worse, I don't know where to start looking. The only thing I checked was that everything is cleared properly, but I don't see how that'd affect during runtime. In the menu, it uses 0%, as soon as the ingame packet is sent, it jumps to 100%. I'm not sure if It's a DX7 issue, possibly an error in the extra tile types, it could be the "NPCDATA" packet, I think it's being sent too often for every NPC. Ideas? ![]() Re: What consumes RAM Client side? - Spodi - 10-12-2007 The RAM usage is mostly going towards the graphic files most likely. They are all loaded into memory and stick there. CPU usage is probably due to a lack of Sleep in the game loop. I'll just steal what I PMed to William a while ago to prevent having to re-type it: Quote:First, get the Sleep API declared. Quote:I added the declare, but the only thing the client have remotly close to that code you posted is the fps cap: Quote:Yup, thats exactly it. So yeah, just add Sleep 1 below that DoEvents and you will no longer be an enemy of CPUs. Re: What consumes RAM Client side? - William - 10-12-2007 I already had the sleep declare so I think it's already in MS. Re: What consumes RAM Client side? - Rezeyu - 11-12-2007 It was already declared, but used nowhere in the code. I raised the FPS lock by 2 (to 35) and it dropped CPU usage by 10% on average. Added a sleep 1 as you said, and brought the FPS lock back to 33, and now it only used 3% CPU. =] Only reason I noticed the issue was because I kept freezing changing maps, like I would change maps, and I couldn't move anymore, and when that happened, my CPU would be at 100%. NPcs and Mobs were skipping too. EDIT: Sigh.. I still get stuck walking through maps randomly, like a 13% chance that when switching maps, I'm unable to move. Re: What consumes RAM Client side? - Rezeyu - 11-12-2007 I toggled breakpoints on all the Canmove = False lines, and when I'm frozen, none of them are triggered. Moving = 0, and IsTryingToMove is false. But NPCs and Mobs can still move around, warping to the map after being frozen fixes it. Re: What consumes RAM Client side? - L - 11-12-2007 You could add a /sync command. Send a packet to the server and simply warp to your current x/y. Just a thought. Re: What consumes RAM Client side? - Rezeyu - 11-12-2007 Thought about it, decided against it. I'd rather remove an issue than patch it up. Re: What consumes RAM Client side? - Rezeyu - 11-12-2007 =[ No ideas? Never happened to anyone else game before? Re: What consumes RAM Client side? - Robin - 12-12-2007 I have 50 different tilesets which are only loaded one at a time, so I only take up 1.55mb of RAM with that :] Gonna create an automatic sprite recognition system which will allow RMXP style spritesheets as well :D Re: What consumes RAM Client side? - Rezeyu - 12-12-2007 My compiled client uses 3.5 MB, and only 2% CPU now. My problem now is I'm getting the problem that I've seen other have, where you need to resync. I leave/enter a map, and am completely frozen. Re: What consumes RAM Client side? - Robin - 12-12-2007 Get a better server, or sort out your packets. Re: What consumes RAM Client side? - Robin - 12-12-2007 Actually.. I think Dave might have hit the nail on the head. Because it's simply the player stopping moving, it's most probably a problem with that sub. I've been meaning to remove the CanMove sub for a while, because it required twice the amount of work for the same effect as just having it serverside. Re: What consumes RAM Client side? - Rezeyu - 12-12-2007 Alright, I'll do that today. however the Canmove sub is never called when it happens. I added breakpoints on canmove, and all the canmove = false's inside of it, as well as every instance of 'istryingtomove' and everything detecting keypresses. None of them are triggered when I'm frozen, yet NPCs and Mobs are able to move. Re: What consumes RAM Client side? - Rezeyu - 12-12-2007 Well, I tried compiling and running.. And I noticed that ONLY when I freeze, upon exiting the game, I get the RTE 91, the object variable one. I'm not sure what object I've fucked up though. I must be stuck in something like you said, since that RTE is the one that usually pops up when you didn't end something right? Running through the IDE, I never get that error. Re: What consumes RAM Client side? - Rezeyu - 13-12-2007 Nope. I never use objects either, I used one for centering font once.. but took it out. I don't fully understand objects and such, so I don't use them. Whatever it is is client side, but why don't I get the RTE when running through the IDE? Re: What consumes RAM Client side? - Spodi - 13-12-2007 Wouldn't it be easier to just do: - Can I move here pl0x? Then either: - Ya shure, I tells everyone yous move'd or: - Lol u can't move, i dun process yer packet Quote:I never use objects either, I used one for centering font once.. but took it out. Thats because objects are worthless crap in VB6. Re: What consumes RAM Client side? - Rezeyu - 13-12-2007 But I haven't added any objects. The only objects being set are the DX7 Surface ones, and they're all release properly as well. I don't understand why the RTE doesn't pop up in the IDE or during Compilation. EDIT: I narrowed it down slightly.. you know that bit that displays "Receiving Map..." that's commented out? I had a gut feeling, and uncommented it. sure enough, whenever my player freezes, that message is displaying nonstop. Sooo... for some reason, the 'GettingMap = False' in the map completed packet isn't being read. For the time being, until I figure out Wtf is wrong, I added a gettickcount timer that sets it back to false after a few seconds, since getting a map never takes that long. But my coordinates are freaking out, so they must not be getting sent properly, but it happens so randomly.. I think it has something to do with my NPCs for some reason. Re: What consumes RAM Client side? - Robin - 13-12-2007 Rezeyu Wrote:But I haven't added any objects. Remove CanMove. ![]() Re: What consumes RAM Client side? - Rezeyu - 13-12-2007 But it doesn't even reach that sub, I'm stuck receiving the map. Re: What consumes RAM Client side? - Robin - 13-12-2007 Remove it :evil: Re: What consumes RAM Client side? - Rezeyu - 16-12-2007 I fixed it, it was that door tutorial, I completely forgot I added it. I decided to put breaks on the setplayerY/X's in the server side playermove sub. Which I dunno why I didn't do at first. I noticed that in 2/4 directions, the setplayerX/Y was never reached because of the fucked up door recognition. Now everything's fine as far as I can tell. EDIT: I celebrated by rapidly going back and forth between a map for like 78 seconds. Re: What consumes RAM Client side? - Rezeyu - 16-12-2007 It was driving me nuts, because I couldn't even figure out the realm of what I was looking for. Usually when something goes wrong you can at least figure out generally where to look, but this was evading me at every turn. XD I never actually looked at the "if tile=door" crap before, because at first glance it looks identical to the tile = key stuff. |