4 ms·
I have always wanted to program a 2D game engine in C++ for fun. Mostly as a learning experience but whenever I decide to do it I get intimidated trying to figu
by gww 6y ago
I have always wanted to program a 2D game engine in C++ for fun. Mostly as a learning experience but whenever I decide to do it I get intimidated trying to figure out how to design it and give up. Does anyone have any recommendations of resources to get over figuring out how where to start?
- krapp 6y agoJust start anywhere. You're going to end up throwing it all out anyway. Accept that failure is the path to success and just do it.
- meheleventyone 6y agoPick a simple game and make that game. Pick a new game and make that game. Take the things that fit the second game from the first game. Now you have at least some basics that do input, rendering and audio. Pick a bit to improve towards your target. Making “an engine” isn’t really something you can do unless you have an idea about what making a game actually means. Then you can work out what it is that you actually value.
- gww 6y agoThanks, I am going to try to start with something easy like tetris.
- skocznymroczny 6y agoA common recommendation is not to write an engine, but to write a game instead. Create a Pong game. Create a 2D space shooter. Create a simple Mario-like 2D platformer. Now take the code that is shared between all three projects - there's your game engine. Just extract that so that it's nicely separated and easily reusable in future projects.
- gww 6y agoThanks, that does make more sense and seems much less intimidating.
- markus_zhang 6y agoMy advice is to follow gaming history and reuse engine code as much as possible. Use SDL2 as it is barebone and yet privides you sophisticated tools. Here is a list of 12 games that I picked because I'm biased towards RPG but you can definitely choose your own wishlist. Part one: Warm up and basic input, audio and video. Pong, Snake, Tetris, Breakout, Galaxian, Frogger. Part Two: Scrolling screen, levels and overall game architecture: Super Mario, Gradius, Twinbee Part Three: RPGs which are more or less "complete" games and need some tooling: Ultima III, Wizardry I Japanese version, Dungeon Master Part Four: Just keep practicing. You already graduated and can do whatever you want! Also don't forgrt to read Masters of Doom which will give you tons of inspiration. You can actually walk Carmack's route as well. His first commercial game is an Ultima spin off called Wraith.
- markus_zhang 6y agoTo correct: Carmack's first commercial game is NOT Wraith, but Shadowforge. But the engine is very similar to the one he used to develop Wraith.
- friendlybus 6y agoIf you can tolerate switching to C#, XNA (later transferred to MonoGame) is a great framework to cut your teeth on. I started there, it may be a little of out date, I'm fairly sure MonoGame is still maintained. There are a bunch of resources out there for XNA.