Jump to content
  • Advertisement
Sign in to follow this  

Game Modules - Feedback request

This topic is 4973 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I'm planning on using a modular design for my game essentially these modules are black boxes with a set of inputs and outputs. Modules trigger another module by activating the appropriate input trigger of the target module. Then the module does whatever processing is needed and actives the appropriate output trigger. The design for a module is as follows: Input data - sends needed data to the module, Input trigger – triggers the module. Output data - sends returned data to the caller. Output trigger – triggers another module. Mechanics – The mechanics of how the module functions. Rules - The instance specific rules for handling the module. There can be multiple inputs and outputs for a given module. Base modules will normally have a set of predefined inputs and outputs, which may be different in a particular instance of a module. The overall purpose of using this design and implementation method is to keep different game mechanics separate, to allow for easy customization of instance specific game mechanics, and to create complex in game interactions but at the same time limiting and simplifying the connections between different modules. It should also hopefully allow from improved creation of procedurally generated content, which my current game relies heavily on. An example of module might be this: Security Control: Input triggers – Security Alert - Explosion - Containment breach - Security device Activated. Output triggers - Investigate - Activate security device. - Evacuate - Call for assistance - Activate failsafe The rules for a given how Security control work would differ depending on the facility a low security facility might active the investigate trigger after 3 security alerts occur from that source. While a high security facility might activate a half dozen motion tracking guns after one security alert. What do people think of this method? Do you see an obvious flaws or problems with it that, as well as possible solutions to them? :)

Share this post

Link to post
Share on other sites
i think its related...

#ifndef NODE_H
#define NODE_H

#include "signal.h"

class World;

/**Base abstract 'Node' framework class

This class is the class inherited by each node.
Node's are different part's of the application,
and can be thought of as little clients.
Signals are recieved and sent as strings.*/

class Node
/**update class pointer to parent*/
Node(World *par);

/**Recieve and Interpret a signal

RecieveSignal should be overriden, by all derived
node classes*/

virtual void RecieveSignal(const string &id , Signal &sig);
/**Send a signal to parent to broadcast

Broadcast should not be overriden as it is used
to communicate with the other nodes, via the parent*/

void Broadcast(const string &id , Signal &sig);
/**Send a signal to parent to relay

SendSignal should not be overriden as it is used
to communicate with the other nodes, via the parent*/

void SendSignal(const string &name , const string &id , Signal &sig);
World *parent; ///< Node's Parent


all game nodes, derive from that class (like Backgrounds, Events .etc).

#include "world/world.h"
#include "node/background.h"
#include "node/startupresource.h"

int main()
World myworld;

BackgroundNode bg(&myworld);
StartUpResourceNode sur(&myworld);


return 0;

so if inside one of the nodes i ever want to signal to another node.

/*testing testing*/
Signal sig("xmlpath startup");
sig("str" , (const char*)"hello")
("age" , (int)10)
("pi" , (float)3.141592654);

SendSignal("startup","do startup",sig); //send signal to startup
Broadcast("do startup",sig); //send signal to all nodes

hope it helps!

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!