Members - Reputation: 100
Posted 27 February 2012 - 02:23 PM
since this is a prototype i want to use easily accessible file formats such as .txt, .csv to input player, enemy, items, and other object data.
the problem i am having is getting my foot in the door as far as design. i have done a couple of tutorials but they came out pretty buggy when it came to reading in files in the txt format.
does anyone have any advice on reading in the files for object and world data??
or any working examples to get me pointed in the right direction in creating a flexible text based adventure game??
**this is feature is completely optional but it is a concept that i would eventually like to implement in the future
Members - Reputation: 1058
Posted 27 February 2012 - 11:22 PM
That said, the first thing I would tackle is outlining exactly what data needs to be stored in external files. If it can be represented fairly simple (such as a table), then creating a parser would not be difficult. If a more complex representation is necessary, I would look at incorporating XML, JSON or similar support, most likely by leveraging an existing library.
Your question is fairly broad. Maybe you need to narrow your focus (and your question). Is there a particular, specific issue you are having with reading files? Is it parsing the data, or using the C++ standard IO? If you post some code you have tried (along with a description of what you want it to do), or at least ask more specific questions, someone here may be able to better help you.
Members - Reputation: 512
Posted 28 February 2012 - 04:43 AM
1. Do a few tutorials, just to get me started (the background experience I have helps a lot, but even if you are knew they worth a try).
2. Establish a goal, like a simple project I want to complete using the new technology.
3. Break down the goal into very specific sub-goals and order them to decide which depend on which
4. Start making goals in order and don't let any of them unresolved. Research and learn about the new tech as much as it needed to complete each goal.
I think in your case you did the first two steps, but you didn't break down the main goal into small enough sub-goals. Your question should sound like: "This is my file I want to read, this is the code so far, why it isn't working?". If you can do that, I am sure we will find a way to help you