Wanting to create my own Game Engine

Started by
17 comments, last by jamespetts 7 years ago

I've started to learn how to create my own game engine and truthfully, so far I haven't got far. I was watching some videos on creating a game engine in Java using LWJGL but I decided to switch to C++ instead and I'm a little stuck.

Of course using C++ means I can't use LWJGL so I'm a little confused on what exactly I should use, I've heard about GLFW and SFML and seen some tutorials on both of them but I'm not sure which one I should be learning? I was originally going with GLFW as I noticed it uses the same functions as LWJGL but I've heard a lot of good things about SFML and how it also includes features for Sound, Networking, Fonts and some more.

I am actually wanting to create a game with my game engine while I work on it so I was wondering if someone could recommend what I should use?

SFML seems to have far more tutorials online and people seem to be using it more then GLFW

Advertisement

Why did you switch languages?

The best way to learn how to make an engine is to write a bunch of games, reusing as much as you can from the last game in the next. To that end I'd suggest you focus on making the game rather than the engine, because otherwise you'll wander off on ridiculous tangents that you'll never actually really need.

Why did you switch languages?

The best way to learn how to make an engine is to write a bunch of games, reusing as much as you can from the last game in the next. To that end I'd suggest you focus on making the game rather than the engine, because otherwise you'll wander off on ridiculous tangents that you'll never actually really need.

Well I've made games before within the Unity and Unreal Engine, I just wanted to learn how to make a game engine as it's something new.

Since the goal is education it really doesn't matter what you use. You've heard good things about three systems. Use whatever one you want more education about.

The best is to write an engine the same time writing a game, working only on what the game needs and not work on lot of features which ends to nothing.
But then if it's only a research, it's never bad to experiments everytime new things.

The best is to write an engine the same time writing a game, working only on what the game needs and not work on lot of features which ends to nothing.
But then if it's only a research, it's never bad to experiments everytime new things.

Well that's exactly what I want to do, work on a game while working on the engine.


Since the goal is education it really doesn't matter what you use. You've heard good things about three systems. Use whatever one you want more education about.

I'm quite interested in GLFW so I'll use that though for features such as audio and stuff, what other libraries would I need?

I know LWJGL uses something called OpenAL for Audio


The best is to write an engine the same time writing a game, working only on what the game needs and not work on lot of features which ends to nothing.
But then if it's only a research, it's never bad to experiments everytime new things.

Well that's exactly what I want to do, work on a game while working on the engine.


Since the goal is education it really doesn't matter what you use. You've heard good things about three systems. Use whatever one you want more education about.

I'm quite interested in GLFW so I'll use that though for features such as audio and stuff, what other libraries would I need?

I know LWJGL uses something called OpenAL for Audio

GLFW does not support audio, GLFW is a window and opengl context creation/handling library, you'd either have to use a separate library for audio, or utilize OpenAL (the audio equivalent of opengl)

On another note, as someone who is also working on a game engine, the rabbit hole goes much further than you might anticipate. While I won't discourage you from this path, I would recommend that you keep your eyes on the goal, don't get too distracted by the enticing prospect of having your own fancy game engine, there's no shame in using someone else's engine to create something fun to play.

Hi, @codelyoko373!

I'm working on a game engine, too, so I will tell my two cents.

My game engine is written in C. Since you mentioned GLFW, I'm using GLFW, too, and OpenAL. For image loading, I'm using libPNG and libvorbis for audio loading (but I might replace them).

It takes time. A lot of time to "finish" a game engine. This amount of time will be determined by what you want to accomplish (is it a generic engine? For 2D and 3D?). The tools you use aren't even the big factor that will determine how long it will take. Most of your time will be spent designing things. How each piece of your engine will be integrated together (update system, rendering system, physics system, assets management, objects life cycle, main loop).

You mentioned you could use SFML. If I was using C++, I would use it. So, I suggest you to use it for two reasons. 1) because it already provides some basic stuff (like window creation, audio and image loading and drawing on screen) and GLFW will only provide window creation. ONLY WINDOW CREATION. I say that because you should be warned that making shaders and functions to draw stuff could be one step to jump if you use a tool that already provides that. 2) because you clearly are a beginner in the subject when you said "uses something called OpenAL for Audio."

I make game engine because I *like* to make game engine. The task isn't always enjoyed by many game developers, so you will hear a lot of "whyyyy?" IF you like to do it, do it.

Good luck! :)

Half of the entire point of writing a game engine is that you actually write it.  Forget about GLFW and friends and use Vulkan and/or Direct3D 11/12.
Use OpenAL for audio.

If all you are planning to do is cobble together a bunch of premade parts, then you haven't actually made anything and you have certainly learned absolutely nothing.  Making an engine means getting into the nitty-gritty.

You might end up using smaller libraries such as FreeImage to load image files because loading images is not part of the learning process, but if you want to learn graphics then you need to use Vulkan/Metal/Direct3D 12.  If you want to learn audio then you need to use OpenAL.  If you want to learn physics then you write a physics engine from scratch.  Want to learn networking?  Write it from scratch.

Asking for a bunch of libraries defeats the whole purpose of writing an engine.  And as mentioned above you need to have made games before in order to have a good idea as to how an engine should be structured and what it should do, but you are also allowed to make mistakes and start on a new engine later down the line once you have more experience, so don't be afraid to jump in.


L. Spiro

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

Forget about GLFW and friends and use Vulkan and/or Direct3D 11/12.
Use OpenAL for audio.

GLFW only provides window creation (Vulkan and OpenGL support) and callbacks for it (for each major platform). The only other option is writing each backend for each platform (write with Xlib for Linux, wgl for Windows, Cocoa for Mac) and writting loading libraries for OpenGL (if OP uses OpenGL), which I feel like something really out of scope and a big amount of work for a beginner to start seeing minimal results.

With exception of SFML, all other libraries are barebones, so I don't think they defeat the purpose of writing an engine.

This topic is closed to new replies.

Advertisement