Jump to content
  • Advertisement
Sign in to follow this  
NoodleCandy

Questions about different pieces of a game

This topic is 1715 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello there,

 

I'm looking to make a small game (more of a tech demo, really). I have some experience programming in C++ and am even currently playing around with OpenFrameworks. With OF, I've learned to draw shapes, move them, and even do very simple collision detection between them. I'm very inexperienced with making games through object oriented programming though so I'm hoping you people could guide me in the right direction.

Currently in the middle of learning vectors and storing instances of an object within it and my end goal is to create a top-down 2D game where shapes will be spawned by an EnemySpawner class. These shapes will fly at the player character which will be controlled via mouse and said shapes are erased once off-screen. I have an idea of how I'll structure the classes but I'm unsure if there are tools I can learn to make some tasks easier.

 

For example, if there were 20 shapes on-screen at once, I could run a loop that will check any intersection between those shapes and the player or the edges of the screen. Is a loop really the way to go about this or could some sort of game framework abstract this away somehow? I'm talking out my ass due to inexperience but these are the kind of issues I'm wondering about.

Share this post


Link to post
Share on other sites
Advertisement

Thanks for the reply! I'm also now bookmarking your signature's tutorials ph34r.png

 

I agree with what you've said, in that I should start with baby steps. It's just I look at my brute force loop code and can't help but be disgusted. I see your point in:


Finding a framework or being told a better way to do it will be doing you a disservice.

However, that's the problem I'm facing at the minute. I'm not entirely sure how to find more efficient ways myself, though I'm about to look up tutorials on the things you've mentioned like occlusion. I suppose I was asking to skip too much when I asked about game engines, it's just that I wasn't sure if I should be using them to speed up learning. Perhaps what I should have asked for is tutorials?

Share this post


Link to post
Share on other sites

I agree about trial and error.  However I'd like to add that using resources is also a good thing.  There are books about how to make engine components, like Logging, Resource Management, Rendering ect...

 

If you are doing 2d I would suggest reading the new SFML2 book in my signature.  They build a large framework in it. 

 

Also there are a few books about 3d engines that go in depth into the components of an engine.  Some good ones are the links below.

 

I read this one, its good for learning about each engine component seperately.

http://www.amazon.com/Game-Engine-Design-And-Implementation/dp/0763784516/ref=sr_1_3?ie=UTF8&qid=1383156729&sr=8-3&keywords=game+engine

 

I read this one too, its good for learning how to write an entire 3d engine from scratch

http://www.amazon.com/Game-Coding-Complete-Fourth-Edition/dp/1133776574/ref=sr_1_4?ie=UTF8&qid=1383156774&sr=8-4&keywords=game+engine

 

I haven't read this one but people seem to like it

http://www.amazon.com/Game-Engine-Architecture-Jason-Gregory/dp/1568814135/ref=sr_1_1?ie=UTF8&qid=1383156774&sr=8-1&keywords=game+engine

Share this post


Link to post
Share on other sites

Thanks for the reply! I'm also now bookmarking your signature's tutorials ph34r.png

 

I agree with what you've said, in that I should start with baby steps. It's just I look at my brute force loop code and can't help but be disgusted. I see your point in:

 

 


Finding a framework or being told a better way to do it will be doing you a disservice.

However, that's the problem I'm facing at the minute. I'm not entirely sure how to find more efficient ways myself, though I'm about to look up tutorials on the things you've mentioned like occlusion. I suppose I was asking to skip too much when I asked about game engines, it's just that I wasn't sure if I should be using them to speed up learning. Perhaps what I should have asked for is tutorials?

 

Again hands on is the best way to do it.  There arent actually a ton of tutorials or books about optimization, especially not aimed at the beginner level.  You can get things like Game Programming Gems, but those books are aimed more towards experienced game developers.

 

 

My suggestion to you, implement it however you can, clean your code up until you are happy with it, then create a thread here or somewhere else asking for recommendations on how to improve it.  This really is one of those things experience will teach you.

Share this post


Link to post
Share on other sites


If you are doing 2d I would suggest reading the new SFML2 book in my signature.  They build a large framework in it.

 

I'll be having a look at those for sure, since 2D is definitely the direction I'll be going for now until I feel comfortable.

 


Also there are a few books about 3d engines that go in depth into the components of an engine.  Some good ones are the links below.

 

Those books seem very interesting and I notice that the Game Engine Architecture book has a segment about good C++ coding practices. Hopefully these books will answer the question I originally had which was:"What the hell does a game engine even do?"

 


My suggestion to you, implement it however you can, clean your code up until you are happy with it, then create a thread here or somewhere else asking for recommendations on how to improve it.

 

Great! I'll be experimenting using your C++ with SFML and 2D Gamedev math tutorials so I hope you'll keep imparting wisdom on such things.

 

 

One thing; as I mentioned in my original post- I've been toying around with OpenFrameworks. The reason for it is that, to my understanding, it wraps a whole bunch of libraries into one which seems to be similar to what SFML does. Graphics, audio, windows, events, some math, etc. Would you have any idea if SFML does anything special that OpenFrameworks can't do? At the moment, OF provides a very easy interface to FMOD which I need for Fast Fourier Transforms. I'm hoping I could keep a portion of my code using OF.

Share this post


Link to post
Share on other sites

I’ve written a tutorial on a very fast quadtree structure that can be used to speed up collision tests with each other, the player, edges of the screen, etc.

Efficient Instant-Insertion Quadtrees

 

It performs extremely well even on low-end devices, but it is not a good starting point if you want to learn about quadtrees in detail, although I doubt it is too advanced to figure out if you put your mind to it.

 

A quadtree of any kind (mine or your own) would be the next step up in looking at how to get performance out of collision detection and there is plenty of material online about their concepts.

 

 

L. Spiro

Share this post


Link to post
Share on other sites


Efficient Instant-Insertion Quadtrees

 

Thank you for the reply but my eyes melted a little. I think I understand the premise but the implementation is something that will probably take a while to wrap my head around.

Share this post


Link to post
Share on other sites

Will you be using physics in your game? If you are, libraries like Box2D will do the collision detection for you and you just handle it in the callback functions it gives.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!