🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

how to design code

Started by
10 comments, last by Chris F 24 years, 5 months ago
I just want to know the best way to design the code for a game? Alot of the time i miss out things that should of gone in the code design and have to recode alot of stuff. Any suggestions. Later.
"I have realised that maths can explain everything. How it can is unimportant, I want to know why." -Me
Advertisement
Well

First of all you need a goal, else you WILL be coding in circles. Have a design document completed so that you will be able to foresee potential obstacles that you may encounter. Know what you want the game to do, and before you start coding, know how you will code it.

Obviously you cannot cater for all issues, but then just integrate seperate modules ( ideas ) to gather a finished product.

Hope this helped a bit

Erick
Have you ever read "Code Complete" by Steve McConnell. This is a must read for any programmer. It''s not a game book, but it can give you an entirely different outlook on programming and software design.

ALso, Erick was right on the money with design documents. You just can''t imagine how much they help until you actually complete one and use it.
I''ve just got to the design treatment stage of my game design. This is only a 4-5 page document outlining the very basics of the game but it amazes me how much it focuses your mind onto what you''re actually trying to achieve.
Try going to the resources section of this sight and searching for design documents in the design section.
Thanks, I''ll place an order for code complete. Later.
"I have realised that maths can explain everything. How it can is unimportant, I want to know why." -Me
Here the best way.

Make plans before you start programing. More your plans are complete (have a good idea on how your engine will work) less chance you forgot something, is something don''t work as you plan (thing always work better on paper) correct your plans.

also try to make a "To do list" ans place the items in order. so you will have a good idea on wath is done. Organization is the key to succes.
Hey Chris..
Delisk is absolutely right about organization. That''s the main thing, since as long as you keep everything well organized so that you have a clear idea about the whole document, you will have no problem writing it. But if it starts to get unorganized and little bit fuzzy it slowly renders to unmaintenable and in the end it''s just too complicated to understand. And then it becomes too difficult to finish it, and usually most people get frustrated and quit doing it.

And when actually writing it, it''s best to first take a broad view and describe everything generally. Not going into any details. General description will later on give you a good view of what you are actually trying to accomplish.
Then you can get a bit more specific and separate different modules for the game and how they interact, and what are their main functionalities. Then when you have this described, you actually have almost half-finished design. Since all you need to do is to go through every functionality for every module you have described, and detail it so that it becomes clear how it should be actually implemented.

But keep each section well separated from each other so that the document is nicely organized.

Well.. Hope this helped. Btw, I have Code Complete too. It''s a very good book, everyone writing complex applications should read it..
Hi marko, yeah i just recieved code complete yesterday havent read much though ive got so many books i need to read, thanks for the help, later.
"I have realised that maths can explain everything. How it can is unimportant, I want to know why." -Me
If you''re serious about doing high-level code design, you might want to investigate a standard called UML (Universal Markup Language). It''s a method of communicating all sorts of detailed designs via drawings (without using code).

UML is used in many professional projects... I''m not sure how many games use it, but where I work it''s very valuable.

Mason McCuskey
Spin Studios - home of Quaternion, 2000 GDC Indie Games Fest Finalist!
www.spin-studios.com
Founder, Cuttlefish Industries
The Cuttlefish Engine lets anyone develop great games for iPad, iPhone, Android, WP7, the web, and more!
Im not serious about high level designI was just wondering what the best way was to design the code for my little projects, thanks, later.
"I have realised that maths can explain everything. How it can is unimportant, I want to know why." -Me

This topic is closed to new replies.

Advertisement