Jump to content
  • Advertisement
Sign in to follow this  
lucky6969b

Architecture for workflow

This topic is 533 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

There are several components in my application.

1st) state machines - drives what the agent is going to do next

2nd) task manager - manages all the tasks coming in and out of the scene

3rd) observer pattern - draw attention to agents when a task comes in

 

How do I put them together?

When a task does come in, say a truck carrying some troops that I want to annihilate.

Firstly, I've some arrival component that signals the truck to arrive in which they composite

some troops inside of this object. Then I use observer pattern to signal the task manager,

and create a task in the manager and push a task through to the NPCs

And when say my army's NPC notice it when their state machines has some pending 

tasks in their queues, they start to action. This is just a brainstorm...

Is it the way to go for the design stuff?

Thanks

Jack

Edited by lucky6969b

Share this post


Link to post
Share on other sites
Advertisement

That is A way to go, not sure about THE way to go.

The three things you mentioned (state machines, task managers, and observers) are tools and patterns.  It's roughly akin to saying you've got a hammer, a screwdriver, and a lathe, now you're wanting to know how to use them all together.

What you've got seems to work.  Going through your description you have something in your simulation that detects the thing is within range. That triggers a function call (observer pattern) and the thing that responds to the call in turn schedules a new task.  You have objects running their own state through state machines, and transitions within the state machine can be called by function callbacks as observers or called as functions from other task scripts.  All of that seems like a viable path.

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!