• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
superman3275

I need help with structuring, really bad!

10 posts in this topic

I've recently ran into a LOT of problems with how I structure my code. I just don't have a very good idea about object oriented properties/inheritance/encapsulation. If anyone can recommend some books, free pdf's, pod-casts video tutorials, anything about structuring object oriented systems(Especially specifically involving game development). I would like to do a lot of reading on this(2+ hours a day) so I can become a better programming. All recommendations are helpful [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]
0

Share this post


Link to post
Share on other sites
Figuring out what should be objects, what they should inherit from, Especially Reusable code, etc. I more or less need something to help me understand how I should apply this to video game programming. Also, I'm refining my list:
•Books about linear algebra
•Books about C++
•Books about graphics programming
•Books about object oriented design
•Books about writing cleaner code.
Please Give me everything you got, especially about linear algebra :)
0

Share this post


Link to post
Share on other sites
[quote name='superman3275' timestamp='1349064095' post='4985635']
Figuring out what should be objects, what they should inherit from, Especially Reusable code, etc.
[/quote]

Code reusability != inheritance.

Nor does it really necessarily have anything to do with object oriented programming. There are design techniques you can apply (composition, inheritance, etc.) to achieve code reuse, but you can also get a lot of code reuse if you write in a somewhat functional style. Another way to put it: Try to move as much as code as you can into pure functions/methods. For example, you could write your physics, general math, and collision code as a collection of simple functions, then piece them together however you need. You don't need to worry about shared state as much and it makes your code easier to test. I would also argue that it makes managing the complexity (of games) much easier.

Neither OO nor functional programming are silver bullets, in my opinion. In my (limited) experience with writing game code, it seems that a balance between the two approaches is very nice. It depends on what type of component you're trying to build--"best tool for the job" and all that. =)

For reference, there's a nice blog post about functional programming written by John Carmack: http://www.altdevblogaday.com/2012/04/26/functional-programming-in-c/
1

Share this post


Link to post
Share on other sites
[quote name='thok' timestamp='1349100536' post='4985753']
[quote name='superman3275' timestamp='1349064095' post='4985635']
Figuring out what should be objects, what they should inherit from, Especially Reusable code, etc.
[/quote]

Code reusability != inheritance.

Nor does it really necessarily have anything to do with object oriented programming. There are design techniques you can apply (composition, inheritance, etc.) to achieve code reuse, but you can also get a lot of code reuse if you write in a somewhat functional style. Another way to put it: Try to move as much as code as you can into pure functions/methods. For example, you could write your physics, general math, and collision code as a collection of simple functions, then piece them together however you need. You don't need to worry about shared state as much and it makes your code easier to test. I would also argue that it makes managing the complexity (of games) much easier.

Neither OO nor functional programming are silver bullets, in my opinion. In my (limited) experience with writing game code, it seems that a balance between the two approaches is very nice. It depends on what type of component you're trying to build--"best tool for the job" and all that. =)

For reference, there's a nice blog post about functional programming written by John Carmack: [url="http://www.altdevblogaday.com/2012/04/26/functional-programming-in-c/"]http://www.altdevblo...ogramming-in-c/[/url]
[/quote]

I use the same approach for most of my game code, trying to strike a balance between OOP, DOP and functional programming based on where each paradigm makes sense.
My math library which I've developed over the years is written using a completely functional approach for example as this provides a more natural approach to 'doing math' with a very clean and re-usable structure, while systems which have to process a lot of data will use a data-oriented approach, just to give an example.
0

Share this post


Link to post
Share on other sites
When I first started programing (not too long ago) I found myself in a similar boat. The syntax of the language made sense, but I couldn't wrap my head around what code to write where, when to use composition, when to use an interface, when to use inheritance, how to compartmentalize, etc. I didn't even know where to begin to start learning through trial and error. I found "Head First Design Patterns at Barnes and Noble, and it did a very good job of explaining design patterns, along with good OOP principles and concepts. It is writen with Java examples for code, but the patterns and concepts it goes into are univerally applicable. While everyone's learning styles are different, I found this book to be exceptionally helpful.
0

Share this post


Link to post
Share on other sites
[quote name='superman3275' timestamp='1349064095' post='4985635']
•Books about writing cleaner code.
[/quote]

Take a look at this one: [url="http://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882/ref=cm_cr_pr_sims_t"]http://www.amazon.co...cm_cr_pr_sims_t[/url]

[EDIT]
I found the book free online and want to assume this is a legit site? (I just Googled the book name and it was the second link). If not I am deeply sorry and appologize. You should buy the book either way as it's a great read.
[url="http://www.e-reading.org.ua/bookreader.php/134601/Clean_Code_-_A_Handbook_of_Agile_Software_Craftsmanship.pdf"]http://www.e-reading.org.ua/bookreader.php/134601/Clean_Code_-_A_Handbook_of_Agile_Software_Craftsmanship.pdf[/url] Edited by UltimaX
1

Share this post


Link to post
Share on other sites
In VB we have #region "Name Here" #End Region to help organize the code. I recomend you write it all down on paper and organize it there first. Once you start to code sometimes it becomes a giant mess unless you plan it out on paper first. Hope that helps.
0

Share this post


Link to post
Share on other sites
I can help. but as exchange. you must help me with my english.
if you agree. contact me.
my email [email="boyue@rocketmail.com"]boyue@rocketmail.com[/email]
0

Share this post


Link to post
Share on other sites
Like the first reply stated. Just keep coding and you will see good patterns emerge.

Write the dam application and then you will spot the parts that you can generalize and move up the class hierarchy for reuse later. Don't even create an hierarchy until you find clear examples of duplication in your code.
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0