Fiesta Fan Forums

Fiesta Fan Forums (http://www.fiestafan.com/forums/index.php)
-   M O S (http://www.fiestafan.com/forums/forumdisplay.php?f=25)
-   -   C++ Knowledge (http://www.fiestafan.com/forums/showthread.php?t=31280)

Phantom Badger 11-18-2011 11:40 PM

C++ Knowledge
 
Afternoon FF, I just wanted to make a little callout to see if anyone on here had knowledge of the programming language C++. Long story short I'm about to start a project using this language and knowing that I could contact a member of the forums if I got particularly stumped would help.
So... Anyone know it ?

Entropy 11-19-2011 02:10 AM

I'm trying to learn C++ right now too. I've written a few C console programs years ago, and been doing lots of PHP lately. C++ seems... hard.

Are you doing something with a windows GUI or just a console application?

a.L 11-19-2011 03:09 AM

Aw, I learned a bit of C, not C++ D:

Phantom Badger 11-19-2011 11:52 AM

Quote:

Originally Posted by Entropy (Post 451431)
I'm trying to learn C++ right now too. I've written a few C console programs years ago, and been doing lots of PHP lately. C++ seems... hard.

Are you doing something with a windows GUI or just a console application?

Its going to be a console application. Think something similar to Zork, if you've ever played that :)

Vasu 11-19-2011 12:39 PM

You can count on me. :) Except with graphics stuff.

Phantom Badger 11-19-2011 04:19 PM

Good to hear Vasu :D As I said there's no graphics involved, I just need someone I can ask questions if I get stuck with a bit of code.

Vasu 11-19-2011 06:24 PM

Oh, you could've mentioned zork was an interactive fiction. Yeah sure, I can help. C++ is not too much harder than C. If you grasp the basic differences between the languages, then they might as well be the same, however crazy that may sound. :D

Sparkeh 11-20-2011 09:44 AM

Good luck, everyone. 8)

Phantom Badger 11-20-2011 08:24 PM

Bleh, my original plan was to have locations linked to a series of X, Y and Z co-ordinates and then through commands issued by the user the player could move through a grid format with if clauses. However this means there are no boundaries, so I've had to scrap it all and now I'm researching into Arrays and sub strings to get it to work.

Vasu 11-20-2011 10:38 PM

Since we're not going to be displaying any grids anyway, you can use simple location IDs. I DL'ed and played a bit of Zork, and there is not much scope for movement within a location, so we can have it similar to that. You can have various states based on the location ID. Each location can be the object of a class, with the following properties:
  • List of items that can be taken. (We can use actual strings to describe the items rather than IDs since there may be too many).
  • A string (or strings) that holds the description of the location. This string must have well defined delimiters within itself. In Zork, the description of a location would change based on whether or not certain items were still there, so we can use separate strings like "General description of the location", "Description of item 1", "Description of item 2" etc, and just concat all of them or some of them depending on the current state of the location.
  • Accessible areas and their directions.
  • Usable items, interactive characters if any.

Basically the most important thing to do in OOP is to draw out a list of the various types of objects that you may use within the game such as "Location", "Item", "NPC".

Then when it comes to taking the input, you'll need to really be able to work with strings and separate them out and stuff. C and C++ are really 2 of the worst languages for handling strings, so you'll definitely have your work cut out for you. Basically you'll need to form an exhaustive list of verbs, nouns and conjunctions if you're using those which will be checked against each time they type something in. Form a structure for the input. In Zork it seems to be <verb> <noun> or <verb> <conjunction> <noun>.

I realise you may already have a lot of this planned out, I'm just trying to show how I would approach the problem.


All times are GMT. The time now is 01:37 PM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.