Developing 2D sports game

Started by
11 comments, last by darrin k 6 years ago

Hi everyone,

My main goal is to eventually build an extremely simple (graphics-wise/game-physics wise) sports video game in 2D. I am a big fan of the "old-skool" Genesis sports video games. I know some Python and C# but would really like to begin learning C++ as well.

Where I am now:

- My original thought was to continue learning some more C# and C++ before diving into any engine. I am thinking Udemy to take additional courses.

-Perhaps, a tennis or golf game since I do not have to do deal with team-based AI which I have heard is extremely tricky to replicate.

-Not sure, if Unity or Unreal is suited for sports game development? If one is better than better for 2-D based games, but I definitely want to learn both C# and C++.

-Is it a realistic goal, to build a simple sports game (basic graphics and physics-- think Genesis or even early 90s DOS)? This goal is just for myself, I am not looking to make money off of this game but just some self-satisfaction that I can build it.

 

Lastly, I know enough programming to build ROM editing tools in C# but that is the extent of my programming, with the exception of some simple Python scripting.

I would appreciate anyone's input and thanks for taking to time to read this and/or respond.

Thanks,

DK

Advertisement

I would advise Unity and C# for this task, but Unreal and C++ will also be a good fit. The 'sports' aspect is not likely to be relevant to the technology choice - both engines give you a physics system built in which you can use to simulate the ball movement, and the rest is up to you.

I think it is a reasonable and realistic goal, providing that you are aware of your limitations as a single developer. While modern engines give you a lot of tools almost 'for free', games from the 90s still required a team of professionals working together for a year or more to make such games. Some of the programming work they used to do will be handled by the engine - but it isn't going to make your gameplay logic for you, and it's certainly not going to generate your visual and audio assets.

Kylotan, Thanks for your response back!!! I appreciate all the insight.

Game engines are much geared towards 3D, 2D is mostly 3D where the camera looks at a flat space, ie the scene has no relevant depth. If you're looking for a more bare-bones approach with C++, using a 2D library like SDL2 would be a feasible option. LazyFoo has a nice tutorial about it, make sure you pick SDL2 and not SDL1.2 tutorials there.

Since you don't have an engine in this setup, you have to write more C++ code for low-level stuff like loading graphics and handling user input etc.

However I would like to throw in the idea that it's probably easier to simulate a sport like golf or tennis in 3D, even if the end rendering looks 2D.

On 4/8/2018 at 1:52 AM, Alberth said:

Game engines are much geared towards 3D, 2D is mostly 3D where the camera looks at a flat space, ie the scene has no relevant depth. If you're looking for a more bare-bones approach with C++, using a 2D library like SDL2 would be a feasible option. LazyFoo has a nice tutorial about it, make sure you pick SDL2 and not SDL1.2 tutorials there.

Since you don't have an engine in this setup, you have to write more C++ code for low-level stuff like loading graphics and handling user input etc.

Ok that might be a good option as well, since it would force me to code more and if I really hit a wall, I could ask for assistance. For now, I will take more C++ and then look at the libraries you mentioned. Thanks!

On 4/8/2018 at 6:54 AM, Kylotan said:

However I would like to throw in the idea that it's probably easier to simulate a sport like golf or tennis in 3D, even if the end rendering looks 2D.

That's what I figured when compared to sports like football/hockey/basketball, my only concern is the math involved for simulating tennis and/or golf physics. I am not sure if there is material about this somewhere on the internet or game programming books.

While math is always useful to know, I don't think you need to go down to physics for a simulation for a retro game, you can just draw a random number to decide the outcome, then have an animation that shows it to the user.

(Much of games is smoke and mirrors, you only want to make it appear like a realistic game, that does not mean you also have to code it like that!)

 

EDIT:

If you do need physics, a falling body under gravity is a simple second degree polynomial y=0.5*g*t*t + v0*t + x0 (with g gravity=9.8 on earth, v0 is initial velocity, x0 is initial vertical position, t is time in seconds), Compute y for increasing t.

Thanks Alberth for the advice and I will make a note of the polynomial equation.

If the genesis style 2D games is what you are looking at then I personally would choose one of the following (in order of preference):

  • C++ and SDL 1 or 2
  • Javascript / HTML5 canvas
  • C# and just Winforms and the inbuilt paint system.

Something like Unity or UE4 is overkill for this and getting your head round their strange 2D orthographic camera in a 3D world kludges may be avoidable if you use a 2D drawing API for your 2D game.

IMO you will learn more and have more fun with the drawing APIs than using a 3D engine.

Actually, for the last Global Games Jam I developed a 2D topdown Rogue-like soccer game for the megadrive using SGDK (gendev) and DGen/SDL. It was a blast. I love these kinds of games. As a happy bonus it worked on most platforms I tried (Win,UNIX,Android,Mac,iOS) because most platforms have at least 5 genesis emulators available on them haha ;)

http://tinyurl.com/shewonyay - Thanks so much for those who voted on my GF's Competition Cosplay Entry for Cosplayzine. She won! I owe you all beers :)

Mutiny - Open-source C++ Unity re-implementation.
Defile of Eden 2 - FreeBSD and OpenBSD binaries of our latest game.
2 hours ago, kop0113 said:

If the genesis style 2D games is what you are looking at then I personally would choose one of the following (in order of preference):

  • C++ and SDL 1 or 2
  • Javascript / HTML5 canvas
  • C# and just Winforms and the inbuilt paint system.

Something like Unity or UE4 is overkill for this and getting your head round their strange 2D orthographic camera in a 3D world kludges may be avoidable if you use a 2D drawing API for your 2D game.

IMO you will learn more and have more fun with the drawing APIs than using a 3D engine.

Actually, for the last Global Games Jam I developed a 2D topdown Rogue-like soccer game for the megadrive using SGDK (gendev) and DGen/SDL. It was a blast. I love these kinds of games. As a happy bonus it worked on most platforms I tried (Win,UNIX,Android,Mac,iOS) because most platforms have at least 5 genesis emulators available on them haha ;)

More and more people seem to be pointing to the C ++ and library approach, what is the difference between SFML and SDL???

I have only seen a couple videos using SGDK, I wish someone could make a tutorial at some point, the code is written in C? I am envious that you got your game to work in a Genesis emulator!!!!

This topic is closed to new replies.

Advertisement