Dang this video is a masterpiece. I've come back to this video at multiple points in time in my relatively little time programming and learned something brand new each time. It's seriously a shame this getting the right treatment from the youtube algorithm. I think every aspiring game dev/programmer needs to see this!
Ok so physics and collisions need regular intervals of time to function properly, I guess thats why, in ksp game, your chances to die when you're about to land, increase when you're using time warp
Addendum: by default, a Pyglet window uses vsync, and because the run loop that drives schedule_interval performs the page flip, the update speed of any schedule_interval registered function will be limited by vsync, likely capping at something less than your refresh rate. (On my system, my refresh is 60hz, capping my updates to about 30 times per second.) To disable vsync, invoke window.set_vsync(False) on your window object. With vsync off, my update loop can run over 1000 times a second.
This is awesome! Coming from the very simple and basic pygame event system this was exactly what could explain the idea behind pyglets event functions. I got one question, though: As I see things, the window event "on_draw" is only triggered whenever something is drawn on the window surface (or the window is created), triggered for example by a function dispatching a different event, or by a scheduled function. When I insert a print statement in the program at 21:24 behind "label.draw()", the message is printed exactly one, in a game that constantly updates state using a scheduled function it is printed out constantly as well. Has this changed in pyglet version 1.2? Thanks in advance, Mirlu Merar
I'm rusty on pyglet as it got abandoned (which is one reason I never fully completed this series). I believe the example at 21:24 only prints once because pyglet won't redraw unless some other event has been triggered. With no events triggering, the state won't possibly have changed so the image won't need changing. Later, when we register an update function to the clock, Pyglet knows the window might need redrawing again. No idea if this differs in 1.2 vs earlier. Have I answered the question?
A hero to so few, but a hero no less. In other words... uh, thanks man. I hope you one day get the recognition you deserve
Dang this video is a masterpiece. I've come back to this video at multiple points in time in my relatively little time programming and learned something brand new each time. It's seriously a shame this getting the right treatment from the youtube algorithm. I think every aspiring game dev/programmer needs to see this!
I agree and relate with your post. Thank you for saying it.
Thank you for this newb friendly and comprehensive explanation of a game loop.
unfair , so few views.. this is extremely helpful.. thank you !
Awesome video. Thanks for making it!
Very helpfull! You have my undying grattitude for your explanation! 🖖
Ok so physics and collisions need regular intervals of time to function properly, I guess thats why, in ksp game, your chances to die when you're about to land, increase when you're using time warp
Addendum: by default, a Pyglet window uses vsync, and because the run loop that drives schedule_interval performs the page flip, the update speed of any schedule_interval registered function will be limited by vsync, likely capping at something less than your refresh rate. (On my system, my refresh is 60hz, capping my updates to about 30 times per second.) To disable vsync, invoke window.set_vsync(False) on your window object. With vsync off, my update loop can run over 1000 times a second.
Thank you so much for doing this. You've helped me a lot.
This is awesome! Coming from the very simple and basic pygame event system this was exactly what could explain the idea behind pyglets event functions. I got one question, though: As I see things, the window event "on_draw" is only triggered whenever something is drawn on the window surface (or the window is created), triggered for example by a function dispatching a different event, or by a scheduled function. When I insert a print statement in the program at 21:24 behind "label.draw()", the message is printed exactly one, in a game that constantly updates state using a scheduled function it is printed out constantly as well. Has this changed in pyglet version 1.2?
Thanks in advance,
Mirlu Merar
I'm rusty on pyglet as it got abandoned (which is one reason I never fully completed this series). I believe the example at 21:24 only prints once because pyglet won't redraw unless some other event has been triggered. With no events triggering, the state won't possibly have changed so the image won't need changing. Later, when we register an update function to the clock, Pyglet knows the window might need redrawing again. No idea if this differs in 1.2 vs earlier. Have I answered the question?
Brian Will Thanks, this answered my question perfectly :)
You sir, made the game loop "click". ;)
These are listed in order on codeschool.org/game-programming/
I haven't found a native UA-cam playlist yet.
Did I overlook one?
awesome tutorial
Good video thanks for this information. :)
so you do like OO?
+Felix T-Rex lool :) not anymore i guess, this is old video :P