Re: game development question:reading and writing game data to and from files
- From: "Tyler Littlefield" <tyler@xxxxxxxxxxxxx>
- To: <programmingblind@xxxxxxxxxxxxx>
- Date: Sun, 12 Jul 2009 23:18:01 -0600
----- Original Message ----- From: "Sina Bahram" <sbahram@xxxxxxxxx>
To: <programmingblind@xxxxxxxxxxxxx> Sent: Sunday, July 12, 2009 11:09 PMSubject: RE: game development question:reading and writing game data to and from files
You don't' have to do string to string. Do string to some object .... Do some object to string ... It doesn't matter. Take care, Sina -----Original Message----- From: programmingblind-bounce@xxxxxxxxxxxxx [mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of Tyler Littlefield Sent: Monday, July 13, 2009 12:43 AM To: programmingblind@xxxxxxxxxxxxxSubject: Re: game development question:reading and writing game data to andfrom files Sina: What I was going to do was something like: class player { private: map <string,string> *values; }; then I could write a save function on top of that. I could always do something like:... #define TYPE_INT 1 #define TYPE_STR 2 struct variant { union { int i; string str; } v; int type; }; but I'd have to store the type of the variant... somewhere----- Original Message ----- From: "Sina Bahram" <sbahram@xxxxxxxxx>To: <programmingblind@xxxxxxxxxxxxx> Sent: Sunday, July 12, 2009 10:39 PMSubject: RE: game development question:reading and writing game data to andfrom filesStruct TyStruct { ObjectTypeTheFirst first; ObjectTypeTheSecond second; int id; char* name; } Then just make a map of hashes or ints or whatever, each to an object of type TyStruct. Instead of struct, make it a class with full type safety and so on. Take care, Sina -----Original Message----- From: programmingblind-bounce@xxxxxxxxxxxxx [mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of Tyler Littlefield Sent: Sunday, July 12, 2009 12:39 PM To: programmingblind@xxxxxxxxxxxxx Subject: Re: game development question:reading and writing game data to and from files hmm, so I would store the pointer to an int/string/double. I need to be able to tell what it is though, no?----- Original Message ----- From: "Sina Bahram" <sbahram@xxxxxxxxx>To: <programmingblind@xxxxxxxxxxxxx> Sent: Sunday, July 12, 2009 10:36 AM Subject: RE: game development question:reading and writing game data to and from filesThe map definitely handles this bro. Just don't make it a map of primative to primative, make it a map of primative to object. That object can be of any type you like. Take care, Sina ________________________________ From: programmingblind-bounce@xxxxxxxxxxxxx [mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of Tyler Littlefield Sent: Sunday, July 12, 2009 12:18 PM To: programmingblind@xxxxxxxxxxxxx Subject: game development question:reading and writing game data to and from files Hello all,I've started work on a custom mud, and am trying to figure something out.Each player will have a set of keys that will be stored, name, connect time, creation time, etc. I was thinking of storing these in a map, but that requires that the map hold multiple values; something which the c++ map doesn't do. So, I'm trying to figure something out. I'd like to be able to store player data, and a list of the player's inventory so the objects can be recreated when the player connects somehow. I would need to store object type, name, etc etc. I'm not quite sure how I could achieve this easily; I could possiblyitterate through the map once I've gotten the data type thing figured outand do something like write key=value. Then when I loaded it I could just strtok on the = and set that up, but I'm not quite sure how I'd handle inventory and that. This is the only snag I'm having so far, and I'm not able to move on withoutit, as I'm to the point where I need to start saving player data, so helpwould be really appriciated at this point. :) Thanks, __________ View the list's information and change your settings at http://www.freelists.org/list/programmingblind__________ View the list's information and change your settings at http://www.freelists.org/list/programmingblind __________ View the list's information and change your settings at http://www.freelists.org/list/programmingblind__________ View the list's information and change your settings at http://www.freelists.org/list/programmingblind __________ View the list's information and change your settings at http://www.freelists.org/list/programmingblind
__________View the list's information and change your settings at http://www.freelists.org/list/programmingblind
- Follow-Ups:
- References:
- game development question:reading and writing game data to and from files
- From: Tyler Littlefield
- RE: game development question:reading and writing game data to and from files
- From: Sina Bahram
- Re: game development question:reading and writing game data to and from files
- From: Tyler Littlefield
- RE: game development question:reading and writing game data to and from files
- From: Sina Bahram
- Re: game development question:reading and writing game data to and from files
- From: Tyler Littlefield
- RE: game development question:reading and writing game data to and from files
- From: Sina Bahram
- game development question:reading and writing game data to and from files
Other related posts:
- » game development question:reading and writing game data to and from files - Tyler Littlefield
- » RE: game development question:reading and writing game data to and from files - Sina Bahram
- » Re: game development question:reading and writing game data to and from files - Tyler Littlefield
- » Re: game development question:reading and writing game data to and from files - Bill Cox
- » Re: game development question:reading and writing game data to and from files - Tyler Littlefield
- » RE: game development question:reading and writing game data to and from files - Ken Perry
- » Re: game development question:reading and writing game data to and from files - Rui Batista
- » Re: game development question:reading and writing game data to and from files - black ares
- » Re: game development question:reading and writing game data to and from files - Tyler Littlefield
- » Re: game development question:reading and writing game data to and from files - Tyler Littlefield
- » Re: game development question:reading and writing game data to and from files - E.J. Zufelt
- » Re: game development question:reading and writing game data to and from files - Tyler Littlefield
- » Re: game development question:reading and writing game data to and from files - Tyler Littlefield
- » Re: game development question:reading and writing game data to and from files - black ares
- » Re: game development question:reading and writing game data to and from files - Tyler Littlefield
- » Re: game development question:reading and writing game data to and from files - Bill Cox
- » Re: game development question:reading and writing game data to and from files - The Elf
- » RE: game development question:reading and writing game data to and from files - Ken Perry
- » Re: game development question:reading and writing game data to and from files - Tyler Littlefield
- » RE: game development question:reading and writing game data to and from files - Ken Perry
- » Re: game development question:reading and writing game data to and from files - The Elf
- » RE: game development question:reading and writing game data to and from files - Sina Bahram
- » Re: game development question:reading and writing game data to and from files - Tyler Littlefield
- » RE: game development question:reading and writing game data to and from files - Sina Bahram
- » Re: game development question:reading and writing game data to and from files - Tyler Littlefield
- » RE: game development question:reading and writing game data to and from files - Sina Bahram
- » RE: game development question:reading and writing game data to and from files - Sina Bahram
- » Re: game development question:reading and writing game data to and from files - Tyler Littlefield
- » Re: game development question:reading and writing game data to and from files - Tyler Littlefield
- » RE: game development question:reading and writing game data to and from files - Sina Bahram
- » Re: game development question:reading and writing game data to and from files - black ares
- » Re: game development question:reading and writing game data to and from files - Bill Cox
- » RE: game development question:reading and writing game data to and from files - Sina Bahram
- » Re: game development question:reading and writing game data to and from files - Tyler Littlefield
- » RE: game development question:reading and writing game data to and from files - Sina Bahram
- » Re: game development question:reading and writing game data to and from files - Tyler Littlefield
- » RE: game development question:reading and writing game data to and from files - Sina Bahram
- » Re: game development question:reading and writing game data to and from files - Tyler Littlefield
- » RE: game development question:reading and writing game data to and from files - Sina Bahram
- » Re: game development question:reading and writing game data to and from files - Tyler Littlefield
- » Re: game development question:reading and writing game data to and from files - Jamal Mazrui
- » Re: game development question:reading and writing game data to and from files - black ares
- » Re: game development question:reading and writing game data to and from files - black ares
- » Re: game development question:reading and writing game data to and from files - Tyler Littlefield
- » Re: game development question:reading and writing game data to and from files - Tyler Littlefield
- » RE: game development question:reading and writing game data to and from files - Ken Perry
- » RE: game development question:reading and writing game data to and from files - Ken Perry
- » RE: game development question:reading and writing game data to and from files - Ken Perry
- » RE: game development question:reading and writing game data to and from files - Ken Perry
- » RE: game development question:reading and writing game data to and from files - Ken Perry
- » RE: game development question:reading and writing game data to and from files - Ken Perry
- » Re: game development question:reading and writing game data to and from files - Tyler Littlefield
- » Re: game development question:reading and writing game data to and from files - Tyler Littlefield
- » Re: game development question:reading and writing game data to and from files - black ares
- » Re: game development question:reading and writing game data to and from files - black ares
- » Re: game development question:reading and writing game data to and from files - Tyler Littlefield
- » Re: game development question:reading and writing game data to and from files - black ares
- » Re: game development question:reading and writing game data to and from files - Tyler Littlefield
- » Re: game development question:reading and writing game data to and from files - black ares
- » Re: game development question:reading and writing game data to and from files - Jared Wright
- » Re: game development question:reading and writing game data to and from files - Tyler Littlefield