Page 1 of 1

Game Events

Posted: Tue Jan 11, 2011 10:51 am
by dnxviral
Well I'm having trouble on game events and was wondering if someone could lend a hand :)

Games usually have events in them, where you talk to someone and you get an item, you kill an enemy and the door opens, you get a certain item and a boulder moves, or you walk on a certain tile a secret passage opens. Now this seems like a pretty simple concept the only problem is I'd like to make events based off of the map. The map data would consist of a list of special events and then once the player completes it then it does something. But how would my program interpret that... without so much interpreting data for once in a lifetime events.

I might not have explained that perfectly but I'm having trouble with this concept.
I'm using XML for the map data and C# for my language if that matters so much.

Thanks, dnx

Re: Game Events

Posted: Tue Jan 11, 2011 1:51 pm
by Ginto8
Have variables in the game's state. ie. an array of quest statuses, an integer (or some other method) to determine story progression, and a few other things. That kind of thing wouldn't necessarily have to create an event, it would just have to change the game's state so things work a little differently ;)

Re: Game Events

Posted: Tue Jan 11, 2011 9:02 pm
by dnxviral
Ginto8 wrote:Have variables in the game's state. ie. an array of quest statuses, an integer (or some other method) to determine story progression, and a few other things. That kind of thing wouldn't necessarily have to create an event, it would just have to change the game's state so things work a little differently ;)
Could you elaborate more... I'm interested in the way you described it as the games state. Wouldn't this be kinda counter productive. If I want something to stay a certain way would I just have a default game then look at the progression and change the game state to the players current progression?

Re: Game Events

Posted: Tue Jan 11, 2011 9:47 pm
by Ginto8
By game "state", I just mean some way of storing the data while the game is running, and possibly then storing it into a file. Your game would have a certain set of parameters that cause different things in the world to change what they look like, how they act, etc. For example, you could have one part of the state control the player's armor, and each time you change the state the armor changes, modifying stats along with it. Which brings another state or two, stats and temporary stat boosts. When a player attacks, the game would look at two states: the player's current stats, and any stat boosts. Then it determines how much damage based on that and a few other things like what monster it's against.

Basically the game state is the game's "playbook". When the game wants to do something that can go a few different ways, it checks out what the current state of play is before deciding on what it will do. This is how story progression and the like happen. Without it, most games would probably be one continuous level where nothing changes. Ever.

Re: Game Events

Posted: Wed Jan 12, 2011 2:07 pm
by dnxviral
Ahh I like it! Ok i'll keep this in mind :D Thanks for your help.