Advertisement

Adjusting projected to be completed for same time for each user

Started by September 21, 2018 03:44 PM
0 comments, last by ggenije 6 years, 2 months ago

Important: I am trying to realize in scrtach which is performance very low due to it's "virutal level" scrtach->flashplayer->java...

Also i'm new to this forum so i'm sorry if I missed group (like last time)

Like a title is saying:
I have project ,and I get negative feedback on it because some people need 30 min to complete it (what is the planned time)
but problem is that some people need EVEN 5 hours…(game is incremental/idle/upgrade type so it's important to keep same time ...)
———————————————————————————————————————-
Of course people with slower computer will have less fps so game will be slower for them,
so I have created TimeDelta system for each frame to calculate something to do per second
for example



 
Update(){move(TimeDelta*speed)} 

so that mean it will be moving speed number of pixels(or units) per second so it will be same for almost each user.

But problem is next:
I have to change ySpeed by jumpPower (#PlayerJump in my project)
when any jump button is pressed
then in each frame decrease ySpeed by gravity it is(-10 * TimeDelta)
but when someone have lower fps it will have higher TimeDelta and will fall faster but with same jump it turns out to jump significantly lower that changes core of game
BUT even worse if fps suddenly in moment of jump then timeDelta would be 1 so player will jump much much MUCH higher , then fall much slower because timeDelta changed in meanwhile…(and the point of my game is about upgrading jump not complete game in first fps drop)



—————————————————————————————————————————————————————

Then I got an idea to fix TimeDelta (like in unity for rigibody) so it will be rounded like
if calculated TimeDelta is 0.01834 it will be 0.02 fixed
if weaker computer is using it the TImeDelta will be 0.143 so runded to 0.14 and so on…

I did not manage to realize it… i tried to calculate it before main initialization of game objects
but I'm afraid to fps will drop in moment that is calculating so it will be much diffirent…
I was trying with empty loop(400)(in scrtach even this is taking time) to calculate it but i'm not sure is it right


So is there good way to realize this fixed TimeDelta

I only have timer function to use and time difference between frames

 

This_is_the_link_for_the_game

This topic is closed to new replies.

Advertisement