How Do You Plan?
#1 Crossbones+ - Reputation: 1389
Posted 03 October 2012 - 06:59 PM
Here's Breakout:
Breakout!
If you need some photo editing done, contact me:
superman3275@gmail.com
if you want some programming help, or are recruiting for a game development team, either PM me on here or email me up there
#2 Members - Reputation: 291
Posted 03 October 2012 - 07:45 PM
I write down everything I need. In this case:
- Tileable sprites for the dirt, copper, tin, etc
- sprite of a vehicle
- Bitmaps for buildings
- Bitmaps for menu's when your vehicle comes closes to a building
- Sounds
- Day/Night -> Bitmap of a sun that moves in a circle.
Ok I got kinda the basics. After this I draw on a piece of paper what classes I'll need and link them.
class main; // entry point of the application class Window; class System; class Graphics; // will be created in the main.cpp class Bitmap; class Sound; class Text; // stores handles to the images, fonts, etc class Vehicle; // this will store an object of Bitmap for your vehicle. class GameState; // will keep a state ( static int m_GameState = STATE_IN_GAME; // or STATE_MENU_MODE; such things. class Game; // this will create all game objects, sounds, etc. Also checks collisions. class Level; // contains information how the level looks like class LevelProp; // props like dirt, copper, etc. Can be a virtual class and support sub-classes.Linking I do with drawing arrows from class to class.
Still don't have any code.
Now I think "What possible methods can the classes contain?"
I give 1 example:
class Bitmap
{
public:
Bitmap(string path); // Loads an image from a file
~Bitmap();
Bitmap* GetBitmap();
void SetAnimationRect(RECT bounds);
RECT GetAnimationRect();
void StartAnimation(int from = 0);
void StopAnimation();
void PauseAnimation();
void SetAnimationSpeed(int speed);
void IncreaseAnimationSpeed(int speedDelta);
void DecreaseAnimationSpeed(int speedDelta);
void Render(int posX, int posY); // The position can also be stored and called with a method: SetPosition(int posX, posY);
private:
HBITMAP m_hBitmap;
RECT m_Bounds;
int m_AnimationCounter, m_AnimationSpeed;
};
Of course this class sucks.
And in case you are wondering, why not painting(Photoshop) and typing instead of drawing(on paper) and writing?
Answer: You only need to have a basic idea for your whole game. So don't waste time with with PS or Notebook.. Drawing & Writing goes allot faster.
~EngineProgrammer
#3 Members - Reputation: 6183
Posted 03 October 2012 - 07:57 PM
The first thing I try to do is identify what the core of the project is, and thinking about how to attack that. I try to put together a prototype of that part pretty quickly (so in some sense I start programming early on, but in a very focused way). For this first prototype, all non-core parts of the program are either dummy versions or missing completely. This exercise often will result in a much better idea on how to implement the core part of the project, without wasting too much effort in the wrong direction. The rest of the parts will often just fall into place.
If you have a particular project in mind, perhaps we can give you some pointers on how to divide it up in chunks, where we would start, etc.
Edited by alvaro, 03 October 2012 - 07:57 PM.
#4 Members - Reputation: 3370
Posted 03 October 2012 - 08:14 PM
It's hard to describe. I get a mental model of the solution and run through scenarios in my head, changing the model where things fail. As different pieces pass more of the scenarios, they become firmer. Once there's a pretty solid mental model, then I can go to a computer and start coding; fleshing out the details and possibly stopping if I run into an unforeseen roadblock. Often times I will segment the problem into the one I want to tackle now and work on that small chunk of work.
As I've gotten more experience (read: made a lot of bad designs) I've realized how much not being at the computer aids this. I've changed the model to use more pre-defined shapes (design patterns) than random blobs. The model is quicker to react to common scenarios (design patterns/previous good designs), and identify traits of those scenarios that guide the trait of the solution. And since the shapes are more pre-defined, I can work with much larger models now that I could as a beginner.
I've realized how much design documents and other formal design hinder my ability to design code, since the audience for the model there is different than 'me, making code'. Once I translate the design into something others can grasp well (and shift into a writing/communicating state of mind), the images pollute my mental model of it and it takes some time to firm it back up.
The process though hasn't really changed in 20 years.
#5 Members - Reputation: 291
Posted 03 October 2012 - 08:41 PM
Downloading open source games / engines, exploring them has been a great help for me. So I suggest you to do the same.
Look how other people have done it. How they structure their classes, how they have written their lines of code, etc.
It's very hard to tell you a structure / design. You need to explore / see it for your own.
Telastyn, I also try to work everything out in my head. But when a week has passed it's hard to remember where I was.
Alvaro, I used to work the same way as yours. But I disappreciate it.. Coding immediately caused me allot of messy code, which made me create new projects over and over again. And after that I got 10 files with sort of the same code and I need to look in all of them first to know what I was doing. My first year of programming I made Dragonball Z: supersonic warriors. I've count the number of versions I have: 17. With only 1 working completely. But the examination went pretty good with that file
~EngineProgrammer
#6 Members - Reputation: 6183
Posted 03 October 2012 - 09:12 PM
#7 Members - Reputation: 291
Posted 03 October 2012 - 09:28 PM
You are programming for 30 years now, that's nice! I have 2 years of experience now hehe.
It would be awesome if you could help me out. You have more experience and you could help me allot now.
I know I'm not the OP but, I want to rewrite this game for another school project: http://www.rocksolid...games/robokill/
How would you handle it? Please play the first level and explore how you would create a game like that. I owe you one.
( moderators this is not offtopic. I'm asking a plan to Alvaro.
~EngineProgrammer
#8 Members - Reputation: 754
Posted 03 October 2012 - 11:11 PM
First: get several white boards and lots of different colored markers start drawing your system structure.
Second: UML diagrams, there are some really nice open source UML designers out there. Use them.
Also, when I code, I start by writing the basic classes that passed around as data like a Vector, Matrix, String, Actor, Node, ect... after I get those done then I cleared out most of the small details and can focus on the larger "Manager" kind of classes, which use these data classes that are mostly done.
If this post was helpful and/or constructive please give rep.
SFML2.0 Download http://www.sfml-dev.org/download.php
SFML2.0 Tutorials http://www.sfml-dev.org/tutorials/2.0/
#9 Members - Reputation: 6183
Posted 03 October 2012 - 11:13 PM
I've never made a flash game before, so the first things I would do are getting familiar with the programming environment and testing that I can correctly process input, animate a character, play music, play sound effects... If any of these things is trickier than it seems, better to find out early.
For a prototype, I would focus on getting the gameplay working, even if I don't have a way to load a map, sound of fancy graphics. Programmer art works to begin with.
I haven't given it nearly enough thought, but one possible division of this in blocks would be:
* Description of the scene (as a data structure in memory).
* Scene update
* AI
* Rendering
* Input
* Sound
So you need to write a game loop and work primarily on my first two bullet points (how you describe the scene in memory and how it gets updated). Of course you'll need to render it and you'll need to process input, but input is probably simple and rendering can be kept crude (think triangles instead of robots) for the first stages.
Just make sure you keep things flexible enough that it won't be impossible to add cutscenes and menus in the future. I imagine in this case it would be easier to not use the game loop at all for those things, and simply implement cutscenes and menus separately, with the game loop only running for the game proper.
I don't know if this level of detail helps you at all or not. The next thing is getting dirty and trying to describe the scene in a data structure. A whiteboard and colored markers can be very helpful.
Edited by alvaro, 03 October 2012 - 11:17 PM.
#10 Members - Reputation: 882
Posted 04 October 2012 - 02:51 AM
What are my primary goals?
What kind of system would best serve those goals?
Then I write the simplest possible version of that system, and build from there.
It's simple, but it works for me.
Small and simple Python 3.x media library: pslab
#11 Members - Reputation: 900
Posted 04 October 2012 - 06:18 AM
Myself, I find that minimal planning and then refactoring as I progress gives me the best results. Refactoring is especially valuable in retrospective to crystallize the real meaning of your code; in contrast to the mess that code can be when you just got it running for the first time. ;)
Edited by demonkoryu, 04 October 2012 - 06:21 AM.
#12 Crossbones+ - Reputation: 3861
Posted 04 October 2012 - 07:14 AM
Agree. When I'm not familiar with what I'm implementing, I tend to plan a bit too much and end up repeatedly going "wait, I need this too" and "hang on, this isn't actually what I want" or "oops, I overlooked such and such dependency and now need to redesign everything", which wastes a lot of time.The problem with planning ahead is that only experience can give enough information to plan a software design properly. So, in a domain where you have good experience (i.e. many completed programs), you might plan ahead and be mostly right.
In my experience, you want to start small (don't start making plans for every little feature you add, or you'll get overwhelmed and will just give up). Plan the core, then add the rest later on when everything works. Make heavy use of stubs if that's your thing. Always try and keep your code as modular and self-contained as possible, so that adding another feature does not interact (and hence, cannot break) other features on the same level of abstraction. Most of your code should be reusable, ideally you should be able to plug in and out features, if that makes sense for your project.
For instance, your game might end up looking like a tree graph, with each node being either a "feature" (for leaves) or a "manager" (for nodes). The tree is strictly going down, so leaves do not interact with anything except utility functions, and nodes only interact with the leaves they use (like the graphics loading manager might use the PNG loader feature to be PNG-enabled or something - dumb example though). This is all very simplified of course, in the real world relationships are much more complicated...
Edited by Bacterius, 04 October 2012 - 07:15 AM.
#14 GDNet+ - Reputation: 342
Posted 05 October 2012 - 12:59 AM






