• 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
moeen k

how to design my programs and games structure?

8 posts in this topic

hi.

 

iworked on some programs that some about games and some were not. and i worket on engines like udk and ue4 but there were always aproblem.

 

something that you you may say structure would happen during the programing. i just imagined and object as a class and started coding for it but there were a lot of mistakes there and those programs was not as compicated as im working now.

 

its better to write an structure for it but i dont know what is the best way for it.

 

i have learnt about ssadm and object oriented analyze like class diagram and ...... but i dont know do them work here as in a game we have concepts like spawning or ai behavior and......

 

are there any good pattern or procedure that help me design my game from ground up or by engine or my program for game like an editor for my levels.

 

how should i imagine of my program look like.

should i think about it as an end project that what i want and after that start to document those designs and after that start to code? what about i wanted there to be some changes. how should  structure be to those changes be easy?

0

Share this post


Link to post
Share on other sites

I guess there are as many ways to learn to structure code as people in the world, but I'll share what works for me.

 

When I'm learning a new framework or language I choose a game that I can code in an afternoon (snake and space invaders are my favourites) and I code it without caring much about structure and such things, because if I barely know what code to write, I'm not even close to know how to properly structure it. I choose a project I can code in a couple of hours because I try to finish it in one sitting, but I guess that's up to personal preferences.

 

One or two days after I rewrite the same game from scratch. Here I already know what code I need to write, so I can think how to structure it and I've had time to think about it. Sometimes, I will rewrite the game from scratch once again after a week or so, just for the sake of it.

 

Edit: yeah, and I forgot the point of the question. The Only True and Perfect WayTM to structure a program doesn't exist. Structuring the code is a skill and it needs lots of practise, as everything else. Choose projects of a manageable size for your skill and practise. After a few projects completed, you'll see how you have a clearer idea of how to structure the code every time you start a new project.

 

Footnote: embrace the refactor. Not for few times I've had to refactor comlpetely a project because the scope had grown beyond expected or simply due to bad decisions at the beginning. In my humble experience, refactor is an unavoidable fact of programmer's life.

Edited by Avalander
1

Share this post


Link to post
Share on other sites

Ask for a professional freelance designer in the forum ;) You will get great designs!

1

Share this post


Link to post
Share on other sites

Here is a readable way to structure things in Pong.

 
// Ball uses inheritance
public class Ball extends Sprite
{
 
        public class Ball(double x , double y)
        { 
              super(x,y);
        }
}
// Sprite uses composition
public class Sprite implements GameComponent
{
       private Vector2D position;
       private Image image;
 
       public Sprite(double x, double y)
       {
           position = new Vector2D(x,y);
       }
}
 
public interface GameComponent
{
    public void update();
    public void draw(Graphics2D g2d);
}

One way to learn is to struggle with the design. Write the code design on paper. Contemplate on it. Why does this work and why did this break and the potential damage that can be done further down the line? It comes with experience and practice. You will improve through struggling and pushing on. Another way is to glance at other people's code to get an idea about how to approach the design instead of copying it.  

 

As for structure the entire game, that can be quite complicated even for small games. Every time I went to outdo my last game project in terms of scale, I would use code from my previous games and then assemble together. Sometimes my design implementation is so bad for a specific feature from the last game, but I can change the design to make it more readable. You can fix a bad design through having staring at it for 4 months.

 

I guess the best way is to write clean code. Try to write clean code like the above. You can only write clean code if you have a holistic view of it which can be done using pencil and paper. I draw diagrams and pseudo-code. Use whatever techniques fit your needs.

Edited by warnexus
2

Share this post


Link to post
Share on other sites

Designing your code is the hardest part for me too. I usually already know how to implement the logic of the game I wanted but I couldn't start because I can't decide on how to design the bigger picture.

 

One design pattern that I started embracing is the Entity-Component (System) pattern. I find it easier to start coding without thinking too much about the design with this pattern. I can start writing independent components and then piece them together later. Sometimes, you just have to code all the necessary components first (make dependencies minimal) before you can have the general idea for your overall code. Idk if I'm making sense, I suck at explanations.

1

Share this post


Link to post
Share on other sites

i think entity-component-system is something like first you design the footballer as entity and after that you work on his functions like walking or running and varibles like height as component and work on its relation with other class object like ball as system. basically most of us i think do that. thank you

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