How much planning do you do before programming the various systems in your game?

By that I mean how much of a system do you plan on a technical level before you starting working on it. Do you just think "I want a combat system that plays like this" and jump right in? Or do you sit down, make UML diagrams and outline how the combat system will work on a technical level and how it interfaces to other systems or other parts of your code. Somewhere in between or even more extreme?

The reason I ask is that for the most part I've just sat down and coded stuff, and figured out how it should work on the fly. Then I would later go back and change it as needed. However I've been working on a project inspired by Paradox Interactive's Victoria 2. I've found that the Pop (population/people) system requires a lot of interfacing with other systems such as how I am handling industry, taxes, good markets, etc. All of these are interconnected. Pops work in industries, pay taxes, and buy goods off the market. Industries use the pops as employees to produce goods to sell on the market, the industries also pay taxes and many times have to buy goods on the market too.

Sometimes I spend more time changing how things work than creating new code because I didn't think ahead and I "designed" my systems in such a way that it is difficult for them to interface together in a coherent manner or it ends up really messy. My "code by the seat of my pants" approach isn't working too well. In a current school project we design everything in discrete units before we start working on it. It is mostly just "What does this do, what data is it working with, what other systems does it need to connect to, what does it need as inputs, and what does it output" answered in a paragraph and a simple drawing with some boxes and lines, but I found it goes a long way. All our code is mostly independent and decoupled and makes connecting everything together relatively simple.

As a side note I have a few friends who refuse to do any planning on any projects because every project we tried sitting down and plan sizzled out and lost interest before any code was written. They now have an attitude that planning is just procrastination unless it is something you plan out in under 10 minutes when you get stuck. I personally blame the failures on undeveloped ideas and temporary enthusiasm of a new project that "sounds cool". They are actually really bitter about failed and unfinished projects which makes it difficult to work with them but that is a whole other subject.

I would like to incorporate more technical planning in my own non-school projects and I was curious to see what everyone else did.

Posted May 20, 2016, 10:09 PM UTC

5345
Forbizzle•

Honestly after 20 years of programming, not a lot. I integrate my planning into my work. Recognizing when there's a hard problem and white boarding it out quickly. Code should be self explanatory, and if you need massive documentation its probably overly complex.

41
Kondor0@AutarcaDev•

Same here, after doing this for years I just use my instinct and experience. Of course, this is only effective if you work alone.

15
badsprite•

It works in groups as well provided you have some division of responsibility and your team is mature enough to know when to bring others in.

1
nickgiarraputo•

Ditto. At this point, I think too quickly to plan things out on paper, doing that would just cause me to lose track. As long as your code is readable and well organized, planning is not necessary.

1
Vasebbit•

Write everything you do as DRY, KISS, and modular as possible.

Past that, I generally just think of what I want for a few minutes, then make it.

7
_real_rear_wheel•

Don't forget to stay agile and scrum yourself

15
Vasebbit•

Only if you let me waterfall.

7
Rozard•

How do you stay DRY in a waterfall?

3
green_meklar•

That sounds like pretty extreme programming.

4
Vasebbit•

You just have to believe.

1
DanaLovesVidya•

Also don't forget to WIPE your ASS.

3
AccidentalRebel@accidentalrebel•

The amount of planning I do really varies and greatly depends on the number of days I have alloted to it (being on a schedule, i don't have the luxury to spend more than a week on planning).

The most important thing is that I should have everthing written down and laid out. I write down tge systems first, plot their interconnections, then I try to makr a really simple class diagram (which a lot of people think is a bad idea because you are effrctively setting what you think should be the code's structure in advance. Nevertheless, I am used to thid process as it helps me give a quivk overviee of the system. The trick is for the prigrammer to be flexible enough to change the system when needed).

By the time the deadline ends, i start coding. Doesn't matter if I finish planning or not. As long as I have a basic overview of what I need to do, then most of the time, it is enough.

6
warddav16•

I much prefer to code things out before I commit to any sort of design or interface. For personal projects or small teams, I think its way better to do the easiest thing possible and refactor your systems as you start to identify patterns. Its much easier to cut and paste common code together than it is to try to change an interface that's implemented many different ways. If all your project needs is circles, there is no need to make "shape" until you see more shapes and how they behave. On larger teams or more professional projects, its good to have one or two people pioneer out use cases via coding, but chances are you have a lot of experience on the team and can identify what you want, and also identify common pitfalls your interface might be locking you into. In this case, after some initial research its better to sit down and make a formal design. (All of this is IMO)

EDIT: Reading your post more in-depth, I think even though you end up having to change things on the fly because you didn't design your system upfront, I find its far more common you don't know all of your use cases up front. And although you may feel it takes time to refactor, and feel if you had done more upfront design you could have avoided it, I feel as though if you design a system upfront, and it doesn't work out, or maybe more use cases/systems to need to integrate with start coming up, it will make your code even more messy and harder to change than you might feel it is right now.

5
himsonis it naptime? ( ु⁎ᴗ_ᴗ⁎)ु.。oO•

My experience with planning vs programming work differs from project to project due to the structure of the game and/or the tools used to create the game.

I've been through a few game projects during college where my friends and I met quite a bit to flesh out the world of the game and the story, but it ended up never coming to fruition. At the same time, I've worked on hackathon and class game projects where everybody rushed into coding which resulted in nice presentable game demos, but never a full releasable game.

I think more important than the amount of planning vs programming in making a game is the amount of both motivation and discipline that exists during creation. If you get more motivated from seeing stuff on the screen, put more focus on programming and fast cycled agile development. If you get more motivated from seeing a clear and structured design and overall vision of the game, put more focus on planning and making well formed diagrams.

Personally, I like to start by quickly programming a proof of concept demo with little to no planning since I get really excited by seeing my work come to life. That then motivates me to go into a long period of planning which usually results in almost all the code from the demo getting scrapped. Then I attempt to make a bare bones version of the game to see if the plan worked out and go from there.

4
tovivify•

Most of my programming work happens on paper, with the use of flowcharts. I decide how I want a given mechanic to work, and how it would interact with the rest of what I have in mind. Then I start drawing out how it would have to work, and in what order. Then I actually sit down and start typing.

3
Jebediah_Johnson•

Could you show us a picture of some of your notes? I'm just interested in seeing what kind of pen and paper planning you do.

3
tovivify•

Nice try, Slugworth.

Just kidding! I had to find some that don't outright give away what I'm working on, or show any spoilers.

Number 1

Number 2

I start out writing down an overview of an idea. This could be anywhere from a single line, to a few paragraphs, thoroughly outlining how it will work. Then comes the technical phase, where I use these weird vertical flowcharts, with arrows pointing every which way. If I already have an idea of the functions I plan to use, I may try and write out some pseudo-code, like in pic #2. Stage three is going and typing it up, seeing if it all works, and trying to simplify and optimize the code. Step four is fixing all the inevitable bugs.

3
2DArray•

Times when you should draw a diagram:

  1. When you can't or don't want to solve it in your head

  2. When you don't want to explain it to someone with words

Once you've drawn a diagram of it once, it'll be easier for you to visualize/communicate later.

A guiding theme is more useful than a big detailed plan (at least from my perspective), because as you said, gamedevs end up changing everything after it's implemented, anyway - nobody gets every guess correct on the first try. When something doesn't work the way it's intended to, the big detailed plan has to be rewritten - but the guiding theme, on the other hand, will continue to show you the way forward.

3
seamuncle•

Concept everything. Vertical slice with the fastest, partial, most garbage, as-hoc code I can churn-- monolithic, unmaintainable. I can usually get some kind of nasty concept working in under a week. Once I've written enough to understand what the game really is--from an effort to feature perspective, what's not covered by the slice because it fall more under design and less under code and what I can pull in from another game, I then start a new project and rewrite all of it based on whatever I just learned.

3
systembreaker•

What's more is that it's not rare to suddenly realize the crappy ad-hoc code is actually useful and not so crappy, and voila! your work is done and you can move on.

2
Mylon•

Not nearly enough.

I just started hammering away at my game hoping to have SOMETHING besides vague ideas. Then I find out I'm repeating myself a lot so I refactor my code to simplify things and then I find out I'm still repeating myself so I refactor again to save more time. And then I end up wondering how to approach a problem and afraid to start because I might be doing it "wrong" until eventually I pick a method and start hammering away and then half-way through I find a way to save time and I start refactoring...

But hey, at least I'm making progress instead of just wondering about making my own games.

2
Sabre070•

I think you've got to think about the individual project when asking this question.

Are you working alone? Small group? Large group?

The more people you work with the more planning you'll need - this is important even if they're not programmers, it's good to be able to know what you're going to end up with a bit more than just a general idea.

Is this game big, small, something you've done before or something new?

The easier a project is the less planning you probably need. If you're doing the design then you can do it on the fly, get something playable then work out what other things you can add from there.

Are you working to a deadline? Do you need to make things to show investors or interested audience? Is the game your job, a hobby or project?

The more "commercial" thinking will require more planning, no point spending 10s/100s hours on programming something if you don't end up with something to show for it - both from a technical view and a demonstration one. If you know you have a set budget then working out how long things will take and how you can implement them is important.

Are you making something to specification or on the fly?

If you know what game you're going to make then it would be better to plan out most of the core systems first. You can make something playable before spending a lot of time planning more complex systems, but just having something working is huge for motivation and working with other team members (art, audio, etc).

Similar to this, if you've already got a plan in place for most of the game then you'd probably want to plan the programming - just so you can figure out if everything is possible for you to implement and timely. This more comes into the commercialized games but time is still valuable and cancelling projects sucks.


Every project is different. Personally I'm currently doing design, 3d modelling, marketing, community and some programming, so most of my work is in planning - it doesn't really come down to the technical nature of how they'll be implemented but it's good that each of our 3 core team members (programmer, artist and myself) have a good idea of our expectations.

2
omegachysis•

As of late I have figured out I am much more productive when I just sit down, balls deep and start throwing code out there. The more time I've spent planning usually the worse off my implementation has been (I tend to overthink).

I still want an idea of the actual target behavior of course, but as of the actual implementation, it just feels more natural to not think too hard beforehand. Programming this way gets a lot easier with time and practice.

That being said, I strictly enforce good programming principles on myself while I do this (DRY, unit testing, detailed documentation... etc.). If you don't do that you are setting yourself up for failure, especially with a large project.

2
sip_of_hemlock•

Every barrier you erect between the moment you have an awesome idea and the moment you finish your first prototype of it exponentially increases the chances that you'll abandon it. If I could time travel to my college dorm room for sixty seconds, I would burn my massive stack of game engine diagrams and write "JUST BUILD A DAMNED PROTOTYPE BRO" on the bathroom mirror in blood.

2
cowvin2•

for me, it depends on the complexity of the system and whether other people are involved. the more people are involved and the more complex the system, the more likely that it's necessary to discuss plans ahead of time and design interfaces. what you're doing in school is teaching you how to work with other people or work within larger codebases.

if you want to work on large projects, you need to learn how to divide up work with abstraction and encapsulation. i've known a lot of effective solo programmers who do not work well with other people because they are poor at communicating interfaces and such.

2
MLG_Panda•

I always write things down with pen and paper and try and plan out my attack and work out problems before they are code level problems. Basically anything that can be physically written should be before you open your computer.

2
gendulf•

For a while I was trying to think of the best way to do things, and implement the best systems. Now I'm creating weekly milestones for things that should be done and only working on those things.

Planning comes when I finish my weekly milestone, and need to prioritize features. Systems get planned when I start fighting my code, or start a new feature that needs to be broken down into smaller pieces.

The code may not be elegant, but progress is getting made, and I'm planning features, rather than systems.

2
StyxArcher•

Usually 5-10 minutes per hour of coding depending on the difficulty. If I know logic/order is going to be an issue I may take a little longer. It is usually no more then a flow chart and a small paragraph of what I plan on doing.

2
Dworgi•

I sketch things out on paper generally whenever a problem would require designing or refactoring. I'm mostly just trying to minimise complexity and keep things self-contained.

2
relspace•

Depends, sometimes I dive right into it, sometimes I prototype it.

For a dungeon generation system I created a stand alone application during development. For a powerup system I just started adding them and testing to see what was fun.

2
systembreaker•

There's such a thing as over-designing something. The risk is where you'd make too many wrong assumptions and code a gigantic pre-designed system that you later end up tearing down anyway because your assumptions were wrong.

As long as you're working by yourself, I'd recommend more of an iterative approach which is light on the designing. Have a starting point, then make code changes and such and just have the goal of getting back to your starting point (in the case of intangible changes such as refactoring) or getting back to your starting point + one single feature implemented correctly. In the latter, that becomes your new starting point for the next iteration.

Try not to risk becoming too "academic" about your designing where you're making diagrams and stuff just because your professor said that's how design works. Heavy design documents are more of a communication tool between members of teams. University system design classes are purposely made to prepare people for industry where you'll be working on teams or have a successor inherit your code someday.

For yourself, just make a simple document that has a list of features you want and below that a todo list that you can cross off and add to as you go along.

2
poohshoesMoonBus, Kradens Crypt•

Spending lots of time refactoring existing code is perfectly normal as it's very hard to know what will be the best system before you have made it. If some code gets messy and you will be visiting that code often then take the time to clean it up.

1