Beginning Game Development Path - Need Opinions

Started by
11 comments, last by MichaelRPennington 11 years, 7 months ago
Alright, I'm new at programming C++, and I was looking for a way to develop a game in a series of incrementally more complex stages as to further my ability to develop a game as well as progress as a programmer in C++. I have an idea as to how I am going to do this, but I would like the community to give me their opinions after reviewing my plan...

1. Text-Based RPG
a. Accepting simplified user input. "Which way do you wish to travel? N, S, E, W? "
b. Accepting advanced user input. "travel north", "attack goblin with sword"
c. Save states. (I'm assuming this would entail writing and reading from a file to retrieve the states, which is my intention)
d. AI. "You hit goblin with sword. Goblin blocks your attack; Goblin flees." vs. "You hit goblin with sword. Goblin dies."
e. Audio.
2. Text-Based ->> 2D RPG
a. Simple graphics display.
c. Sprite display and movement.
b. Collision detection.
3. 2D RPG ->> 3D
... I'm going to stop here for now.

I just want to be able slowly progress from the complete bottom to the top.

If anyone has any ideas on how to do this more effectively, or any tips, tricks, things to avoid, etc. for a beginner, please post them.

Thanks, and looking forward to all the comments!

EDIT: A few questions as well...

I'm wanting to make this really organized, easy-to-read, easy-to-alter code.

I want a main loop that pretty much initializes the game and manages its state, but doesn't interact with the user. I want all interaction to be done on a more intimate level. I know how I could do this is in Java, but what about C++?

... and a few programming inquiries -
How would I store area data in an easy and accessible way such as the game knows where you are and based on your location can send you to the appropriate area depending on the direction you choose to take? I was thinking something like a grid coordinate system. But then I'm not sure how I could reference the areas' coordinates...
Any problem can be fixed, any issue balanced, any design possible; it's a matter of your resolve to make things happen.

Those who say, "It's not possible!" should look at where games started and where games are today. I'm sure they once thought that millions of players playing and interacting at once was not possible, yet we play games that match that description everyday.

Never tell me that something isn't possible; it will only make me more determined to prove you wrong.
Advertisement
If you don't mind spending a bit of money, this book can get you through step 1 easily (except for the audio).

If not it looks fine, although perhaps you can move the audio part to 2d (you mixed up the order btw :P), I say this because you will most likely use SDL, SMFL or something similar which has an audio part in it. Even if you do it yourself through opengl/directx, you can use collision events and such to trigger sound effects.
Looks pretty good to me. You can learn a lot about design skills and data structures and such even in relatively simple projects. For stage 1, you definately don't have things like FPS to worry about, so there is no major consequence to an inefficient design decision, but I encourage you to spend some time designing (perhaps on paper) what you're going to do ahead of time. Keep memory usage and Big-O in mind. Play around a bit with the STL. If you have any problems, let us know (honestly, the unadulterated basic design questions are often the most fun to work with)!
There was a saying we had in college: Those who walk into the engineering building are never quite the same when they walk out.
I may be presenting an unpopular opinion here. Not sure since I've never voiced it before. So here goes.

I see a lot of new programmers asking question about advanced data structures and algorithms. I think this is a bad idea. Things are called 'advanced' for a reason. A new writing student doesn't start with learning the structure of an essay, but the structure of a sentence. Similarly, a new piano student doesn't start learning things like syncopation until they've practiced enough to at least hit the right keys at the right times. New programmers need to start the same way. If you're a new programmer, I would recommend just writing a bunch of programs in the simplest way you can think of. Don't worry at first if you're using the 'right' structures or the 'best' algorithms. Right now you just need to practice writing code. After you've written some things you'll start to notice that you're writing similar code blocks over and over again. This is when you can step back and ask yourself, "self, how could I write this in a more generic way so I can apply it to more than one problem?" In this way you'll start to build up your own library of functionality that you will actually use. At the same time, you'll train yourself to think about how to abstract away problems.

One of the main reasons for this approach is that it lets you make mistakes. You've already considered using a grid for your text RPG; that's good! Now try it. See how it works. Figure out what problems it has. Then think about how to solve those problems. This will train you to think critically about your architecture instead of just using whatever everyone else says is the 'right answer.' One of the other key points to this is that you actually work at it instead of getting paralyzed wondering if you're doing it the "right" way. Because there is no right way. There are just ways that work better than others in certain situations. Another benefit is that you'll understand through experience the things that others just know by rote (and therefore don't really know at all): why globals should be treated carefully, why goto should be avoided, the importance of commenting your own code, etc.

Now that I'm done with my soapbox, I think your overall plan is good. I would just recommend approaching each step in at least two different ways before moving on. Again, this will help you improve your problem solving skills and will train you to write good code. The only other thing I could recommend right now is to get away from C++ as soon as possible. There's still a huge misconception that you have to write games in C++. It's absolutely not true. You're years away from needing to worry about the few milliseconds that C++ might gain you. You should be worried about the hours you'll waste dealing with C++ features that are easier or complete non-issues in other languages.
Thanks everyone so much for your replies. I'm taking my time and working on it in extreme detail and planning. Hopefully, by taking these small minute steps, even my text adventure RPG will be excellently executed and designed and impressive (hopefully, once again).

BTW, I will release each step as it achieves completion!
Any problem can be fixed, any issue balanced, any design possible; it's a matter of your resolve to make things happen.

Those who say, "It's not possible!" should look at where games started and where games are today. I'm sure they once thought that millions of players playing and interacting at once was not possible, yet we play games that match that description everyday.

Never tell me that something isn't possible; it will only make me more determined to prove you wrong.

You're years away from needing to worry about the few milliseconds that C++ might gain you. You should be worried about the hours you'll waste dealing with C++ features that are easier or complete non-issues in other languages.


You don't waste hours working with c++ if you learn it. It is also a much more elegant language if used properly, and cannot only save you "milliseconds" if used correctly, but can save you much more than that by being low enough to skip a lot of unneeded steps.

[quote name='Suspense' timestamp='1333601665' post='4928382']
You're years away from needing to worry about the few milliseconds that C++ might gain you. You should be worried about the hours you'll waste dealing with C++ features that are easier or complete non-issues in other languages.


You don't waste hours working with c++ if you learn it. It is also a much more elegant language if used properly, and cannot only save you "milliseconds" if used correctly, but can save you much more than that by being low enough to skip a lot of unneeded steps.
[/quote]

Agreed, those hours "wasted" on C++ will be hours gained on game development in the months to come, with every hour you "waste" dealing with C++ problems you gain knowledge, you research and you may even stumble upon stuff that make you think in ways you never would have thought if you did everything by the book. Also, I may be weird, but sometimes I get enjoyment from dealing with C++ problems, at least the end result gives me more a feeling of satisfaction like nothing else can.

If you learn C++ you will gain enough knowledge to do programming in mostly any major language used for the purpose of game development, as they are all quite similar (also majorly different at some points), but all in all C/C++ is the core of all game development, and whatever you do you will probably run into it one day no matter how much you try to avoid it.

But enough about that. Your plan looks good overall, also about the audio, you are likely to use SDL/SFML for that, so you would be all set for graphics and all the other stuff too, you can use both SDL and SFML components without having a window created by them, meaning - you can have audio in your text-based RPG.
I think I've decided to do Python for now. For me, at this time, it's simpler and quicker, which is paramount considering my time constraints. I work 12-hour rotating shifts tongue.png But once again, thanks all for your comments and suggestions!

Then again.. maybe not. XD
Any problem can be fixed, any issue balanced, any design possible; it's a matter of your resolve to make things happen.

Those who say, "It's not possible!" should look at where games started and where games are today. I'm sure they once thought that millions of players playing and interacting at once was not possible, yet we play games that match that description everyday.

Never tell me that something isn't possible; it will only make me more determined to prove you wrong.
I'm going to have to agree fully with Mr. Suspense, which is why I +1'ed his post...

So you're just starting C++? Hahahahaha! </end-evil-laugh> Get ready for your brains to feel like mush, your eyes to glaze over and your girlfriend to leave you lol. Starting C++ is not easy, and it takes a long time just to get over the initial learning curve in which you struggle to get the language to do anything for you, much less write a working game. However, there is nothing like the satisfaction of finally "getting it", after months and months of struggling.

I strongly suggest you listen to our friend Suspense and all of our other programming veterans and don't try to go from no C++ knowledge to writing video games. You couldn't have picked anything harder, except maybe developing an operating system or drivers. You won't even know where to begin, and it will most likely turn you off to programming altogether. Start small... write console applications and learn basic C++! Then step it up a notch, and learn to write a DLL, link it and consume it in your own console applications. Write your own libraries to handle hard and time-consuming things for you. Just whatever you do, don't give up or stop practicing. One day you will suddenly have a "revelation", of sorts, and things will begin to make sense and get easier and easier. It is then that you will be within reach of writing your first simple game or a usable application.

But for now, start small with stuff like this:

int main() {
int lbs = 0;
cout << "Enter weight in pounds: ";
cin >> lbs;
int kg = (int)((float)lbs * 2.2F);
cout << endl;
cout << "Weight in kilograms: " << kg << endl;
return 0x00;
}

Try to figure out what problems that code has and how it could be improved. Try writing your own stuff and do the same. One step at a time is the path to victory! :-)
_______________________________________________________________________________
CEO & Lead Developer at ATCWARE™
"Project X-1"; a 100% managed, platform-agnostic game & simulation engine

Please visit our new forums and help us test them and break the ice!
___________________________________________________________________________________
Well, I know basic C++, but I just don't know how to apply it to my situation. I'd really like to use C++ rather than Python... Working with Python makes me realize that I'm not a big fan of blank space. I like encapsulation... Give me the good ol' curly brackets any day tongue.png

Basic input would be interesting, I was wondering how I should catalog and reference commands...

Should I do a string of if statements, or store them in an array, list or dictionary?

My basic command structure should end up being something simple, such as '[action] [target]' like Attack Goblin, or Open Inventory, or Open Door. This seems simple enough. We can just take the input string and split it by a delimiter, such as a space or '>', so the input could look like 'attack>goblin', and then reference it with the list of commands and functions to call...

My question is, what method to go about call the functions once the game realizes what command you have given...


Oof, why does C++ make everything so complicated? Even something as simple as splitting a string is drawn out to an unreasonable extent... It makes me miss Java.
Any problem can be fixed, any issue balanced, any design possible; it's a matter of your resolve to make things happen.

Those who say, "It's not possible!" should look at where games started and where games are today. I'm sure they once thought that millions of players playing and interacting at once was not possible, yet we play games that match that description everyday.

Never tell me that something isn't possible; it will only make me more determined to prove you wrong.

This topic is closed to new replies.

Advertisement