wow you just motivated me to make an account and get better at C++! Thanks!!To develop an engine you need at first and only: Motivation
Without a game in mind which will use the game, you will lost your motivation very fast. Or why do you write it?
I myself started to develop an engine when I was 15 or 16... I had a game in mind... a big multiplayer first person shooter which was located in an open world. So I started... but don't find a good starting point... I really lost my motivation very fast. But this was not the end. After that I started to make an animation film... Again, I failed. Then I started a novel and understand that I really don't want to play or make a game.
I only wanted to tell a story. So I started my novel and continued to write it even today. I also continued my engine and it grew and grew... Today it is not finished, but this time my motivation is to make a game for my novel and to design huge software architectures. I really love design and this is the reason why my engine is alife even after 5 or 4 years.
What does that have to do with engine development?
Very much. Motivation is the most important basis you can have. But don't let it fly away. Fix it to something. I wrote myself a novel. What have you done?
Also buy books... many books... ten is not enough
Like Game Engine Architecture. Read all of them. Love them and of course understand them.
When you really only want to make a simple game you should use other available engines. Like Ogre, Irrlicht or maybe Unreal, Unity and if you really love high end, the CryEngine.
You have to invest a lot of time before you get something useful which you can call an engine. You will rewrite it many times. And everytime it will be easier. You will understand more and it will make you more fun. Of course there are also times where the motivation is down. Don't make you mad, you don't need pressure of time. I failed many times and I'm failing even today, but don't lost your motivation.
Maybe I've told a lot, but someday you will understand.
So at the end my suggestion to you:
Do it! Start your game engine development adventure!
Happy coding!
Ömercan
Game Engine Programming
#21 Members - Reputation: 111
Posted 23 August 2012 - 09:13 AM
#22 Members - Reputation: 358
Posted 23 August 2012 - 11:22 AM
Really? Coolwow you just motivated me to make an account and get better at C++! Thanks!!
This probably does not affect the plans of the OP but still: Networking and prediction last? Yikes!I'd say work your way through the list but leave all sorts of networking out of your first engine. Then, when you fell like you would like to add networking, start over again (probably using the parts of the first engine that you feel are working well) but plan the engine with networking in mind from day one.
I implemented things like NAT punch through, lobby servers and matchmaking before my engine could even create a window, and it has really payed off. I feel this is the only good way to create a networked game engine. This might be why you feel that "networking is the worst thing you will have to deal with".
That said, you can probably create a fully functional renderer and use it in a networked game engine just fine, as long as the renderer is separeted from the game logic, but only start create the GAME engine systems when you have your network layer figured out.
Just my two cents...
I also think that Network shouldn't be the last option. But it is also not the most important part. Design the framework with Network in mind.
You need at first a good object and class system. But please not a huge hierarchy tree. Also one root class like the QObject class in Qt is not really useful in game development (but in GUI developing).
My second suggestion: Don't make the underlying classes too general. You will lost much power and performance and in the end you will get spaghetti code because everything is done with the preprocessor and the template system.
To make a sophisticated design, I recommend UML tools.
Regards
Ömercan
PS: And on my mind don't use something like a signal slot system and over think the use of callbacks. But this all is up to you.
I have a blog: omercan1993.wordpress.com look there for more content
And I also do some art: omercan1993.deviantart.com
And whats about the Pear3DEngine? Never heard of it? Go and look!
Yeah, and currently I do this: SimuWorld
PS: Please look at this poll on my blog about scripting languages: A opinion poll about scripting language
#23 Members - Reputation: 291
Posted 23 August 2012 - 12:19 PM
Video of what I have written so far:
Now I'm implementing the converter into my program to win more development time.
I also have written a camera and system class so far. So I can check all input of the keyboard and mouse and change my camera with the input.
Edit:
Hmmm strange, my video is shaking and I have no idea why.. Recorded it with CamStudio.
Edited by EngineProgrammer, 23 August 2012 - 01:01 PM.
#24 Members - Reputation: 358
Posted 23 August 2012 - 12:25 PM
I have a blog: omercan1993.wordpress.com look there for more content
And I also do some art: omercan1993.deviantart.com
And whats about the Pear3DEngine? Never heard of it? Go and look!
Yeah, and currently I do this: SimuWorld
PS: Please look at this poll on my blog about scripting languages: A opinion poll about scripting language
#25 Members - Reputation: 689
Posted 23 August 2012 - 01:41 PM
There are plenty of existing solutions out there for game engines. If this is an educational experience I would say you would be better served downloading the source code to an existing game engine (idtech4's source was released recently) and modifying a piece at a time. You will see more immediate results and get a look at how things are typically done (with the idtech4 suggestion this applys to the way id software writes FPS games).
Writing an engine first with the intention of using it to build a game will only limit what you can do in the game later on. Perhaps you didn't forsee a certain condition in your game that your engine wasn't designed to handle. Changing that could mean a major refactor. Alternatively, if you focused on just building a game first, an engine will naturally develop as a consequence of developing games repeatedly and identifying chunks of code that you use over and over again which you can set aside and bundle into what would be your engine (a big hunk of reusable code).
Also be careful when trying to become familiar with a ton of different areas of programming at once. Don't mistake the notion of being familiar with a concept and actually truely knowing a concept. When I was first starting out I would focus on a ton of different concepts only to declare that I "know" an area of programming and can move on to the next. This was not the case. I had a shaky understanding of what is kind of going on. What I'm trying to say here is that you should pick an area that's interesting to you first to focus on. Put your time and energy into one area whether it be physics simulations, artificial intelligence, shader programming, particle systems, whatever. Keep building your programs around that specific subject and keep working on that until you truely know it. Simply glossing over the details will only be doing wrong by yourself. Don't cheat yourself out of properly learning the ideas.
#26 Members - Reputation: 291
Posted 23 August 2012 - 02:35 PM
And because the game engines at school are very bad ( bad framework, lots of bugs, etc ) I'm writing a Game engine for the school project I am going to make.
The school project must be finished in may so I have plenty of time left.
And I'm also doing this to learn how to engine program. It's quite fun. :-)
#27 Members - Reputation: 1138
Posted 27 August 2012 - 12:35 AM
Also, does someone have any tips for me I can use to create an efficient engine?
Yes; don't write an engine.
Write a game, extract parts from it, reuse those parts in another game and repeat. In time the reusable parts will form an 'engine' as you become more experianced.
Attempting to sit down and write an engine without a game to focus it will result in unusable junk which you will just end up re-writing as soon as you want to use it in any real sense. Lack of experiance making games will just make this problem even worse.
EVERY good game engine out there has grown out of being used in a game (or series of games) first and then recycled. This is the only way to ensure you get something usable.
Exactly. Just make a game, with some re-usability in mind but don't over-sweat it if it gets in the way of getting game done (it shouldn't get in the way of getting things done anyhow). If you want to get a game done it may, in most cases, be better to use something like Ogre.
On the timeframe, it can vary wildly with regards to what you want to do and how experienced and productive you are. Keep in mind that even old engines (Quake 2 for example) took a lot of manpower.
#29 Members - Reputation: 291
Posted 28 August 2012 - 12:15 PM
I love all those low-level programming of Win32
But yes indeed, I need to write games, get the reusable code from it and make my engine that way.
I'll do that but to write my game I also need to write some 'engine' code.
Here is an example of what I have so far.
- Specular shading
- Bump mapping
- Camera that can move around
- I have also made a modelreader ( .obj ).
- ( And many more: text, 2D bitmaps, textureshaders, multitextureshader, etc )
But now. I'm not working with Mesh Loader of DirectX yet. I found the algorithm to read in obj files into C++. But I have a little problem now. As you can see in the video I don't have smoothing groups yet.
Can someone help me out a bit for that? In the .obj file there is this kind of data:
s 4 f 1/1/1 2/2/2 3/3/3 f 3/3/3 4/4/4 1/1/1 f 5/5/5 6/6/6 3/3/3 f 3/3/3 2/2/2 5/5/5 f 7/7/7 8/8/8 6/6/6 f 6/6/6 5/5/5 7/7/7 f 9/9/9 10/10/10 8/8/8 f 8/8/8 7/7/7 9/9/9 f 11/11/11 12/12/12 13/13/13 f 13/13/13 14/14/14 11/11/11 s 1 f 15/15/15 16/16/16 17/17/17 f 17/17/17 18/18/18 15/15/15 f 15/15/15 19/19/19 20/20/20 f 20/20/20 16/16/16 15/15/15 f 19/19/19 21/21/21 22/22/22 f 22/22/22 20/20/20 19/19/19 f 21/21/21 23/23/23 24/24/24 f 24/24/24 22/22/22 21/21/21
s : smoothing group
f : faces
How do I enable the smoothing into my model? The normals I read in should normally create the smooth rendering but it doesn't. So I'm missing something but I dont' know what. Also what do I need to do with the value for the smoothing?
Yes I noticed. Already changed it 2 days ago. Thanks!Should release in the reverse order of allocation to avoid deadlock (in general)
Edited by EngineProgrammer, 28 August 2012 - 04:27 PM.
#30 Members - Reputation: 837
Posted 29 August 2012 - 10:50 AM
It appears the integer after the "s" is the smoothing group number. It also appears that if the file did not contain vertex normals (vn) then you may have to create some yourself and then interpolate them across smoothing groups (groups of vertices).
#31 Moderators - Reputation: 13494
Posted 29 August 2012 - 11:11 AM
I'd suggest using constructors/destructors and not using the singleton anti-pattern:As I said, I would put some code down. Here you go:
...So this is a basic code of my WinMain.
Creating Engine objects using Singleton design.
Asking the Game class for the properties and initialize engine with it.
int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE, LPSTR, int nCmdShow )
{
T_Engine engine;
T_Window window( hInstance, nCmdShow );
T_System system( engine, window );
StarBattle starBattle(engine, window, system);
// Run the Message loop
MSG msg = {};
int iTickCount = 0, iTickTrigger = 0;
while( msg.message != WM_QUIT )
{
if( PeekMessage(&msg, NULL, NULL, NULL, PM_REMOVE) )
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
else
{
iTickCount = GetTickCount();
if( iTickCount > iTickTrigger )
{
iTickTrigger = iTickCount + 1000/engine.GetFramerate();
starBattle.GameUpdate();
starBattle.GameRender();
}
else
{
Sleep(1);
}
}
}
return TRUE;
}This is good advice, and N.B. this happens automatically in the above re-write, when not over-engineering thingsShould release in the reverse order of allocation
Edited by Hodgman, 29 August 2012 - 11:14 AM.
#32 Members - Reputation: 291
Posted 31 August 2012 - 03:12 PM
But I've asked my docent at school and he told me a way to do it. So should work now.. When I've written the code.
About the singleton, yes I've already changed my framework for that.
So last thing I want to say is kinda off-topic.
I'm starting a journal so you guys can watch my progress!
Feel free to follow my blog.
http://www.gamedev.net/blog/1543/entry-2255042-creotex-engine-introduction/
I'll post Part 1 with some code this night. First I want to be sure everything runs smoothly so I don't show you bad code.
#33 Members - Reputation: 121
Posted 01 September 2012 - 04:57 AM
Free C++, OpenGL, and Game Development Video Tutorials @
www.marek-knows.com
Play my free games: Ghost Toast, Zing
#34 Members - Reputation: 291
Posted 01 September 2012 - 07:20 AM
But for every game I need graphics, models, shaders, sounds, etc. So I can directly put all of those into my engine so I don't need to worry about them anymore later on.
But I'm putting all those piece of codes in small classes to have a nice overview of my engine. I love clean code.
My motivation breaks down sometime because I want to rewrite the whole framework when it's "bad". This is my 5th try to get a nice framework and it's already looking good so I think I have a good structure now.
#35 Members - Reputation: 291
Posted 01 September 2012 - 07:30 AM
Everyone remembers this line of code?
static LRESULT CALLBACK WndProc(...)
When you got this method:
LRESULT CALLBACK Class::HandleEvents(...)What did you do to be able of calling that method?
There are some possibilities.
- Using singleton design
- Using a global pointer
- Creating the pointer using WM_CREATE and then make calls when the pointer exists.
That's all what I can think of at the moment.
I've found something ,even better, you don't need anything of the three above!!
static LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
return ((Window*)GetWindow(hWnd, 0))->HandleEvents(hWnd, msg, wParam, lParam);
}
Now the strange part comes up.This pointer that is returned is always nullptr. Never it will be allocated or initialized with an existing pointer. But.. The is not a single crash, he can call every method inside that class.
But does someone knows the disadvantage of this code? Because in all those years of programming I can't be the first one who noticed this? Is this an "unstable" line of code?
~EngineProgrammer
Edited by EngineProgrammer, 01 September 2012 - 07:31 AM.






