Hi Everyone,
So I had a pretty general question for people. Lets say you wanted to make a standard adventure game. The kind where the user given a room(s) and they have choices to make. Such as "Look", "Get", "Examine", "Talk", or move to the next room and so on.
Given this setup, what would be the best way to set about making a general engine for it? For example, I would think setting up a 2 dimensional array of structs for the rooms would be ok, with different parts of the structure being created for the attributes of the room. Like how many exits exist, how many items are found in each room, who is in each room, etc.
But the problem with that approach is that I'm not sure how to make it flexible enough. Like, if any room contains (x) amount of items, how should that be stored in the structure? Or if an item, object, or person has multiple states... Like if you examine a table 3 times, a key is revealed, how would you store that kind of information in the room?
At first I thought I would just give a room an attribute called "Item List" or something, and just put a list of items via index in it. And so, if the list contained item "3" then look up a different array to find out what kind of item it is and how to behave when you investigate it (As an example).
Perhaps my method of tackling this issue is wrong to begin with? Sorry for the pretty messy description, but I'm hoping someone with experience kind of knows what I'm trying to figure out. (^_^);
So I had a pretty general question for people. Lets say you wanted to make a standard adventure game. The kind where the user given a room(s) and they have choices to make. Such as "Look", "Get", "Examine", "Talk", or move to the next room and so on.
Given this setup, what would be the best way to set about making a general engine for it? For example, I would think setting up a 2 dimensional array of structs for the rooms would be ok, with different parts of the structure being created for the attributes of the room. Like how many exits exist, how many items are found in each room, who is in each room, etc.
But the problem with that approach is that I'm not sure how to make it flexible enough. Like, if any room contains (x) amount of items, how should that be stored in the structure? Or if an item, object, or person has multiple states... Like if you examine a table 3 times, a key is revealed, how would you store that kind of information in the room?
At first I thought I would just give a room an attribute called "Item List" or something, and just put a list of items via index in it. And so, if the list contained item "3" then look up a different array to find out what kind of item it is and how to behave when you investigate it (As an example).
Perhaps my method of tackling this issue is wrong to begin with? Sorry for the pretty messy description, but I'm hoping someone with experience kind of knows what I'm trying to figure out. (^_^);