Tuesday, May 21, 2019

Monster Storage and high CPU Usage, TNR News

Hey guys, It's been quite some time since I last posted news on this project, I've been a bit... down... latelly, but possibly I'll feel better the next weeks.

Now let's talk about the stuff, and yes, that I mean the Tamers Network Project. I've been doing some tweaks on some parts of the game, even though looking at the codes again, I'm sure that there are way better ways of making the engine do stuff. I removed some codes related to humanoid characters (player and some npcs) from the general tamer script, so the game will be a bit lightweighter on the memory on the run time.

Another thing I've did, was implement a storage system for the game, differently from... One of the versions of TNR released, all monsters in the storage wont be loaded with the player, instead, will be loaded when you open the monster storage window.

Here a look on how it looks right now:
The greatest mystery for me is how to make it less confusing, since if you had the experience of messing with that, you would probably be lost when trying to browse it. For example, try to find the selected slot in the storage.

Maybe if I make the border of the selected slot bigger would make it easier to find the selected slot, I'll have to test that out later.

Meanwhile, an old issue has returned, the high CPU usage, when debugging the game, the CPU usage went to 85%, at least on my pc. My pc is low end, so possibly the cpu usage will be lower on more powerful pcs, but still, It was kind of worrying the issue.

I've first begun testing to see what was causing the issues, until I noticed that was related to the script used on npcs and the player, disabling it seemed to have solved the issue, but If I kept it disabled, we would have no npcs or even a playable character in the game, so I've kept on the debugging. I've been commenting some codes here and there, and even saw some false alerts that the problem was solved, until a little thing that happened gave me the clue of what was the problem.

Since the beggining, the issue wasn't related to updating the actors(player and npcs), but was kind of related to drawing, actually, not even the drawing scripts was the issue causer, It instead was related to the script I use to draw text with borders, for some reason the 5 times drawing was causing issues, so I had to change the script for something more simpler, made so It draws a the text with the choosen color, and in the background has a transparent black targe.

Well, that fixed good part of the issue, I'm not even having slowdowns on the main menu after the fix, check by yourself:
Even though the abusive cpu usage was solved, I believe I can still lower the cpu usage, but I'll still do some checkings and try finding other things that might be causing an abusive CPU usage. Beside that lead me into thinking if...

Oh boy, I guess that fix opened up a new window. :D

Well, that's all for today's news. And wow! 4:50am. Not that It's a special thing, since I've used to stay up late before... I kind of have no idea why so special so... Well, whatever.

Until next news.

No comments:

Post a Comment