Game Events

Anything related in any way to game development as a whole is welcome here. Tell us about your game, grace us with your project, show us your new YouTube video, etc.

Moderator: PC Supremacists

Post Reply
dnxviral
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 51
Joined: Tue Dec 14, 2010 6:49 pm
Favorite Gaming Platforms: PC
Programming Language of Choice: Everything... and C#
Location: dnXstudios
Contact:

Game Events

Post 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
User avatar
Ginto8
ES Beta Backer
ES Beta Backer
Posts: 1064
Joined: Tue Jan 06, 2009 4:12 pm
Programming Language of Choice: C/C++, Java

Re: Game Events

Post 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 ;)
Quit procrastinating and make something awesome.
Ducky wrote:Give a man some wood, he'll be warm for the night. Put him on fire and he'll be warm for the rest of his life.
dnxviral
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 51
Joined: Tue Dec 14, 2010 6:49 pm
Favorite Gaming Platforms: PC
Programming Language of Choice: Everything... and C#
Location: dnXstudios
Contact:

Re: Game Events

Post 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?
User avatar
Ginto8
ES Beta Backer
ES Beta Backer
Posts: 1064
Joined: Tue Jan 06, 2009 4:12 pm
Programming Language of Choice: C/C++, Java

Re: Game Events

Post 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.
Quit procrastinating and make something awesome.
Ducky wrote:Give a man some wood, he'll be warm for the night. Put him on fire and he'll be warm for the rest of his life.
dnxviral
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 51
Joined: Tue Dec 14, 2010 6:49 pm
Favorite Gaming Platforms: PC
Programming Language of Choice: Everything... and C#
Location: dnXstudios
Contact:

Re: Game Events

Post by dnxviral »

Ahh I like it! Ok i'll keep this in mind :D Thanks for your help.
Post Reply