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.

AppGameKit Classic Chat / so HTML 5 export works really slow on normal browsers? well, think again. the solution can be found here.

Author
Message
haliop_New
User Banned
Posted: 4th Feb 2019 00:58 Edited at: 4th Feb 2019 01:00
ok, so back in the day I posted a way to "fool" the device (any) to think you are playing a 30 fps game but actually, it acts like 60 fps or more.

how?

it's simple.

let me introduce you to CycleCounter and CycleMax
these 2 variables will change your gaming development experiments forever.

so let's say you have strict a game to run on 30 fps with vSync 1, right? cause we want to save battery life on a mobile phone.
well once this is done you will be running a 30 fps game on your device or is it?

what if before the "sync()" command we will do something like that:



so what does this do?
well think about it for a second
let's say you have a sprite running towards the enemy from the left to the right of the screen.

something like
setSpriteX(sprite,getSpriteX(sprite)+1)

in the normal scenario, this sprite will run +1 to the right each frame so that's about 30 in distance every second.
in our scenario it will actually run 30 in distance but actually will be presented only half of the time, and the normal eye cannot see it, why? because the sprite will run in the background but won't be drawn to screen, only once in 2 counts.
this actually means it will run a lot faster and will stimulate like you are playing on a higher FPS machine...

so, well... Browser games here we come! unleashing wrath and RAM loss on CHROME!


well this might not be explained the best, so here are 2 videos of the same game (called MINI MATH X and it's super awesome just wait for the next update it's for free with in-app purchases)
so believe it or not... I hardly care about low-end devices as once I do a small benchmark for the device on the first startup of any app I build I can measure for the about CycleMax which gives me instant results , it also means that the game will not run the same on all devices even if we use DeltaTime or GetFrameTime
but it will actually feel much better then the normal situation where low fps completely destroy the fun of things. when thinking about releasing in HTML 5 this is the solution I'm up for, cause the "normal player" well even the experts (got some gamers friends they had no clue i told them the browser running a 60 fps game just for the fun of it, they did not believe it at first but after playing some said.. "I don't know if its 60 fps but its ridiculously fast for a browser game" ) will hardly notice.

btw this will also make the game "rest" or the "CPU" and "GPU" rest since it draws only half or third or fourth of the times it should but the actual "UPDATES OF ANYTHING" will still be processed just not drawn to screen every frame.
I dare you to try it in your games, post a video or just commenting if it works for you, I found it works really well under the browser restrictions you hardly notice any difference.

JUST KNOW SOME ADJUSTMENTS SHOULD BE DONE IF YOU ARE USING THIS SOLUTION. DO NOT FORGET. THINGS WILL RUN (DRAWN) ON SCREEN IN A MUCH FASTER WAY, THEY WILL ACT THE SAME BUT WILL RUN FASTER.


NORMAL KNOWN ROUTINE


CycleCounter and CycleMax routine



P.S
WONDERING IF ITS TIME FOR A NEW BADGE.
the Tutor Badge, not for this post but for people who teaches other people (as work) about game development with AppGameKit and AppGameKit ONLY.

Login to post a reply

Server time is: 2024-04-19 14:48:41
Your offset time is: 2024-04-19 14:48:41