Hey,
In my game, every time the player reaches the next 'node' along the path a random event happens to them. In order to keep the gameplay interesting I need to have lots of events (a few hundred). What would be the best way to store the events? I need to store the event name, description and effects. My first thought was a database but I dont want to have to deal with using mySQL. I am coding in C++ using SDL.
Thanks
Help with storing events
Page 1 of 11 Replies - 126 Views - Last Post: 05 February 2013 - 10:25 AM
Replies To: Help with storing events
#2
Re: Help with storing events
Posted 05 February 2013 - 10:25 AM
If you were to have an event manager that handles event objects and fires them to the player you could easily just create a new type of event whenever it is needed. You wouldn't need to store more than one at a time you can simply create a random event type whenever it is needed.
So you would need an event manager class to send the events, an event base class to derive all of your other events and a random way to choose which event needs to be created. Such as an event factory that creates events based on a number then you can randomly choose a number each time and pass it to the factory.
So you would need an event manager class to send the events, an event base class to derive all of your other events and a random way to choose which event needs to be created. Such as an event factory that creates events based on a number then you can randomly choose a number each time and pass it to the factory.
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote



|