Moving Characters and AI

posted in Yar
Published February 17, 2005
Advertisement
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!
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement

Latest Entries

!!!!!!!

671 views

MIDI Keyboard v1.7

1539 views

Yar.

1208 views

Orchestra Recording

1323 views

MIDI Keyboard v1.5

1458 views

Registration

1323 views

Ahhh!!!

1089 views

Um... yeah...

1075 views
Advertisement