• 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
buumchakalaka

Good habits for game development

35 posts in this topic

i want to add that during development keep in mind that at some point you will need some debug information displayed in the game. a really simple example: mouse coordinates (screen vs world), number of textures, number of vertices, state of an agent and so on, and so on. so when you think about the structure of the code, think about that too.

1

Share this post


Link to post
Share on other sites

If you want to design your game (or more precisely your game engine) up front, before coding something wrong and useless, elaborate your requirements in detail: there are features you really need, features which are likely to be useful, with vastly different priorities, and features you don't need.

Apart from discovering important decisions and complications early in the process to adjust your game design towards feasible objectives, knowing what you want is necessary in the choice of libraries, data structures, algorithms, contrasting architectures.

1

Share this post


Link to post
Share on other sites

I think an object oriented language is the way to go for organization and maintenance (not speed though but it's fast enough for 99% of the code).

 

- Encapsulate as much as you can. I end up re-factoring my code all the time. To think you'll get it right the first time every time, or that you won't change your mind is silly, and the more you have things encapsulated the easier it'll be to re-factor things around without breaking the things that rely on the code. It also allows for experimenting with new ideas without breaking existing code. Even if you think something is small, encapsulate it because chances are you'll come back and make it more complex eventually and doing this can really make your life easier later.

 

- Make self containing code as much as possible. The more your code relies on each other the harder it'll be to make changes without breaking a bunch of stuff. This again allows for easier changes that don't break as much code if any. I like using event programming for this so that my objects fire events and other objects can subscribe to these events if they want. This way my objects aren't tightly coupled together (ie the HUD object doesn't need to directly know about the Player object), and don't rely on polling systems which waste time.

 

- Always make sure your code compiles each day that you are done with it. Don't leave compile errors overnight. Logical errors are OK to leave, but be sure to note them.

 

- I'll contradict Servant's comment and say, never use goto, global's, or macro's. In my 15 years of programming I've never used goto outside of first learning it. It's simply not needed. Globals took longer for me to realize their danger but eventually I have seen the harm they cause and haven't used one myself (libraries you use might) for probably the last 8 years. Stick to a singleton if you need something like a global. Macro's start out making your code easier and then you start abusing them and they actually end up making your code harder to read & maintain. 

 

- The biggest thing I think is to make your functions small! They should be visible on about 1 "screen". Any bigger than that and it's most likely doing too much and should be split. It will also be harder to maintain than a small specific function. This is important, as it's all to common to see new programmers putting so many things into giant functions. Don't do it! This is worth repeating. Practice doing this until it's second nature. This is a big one.

Edited by rpiller
0

Share this post


Link to post
Share on other sites

One thing that helps me get things done is having a deadline. Preferably a deadline that you cannot push back like for a contest. When you have a deadline it helps you keeps your project simple and cut out unnecessary features so the focus becomes finishing the game rather than trying to see how many awesome features can make it into the game. Even if you cannot find a contest or other hard deadline still try to set out a realistic timeline for yourself and follow it. If you find your initial estimates weren't accurate adjust them. But break up your project into smaller pieces and tackle one piece at a time.

2

Share this post


Link to post
Share on other sites
For C++, I'd recommend reading C++ Coding Standards by Sutter and Alexandrescu. The table of contents by itself is helpful, but the full book contains discussion like reasoning and exceptions to the general rules. The only problem is that it predates C++11.

 

I just came across this the other day. Scott Meyers' range of Effective C++ books are also a great read on best practices

1

Share this post


Link to post
Share on other sites

@jbadams

 

I stand by the small section of my comment you decided to quote. IF one wants to go the global route, use a singleton because it offers more benefits than a pure global. You may not think those benefits are worth anything but I do. Benefits in refactoring at a later date to actually be a normal object, better organization & structure, encapsulation, etc. A singleton is clearly better than a global because it's wrapped up in a neat little class and you get the benefits that classes get. Because that allows for more flexibility and organization than a loose global variable. Yes, they have the same scope, but one adds more benefits than the other, does it not?

 

I don't get belittling the benefits of what a class offers and clearly " just because it's wrapped up in a fancy class" is belittling what a class offers in it's tone.

-3

Share this post


Link to post
Share on other sites
And in general, what I should consider for become a better game developer and make better games?

 

Finish what you start ... when you start a game, finish it.

 

This leads to a natural corollary, Don't start things that are too big for you to finish.

Edited by jwezorek
2

Share this post


Link to post
Share on other sites

I have to agree with the comments suggesting source control, even for relatively small hobby projects. I've found it really helps me stay organized--the free online repository site I'm using has a built-in issue tracker, which has been much more useful than my previous system of scribbling down random problems and planned features as I thought about them in a notebook. It encourages you to set specific, incremental goals--and them meet them before moving on to something else.

Edited by TheSasquatch
2

Share this post


Link to post
Share on other sites

[quote name='TheSasquatch' timestamp='1358625548' post='5023275']
the free online repository site I'm using has a built-in issue tracker
[/quote]

Which free online repository site are you using?

2

Share this post


Link to post
Share on other sites

the free online repository site I'm using has a built-in issue tracker

 

Which free online repository site are you using?

Didn't want to sound like I was advertising, nor stir up a Git vs. Hg firestorm, so I didn't name names, but I suppose there's no harm in saying Bitbucket. Github probably has similar features, but the deciding factor for me was Bitbucket's unlimited free account for those with a .edu email address. As a broke grad student, I couldn't turn that down.

1

Share this post


Link to post
Share on other sites

Something from writing/fixing others code :

 

If there is some parameter flags that cause variations of behavior of a subroutine - clearly comment this  at the parameter definition and down in the code where trhe different modes take action.  (Im not talking about simple subroutines but ones hundreds and thousands of lines long that it may not be productive to have a variant copy customized for each 'mode'.)

 

Especially if the scope of the differences cause odd side-effects or have important limitations.

 

Document those (if not anything else) becase of the amount of the time/effort it takes to trace thru the code again  to figure out what it does and once you find it (as when fixing other peoples poorly documemnted/commented code)  it can save the effort or repeating the detailed logic tracing.

 

Anything with weird/atypical/convoluted behavior should get priority for comments if there is little time for any done systematically (its just a fact in the real world that you dont always have the resources to do a full commenting/documentation).

 

----

 

 

And when I make many such comments I make them very plainly stand out so that its hard to miss  (indicating that the codes behavior is something to be wary of)

2

Share this post


Link to post
Share on other sites

Some general things, most of them independent of coding style:

 

- Have realistic and well defined goals that are clearly communicated to members on your team

- Scope it down: your game idea is probably too damn big.  Polish takes time, things get cut, features don't exist in a bubble (unless the project fails that is).

- Iteration time is everything: Fail early and fail often, prototype mechanics, and be prepared to cut something you invested a considerable amount of time in

- Knowledge is power: profile your code, run tools that check for leaks, crank up compiler warnings, and use static analysis tools if possible

- Interfaces are king: A well designed one is the root of a clear, maintainable, and productive workflow for others.  A poor one will cut into iteration time.

- Understand that hard problems will inevitably contain immensely complex code: elegant systems rarely survive contact with real users

- Embrace time estimates and embrace making time estimates that might be completely wrong.  Do this over and over and over again.

- "Self Documenting Code" is probably only documented to you

- It's (usually) not done until it's data driven

 

 

 

Edited by l0k0
2

Share this post


Link to post
Share on other sites

[quote name='wodinoneeye' timestamp='1358779996' post='5023907']


If there is some parameter flags that cause variations of behavior of a subroutine - clearly comment this at the parameter definition and down in the code where trhe different modes take action. (Im not talking about simple subroutines but ones hundreds and thousands of lines long that it may not be productive to have a cariant copy customized for each 'mode'.)
[/quote]

 

I'm going to agree here, on the caveat that youl should avoid writing this kind of code as often as possible in the first place.  Sometimes it's unavoidable, but it's a code smell that should be minimized.  A function should ideally do one thing.  It's not really one of those lofty architecture astronaut ideals 99% of the time either.

1

Share this post


Link to post
Share on other sites

Incredibly helpful thread! 

 

Here's my tip... define your goals ahead of time, both for yourself and for the project.  If you're doing it to learn then take every chance to learn.  Try out new approaches to various coding problems even if you're already comfortable of some other way of doing something.  Having more tools at your disposal for the future is what learning is all about.

 

On the other hand, if your primary goal is to create an awesome game and to hell with everything beyond it, then do the opposite of the above.  If you know a way to solve a problem, don't worry about whether or not its the best way or even necessarily a good way, provided it works and it does the job you wish it to do. 

 

In reality, most projects are going to be somewhere between those two extremes.  Learn how to balance the benefits of taking time out of your project to learn something new versus just powering through with what you have understanding that there might be better ways of doing things out there but knowingly declining them for now.

1

Share this post


Link to post
Share on other sites

For games, especially if you are designing, you are much less an engineer and much more a sculptor, constantly pushing and pulling things around, removing unneeded bits and adding extra bits.  Plan for things to change, 

 

  1. Get a playable version as fast as possible. Even if it all gets thrown away.
    • Prototyping is a design step, a pre-production step.
    • Its going to help in planning and identifying what really needs to be implemented.
  2. Design up front just enough to get a good idea of what you really need.
  3. Implement the minimal amount.
  4. Schedule the minimal amount.
  5. Art and sound and nice assets can wait.  Make things work first.

 

And the last thing is my personal law for programming.  It might sound stupid but it helps in about a million ways.

  • Never write a function longer than 50 lines (including white space and comments).  Decompose. make it fit on a single page.  
Edited by HAM
2

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