Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers AppGameKit Corner / Curious performance problem on entering main .

Author
Message
Richard Stevens
4
Years of Service
User Offline
Joined: 14th Jan 2020
Location:
Posted: 4th Sep 2020 12:47 Edited at: 4th Sep 2020 12:58
Ok so my project is growing at quite a rate, and at some point I seem to have inserted a new problem, but I'm buggered if I can find out where it is.

When the main game loop starts (after the menu), it slows down to 30-40 fps for 3-4 seconds, before hitting 60 FPS and staying there. This is reproducible both on my windows laptop & on my phone (android)

Now, there's no reason at all that I can think of that anything 'more' is happening in the first few hundred frames of the game. I've tried taking out all the 'heavy lifting' stuff from the main program loop & most of the drawing to leave it bare bones, but it doesn't have an effect. All the images are loaded & sprite setup etc before entering the main loop. It could be a red herring, but it does seem to have got worse as I've progressively loaded a lot of images ( even tho these are done prior to the main loop)

It 'feels' as if AppGameKit is caching something or other.. as after that 3-4 seconds it's fine.

I can probably work round it creatively by using a starting flag with a four second countdown (it's a race game).. but I'd love to know why it's happening.

has anyone come across anything similar?
pavel_sv_1982
11
Years of Service
User Offline
Joined: 9th Apr 2013
Location: Russia
Posted: 4th Sep 2020 13:08 Edited at: 4th Sep 2020 13:16
I have encountered that slow loading objects such as heightmap.
then everything is normal. it's just that the 9 maps I uploaded were large. But it was very beautiful. And it seemed that the world without sutures.

Do you have a 3D or 2D game?

Sprites need to do perhaps not 1024 on 1024 and 128 on 128 or even less.
Lupo4mica37
4
Years of Service
User Offline
Joined: 1st Jun 2020
Location:
Posted: 23rd Sep 2020 19:45
Going back to the days of CPC-464, I waited sometimes up to 15 minutes for the game to load, so you are very fortunate to have to wait for 4 seconds. Be greatful.
????????
Lupo4mica37
4
Years of Service
User Offline
Joined: 1st Jun 2020
Location:
Posted: 23rd Sep 2020 20:40 Edited at: 23rd Sep 2020 20:44
Another important point is the hardware. Running any appliation/software/game on a computer with CPU=i9-10900K and GPU=Quadro RTX 8000 (my PC, I wish) VS CPU=i5-3230M and GPU=intel graphics 4000 (my laptop), as you might predict yourself will produce varied results as the rate at which one device can calculate a number of operations differs between devices and sometimes the phones themselves these days can exceed some peoples' personal computers.

My PC is really not that bad to be honest with you, so in the case you want me to test the matter of hardware for you, I am able to do it in contrast to my 2012 laptop as long as you can provide a link to the application with all data required to run it to perform such a test. No secrets to your code required .
????????

Login to post a reply

Server time is: 2024-11-23 08:12:24
Your offset time is: 2024-11-23 08:12:24