C++, Laying out a game...

Started by
13 comments, last by stylin 18 years, 8 months ago
Just to add my (admitedly anonymous, the registration function seems broken) voice to the chorus, "best" is the enemy of "good". This can't be overstated, attempts to hit the "best" design usually result in a train wreck.
Advertisement
Start writing a program, any program. If you get to a point where you can't decide on the best way to do something, flip a coin and continue. You're probably going to end up writing a lot of code that you will decide "ah, hell, that doesn't work" and throw away. But that's exactly the point.

Some important words from Thomas Edison

"I am not discouraged, because every wrong attempt discarded is another step forward".

"Nearly every man who develops an idea works at it up to the point where it looks impossible, and then gets discouraged. That's not the place to become discouraged."

"I have not failed. I've just found 10,000 ways that won't work."

[Formerly "capn_midnight". See some of my projects. Find me on twitter tumblr G+ Github.]

I'd like to say this has been a very high quality thread. I have just one thing to add for ErUs. With books like "design patterns", put it away if you feel you're not getting much out of it.. but *make sure* to find the time to *go back* to the book after you've done more coding. Then put it away again, code more, pick up the book once again, repeat!

The reason is this. It's useless to discuss software technique as a purely logical matter. There just isn't enough "symbol space" in our brains to reason about an entire software system. To appreciate the technique of patterns, you have to *feel* them -- and the only way to acquire that feeling is through relentless repetition and experience.
Oh, and don't stop in the middle of coding and think "how am I going to do this?" when all it is is a stupid loop function that copies a string. If you find yourself there just code it. One of the parts that makes you good at coding is you just keep at it at all aspects. As you were saying. In a game you have data and functions. With C++, we can keep those together, but you find yourself often that it doesn't exactly work to well like that. For example, you could have a list of objects to render. You can either send them to a renderer, or include the render code in each one. One works better than the other, not at everything, but at some.
We should do this the Microsoft way: "WAHOOOO!!! IT COMPILES! SHIP IT!"
Quote:Original post by ErUs
ok, hello again.

...i have real problems laying out classes for any sort of game.
...i don't know what to put in classes and what not to
...i don't know how to set up a system were different classes can look at other classes...

i would like to see how you guys set up your games...

Not sure if you have read these Fine articles, but they might be what you're looking for. The first is here:

http://www.gamedev.net/reference/articles/article1947.asp

:stylin:
:stylin: "Make games, not war.""...if you're doing this to learn then just study a modern C++ compiler's implementation." -snk_kid

This topic is closed to new replies.

Advertisement