Game Engine

Started by
12 comments, last by WhiteSponge 8 years, 7 months ago

Hello forum mates.

I'm new here and I hope to stay.

I have a rather simple question yet I believe the answer will be much more complex.

I would like to ask for a somewhat simple explanation to what does making a game engine (from scratch) means.

For example I follow Notch (Markus Persson) on Twitter and he always write about how he likes to develop his own engines when he is working on a game, like Minecraft with JAVA for example.

I'm learning C# for about a year now on my own using books and internet sources and developing a little game was always a dream of mine, which is why I would like to understand a bit more what it means to develop a game engine.

Thanks in advance, I really hope someone will have a meaningful answer, and please don't even bother writing to me "ever heard of a search engine?" and so on, it is the first stop, always.

Advertisement

First define what you mean by "engine?"

At the most generic level, a game engine is just a bunch of code and/or tools that you use to build or run a program you call a "game." So what kind of game do you want to make, and what kinds of supporting code will it need? How much of that supporting infrastructure is uniquely critical to the kind of game you are building (which means you should it yourself)? How much of that supporting infrastructure is not uniquely critical (such as rendering or physics), which means you should just integrate existing middleware?

Note that by "uniquely critical" I mean "you want something different that existing middleware cannot trivially provide."

There's no single true path forward here, which is why in general if you have to ask "how do I build a game engine?" you probably shouldn't, and should instead simply focus on building concrete games with defined goals, and refactor your engine out of the reusable components of those games over time.

Thank you so much for the quick reply.

So here is another question, is it possible to make a 2D side scrolling game out of pure C# code?

From all I have learned the past year I believe I am capable of creating a program with a database to write and view recipes for example, but I can't wrap my head and figure out on my own how to use the C# knowledge I have to create even the smallest game.

Maybe I don't have the right thinking to develop a more complex project than a simple program...

Unless you are building an engine for the goal of an engine instead of building a game, it's more practical to just make games.

After you've made several games, and you grow in skill, it becomes clearer what part of the game is generic and what part is project-specific (or genre-specific), and allows you to more cleanly separate those areas of code.

Many beginners think they need an "engine", because it sounds cool, without even knowing what it is, or what it isn't. Not to mention that "engine" is a poorly defined word anyway - some people think Engine means an SDK that includes editors, other people think it's just an API with a higher level of abstraction.

Many simple games don't use "engines", especially if they are 2D. Many attempts to make custom engines result in fancy tech demos but without any games ever being built with it.

In my opinion, the best way to learn to make games is to - for a year or two - forget that the word "engine" exists, and just make games (unless you are using an already-existing engine, which is a good idea in some cases).

The best way to design an engine from scratch is to already have experience from making games.

Thank you very much Servant of the Lords your reply made it much more clear to me.

So now I stumble upon my second post on this thread, how do I start making a game using C#, I simply can't get my mind to understand how I start.

Is it possible by using visual studio only? Must I use some third party IDE?

All I find online is Unity and XNA which isn't supported anymore.

A game is a program that displays pretty (changing) pictures while you interact with it.

So, all you need is an input from you (keyboard, mouse), and a way to display pretty pictures / text/ etc.

The game then basically constantly monitors your input, and moves the time forward, eg changing the scenery, moving the enemies somewhat, etc.
Finally, it draws the new picture, and the cycle starts again.

It does this at say > 15-20 times a second, which we experience as a fluid motion.

I'd say start simple, eg pong or tetris

XNA is still being developed as an open source lib called MonoGame, you can find more here:

http://www.monogame.net/about/

Currently working on a scene editor for ORX (http://orx-project.org), using kivy (http://kivy.org).

Thank you all for the information, all of you are helping me a lot.

Now here is a noob C# question this might not be the place to ask..

How do I make it so the program is always ready for a certain input?

So every time the key "Right Arrow" is being pressed a picture box will move one pixel to the side no matter what other methods and code ran..

Games are basically infinite loops. They look (conceptually) like this:


LoadResources();
SetupStartingState()

bool stillPlaying = true;

while(stillPlaying)
{
     HandleUserInput();
     UpdateGameLogic();
     DrawEverything();
}

FreeResources();
EndProgram();

Any keypresses that get received by the operating system get added to a queue, and inside your 'HandleUserInput()', you empty the queue and handle all the input, before continuing on to update and draw everything.

That's step one of game architecture: learning the basic game loop.

Step two would be learning about 'game states'.

Thank you, once more, Servant of the Lords.

This is a starter baseline I hope.

Do I close this thread somehow? I got all the answers I needed.

This topic is closed to new replies.

Advertisement