Frame rate independent game loop
Re: Frame rate independent game loop
works now!
[edit] 18 fps 5000 meta's GL
[edit] 18 fps 5000 meta's GL
Last edited by dafhi on Oct 29, 2017 15:49, edited 1 time in total.
Re: Frame rate independent game loop
There. Sorry for the inconvenience, mate.
Re: Frame rate independent game loop
Modified the interface yourself? (preemptive strike hahaha) =Ddafhi wrote:works now!
Re: Frame rate independent game loop
downloaded .. my oop is very limitedpaul doe wrote:Modified the interface yourself? (preemptive strike hahaha) =Ddafhi wrote:works now!
Re: Frame rate independent game loop
Hi Paul,paul doe wrote: Teaming up for something? Count me in! What kind of stuff you're interested in? 2D? 3D? And what kind of game, concretely? I need some fun (I'm sick of financial coding stuff) so this could be very interesting.
I would love to see your physics stuff. If time permits, I'll show you a simple implementation of a barebones 2D physics engine that uses Verlet. It's simplistic, but you can do mighty interesting stuff with it. It can be useful for debugging purposes, much like the 3D stuff in the thread that I pointed you before. Looking forward!
I am cleaning up a proof-of-concept demo version that will be posted very soon. In short, I have developed a 2D physics engine called SquishyPlanet that combines next-level soft-body physics and orbital mechanics. This serves as the backbone of my game Graveyard Orbit, which is an orbital mechanics puzzle in which the player needs to solve real-life space travel challenges, like placing cargo in orbit, moving from one planet to another, reaching a destination using as little fuel as possible, and hacking the levels using gravity assist, Oberth effect, roping through asteroid belts and what not. The soft body part is for girders, steel wires, vines, and space blobs. Since probably most people will find this too boring, I'm planning on adding a single/multi player dogfight mode where friends can blast each other out of the sky :-)
If you're into Verlet then I'm sure you'll like my home brewn soft body constraints - It's a very stable and rigid damped spring using sequential impulses and warm starting. I'll post some simple interactive demo doodles of it.
Anyway, long story short I'm looking for potential future partners and friends who share my interest and would like to develop this or similar games with me.
Cheers, Mike
Re: Frame rate independent game loop
Wow. I scratch 10 fps with 1000 XD (yeah, the craptop I use to code sucks)dafhi wrote:works now!
[edit] 18 fps 5000 meta's GL
Mmmm... I thought that you did it manually, we cross-posted as you can see. This is what your code was missing:dafhi wrote:downloaded .. my oop is very limitedpaul doe wrote:Modified the interface yourself? (preemptive strike hahaha) =Ddafhi wrote:works now!
Code: Select all
...
interface IRenderDevice extends object
...
declare abstract function setRes( byval as integer, byval as integer ) as integer
declare abstract sub setRenderer( byval as IRenderer ptr )
...
end interface
...
See ya
Paul
Last edited by paul doe on Oct 29, 2017 20:48, edited 1 time in total.
Re: Frame rate independent game loop
I'm not familiar with orbital mechanics, but will take a look. You're right, it does sound boring XD but I'm curious as to how you'd pull this off. I was thinking in more 'mundane' 2D physics, like Angry Birds or LBP. You caught me with my pants down on this one LOLh4tt3n wrote: Hi Paul,
I am cleaning up a proof-of-concept demo version that will be posted very soon. In short, I have developed a 2D physics engine called SquishyPlanet that combines next-level soft-body physics and orbital mechanics. This serves as the backbone of my game Graveyard Orbit, which is an orbital mechanics puzzle in which the player needs to solve real-life space travel challenges, like placing cargo in orbit, moving from one planet to another, reaching a destination using as little fuel as possible, and hacking the levels using gravity assist, Oberth effect, roping through asteroid belts and what not. The soft body part is for girders, steel wires, vines, and space blobs. Since probably most people will find this too boring, I'm planning on adding a single/multi player dogfight mode where friends can blast each other out of the sky :-)
What I like about Verlet integration is its simplicity. You can make things that look and feel rather advanced, with very little coding and a minimum of fuss. Perhaps you already knew, but here is the de facto reference on Verlet: https://www.gamasutra.com/view/feature/ ... hysics.phph4tt3n wrote: If you're into Verlet then I'm sure you'll like my home brewn soft body constraints - It's a very stable and rigid damped spring using sequential impulses and warm starting. I'll post some simple interactive demo doodles of it.
Anyway, long story short I'm looking for potential future partners and friends who share my interest and would like to develop this or similar games with me.
I would love to see your
Code: Select all
stuff, so when you're done, make sure that you tell me. Just quote whatever random crap I wrote, so I get the notification, dale? Catch you later.
Paul
Re: Frame rate independent game loop
I will, and yes I'm very familiar with Thomas Jacobsen's verlet paper - this brings fun memories from the old, original Hitman game in which he and his colleagues implemented it :-)
Re: Frame rate independent game loop
By the way, dafhi. In 'loop comparison.bas', when you switch to DodiLoop, how many fps does it report? Asking because it should be 60. It is?dafhi wrote:works now!
[edit] 18 fps 5000 meta's GL
Re: Frame rate independent game loop
dodiloop 60. your version, even though reporting ~120, looks about 30. could be "physics " timestep or integer meta pos, although looking at vec2h i see floats .. ima grab my hot chocolate and see if i can figure this out.
okay found itlol
okay found it
Code: Select all
m_ticksPerSecond = 30
Re: Frame rate independent game loop
Haha very good. Change that to 60 if you wish the game to be updated at 60 fps. The rendering could go as fast as you hardware can handle, yet the updating of the game happens at 'm_ticksPerSecond' value. Want the loop code dissected here?dafhi wrote:dodiloop 60. your version, even though reporting ~120, looks about 30. could be "physics " timestep or integer meta pos, although looking at vec2h i see floats .. ima grab my hot chocolate and see if i can figure this out.
okay found itlolCode: Select all
m_ticksPerSecond = 30
Re: Frame rate independent game loop
i'm more of a demo-style coder, but i've known about animation / physics .. first read about it from relsoft maybe? 2 other here also influenced the style that i use today: anonymous1337 and StoneMonkey
updated, from my post in the BasicCoder2 thread
updated, from my post in the BasicCoder2 thread
Code: Select all
var iphys_fps = 1/89, phys_t = 0f
var ianim_fps = 1/24, anim_t = 0f
var tp = timer
while inkey=""
if anim_t <= 0 then
screenlock
' ..
screenunlock
anim_t += ianim_fps
endif
sleep 1
var t=timer, dt=t-tp
tp=t
anim_t -= dt
phys_t += dt
var frames=0
while phys_t>0
frames += 1
phys_t -= iphys_fps
wend
var rate = pi*iphys_fps*frames*5
incr axis.a0, .1*rate, twopi
incr axis.a1, .011*rate, twopi
'..
wend
Re: Frame rate independent game loop
Very well, then. And yes, it was rel who first published about this. In the post (from 2014 IIRC) he used the implementation by Glenn Fiedler (the link to gafferongames.com that I posted before), while I use the implementation seen on koonsolo.com, by Koen Witters. Same problem, two solutions ;)dafhi wrote:i'm more of a demo-style coder, but i've known about animation / physics .. first read about it from relsoft maybe? 2 other here also influenced the style that i use today: anonymous1337 and StoneMonkey
I'm currently refactoring the demo (minor changes in the interface) to be able to implement a simple physics demo.
Which one?dafhi wrote:updated, from my post in the BasicCoder2 thread
Re: Frame rate independent game loop
The GL thread, page 4 near the top
Last edited by dafhi on Oct 30, 2017 16:13, edited 1 time in total.
Re: Frame rate independent game loop
Oh, right. The cube inside the sphere. Yeah I can see it now, hadn't worked through the code (even though the comment at the beginning clearly states this hahaha). Well then there's no mystery for you here =Ddafhi wrote:The GL thread, page 4 near the top. Nothing to write home about
I asked because DodiLoop was reporting me 30, which isn't correct. Must be my box doing crappy things again :'(
Last edited by paul doe on Nov 01, 2017 11:29, edited 1 time in total.