Different types of private variables, and Timer Objects.

New releases and general discussions.

Post » Tue Mar 10, 2009 8:39 pm

The reason why I wanted to suggest these is because simply using private variables for what we have now with the sprites doesn't really do the job. It counts down a variable each cycle instead of counting when the values per second.

For say right now, each cycle deducts .5 from a variable instead of deducting .5 a second from a variable.

We already know that the properties in the objects section already syncs to the timer.

So basically using value * TimeDelta is simply not the solution for those who want a pixel perfect gameplay with no random variations, especially if we want to have enemies to do some rapid fire rate shooting.


So the followig that I want to suggest is:
Private variables with different types to determine if we went to have this private var to be counting(subtracting/adding per cycle), or timer type(same thing but per second no matter the FPS). And we can tabe Timer Objects that can count .3 a second or have a player ship fire out shots 15 times a second no matter what FPS you have.

If this idea was to happen, this program will be even more useful.

I'm still interested to see what the future developments have to bring.
B
1
G
3
Posts: 3
Reputation: 831

Post » Tue Mar 10, 2009 8:42 pm

couldnt you just do every 1000 millisecond =add .5 to value
B
52
S
7
G
6
Posts: 1,945
Reputation: 7,610

Post » Tue Mar 10, 2009 9:38 pm

You could use the Timer Behavior.
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529

Post » Tue Mar 10, 2009 9:56 pm

[quote="PrinterHead":273bmxc6]pixel perfect gameplay with no random variations[/quote:273bmxc6]
If you want this, you have to make your game framerate dependent. That means it either tears (reducing display quality) or runs at different speeds on different computers. So if you really want that, get rid of all your TimeDelta or enable TimeDelta override. But I have to ask, why is it important for your game to play out the same way every time pixel perfect?

[quote:273bmxc6]
Private variables with different types to determine if we went to have this private var to be counting(subtracting/adding per cycle), or timer type(same thing but per second no matter the FPS).[/quote:273bmxc6]
I don't understand. You can either add 'X' to a timer every tick, which makes it framerate dependent, or add 'X * TimeDelta' every tick, which makes it framerate independent. That's already the system you described.

[quote:273bmxc6]have a player ship fire out shots 15 times a second no matter what FPS you have.[/quote:273bmxc6]
Now I'm confused. If you want your game to play out pixel perfect every time, it's not possible to do that. Different computers will have different framerates, fullstop. If you sacrifice pixel perfect accuracy for framerate independency, you can have your game accurate in time like that.

Which do you want? Accurate timing or accurate gameplay? You can't have both.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,468

Post » Tue Mar 10, 2009 9:58 pm

Timer Behaviour(sorry for spelling), so where could that be? After when I create a sprite or what object is that in?

[quote:3e6itnmj]
couldnt you just do every 1000 millisecond =add .5 to value
[/quote:3e6itnmj]

Well as I said, that can't be done because with the computer I have, makes FPS varies because I use a program that records and slowes down the game to a much lower fps rate.
B
1
G
3
Posts: 3
Reputation: 831

Post » Tue Mar 10, 2009 9:59 pm

Click add behavior, and select Timer, it sounds like exactly what you want, after this confusion :P.
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529


Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 0 guests