Implementing Event Driven Communication between game module
Posted: Tue Nov 01, 2011 12:14 am
Bare with me I'm going to make a vague question as nonvague as possible here.
I've been reading Game Coding Complete and the book talks a lot about having the game as modules which communicate with and Event Manager which is basically an Observer design pattern. Now the biggest difference between my game and his concepts is Irrlicht which in itself is a module mostly the graphics part (some collision stuff too) Now Irrlicht really isn't designed to interact in the same way as his graphics module does making communication between let's say Enemy entities and their 3d representation aka nodes. There really is no need to have the Enemy AI to send out an event to the Event Manager for Irrlicht to listen to telling it to rotate the object. Or am I missing the point? Event driven communication kind of has me puzzled as how to design my overall architecture because certain things are turning out to seem kind of redundant to me. Like having the collision of two nodes triggering an event telling entities to solve the problem rather than have the game logic just let the associated entities of the nodes (I.E. PlayerEntity, EnemyEntity) do their own thing by themselves.
I'm missing a point here aren't I?
I've been reading Game Coding Complete and the book talks a lot about having the game as modules which communicate with and Event Manager which is basically an Observer design pattern. Now the biggest difference between my game and his concepts is Irrlicht which in itself is a module mostly the graphics part (some collision stuff too) Now Irrlicht really isn't designed to interact in the same way as his graphics module does making communication between let's say Enemy entities and their 3d representation aka nodes. There really is no need to have the Enemy AI to send out an event to the Event Manager for Irrlicht to listen to telling it to rotate the object. Or am I missing the point? Event driven communication kind of has me puzzled as how to design my overall architecture because certain things are turning out to seem kind of redundant to me. Like having the collision of two nodes triggering an event telling entities to solve the problem rather than have the game logic just let the associated entities of the nodes (I.E. PlayerEntity, EnemyEntity) do their own thing by themselves.
I'm missing a point here aren't I?