starting game engine

Started by
17 comments, last by ATC 11 years, 6 months ago
Hello everybody!!

First of all, sorry for my english... I'll try to do my best!!

I am studying videogame programming, and this year I'm going to do a basic game engine.

I'm searching about information like physics, math, libraries, how to start, etc.

I have the basics, a window class that open a window, a basic input class, my general personal types (int8, uint16, etc) and a clock class that test the velocity...

If anyone knows webs, topics in this web, tutorials, etc. please share this wisdom with that poor programmer!! happy.png

Thank you very much!!
Advertisement
When it comes to physics, math, etc., you will have to ask a more specific question. Your current questions are too broad.

Generally people will use existing physics engines such as Bullet. Trying to write your own will be too overwhelming at your current level.
You will also need to specify the rendering API you are using. If DirectX 9, you can use the DirectX math library. This will however tie you closely to DirectX, meaning no chance of porting your engine in the future (though since it is just for learning that may not be a problem).
Otherwise, you can find how to write vector and matrix classes easily via Google.


My site aims to document the creation of a next-generation engine and has tutorials useful to beginners.

Fixed-Time-Step Implementation
General Game/Engine Structure
Passing Data Between Game States


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

Write games, not engines: http://scientificnin...mes-not-engines
If you, after reading the article, still want to write a game engine. Continue reading.

What can the game engine you have in mind do? Is it capable of cross-platforming(Windows,Mac,Xbox,Ps3,etc)? Do you want to work with Win32, DirectX, OpenGL, etc?
Is it a 2D or a 3D engine? Will it be commercial, open source, private?

cross-platforming:
To get the cross platforming done you need to check how a window is created on all consoles, how the type id's are called, etc.
Here are some defines that will help you:

#ifdef _WIN32 || _WIN64
#elif __APPLE__
#if TARGET_OS_IPHONE
#elif TARGET_OS_MAC
#endif
#elif __linux
#elif __unix
#elif __posix
#else // unknown platform
#endif


Win32, DIrectX, OpenGL:
Win32 is the standard library of C++. It's only supporting windows.
DirectX is the best choice, even it's not supporting cross-platforming yet. With the possibilities of this library you can create any application you have in mind!
OpenGL and DirectX were racing neck on neck a few years ago but they update of DirectX made OpenGL run behind. But it's an easy language to use.

Commercial, open source, private:
If you want to make a commercial engine like CryEngine, Unity... No chance on your own so forget this. laugh.png
If you want to make it open source, be sure to really have everything bug-free, error-free. You don't want the clients to complain about your engine, even it's open source.
If you want to make it private, I think you are better of with a simple framework instead of an engine. smile.png


~EngineProgrammer


EDIT: I'm regretting this post immediately. sad.png
Is this a school project? Or does 'studying' mean learning about it on your own?

If it's a personal project I'll give 2 solid pieces of advice which have been floating around these boards for a long time:
1. Make games, not engines (as the poster above me pointed out already)
2. If you have to ask how to make an engine, you're not ready to make an engine.



Win32, DIrectX, OpenGL:
Win32 is the standard library of C++. It's only supporting windows.
DirectX is the best choice, even it's not supporting cross-platforming yet. With the possibilities of this library you can create any application you have in mind!
OpenGL and DirectX were racing neck on neck a few years ago but they update of DirectX made OpenGL run behind. But it's an easy language to use.


Why do you drag Win32 into a discussion of graphics APIs? Win32 is not the C++ standard library for windows, Win32 is the basic Windows API which exposes Windows core functionality to developers.
The latest OpenGL release also made it basically on par with DirectX again, so there's no issue there. I also wouldn't expect DirectX to ever go cross-platform (at least not in a way condoned by microsoft), but that doesn't mean an engine shouldn't support DirectX even if that engine will be cross-platform.


If you want to make it open source, be sure to really have everything bug-free, error-free. You don't want the clients to complain about your engine, even it's open source.


There's no such thing as bug-free or error-free software :D

I gets all your texture budgets!


[quote name='EngineProgrammer' timestamp='1349653462' post='4987801']
Win32, DIrectX, OpenGL:
Win32 is the standard library of C++. It's only supporting windows.
DirectX is the best choice, even it's not supporting cross-platforming yet. With the possibilities of this library you can create any application you have in mind!
OpenGL and DirectX were racing neck on neck a few years ago but they update of DirectX made OpenGL run behind. But it's an easy language to use.


Why do you drag Win32 into a discussion of graphics APIs? Win32 is not the C++ standard library for windows, Win32 is the basic Windows API which exposes Windows core functionality to developers.
The latest OpenGL release also made it basically on par with DirectX again, so there's no issue there. I also wouldn't expect DirectX to ever go cross-platform (at least not in a way condoned by microsoft), but that doesn't mean an engine shouldn't support DirectX even if that engine will be cross-platform.


If you want to make it open source, be sure to really have everything bug-free, error-free. You don't want the clients to complain about your engine, even it's open source.


There's no such thing as bug-free or error-free software biggrin.png
[/quote]

Sorry for my misunderstanding about Win32. I meant the header file <windows.h> with Win32. And that can also be used to write a game engine with, so I dragged it into this discussion.

About OpenGL, my programming lecturer said 3 weeks ago that OpenGL is running behind DirectX and he is looking updates about programming stuff every day so I assume he is right. smile.png
Though I should have checked first on their sites before posting it here. My apologize.
But still, I've programmed with OpenGL last year for a month, I think it was child coding to be honest. But in a year allot can happen of course. smile.png


There is no such thing as a bug-free and error-free game engine?
Yes there is... With enough checking code, and a good team of programmers. laugh.png
But yes, it all depends on the client who uses your engine. If he can't work with it properly failing stuff will happen indeed. But that's not the fault of the engine but of the client. Still, a good engine would be prepared for moments like that and be sure to have enough error checking.

But my experience in programming isn't that much, I just try to help others with the knowledge I have at the moment.
If you can give me an example of an unfix-able piece that you can't keep error-free, please tell because I want to know. smile.png


~EngineProgrammer
It's not about single unfixable pieces of code, bugs can always be fixed one way or another (if they can't there's something wrong with your design), but when a project grows and starts to get more and more complex the potential for bugs to creep in grows as well.
Now let it be so that game engines themselves are incredibly complex pieces of software which have to process loads of data coming from different sources and all in different formats made by different authors, all of that preferably at a very high speed as well. Now also let it be so that there's no way of knowing whether you've actually found all bugs in a piece of software like that. Of course, there are approaches in software development which tend to aggressively test and check for bugs (like extreme programming), but these might not be feasible when working with time constraints and still do not guarantee that you'll find all bugs in your code.

You can be sure of the fact that all the major commercial AAA engines have bugs in them, some more critical than others. It's up to the developers and maybe testers (like when it comes to games) to locate and categorize bugs in software. Then it's just a matter of determining what is acceptable for release and what isn't, and eliminating the bugs which are deemed non-acceptable.

EDIT:

Here's a fitting quote:

"Everyone knows that debugging is twice as hard as writing a program in the first place. So if you are as clever as you can be when you write it, how will you ever debug it?"

I gets all your texture budgets!

I will have to disagree with the notion that one should NEVER write an engine... Tell that to the developers of Unity, Unreal, etc... they will just laugh, and the company execs will smile at you and drive away in their Aston-Martins and BMWs (after, of course, wishing you luck with your "Super-Pong VIII" project)... Writing a good engine can result in hundreds and hundreds of successful games by "in-house" and 3rd party developers, and mounds upon mounds of cash. Though writing an engine that good is extremely difficult it has been done more than a few times by more than a few people and companies...

But I have to agree that just writing a "generalized" engine without ever developing any games or sample apps to drive development and solve specific problems is a bad idea. You'll end up creating an engine that does a little bit of everything but is relatively useless for practical and commercial purposes. The approach I advocate is to drive your engine development by way of continuously evolving samples/demos which implement the core/structure of various types of games. Over time those should evolve into complete games. As development progresses you will identify common functionality that is needed by games, eliminate junk/bloat, reduce bugs, increase speed, etc... That is essentially what an engine is; common functionality needed by games and/or a hosted environment for the game to run in.
_______________________________________________________________________________
CEO & Lead Developer at ATCWARE™
"Project X-1"; a 100% managed, platform-agnostic game & simulation engine

Please visit our new forums and help us test them and break the ice!
___________________________________________________________________________________

I will have to disagree with the notion that one should NEVER write an engine... Tell that to the developers of Unity, Unreal, etc... they will just laugh, and the company execs will smile at you and drive away in their Aston-Martins and BMWs (after, of course, wishing you luck with your "Super-Pong VIII" project)... Writing a good engine can result in hundreds and hundreds of successful games by "in-house" and 3rd party developers, and mounds upon mounds of cash. Though writing an engine that good is extremely difficult it has been done more than a few times by more than a few people and companies...

But I have to agree that just writing a "generalized" engine without ever developing any games or sample apps to drive development and solve specific problems is a bad idea. You'll end up creating an engine that does a little bit of everything but is relatively useless for practical and commercial purposes. The approach I advocate is to drive your engine development by way of continuously evolving samples/demos which implement the core/structure of various types of games. Over time those should evolve into complete games. As development progresses you will identify common functionality that is needed by games, eliminate junk/bloat, reduce bugs, increase speed, etc... That is essentially what an engine is; common functionality needed by games and/or a hosted environment for the game to run in.


I don't think anyone here stated that you should never write an engine, but coming onto a forum asking how to write one generally shows that you lack the fundamental understanding of game development required to actually build a usable engine.

I partially agree with your last statement, but I wouldn't consider it a good practice to drive engine development purely on samples. If you don't have a fully defined goal/game in mind to drive your engine then you'll probably end up with that relatively useless engine you mentioned, and I don't consider tech demos or samples proper goals.

I gets all your texture budgets!


I don't think anyone here stated that you should never write an engine, but coming onto a forum asking how to write one generally shows that you lack the fundamental understanding of game development required to actually build a usable engine.


It has been said in a few threads around here, and there are quite a few articles out there on the internet where people scoff at the concept of an engine entirely. But I wasn't accusing anyone here in this thread of such radical views.


I partially agree with your last statement, but I wouldn't consider it a good practice to drive engine development purely on samples. If you don't have a fully defined goal/game in mind to drive your engine then you'll probably end up with that relatively useless engine you mentioned, and I don't consider tech demos or samples proper goals.


Of course not... if you're trying to drive development purely on tech demos and samples you're making exactly that useless engine... I'm just saying that tech demos and samples are a good starting place for getting your engine working, figuring things out and getting a good foundation for your engine. But then you have to switch gears and start writing some games and practical applications... that is, after all, what the objective of an engine is: to write games and apps. Failing to do so is like training an army shoot guns well but never teaching them how to actually fight and win in combat. You'll have an army of good marksmen, yes... perhaps the best shooters in the world... but they'll be totally scattered and routed by a well-organized and trained army with far less-capable marksmen and equipment.
_______________________________________________________________________________
CEO & Lead Developer at ATCWARE™
"Project X-1"; a 100% managed, platform-agnostic game & simulation engine

Please visit our new forums and help us test them and break the ice!
___________________________________________________________________________________

[quote name='Radikalizm' timestamp='1349715178' post='4988035']
I don't think anyone here stated that you should never write an engine, but coming onto a forum asking how to write one generally shows that you lack the fundamental understanding of game development required to actually build a usable engine.


It has been said in a few threads around here, and there are quite a few articles out there on the internet where people scoff at the concept of an engine entirely. But I wasn't accusing anyone here in this thread of such radical views.


I partially agree with your last statement, but I wouldn't consider it a good practice to drive engine development purely on samples. If you don't have a fully defined goal/game in mind to drive your engine then you'll probably end up with that relatively useless engine you mentioned, and I don't consider tech demos or samples proper goals.


Of course not... if you're trying to drive development purely on tech demos and samples you're making exactly that useless engine... I'm just saying that tech demos and samples are a good starting place for getting your engine working, figuring things out and getting a good foundation for your engine. But then you have to switch gears and start writing some games and practical applications... that is, after all, what the objective of an engine is: to write games and apps. Failing to do so is like training an army shoot guns well but never teaching them how to actually fight and win in combat. You'll have an army of good marksmen, yes... perhaps the best shooters in the world... but they'll be totally scattered and routed by a well-organized and trained army with far less-capable marksmen and equipment.
[/quote]

Ok, we're on the same level here :D

There are indeed articles going around which are quite harsh against the idea of writing an engine, but I believe those articles are mostly aimed at exactly those people who need to scour the internet for a tutorial or guidebook on how to build one. If you are comfortable with all the required concepts to build advanced games or an engine, and if you have a desire to actually build one then you should by all means build one.

I gets all your texture budgets!

This topic is closed to new replies.

Advertisement