Jump to content
  • Advertisement
  • entries
  • comments
  • views

Project: AI Legacy

Coding a Mission System



I finished a dialogue system so that it will take any number of dialogue sentences that require a button press to move to the next sentence, then can handle any number of dialogue options from that choice. The map can loop on nodes and really go anywhere, along with code to run once the dialogue finishes.


Having set that up, I wanted to work on a mission manager. I wanted this to be completely divorced from my other managers and just listen in on the other systems. It would, unfortunately, need to know what's out there, but that's a simple compromise for now until I can learn to pass events and delegates through methods.

The mission manager is nice. For now I have two types of missions. The first is to stockpile resources, the other is to build a number of a certain building. I quickly discovered some powerful features of properties.

I realized that I did not need to define a delegate for every event. I defined one delegate, which was resource changed, that passed an integer. I then declared an event for each resource, then had a a small method to invoke the event.

But here's the cool part. I put this method inside the setter of the resource integer. So now my mission manager checks which resource it needs to listen to, and then registers for the resources event to a simple method that updates the mission text. So everytime the resource count is changed, we automatically update the on screen mission text that the player sees. No update needed.

I really like these types of solutions. The mission system is ready, the dialogue system is ready, and the building system is ready. Time to polish with animations and fill our databases with assets.


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Advertisement
  • Blog Entries

  • Similar Content

    • By ethancodes
      I'm fairly new to creating full 2d levels, so please feel free to correct me if I use incorrect terminology or if I'm doing something wrong here. Currently, I am using the Tile Palette with several sprites placed on it to create my levels. With that I can just run my mouse across the screen and quickly place tiles. Then on the TIlemap gameobject I place a Tilemap Collider and a Composite Collider. This works great, it's quick, simple, and efficient. However, for the next part of my character controller I'm looking at adding the ability to do a ledge grab. After doing some research, it seems like a common way to do that is to make the ledge he can grab "grabable" by putting a different collider on them. So my question is, is there an efficient way to where I can let the Tile Palette know if I use a specific corner sprite, place the ledge grab collider on it? Is there any way other than going through all the ledges in the game and manually placing them there? I'm also open to any tips on level building and using the Tilemap, etc that may help me out as, like I said, I'm pretty new to it all. Thanks!
    • By syedMohib44
      Hello guys I am a bit confused on rotation and position in unity. The thing is when I am at 0 rotation on X-Axis and I restricted my player to not let it go more than 10 on x-axis and less than -10 x-axis but when I rotated it to 90 degree It stated to move forward on left key press and backward to right key press. I just want to clamp position between 10 and -10 on every rotation It must not move differently when rotated... e.g for some understanding the scenario If a player is on a road and it is restricted to go on foot path then it should also be restricted when rotated to left or right... Please help me with this guys any help would be appreciated. 
      Thank You.
    • By Doctrina Kharkov
      We released an arcade story-driven game created by 12-13 years old children.
      All coding, art and animation was madden by them.
      Game have 5 unique mechanics levels.
    • By VoroNoise
      Main designer here with a massive scale RTS/grand strategy/city builder/god game. If this sounds interesting and you're an artist or programmer with ideas then please contact me! We can make a bundle! I already have musicians with solid tracks. About three quarters of the way through total development, just need minor details filled out and a lot of art assets worked in.

  • Advertisement

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!