Advertisement Jump to content
Sign in to follow this  
XNobodyX

Properly planning a game and its structure

This topic is 1836 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

Preamble:

I have attempted to make 2 little indie games and each of them have failed for one reason, planning. For both of the projects I started off only planning to have a few parts to the game. As I started to code those parts I would realized  that each of these parts needed a lot more code and classes and such than I originally thought. The problem is I would have already coded the majority of the game before I realized this. Thus leaving me with two options, 1) Rewriting the whole game, and throwing out countless hours of time. 2) Giving up sad.png . After thinking about where I went wrong it would always come down to the fact that when I started writing the game I didn't fully understand what I needed and thus didn't design it properly. I figure that this might happen a lot in many games(Realizing that a major change needs to be done) and I imagine that they don't all restart or quit. Which leads me to the conclusion that my planning might not be sufficient but the main structure of my code might be the problem. When I looked over my first game I found that a lot of my code was very specific and could not be easily rewritten without affecting other parts.

 

The question:

1) How do you go about properly planning a game and allowing major changes to be made without a re-write?

2)To avoid problems with having to rewrite everything should I try and write everything as a module that can be used in a main game loop?

 

If anyone has any good ways of organizing a game that you could point me to that would be awesome(Currently I am using the Model, View, Screen system)

Share this post


Link to post
Share on other sites
Advertisement

This is a problem I am kind of facing as well =/. I've had to resign to starting over due to not knowing an efficient way to continue my code and seeing that I was headed towards coding myself into a corner.

 

Any insight on dealing with this or avoiding this in the future would be greatly appreciated.

Share this post


Link to post
Share on other sites


1) How do you go about properly planning a game and allowing major changes to be made without a re-write?

Paper and pencil is really the way to go.  Sketching things out is a great way to work out ideas. Use of formal tools, like UML, is entirely optional -- if you think that they help, go for it!

 


2)To avoid problems with having to rewrite everything should I try and write everything as a module that can be used in a main game loop?

Do it, if it makes sense. But avoid over-generalization -- YAGNE!

 

 

Happy hacking!

Share this post


Link to post
Share on other sites
Code wise, not sure. As for gameplay, keep wrting each idea on a book (books for me), when you've reached a point where you think it's alright, read through the whole thing and make sure it flows naturally, removing and adding ideas till you feel it's good. It could help you guess what the code will be like.

Share this post


Link to post
Share on other sites

L. Spiro has pretty much nailed it in the head. I would like to add a slight bit of advice though that I've read a long time ago and I can't remember where it's from: Always try to refactor your code before throwing it away. I find this is a better approach when it comes to learning because by fixing the code that you know is broken, it forces you to think about why it's broken and what the correct solution is. When you just start over and toss the other code aside, you're just making another shot in the dark. That's really just the way your memory works too. If you don't think about something extensively, you decrease your chances of remembering it.

 

Initially, this process will take a mighty long time, but the more you do it, the better code you'll write in the first place. As an example, I program my UI's by hand, and, at first, the UI code alone would give me so much trouble that I would rather do just about anything else than have to modify it, but once I started refactoring it, I find much better techniques for separating all the parts of it. Now I actually got myself a little library that handles building intricate menus :D 

Share this post


Link to post
Share on other sites

Preamble:

I have attempted to make 2 little indie games and each of them have failed for one reason, planning. For both of the projects I started off only planning to have a few parts to the game. As I started to code those parts I would realized  that each of these parts needed a lot more code and classes and such than I originally thought. The problem is I would have already coded the majority of the game before I realized this. Thus leaving me with two options, 1) Rewriting the whole game, and throwing out countless hours of time. 2) Giving up sad.png . After thinking about where I went wrong it would always come down to the fact that when I started writing the game I didn't fully understand what I needed and thus didn't design it properly. I figure that this might happen a lot in many games(Realizing that a major change needs to be done) and I imagine that they don't all restart or quit. Which leads me to the conclusion that my planning might not be sufficient but the main structure of my code might be the problem. When I looked over my first game I found that a lot of my code was very specific and could not be easily rewritten without affecting other parts.

 

The question:

1) How do you go about properly planning a game and allowing major changes to be made without a re-write?

2)To avoid problems with having to rewrite everything should I try and write everything as a module that can be used in a main game loop?

 

If anyone has any good ways of organizing a game that you could point me to that would be awesome(Currently I am using the Model, View, Screen system)

Start using a source code revision tool as it allows you to code a lot more fearlessly of  losing old work, make sure you checking in often. If something doesn't pan out just revert to the last working version and start afresh, if something pans out to work check it in so you have a backup.

Share this post


Link to post
Share on other sites


You are basically asking, “How do I learn from experience without going through the ‘experience‘ part?”.

 

I wouldn't exactly say that. I understand how valuable experience is and learning from my mistakes. Getting experience helped me learn another fieldset(Web dev. php, js, ruby, ect). Like writing an essay, there are certain structures that are generally accepted as at least a good outline on how to do it,

Share this post


Link to post
Share on other sites

 

Preamble:

I have attempted to make 2 little indie games and each of them have failed for one reason, planning. For both of the projects I started off only planning to have a few parts to the game. As I started to code those parts I would realized  that each of these parts needed a lot more code and classes and such than I originally thought. The problem is I would have already coded the majority of the game before I realized this. Thus leaving me with two options, 1) Rewriting the whole game, and throwing out countless hours of time. 2) Giving up sad.png . After thinking about where I went wrong it would always come down to the fact that when I started writing the game I didn't fully understand what I needed and thus didn't design it properly. I figure that this might happen a lot in many games(Realizing that a major change needs to be done) and I imagine that they don't all restart or quit. Which leads me to the conclusion that my planning might not be sufficient but the main structure of my code might be the problem. When I looked over my first game I found that a lot of my code was very specific and could not be easily rewritten without affecting other parts.

 

The question:

1) How do you go about properly planning a game and allowing major changes to be made without a re-write?

2)To avoid problems with having to rewrite everything should I try and write everything as a module that can be used in a main game loop?

 

If anyone has any good ways of organizing a game that you could point me to that would be awesome(Currently I am using the Model, View, Screen system)

Start using a source code revision tool as it allows you to code a lot more fearlessly of  losing old work, make sure you checking in often. If something doesn't pan out just revert to the last working version and start afresh, if something pans out to work check it in so you have a backup.

I am pushing to a private git repo every night after I finish. Is this sufficient for version control?

Share this post


Link to post
Share on other sites


I am pushing to a private git repo every night after I finish. Is this sufficient for version control?

You really want to be making commits of each feature and/or refactor, so that you can step through the history change-by-change to analyse when bugs were introduced.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!