Jump to content
  • Advertisement


Sign in to follow this  
  • entries
  • comments
  • views

Moving Characters and AI

Sign in to follow this  


Okay I've started coming up with how to move my characters. In FFT or Tactics Ogre when you select a character to move it highlights the maximum range that that character can move. I wasn't sure about how to go about this. What if there was a wall right next to the character and I highlighted a range of five squares? I would have to have a method for determining if that square should be highlighted. After playing around with this for a while I quickly found out that I simply could not come up with a good way for doing this so I came up with a different idea.

When you select a character for movement, it displays how many moves down in the corner, and then you can hit the directional buttons and move the character each tile. This makes it so that you don't have to highlight and yet you still get the range limit that I was looking for. Now you might wonder what prevents this character from going through the wall? Just before each move there is a check to see if the tile the character is moving to passable, and if the characters agility enables him to do so. This prevents a person from jumping down a cliff, or climbing up a ten tile wall.

When I was trying to get that concept with highlighting, I had to compute it for every possible path. such a hassel. I think that the way I am doing it right now is also a little bit more realistic feeling also.

Spells are going to be operated the same way. You get to move the 'spell' cursor so far, and then you can activate it. This also enables the AI for the enemies to be operated by something in this order:
*Get What action to do (move attack run etc)
*Which direction is target?
*Move one tile in that direction.
*if obstructed try going around it
*Goto line 1
Now obviously with this algo there is a problem with the enemies getting stuck in a corner... still working on this. Any links code welcome!
Sign in to follow this  


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

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!