RobertMKD's Forum Posts

  • But then I will never know if 'CustomMovement' is the problem. Because I can't move the player without this behaviour.

    I have created my own moving system, but that system was very inefficient for my CPU, it would pass beyond 200% once I issue the player to move, and then go back to normal but it surely caused a lot of lag. This is because, every few sec I had to move the player a bit and check if his XY is the same of some objects that are on his path (I calculate the path and the XY of the objects on it before I call the move function).

    So, I realized this system is even more inefficient and it has a lot of improvisation in it, so I have returned to my 'CustomMovement'..

    So, if this behavior is the problem, then maybe I am doing something wrong with it?

    Here's a picture but I doubt it would help. I really have no idea what may be wrong with this behavior...

  • The collision checks are okay, the image size is also fine.

    But you are engine and draws calls are really high in CPU using, and that's just CPU alone if we take the GPU into account it will be probably even worse. I did a comparison with the games worked on and made, and all of them take around 1% for draw calls and between 0.5-1% engine.

    Your problem can be caused by those two, high draw calls means the engine is trying to render a lot of spires at once, and if those images are also animation that can cause even further problems. You can improve this by reducing the resolution size of the game so less objects can be viewed at once, also if you spawn new objects on the layout while the game is running or using particle effects try to minimize that, instead of creating the objects on layout create them while its loading and then teleport them where they need to be.

    On the second picture you showed where the player is moving they are two event groups that take 14% of CPU power, which ones are those, I was unable to identify them from the picture? You can also try to tweak those because 2x14 is around 28% usage which is high.

    And now for the engine usage, the engine usage in the debugger is only for the behavior and some other c2 stuff, which means if you have high usage is probably caused by same behavior, I don't know which one, but some of the is using a lot of CPU, you will have to figure that out, make a back up copy of the game and start deleting the behaviors and see which one improves the performance.

    Hi, thanks for the reply,

    First, the CPU usage for these two event sheets is rarely that high, it is usually around 3-6%, but sometimes random events just appear with some crazy value and then they are back to normal again, so it's not that high as it is in the second picture.

    As for the engine, yes, it is really high, sometimes it gets up to 22%. If it is a behavior the problem, then the first suspect would be 'CustomMovement', because the engine's CPU raises only when I move the player.

    'CustomMovement', 'DestroyOutsideLayout' and 'Pin' are the only behaviours in my project (however 'pin' is very rarely used in this layout).

    Well one quick check to see if it is rendering the issue would be to change the quaity of the rendering (fullscreen scaling) to low and test (it's a project property that is on high by default, more infos in the manual but basically it will not scale up the game assets if needed which should improve the perfs if it is indeed GPU bottlenecked)

    I'm not sure it's caused by it but I'll ask anyway: why not use a tilemap for the ground? you can set it up to be different each level.

    It's very weird though, as it seems simple ad so I don't see why it operates poorly, how are you testing on mobile too?

    Hi, thanks for your reply,

    I have set the 'Fulscreen Scalling' to No as you said, so it didn't make much difference in the graphics (since I've also set 'Sampling' to 'Point') and I need to test this out on a mobile, because my problem is harder to notice on a PC.

    As for the ground, I am not really experienced with tilemaps (or I would say, I'm a noob), but I also think it won't make much difference. Another thing that I should note is that the image of the 'Tiled Background' is 250x250. I can't make it smaller, it needs to be the same size as my grid. But I doubt that the image size is the problem here.

    edit: I have tested the game with 'fullscreen scalling' to no, but there is no difference.. :/

  • when the player is idle

    when he's moving

    again when moving, but this time you can see the draw calls and engine...

    The largest images in the layout are over 41x58 (maybe it's small, but I had to try and minimize them and test the difference)

    And there's also the image of the UI 100x550. I can't make this one smaller....

    There's over 10-15 animated objects in each level. They change frames every 0.12 sec..

  • I have checked all those stuff. I have reduced collision checks to over 200 per tick. There's bo line of sight or physics in my project.

    I know how to use the debugger, the CPU is never higher than 30% ( while the max on a mobile is 70%, but it is mostly around 60%).

    I have 300-400 objects in each level. I can't go below that, but I've tried removing some of them and tested the game with around 170 objects. It still lagged and there was np difference. The objects I have removed were not moving either way.

    The only object that is moving is the player, and a few other animating objects.

    I wouldn't create this thread if I haven't read thousands of tutorials about optimizing and all that stuff....

  • Hi, thanks for the reply.

    As I said above, my events are fine. The CPU will reach 100% if I am creating my objects every second and will possibly crash the game.

    All of the objects are created at the start of the layout and 90% of them are never destroyed.

    Also, it is good to note that my images are not bigger than they should be, which may be a cause for my problem...

  • I have this problem with the rendering of my game and I am unsure whether I should continue working on the project, since I can't find a solution for it for quite a while.

    My CPU is over 50-70%, which means the code of my project is fine, but on mobile devices (and rarely on my PC) the FPS drops below the minimum 30 half of the time and the movements in my game go into slow-motion. I've tried setting the minimum framerate to less than that, but then I would experience issues like objects teleporting through other objects that are about to stop their movement....

    I have read some tutorials about rendering and WebGL, and I couldn't find anything that is wrong with my project.

    This happens in the 'Level' layout of my project.

    The levels contain objects that are placed in a grid, and 70% of these objects are instances of 1 object type with 2 different textures (2 animation frames). I can't make a tiled background or something since the position of objects differs in each level.

    The trees and rocks objects in the image are actually of the same object type but different animation frames.

    So, the problem occurs when I move the player. He never walks as fast as he should do, and sometimes he walks even slower.

    I don't know how much info do I need to provide because the game is very simple as far as I think.

    Have you ever encountered a problem like this, and how did you manage to solve it?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hi guys, I have searched for topics and tutorials on this one but couldn't find a solution on the reducing of the size of APK.

    My project is 4,7mb big (3,2mb approximate download), I have exported it to cordova and at that point it expanded to 12,8mb (I even deleted some iOS files cause I am willing to build it for Android for now). Then, after I've built it using Intel XDK, the APK size was 29,5mb. It was over 35mb before, but this is the maximum I can do, everything else is added independently of the size of my images or sounds.

    So, when I install the app, it reaches over 110mb (+10 saved data), which is crazy! I guess you can judge by the size of my project that it is just a simple app.

    I've seen a lot of app developers who are not using softwares like C2 but code manually and get very small APK sizes..

    I wonder if gigantic APK's are our destiny lol.

    Somebody got any solution?

  • I will take this method into consideration, thanks. By the way, I don't know what does 'spreadsheet mean, could you explain this to me? 0_0

  • My project is adapted for translations, however I have no idea what's the best way to allow someone to translate my project and then add the translated strings into my project..

  • Oh, I have put it in the wrong folder. Thanks

  • Right, but the plugin does not work. I have added it in the folder but can't find it in C2.. Do you have any idea what may I be doing wrong?

  • I don't really understand what you're trying to say.

    I'm trying to add timers in my game that will countdown regardless if the game is running or not. So, is there a way to accomplish this without setting up an entire server for a single date and time?

    I have found this plugin made by rex, but it's one of the old ones and although I have placed the files in the plugins folder I still can't get it to work...

  • C'mon anybody?

  • It's crashing. Check your code and your images. If your images are too big they can crash the game.

  • That's not the problem. The problem is, after you close and re-open the game, the time needs to be updated, which means it has to be equal to the real time..