Platform Racing clone game dev
#29
(26th October 2021, 10:01 PM)Delphinoid Wrote: This is awesome, thank you for putting it on GitHub! I like how it's clearly outlined how to compile it and set it up, that's something I never end up bothering with. I do have a couple of comments on some technical(-ish) problems that can be easily fixed btw, although you're probably already well aware of these.

1. I'd strongly recommend uncoupling updating and rendering, especially if you plan on making this multiplayer eventually. You should ideally have both a target framerate and target tickrate. The reason for this is just because if someone can't maintain the desired framerate at all times, they'll fall behind. You might then think, "well that's a simple fix, I'll just make everything happen faster at lower framerates"! This is somehow an incredibly common "solution" that pops up frequently even in heaps of AAA titles, but it introduces a nasty framerate dependency on the game physics: as well as making the physics non-deterministic, it also makes them susceptible to blowing up at low framerates or breaking at high framerates. The best solution is to just have the game update and render independently.

2. If you plan on supporting Windows, it's probably best to let go of SDL_Delay, as it has a tendency to oversleep. Iirc, this is because the implementation of SDL_Delay on Windows doesn't correctly change the timer resolution before sleeping. Fortunately it's not too difficult to write a custom timer that fixes this.

I just realized you're using SDL for rendering rather than OpenGL; I had actually completely forgotten it was even capable of simple drawing instructions! It's been a long time since I've used it in anything drawing related, so I can't really offer any advice on that unfortunately. Back when I used it like that, it didn't support hardware acceleration, but I think it might now so it should be fine.

I'd also like to have a proper look at some of the game code later too, it's super interesting looking through all of this!

Thanks for the response!

The two issues you mention are pretty much the one and the same, and the solution is just as you mentioned of having a proper timestep. This is mostly a learning experiement first and I'm too much of a BAKA to immediately know how to add it. Shouldn't be too complicated, hopefully.

I've not really gotten my hands dirty with raw OpenGL so I can't say how it compares, but SDL is simple to interface with, has great documentation, is relatively popular, is portable and Works on My Machine™ so I'm rolling with it.

The biggest problem I would say the actual game code has now is how it handles "active" blocks (that is, the blocks visible on screen/update in accordance with the player or the blocks' own behavior). The rest...should be acceptable, hopefully. Outside the context of game code, there's probably something that can be done with tidying up the #includes, but proper header file organization to me is a wasp nest I'm too afraid to even poke with a stick. And whatever you do, don't look in G_COMMON.h unless you want to be spoiled on gameplay features I intend on addding!!!!!!1111

I know Donkey Kong 64 did something like the gaffe you mentioned in issue #1. That's your random trivia for today.

Oh, and if GitHub ain't your thang, I've also put up my own handy Gitea instance, just in case you're a fellow M*crosoft hater:
https://git.doxsite.xyz/Mythradox/free-racing
[Image: aGf8Xvh.png]
The Following 1 User Says Thank You to Northadox For This Useful Post:
  • Delphinoid
Reply


Messages In This Thread
Platform Racing clone game dev - by Northadox - 18th September 2021, 2:54 PM
RE: Platform Racing clone game dev - by Adulock77 - 18th September 2021, 8:07 PM
RE: Platform Racing clone game dev - by Addy - 18th September 2021, 8:43 PM
RE: Platform Racing clone game dev - by Northadox - 18th September 2021, 8:57 PM
RE: Platform Racing clone game dev - by Adulock77 - 18th September 2021, 9:09 PM
RE: Platform Racing clone game dev - by tadtad - 19th September 2021, 11:18 PM
RE: Platform Racing clone game dev - by Addy - 18th September 2021, 9:27 PM
RE: Platform Racing clone game dev - by Northadox - 18th September 2021, 9:57 PM
RE: Platform Racing clone game dev - by Ranko Danko - 18th September 2021, 11:02 PM
RE: Platform Racing clone game dev - by Adulock77 - 19th September 2021, 12:04 AM
RE: Platform Racing clone game dev - by Camer the Dragon - 19th September 2021, 12:06 PM
RE: Platform Racing clone game dev - by Stxtics - 21st September 2021, 1:34 PM
RE: Platform Racing clone game dev - by Rei - 25th September 2021, 7:51 PM
RE: Platform Racing clone game dev - by Northadox - 26th September 2021, 12:31 AM
RE: Platform Racing clone game dev - by Camer the Dragon - 26th September 2021, 8:22 AM
RE: Platform Racing clone game dev - by Northadox - 26th September 2021, 9:45 AM
RE: Platform Racing clone game dev - by Camer the Dragon - 26th September 2021, 10:32 AM
RE: Platform Racing clone game dev - by Rei - 26th September 2021, 1:31 PM
RE: Platform Racing clone game dev - by Northadox - 28th September 2021, 12:31 AM
RE: Platform Racing clone game dev - by Northadox - 29th September 2021, 11:12 PM
RE: Platform Racing clone game dev - by Northadox - 1st October 2021, 11:03 PM
RE: Platform Racing clone game dev - by Rei - 4th October 2021, 8:38 PM
RE: Platform Racing clone game dev - by Rei - 5th October 2021, 7:48 PM
RE: Platform Racing clone game dev - by Northadox - 22nd October 2021, 11:40 PM
RE: Platform Racing clone game dev - by Rei - 24th October 2021, 1:04 PM
RE: Platform Racing clone game dev - by Camer the Dragon - 25th October 2021, 11:23 PM
RE: Platform Racing clone game dev - by Northadox - 26th October 2021, 8:54 AM
RE: Platform Racing clone game dev - by Northadox - 5th November 2021, 3:47 PM
RE: Platform Racing clone game dev - by Northadox - 6th November 2021, 10:06 PM
RE: Platform Racing clone game dev - by ThePizzaEater1000 - 7th November 2021, 10:45 PM
RE: Platform Racing clone game dev - by Northadox - 8th November 2021, 10:02 AM
RE: Platform Racing clone game dev - by Camer the Dragon - 8th November 2021, 2:22 PM
RE: Platform Racing clone game dev - by Northadox - 8th November 2021, 2:56 PM
RE: Platform Racing clone game dev - by ThePizzaEater1000 - 12th November 2021, 8:40 PM
RE: Platform Racing clone game dev - by Northadox - 13th November 2021, 9:59 AM
RE: Platform Racing clone game dev - by Northadox - 28th November 2021, 7:11 PM
RE: Platform Racing clone game dev - by Northadox - 4th December 2021, 2:07 AM
RE: Platform Racing clone game dev - by Magyar - 6th December 2021, 12:58 PM
RE: Platform Racing clone game dev - by Adulock77 - 6th December 2021, 7:56 PM
RE: Platform Racing clone game dev - by Northadox - 8th December 2021, 2:28 AM
RE: Platform Racing clone game dev - by Camer the Dragon - 8th December 2021, 1:24 PM
RE: Platform Racing clone game dev - by Northadox - 11th December 2021, 7:27 PM
RE: Platform Racing clone game dev - by Northadox - 6th January 2022, 11:40 PM
RE: Platform Racing clone game dev - by Magyar - 11th January 2022, 5:40 PM
RE: Platform Racing clone game dev - by Lego-man945 - 7th January 2022, 4:49 PM
RE: Platform Racing clone game dev - by Northadox - 7th January 2022, 10:39 PM
RE: Platform Racing clone game dev - by Northadox - 7th March 2022, 7:27 PM
RE: Platform Racing clone game dev - by Magyar - 8th March 2022, 4:16 AM
RE: Platform Racing clone game dev - by Northadox - 8th March 2022, 7:55 PM
RE: Platform Racing clone game dev - by ThePizzaEater1000 - 10th March 2022, 12:05 AM
RE: Platform Racing clone game dev - by Hahli144 - 10th March 2022, 8:19 AM
RE: Platform Racing clone game dev - by Hahli144 - 10th March 2022, 9:08 AM
RE: Platform Racing clone game dev - by Northadox - 10th March 2022, 4:26 PM
RE: Platform Racing clone game dev - by Hahli144 - 11th March 2022, 3:46 AM
RE: Platform Racing clone game dev - by Northadox - 11th March 2022, 5:37 PM
RE: Platform Racing clone game dev - by Different - 17th March 2022, 12:37 AM
RE: Platform Racing clone game dev - by Northadox - 1st June 2022, 10:54 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)