1 Replies - 485 Views - Last Post: 05 February 2013 - 10:25 AM Rate Topic: -----

#1 CountBale  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 28
  • Joined: 22-January 13

Help with storing events

Posted 05 February 2013 - 06:42 AM


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.


Is This A Good Question/Topic? 0
  • +

Replies To: Help with storing events

#2 stayscrisp  Icon User is offline

  • フカユ
  • member icon

Reputation: 1040
  • View blog
  • Posts: 4,325
  • Joined: 14-February 08

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.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1