Jump to content

View more

Image of the Day

WIP title screen for #DeathOfAPartisan #screenshotsaturday #gamedev https://t.co/qJNhfZCvd4
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Question about game events

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
3 replies to this topic

#1 Irlan Robson   Members   

4056
Like
0Likes
Like

Posted 18 June 2014 - 05:43 AM

I want to know if game events should be generated by the Game itself or, for instance, the game world can generate game events based on things that happen inside the world?

 

So my world can have a EventListener attached to it?

 

 

Eg.

 

BeginContact->GenerateGameEvent->DispatchEventViaEventListener

 

?



#2 Jason Z   Members   

6430
Like
1Likes
Like

Posted 18 June 2014 - 05:49 AM

What will the events be used for?  If they will be used for sending information about the game state, then it should probably come from the game.  If it is for sending data to the game to cause a change in game state, then it should be able to come from the game itself or other systems.

 

So you need to clarify what these objects are supposed to be doing, and then make the design decision based on that!



#3 Irlan Robson   Members   

4056
Like
0Likes
Like

Posted 18 June 2014 - 04:22 PM

What will the events be used for?  If they will be used for sending information about the game state, then it should probably come from the game.  If it is for sending data to the game to cause a change in game state, then it should be able to come from the game itself or other systems.

 

So you need to clarify what these objects are supposed to be doing, and then make the design decision based on that!

I'm saying if a Game Event is called "GAME EVENT" they're supposed to come from the GameState, or is just globals that propagate through the world, systems, etc.

If so, I don't need even have a EventListener, I can call directly each Object's Event Handler based on a certain criteria.



#4 SeanMiddleditch   Members   

17493
Like
4Likes
Like

Posted 19 June 2014 - 04:57 PM

It doesn't matter. Different games do it different ways. Which way is best for your specific situation depends on a whole ton of details you haven't provided (and which, frankly, nobody here cares about).

Just do whatever way makes the most sense to you.

Game Developer, C++ Geek, Dragon Slayer - http://seanmiddleditch.com

C++ SG14 "Games & Low Latency" - Co-chair - public forums

Wargaming Seattle - Lead Server Engineer - We're hiring!





Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.