In-Game Event System

BlitzMax Forums/BlitzMax Programming/In-Game Event System

Macguffin(Posted 2008) [#1]
Hi all,

The strategy game I'm making will require a system to handle events. The events are going to be pretty general in scope, and there could potentially be a lot of them firing off at any given time. Think along the lines of the Europa Universalis series of games - although I'd like to avoid some of the pitfalls theirs seems to have landed in. My goal here is to try to get off on the right foot with what looks like a central system for the game.

I'm only now getting into learning about design patterns and related topics, and was wondering if anyone can suggest additional avenues I should investigate for this event system. I don't know enough atm to know if this is something that Blitz's Event modules could/should be used for, if it's a different kind of thing altogether, or what.

Essentially, I'm at square one and looking for your thoughts. Natch, I understand that whatever I implement isn't going to be perfect, but since I'm so low on the learning curve in this area, I want to at least get started in roughly the right direction.

Thanks.


AlexO(Posted 2008) [#2]

....The events are going to be pretty general in scope...



Could possibly look into implementing an event system using SendMessage(). Each object in Blitzmax implements this method. There's more info in the Blitzmax docs help under:
Language Reference -> Objects. May suit your needs or may not depending on your requirements.


Dreamora(Posted 2008) [#3]
The alternative is really using the event system that is used for the GUI as well for example. As BM allows you to create own events and eventhooks allow you to get non-serial code behavior, this is definitely a way you should have a look at.

brl.event etc are the place to start for this usage.


Arowx(Posted 2008) [#4]
The command pattern is possibly the closest one to a generic Event system to be starting off with...

Command Pattern


Macguffin(Posted 2008) [#5]
Thanks! This is just what I was looking for - general ideas for me to research. Much appreciated.