Jump to content

  • Log In with Google      Sign In   
  • Create Account


Beginning Game Development Path - Need Opinions


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
12 replies to this topic

#1 MichaelRPennington   Members   -  Reputation: 126

Like
0Likes
Like

Posted 02 April 2012 - 02:46 PM

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.

Sponsor:

#2 Rld_   Members   -  Reputation: 1380

Like
1Likes
Like

Posted 02 April 2012 - 03:21 PM

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.

#3 medevilenemy   Members   -  Reputation: 312

Like
0Likes
Like

Posted 02 April 2012 - 09:56 PM

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.

#4 Suspense   Members   -  Reputation: 449

Like
2Likes
Like

Posted 04 April 2012 - 10:54 PM

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.

#5 MichaelRPennington   Members   -  Reputation: 126

Like
0Likes
Like

Posted 10 April 2012 - 06:29 PM

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.

#6 Slig Commando   Members   -  Reputation: 334

Like
0Likes
Like

Posted 13 April 2012 - 10:23 PM

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.

#7 Mind Calamity   Members   -  Reputation: 134

Like
0Likes
Like

Posted 15 April 2012 - 11:54 AM


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.


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.

#8 MichaelRPennington   Members   -  Reputation: 126

Like
0Likes
Like

Posted 13 September 2012 - 08:52 PM

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 Posted Image But once again, thanks all for your comments and suggestions!

Then again.. maybe not. XD

Edited by MichaelRPennington, 15 September 2012 - 08:12 PM.

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.

#9 ATC   Members   -  Reputation: 551

Like
0Likes
Like

Posted 15 September 2012 - 07:57 PM

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! :-)

Edited by ATC, 15 September 2012 - 08:02 PM.

_______________________________________________________________________________
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!
___________________________________________________________________________________

#10 MichaelRPennington   Members   -  Reputation: 126

Like
0Likes
Like

Posted 15 September 2012 - 08:12 PM

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 Posted Image

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.

Edited by MichaelRPennington, 15 September 2012 - 08:25 PM.

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.

#11 Bacterius   Crossbones+   -  Reputation: 8348

Like
1Likes
Like

Posted 15 September 2012 - 08:35 PM

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..

Typically this is done by parsing the input string and looking for keywords, such as "attack" which will perhaps fire an attack() method, and the second parameter says "goblin" so the method looks for a goblin near you and throws the dice to get the total damage done. You can get away with splitting the string and feeding the substrings into arrays and methods for simple commands, but once you get to more complicated syntax it gets messy quickly. Perhaps using a scripting language would be worthwhile when you reach that point.

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

Scripting languages would solve this, but another method could be a huge switch case associating each main command with its function (or you could create a lookup table mapping command strings to the correct function pointers). There are many ways.

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.

Well, how do you think Java does it under the hood? It just hides all that stuff from you, but it doesn't mean it isn't there Posted Image And if you are going to be working with strings alot, you may want to download a C++ string utility library (if the standard libraries are not sufficient), or you could write it yourself, so you'd have a little utility library with functions such as splitString(), parseDelimited(), etc...

The slowsort algorithm is a perfect illustration of the multiply and surrender paradigm, which is perhaps the single most important paradigm in the development of reluctant algorithms. The basic multiply and surrender strategy consists in replacing the problem at hand by two or more subproblems, each slightly simpler than the original, and continue multiplying subproblems and subsubproblems recursively in this fashion as long as possible. At some point the subproblems will all become so simple that their solution can no longer be postponed, and we will have to surrender. Experience shows that, in most cases, by the time this point is reached the total work will be substantially higher than what could have been wasted by a more direct approach.

 

- Pessimal Algorithms and Simplexity Analysis


#12 ATC   Members   -  Reputation: 551

Like
1Likes
Like

Posted 15 September 2012 - 09:32 PM

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 Posted Image

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.


The questions you're asking are basic C++. So you don't know basic C++ quite yet! :-)

However, you do show some knowledge and initiative. That's a major ++2 on your chances to succeed. So don't be discouraged. Keep learning the basics. Try, toil and struggle with a game if you must and your mind is set on it. You'll still learn, it will just take a long time to feel successful and recieve any gratification for your efforts. If you're not the type of guy who lets that stop him then go ahead and keep trying to write a game and don't slow down.

To answer your C++ question, if you're using an [action][target] structuring for your command inputs, then you'll want to learn to write your own class. I'll show you what I mean in C++-ish pseudo-code so you still have the challenge of doing it yourself:

[source lang="csharp"] class Command { public Command(string action, string target) { this->action = action; this->target = target; } public string action; public string target; }; int Main(string[] args) { PrintHelpMenu(); Command cmd = getCmd(); // This is how you use if/else if (cmd.action == "close") { if (cmd.target == "game") Exit(); else if (cmd.target == "menu") CloseMenu(); else ; // whatever... } // This is how you use case/switch if (cmd.action == "open") { switch (cmd.target) { case "help": PrintHelpMenu(); break; case "items" ShowItems(); break; // blah, blah, blah... You get it now! [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img] default: break; } } return 0x00; }[/source]

Don't try to compile and run that code, because it's not valid C++. Though it is quite similar in syntax and style. Read it and take the concept it expresses and learn to do such things in C++. Programming, after all, is learning to turn concepts in your head into code! :)

Edited by ATC, 15 September 2012 - 09:36 PM.

_______________________________________________________________________________
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!
___________________________________________________________________________________

#13 MichaelRPennington   Members   -  Reputation: 126

Like
0Likes
Like

Posted 16 September 2012 - 09:28 AM

Thanks a lot guys. I'll keep studying up. +1 for both of you :P
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.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS