Making a Game Engine

Pages: 12
Say one wanted to make a game engine, like a doom game engine, the whole game being no larger than 13 megabytes.

How long would that take? Just one person writing it.

Also how much effort would it take? On a scale of 1 to 10.

Is it similar to writing a book? Because with book writing some authors take several years, but everyone knows you can write a long ass (pretty good) book in about a month or two. Or will writing a game engine basically just take 2 or 3 years?

I really would like to get started on this soon, I only have a very rudimentary knowledge of C++, having learned it only for a few weeks, but I know a bit of Perl and Python and have noticed that they are sort of similar.

Besides writing C++ code what else would I have to do? (something about directx, opengl, sdl) Is it possible to write the whole thing purely in C++?

Keep in mind I'm not computer savvy, so simple answers would help.

tyvm
That depends on what you want your game engine to be able to do. Based on that, it could take you from a few days to a few decades if you're working on it alone (assuming you were already a skilled C++ programmer).

First, you have to get better at C++ and create several games of your own to get an idea of what a game engine needs (that would be those parts that you keep on reusing or rewriting in the majority of your game projects).
Well say it was just a very simple doom-esque engine (the game doom) that I wanted to replicate. Not exactly the same but similar. Would it take long? Is that what you mean by what the engine is capable of? Sorry I'm not that knowledgeable about computers.
bump
I'm not that knowledgeable about computers.
Would it take long?


For you? Yes. =P


3D worlds have a lot of complex computations that need to be done for line-of-vision tests, collision detection, and other things. It involves a lot of mid-to-high level math.

That's not to say it can't be done, but it definitely should not be a first project. Start with something simpler like a simple 2D run-and-shoot game or something. That'll give you an idea of what to expect when you move onto larger projects.
So long as in... several months? Or years etc?

Also what's Allegro is it a game engine or an api?

I think I might use it.
Do you want your game to be good or crap? If you want it to be crap I'd say you could probably write it on a napkin in a few hours, but if you want it to be good (like doom for example) I'm gonna go with a few years.

The other option would be to take a game like doom and edit the sprites and levels. Then you could make a decent game in a few weeks, although you'd have to be careful about which game you edit if you want to distribute it, because you may or may not be in breach of copyrights. This is called mod-ing by the way, and you can do for just about every game in some form or another. Maybe that's your best option?
Last edited on
Crappy game it is then!

Are you sure it would take a few years, cuz carmack wrote doom in less than a year. And that was in 1993.

Plus some other guy said I could do it in.a few weeks. I.mean the original doom BTW not doom 3.

Anyways what's allegro?
I would not let the math of a game engine deter you from the attempt to create one. First off, I would ask you how your linear algebra skills are with matrix operations. If you can master that, and be able to produce algorithms from it, you should not have a huge problem writing a game engine - beit 2d or 3d.
Last edited on
If you know as much about programming as john carmack did in 93 then sure, you could write it in a couple of months...
Well no, you are right, I am no genius.

But at least trying is better than nothing, plus there are considerably more resources today then before, hopefully with tutorials and all that I could do it.

Either that or I could just use an existing engine, but never settle for less eh? lawl
Well it is always an argument of reinventing the wheel. Some people say there is a better, more optimized solution, others laugh at the idea. That's the glory with programming.
If some they hadn't reinvented wheel, we would still use square ones then.
Last edited on
A friend of mine started building a space simulator a few years back. He build the fundamental skin (ie. the "world" and the "ship" and the tools for inserting objects) and collision detection in a couple of weeks. The difficult part was all the little things you never think about.

For example, he wanted to have a first person and 3rd person view (a la lara croft) of the spaceship. The trouble was, what should it do if you accelerate really fast? Well, to make it look like you're accelerating you need the camera to shift back slightly as the ship acclerates, as if it's trying to catch up. This creates the sense of acceleration. Trouble is, if you accelerate too fast, the ship just dissapears and the camera has to catch up. We ended up building a complex suspension/dampening system that took about a week to write, all to get the bloody camera to look cool in 3rd person.

Then we applied it to first person. Trouble was, the head of the pilot (ie. camera) would bounce out of the ship at high G's. So we had to create a "wall" (ie. the head couldn't bounce out of the ship). But you don't just want it to stop at the wall because that looks ridiculous, you need it to approach it and then stop. So we had dampening that also approached infinity at the wall. Anyway, you get the picture, it got immensly complex.

It's the little things that make it take long, and unfortunately they're often also the hardest to forsee...
Last edited on
Aight I've decided to use a free open source engine to do the game instead.

I'm just wondering which one to use, I need one that does programming in C++. Or was written in C++. I'd also prefer the engine to also be able to do sound and input.

I just can't seem to be able to find one that fulfills those requirements. The annoying part is that there's Allegro, but Allegro is written in C, I don't want to learn C.

Then there's Blender and Panda3D, those use Python and crap, I know a bit of Python and Perl having originally learned those before C++ but I really don't want to revisit other languages. So if anyone has any ideas, many thanks!
1) Learn a lot of math
2) Learn how to *really* (key part) program in c++ (6 years; including time to learn design patterns)
3) F... Play around with opengl for 6 months
4) Start creating your engine and then quit it once you learn everything you wanted to.

NEXT

EDIT: Guess you could combine 3 and 4, just dive in and learn/test
Last edited on
K I'm gonna dive in with allegro, wish me luck!

Actually I'll just wish myself luck!

Good luck!
It probably wouldn't take that long. But you probably can't do it.
If you want something C++y, and with lots of useful features besides basic gfx, sfx, ui and timers, I would recommend SFML: http://www.sfml-dev.org/

Also: http://cplusplus.com/articles/1w6AC542/
6 years to learn C++? you kidding me? you can probably learn the key concepts of C++ within 2 weeks if you worked hard.
6 years is if you would want to Master C++, Not really build a game engine?-stop discouraging them for god sake!

you have to think about the things you need to learn, Like windows programming first.

People seem to think that once you learn a Programming language, that's you done...
"You can code anything in the world!!"

-This is not the case. Programming isn't just learning a language but it's also about understanding how that language is implemented in a system which has been developed for you to use. in this case, Windows (or the platform you want to build games for.)

you need to study the platform's technologies, ie, Windows uses DirectX as a graphical API, which you'll need to effectively display a model on screen.
(if you don't know what a model is, you can pretty much give up now.)
Pages: 12