Jump to content

  • Log In with Google      Sign In   
  • Create Account


What does the structure of a 3D game engine look like?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
13 replies to this topic

#1 DyeGuardian   Members   -  Reputation: 100

Like
0Likes
Like

Posted 11 February 2012 - 11:37 AM

I'm wondering what the structure of a 3D game engine is. I can't seem to find any online resources whatsoever on the subject. If I play to write an engine, I need to know what the structure of a good functioning engine is. And how it all works with each other and such.

Thanks.

EDIT: Also I've been looking into SDL and OpenGL but I have no idea how to implement them into or with an engine.

Sponsor:

#2 yckx   Prime Members   -  Reputation: 1163

Like
2Likes
Like

Posted 11 February 2012 - 12:43 PM

Honestly, if you're asking this question then you're not ready to write an engine. Don't worry about engines; write games. Once you get a few under your belt you'll begin to see parts that can be reused, bits that could be reused if they were coded a bit more generically, etc. Essentially your engine will grow and evolve over time from these bits. Without doing this you simply lack necessary experience to know how to approach things and what to avoid.

#3 DyeGuardian   Members   -  Reputation: 100

Like
0Likes
Like

Posted 11 February 2012 - 01:18 PM

Honestly, if you're asking this question then you're not ready to write an engine. Don't worry about engines; write games. Once you get a few under your belt you'll begin to see parts that can be reused, bits that could be reused if they were coded a bit more generically, etc. Essentially your engine will grow and evolve over time from these bits. Without doing this you simply lack necessary experience to know how to approach things and what to avoid.


Thanks for the reply. I am learning C++ at the moment, do you suggest I make games in this language?

I appreciate you taking the time to reply, I realize that I often thing bigger than realistic. I'll make a some small games (THAT FUNCTION!). Thanks.

#4 Marvel Magnum   Members   -  Reputation: 324

Like
2Likes
Like

Posted 11 February 2012 - 03:23 PM

C++ is a great language but its often not the right choice for people stating with programming. If you have experience with any other programming language then by all means go ahead with C++. If not, I'd recommend starting with some easier language like Python so that you can understand the logic of programming.

Here is something to get you started if you are new to programming and are willing to start the Python way:

1. Invent your own Computer Games with Python (Beginner Level)
http://inventwithpython.com/index.html

2. Making games with Python and Pygame. (Intermediate Level)
http://inventwithpython.com/pygame/

Both these books are free for online reading and are enough to get you started on the right track. Happy game programming! Posted Image

#5 yckx   Prime Members   -  Reputation: 1163

Like
8Likes
Like

Posted 11 February 2012 - 05:00 PM

I gues I could give some more immediately helpful advice ;)

C++ is rarely, if ever, a good first language to learn. It's possible, and many have gone that route, but people tend to recommend Python or C#, and you can get some decent early results with either language.

People often suggest starting with some simple text-mode games before moving on to shiny graphics: guess-the-number, is probably easiest and most common. Some people like to work their way up to a simple text-mode RPG. These programs help ensure you know the fundamentals of the language before tackling more complex problems.

Once you make the jump to graphics, the recommended path is: Pong, Tetris, Pac-Man, then some knd of platformer. Pong is about as simple a graphical game can get, but still offers plenty of opportuniy to learn. Each game builds on concepts learned from the previous one and introduces new problems to solve and game elements to consider.

Don't worry so much about making it "the right way." your focus should be on making it work. Nearly any chunk of code can be improved, and it's all too easy to fall into the trap of improving existing, working code rather than finishing the damn game. If you don't like the way you coded something or think there must be a better way, comment the hell out of it so you can find it again after the game is finished and playable, and ask about it here. Apply what you learn to your next game. Applying it to your last game rarely grants any obvious reward.

I would recommend sticking with 2D for a while. There is little if any real difference in the code, but 3D assets are more complicated than 2D assets (and generally take additional skills and software to create, although there are plenty available online if you can find something that suits your needs) and dealing with that added ccomplexity can distract you from where your focus should probably be.

Elements of a game engine include audio, graphics, user input, AI, asset management, game logic, save/load system, physics, networking… There are other possible systems and not all those listed are needed in every game. Each of those is a complex subject in it's own right, as well as the task of integrating them into a cohesive whole.

That should give you some stuff to think about and some direction, at least. Good luck and enjoy the ride. This hobby is both among the most frustrating and most satisfying experiences I've found ;)


Edited by yckx, 14 August 2013 - 07:52 PM.


#6 DyeGuardian   Members   -  Reputation: 100

Like
0Likes
Like

Posted 13 February 2012 - 08:26 AM

I gues I could give some more immediately helpful advice ;)

C++ is rarely, if ever, a good first language to learn. It's possible, and many have gone that route, but people tend to recommend Python or C#, and you can get some decent early results with either language.

People often suggest starting with some simple text-mode games before moving on to shiny graphics: guess-the-number, is probably easiest and most common. Some people like to work their way up to a simple text-mode RPG. These programs help ensure you know the fundamentals of the language before tackling more complex problems.

Once you make the jump to graphics, the recommended path is: Pong, Tetris, Pac-Man, then some knd of platformer. Pong is about as simple a graphical game can get, but still offers plenty of opportuniy to learn. Each game builds on concepts learned from the previous one and introduces new problems to solve and game elements to consider.

Don't worry so much about making it "the right way." your focus should be on making it work. Nearly any chunk of code can be improved, and it's all too easy to fall into the trap of improving existing, working code rather than finishing the damn game. If you don't like the way you coded something or think there must be a better way, comment he he'll out of it so you can find it again after the game is finished and playable, and ask about it here. Apply what you learn to your next game. Applying it to your last game rarely grants any obvious reward.

I would recommend sticking with 2D for a while. There is little if any real difference in the code, but 3D assets are more complicated than 2D assets (and generally take additional skills and software to create, although there are plenty available online if you can find something that suits your needs) and dealing with that added ccomplexity can distract you from where your focus should probably be.

Elements of a game engine include audio, graphics, user input, AI, asset management, game logic, save/load system, physics, networking… There are other possible systems and not all those listed are needed in every game. Each of those is a complex subject in it's own right, as well as the task of integrating them into a cohesive whole.

That should give you some stuff to think about and some direction, at least. Good luck and enjoy the ride. This hobby is both among the most frustrating and most satisfying experiences I've found ;)


Thanks so much for your big reply. I'm glad I could find the advice I needed, I think I'll create a free blog simply to track my own progress on. Maybe I'll post up my games as well. Hell maybe I'll get more support off that :P

Thanks!

Also, do you recommend C# over python because I plan to switch to C++ later?

#7 yckx   Prime Members   -  Reputation: 1163

Like
1Likes
Like

Posted 13 February 2012 - 01:37 PM

To be honest I'm not yet familiar enough with C# and Python to recommend one over the other. C# does have a more similar syntax to C++, but once you really have enough experience syntax tends to become less of a concern.

I strongly encourage you to begin a programming blog. You can have one right here at GD.net, and many people do. Documenting your progress helps in many ways: putting what you learn into words helps to reinforce the concepts in your mind; discussing your ideas for games helps you to develop them, and gives others the opportunity to provide input, which may lead to improved ideas; it gives you something you can look back on over time and see just how far you've come, giving you a sense of accomplishment; and it allows others to see what you're doing, which can inspire them to begin or resume game programming, and possibly have their own blog, which serves to expand and improve the entire community.


#8 DyeGuardian   Members   -  Reputation: 100

Like
0Likes
Like

Posted 15 February 2012 - 07:15 PM

To be honest I'm not yet familiar enough with C# and Python to recommend one over the other. C# does have a more similar syntax to C++, but once you really have enough experience syntax tends to become less of a concern.

I strongly encourage you to begin a programming blog. You can have one right here at GD.net, and many people do. Documenting your progress helps in many ways: putting what you learn into words helps to reinforce the concepts in your mind; discussing your ideas for games helps you to develop them, and gives others the opportunity to provide input, which may lead to improved ideas; it gives you something you can look back on over time and see just how far you've come, giving you a sense of accomplishment; and it allows others to see what you're doing, which can inspire them to begin or resume game programming, and possibly have their own blog, which serves to expand and improve the entire community.


Thanks a lot for all your helpful advice.

#9 Serapth   Crossbones+   -  Reputation: 5182

Like
0Likes
Like

Posted 16 February 2012 - 07:36 AM

To be honest I'm not yet familiar enough with C# and Python to recommend one over the other. C# does have a more similar syntax to C++, but once you really have enough experience syntax tends to become less of a concern.

I strongly encourage you to begin a programming blog. You can have one right here at GD.net, and many people do. Documenting your progress helps in many ways: putting what you learn into words helps to reinforce the concepts in your mind; discussing your ideas for games helps you to develop them, and gives others the opportunity to provide input, which may lead to improved ideas; it gives you something you can look back on over time and see just how far you've come, giving you a sense of accomplishment; and it allows others to see what you're doing, which can inspire them to begin or resume game programming, and possibly have their own blog, which serves to expand and improve the entire community.



Python has one advantage in that it is interactive, which is incredibly useful for learning to program. This means you can "watch your code execute" as you write it. On the other hand, the tooling support for C# is way better. Hell even MonoDevelop is a better IDE than the best of what's (freely) available for Python, although Komodo comes close. Additionally, Microsoft has put out a literal TON of learning materials for C#.

As a matter of opinion, I vastly prefer C# over Python, but then Python has always rubbed me the wrong way.

#10 Memories are Better   Prime Members   -  Reputation: 769

Like
0Likes
Like

Posted 16 February 2012 - 08:13 AM

I would recommend C# over python, mainly because of all the components and features of .net, plus your transition to C++ will likely go smoother if you started with C#, I am not really familiar with python, I typically dislike dynamic languages but for the sake of goals, C# may be a better option mainly because of its similarities to C++ and because it has XNA.

If you plan to use DirectX (or even openGL) in the future you can make use of SlimDX / OpenTK. I cant speak for OpenTK since I havent used it but SlimDX has all the features of DirectX and is really nice to work with, though I would suggest practising with XNA before DX/OpenGL

#11 lmbarns   Members   -  Reputation: 459

Like
0Likes
Like

Posted 16 February 2012 - 07:46 PM

Unity is a good starter engine as well, similar to xna but is already packaged so you don't have to decide what renderer, physics engine, etc you just start adding components and attach code to make them do stuff. It also works cross browser with a "flash like" plugin as well for nice 3d web games. Not sure what it would take to write 3d multiplayer games in c++....a team I imagine.

But xna would lead you through the entire process of learning all about game engines and probably prepare you better for openGL development down the road..

#12 FootSpaz   Members   -  Reputation: 103

Like
0Likes
Like

Posted 17 February 2012 - 02:43 PM

C++ is rarely, if ever, a good first language to learn.


I have to disagree with that statement. I learned C++ as my first language and I feel that was the best language for me to start with. My reasoning for this is because it forces you to learn the nitty-gritty details and really understand how almost all aspects programming works. This is assuming of course you have the right materials to help you learn the proper way of doing things. I would highly recommend purchasing a good book to help you with this; Accelerated C++ is a good choice and is also fairly cheap. The college I went to did an experiment one year where they tried to teach freshmen C# as their first language. This failed miserably and they switched back to C++ the next year. The problem they ran into is that C# holds your hand so much for beginner-level stuff that the students really didn't understand the core concepts of programming when they had to use a lower-level language like C++ or when they delved into advanced concepts in later classes. Most of the students from that year ended up retaking their first programming classes the following year.

That said, if you don't really want to learn and excel at programming so much as you just want to code up a simple game, then C# is an excellent starting point. That's also not to say you can't learn C++ after learning a higher level language first, it's just that it will most likely be a lot more frustrating and perhaps even more confusing than had you started with C++ or another lower-level programming language. In the end, you can really start with whatever language you feel like. Learning a new imperative language after you already have one down is generally rather trivial. Learning a functional programming language like LISP and Haskell can be very frustrating, but you won't need those for game development since game development is OOP (Object-Oriented Programming) based.

The reason I make such a big deal about how much hand-holding high-level languages like C# or Java do is because if you really want to get serious about game development then you are eventually going to need to understand advanced memory management and many optimization tricks because you're going to want to eek out as much performance as you can. Many of these things can't even be done is C#, you'll have to embed and call C++ code from within your C# program if you wish to do so. There's a reason almost every professional video game is written in C++ and that reason is because C++ is very nonrestrictive. As others have noted before though, that same freedom C++ gives you also allows you to very easily shoot yourself in the foot; something which is much more difficult to do in C#.


EDIT: If you just want to get started writing games, I second using C# with the XNA framework like Dynamo_Maestro and Imbarns mentioned. Not only is it easy and does a lot of the heavy lifting for you, there is all kinds of good documentation, support, and tutorials out there for it. You can also run your games on your XBox 360 if you have one.

EDIT 2: I was so busy responding to that quote I forgot to answer the original question. If you want to see what some 3D game engines look like then a good place to start would be open-source engines. Note that many of these will require a version control tool to download like GIT or Mercurial. You'll have to look into that on your own, but I highly recommend learning how to use a DCVS tool or at least SVN.

Professional
Community Created
  • OGRE 3D (Note that this is just a 3D render engine meaning it will only draw things, not run the code for your game.)


#13 Serapth   Crossbones+   -  Reputation: 5182

Like
0Likes
Like

Posted 19 February 2012 - 10:30 AM

Unity is a good starter engine as well, similar to xna but is already packaged so you don't have to decide what renderer, physics engine, etc you just start adding components and attach code to make them do stuff. It also works cross browser with a "flash like" plugin as well for nice 3d web games. Not sure what it would take to write 3d multiplayer games in c++....a team I imagine.

But xna would lead you through the entire process of learning all about game engines and probably prepare you better for openGL development down the road..


You know what, I used to share this opinion and I believe this site recommends Unity as a way to learn to program games, but I actually am starting to believe that isn't a good idea. I simply think starting in Unity would actually be a fair amount more difficult than XNA or otherwise, as you not only need to learn the language, but also the Unity way of doing things. I'm not recommending against Unity, I just not sure it's really a great place to start.

#14 yckx   Prime Members   -  Reputation: 1163

Like
0Likes
Like

Posted 19 February 2012 - 09:05 PM

I have to disagree with that statement. I learned C++ as my first language and I feel that was the best language for me to start with. My reasoning for this is because it forces you to learn the nitty-gritty details and really understand how almost all aspects programming works. This is assuming of course you have the right materials to help you learn the proper way of doing things.

That very assumption is why C++ is such a difficult first language. Without a good instructor a lot of the language's concept can be terribly confusing, and bad practices develop, even with a good book. And many, perhaps most, people here will begin learning C++ from websites that may have outdated, inaccurate, or poorly though out information; or from library books, which may be similarly out of date.

There are plenty of more general programming concepts that can be learned from easier languages without the distraction of needing to worry about lower-level stuff that is part and parcel of C++. I appreciate the example you gave of your school trying C# as an intro language, but I don't believe a single attempt of a single semester (or year) is enough data. I understand the school's decision to return to C++ since it's priorities don't really lend themselves to a more extended trial. But the anecdote as given lacks enough data to claim that C# is the reason the students were I'll prepared. It seems to me that the followup course (at a bare minimum) would also need to be restructured

So, yes, with the right instructor (and student) C++ can be a satisfactory first programming language. But I can't recommend it as a starter language in the general case.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS