New First Game need pointers

Started by
8 comments, last by Zackery Hardin 10 years, 10 months ago

I'm sure some of you have seen my thread about the Frank Hunter ACW clone I guess you could call it, that I've been wanting to build for my first game. I have found it, while a good idea and as I was going about it slowly, a workable one. However, I have deemed it too ambitious for my level and have settled with a text-based RPG to start out as I'm more capable with that (Already created basic input info, output story type text based stuff). Now, for this to work as I'm brand new to C++ , I'll need ideas for the basic coding elements needed (I.E. An array for this, class for that, etc. [FYI: I already know characters and enemies need a class, so don't list that please); I can work from there.

Now, I want a drawn out menu module for this game. A start menu for new game/ continue (Selectable only if applicable [ I believe an if function would be necessary for that one] options [Load screen for continue if applicable]), an in-game menu with multiple options in it such as an equip screen, item inventory screen, save option, etc. Yes, the menu module seems reminiscent of a Final Fantasy menu but that's where the idea came from. To me, that's the best menu module out there for any rpg whether text-based, 2d or 3d.

I'll also need a battle system and a leveling system for character progression. For those of you more experienced in that, as I have no clue what would control everything in that (I know I'll need separate files for these systems, but that's a given) Please fill me in on the basic c++ elements for this.

For story aspects, I'm not sure what exactly what I'll need, but I do need a text output of some sort for the story and character dialogue. Again, those experienced in this can point out the basic C++ elements needed for everything inside this (I think this may be a little beyond the basic cin, cout I've been doing for my small projects).

Once I get the basic elements, I should be ok and be able to get the game done in good time to show my friends and family as that is the purpose of this (I don't think many people want to play text-based games since 2d and 3d graphics are out) project (Showing them how well I've progressed).

If I've missed anything that's crucial, please feel free to add it. This may be text-based, but story wise it should be about as big as a standard Final Fantasy game would be. I'm not a graphics person so that's the reason for the text-based requirement.

Advertisement

Hello Ares,

The entire point of programming is learning to solve problems and to break large problems into smaller chunks. Programming is really mostly problem solving.

You could read about the various flow control and data structure options available and decide for yourself which to apply in the context of the program that you are trying to create.

I know this sounds like it would be easy to make the wrong choice or to end up with a bad design... and that is exactly the point. You should write the program using what you know now, and then get feedback on it... from that feedback you will learn. You will also learn when you think to yourself "If I had done it THIS way it would be much better!" That is when you improve as a programmer.

Here is some advice anyway though:

1. I recommend trying for a data driven design. Define rooms/monsters/items/ect through configuration files. Ideally adding new items to the game should be mostly a matter of editing configuration files and not involve writing much additional c++ code (if any).

2. A vector is probably adequate for your inventory purposes.

3. Favor references instead of pointers. (If you don't know when to use a pointer, then usually the answer is don't).

4. cout and cin are fine for your text output and input. If you really want to get "fancy" you could mess around with ncurses (Although if you are using Windows then you are going to have a headache with this... If you are using Visual Studio than you probably don't even want to bother.). There are highly windows specific ways of manipulating the console, but I really don't wish to suggest them...they can be turned up in a google search.

5. Consider using Python instead of C++ (Just my opinion, don't shoot me!). Here is a nice curses module for PyGame that works with windows and linux: Pygcurse.

I'm a lecture/example type of learner. Ok, to clarify, I started learning C++ through what ever books I could find at the local library or online tutorials. A lot of them were dry reads, you know detailing the code and showing the code itself. the only one I truly learned anything from on terms of games however was Beginning C++ through Game Programming third edition. Now that actually got me to understand game programming in general to an extent: the examples used in the book. I can clone the examples there no problem with even changing the details of everything. The problem is: the elements of the language that I've learned, I only know how to use in that exact way, limiting me to just repeating the same basic thing. I'm tired of it. I just need an explanation of what elements are used for what in any kind of game and I'm basically set. Unless you can suggest another source of learning.

Ares,

Not understanding when to use elements of a language is the same as not understanding how the elements of the language works. The answer to your question is to write more programs and to experiment with how each element is used and in what context.

No one can tell you in what contexts to use each element of programming to make any kind of game. What elements you use and when is what programming is all about. It is about using those elements to solve small problems which have been broken up from the original larger problem.

It is like learning a language. You can learn the vocabulary all day, but how you form a sentence takes practice. You are really missing the grammar of programming. Your question is like "Tell me what words to use for any sort of sentence I want to write and what order to use them in and I will be all set."

The source of learning is practice. Write LOTS of code. Write code and write code and write code some more. Write code until you have written lots and lots of code and then write some more. Your code will suck, and you will learn from it, and you will improve. It is really the key to learning how to program.

Ok, so I'm just lacking experience with what I know (Still not very much so I don't have all the language learned but it's a smooth process) then. My frustrations should be toward myself and not the authors. This is what I get for taking the hardest way of learning a language but I didn't have a choice. I also noticed your comment on Loxagos_Snake's topic "Writing a text-based game in C++ and need tips!" and was wondering, as I haven't gotten to maps yet, is how useful are they for a Final Fantasy- style inventory (unlimited list of all applicable items in possession and the quantity of each item)? I know I could do a vector or go simple with a regular array, but I feel an inventory setup such as this would need a map for it or if there's a better way that I haven't mentioned, please let me know what it is. I'm still new to the C++ language, although my basic cin-cout usage has been honed so much that if that's all C++ was, I'd be an expert with it. However that isn't the case. I know I can make a good story-telling program If I wanted to, but I want so much more with it and with all those extra features, come so much extra language that I'm seriously running in circles. I decided to hold back on the code first until I finish my concept first (Which is nearly done). I know the combat system will have to be an extra cpp than my main one, and probably most of the others including the inventory. Out of all of those, the Inventory in concept at least, is fully completed. I just need to get the code in, but with what I'm looking for is what seems to be my issue there. Almost everything seems to make limited functionality and that just isn't workable here; at least for me.

I'd use a vector since you can sort the vector based on different criteria (alphabetical, weapons first, etc.). You may want to use several different vectors for different types of equipment (armour, weapons, potions, etc.) as well.

"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley

ok, thank you Paradigm Shifter. And may I ask if the name was inspired by FFXIII?

Edit: also, does anybody make heads or tails of this error? It comes up even on programs I know that should work:

1>MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup

1>C:\Programming\Dung\Vector_Test\Debug\Vector_Test.exe : fatal error LNK1120: 1 unresolved externals

========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Nope, I joined in 2001 2002 and FFXIII wasn't out then ;) Something to do with the shift from procedural to object oriented programming perhaps?

I've never played a FF game...

"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley

Did you make a console application or a windows application? This error is related to WinMain not being defined I believe. You should start off making a console application first.

Ok. Got so used to console application being automaticI didn't check for that. That's probably what it is.

This topic is closed to new replies.

Advertisement