Jump to content


Photo

I need help in an almost finished AI.....


  • Please log in to reply
2 replies to this topic

#1 xboxown

xboxown

    GMC Member

  • GMC Member
  • 47 posts

Posted 07 May 2012 - 03:48 AM

I am almost finished with the AI for my game but there are still this 20% of the AI that I am not happy with and it's behavior is not the way I want them. Right now when they are moving they are not exploring or moving around the entire level, they are too random in their movements and exploring very little portion of the level. When they hit the wall they stay paused for 6 seconds before they move again instead of instantly changing directions in the level.

One other bug I hate about the AI, that if the monster is put in a "hallway" like level they go up and down, up and down and go up and down and go up and down but when there is a little exit they never go to the exit. Final bug, they are not fit on the 48 X 48 grid, so when the monster moves and tries to exit the door part of the body hits the wall and this prevents the monster from entering the room. Also the pattern of the monster in movement is always the same pattern instead of unpredictable movement in when they go next. I have attached here completely the source code link from pastebin website:

http://paste.dprogramming.com/dpxsenhp
  • 0

#2 lukew23

lukew23

    GMC Member

  • GMC Member
  • 276 posts
  • Version:Unknown

Posted 07 May 2012 - 05:59 AM

Research the mp_grid functions. They will help with most of your problems. Basically, set their target point as random x and y variables and have the AI move using the mp_grid functions. Then, when they reach the target, randomise the position again.
  • 0

#3 xboxown

xboxown

    GMC Member

  • GMC Member
  • 47 posts

Posted 07 May 2012 - 08:15 PM

Research the mp_grid functions. They will help with most of your problems. Basically, set their target point as random x and y variables and have the AI move using the mp_grid functions. Then, when they reach the target, randomise the position again.



is it possible you could give me a sample code of what you are talking about? Or use the source code I have posted above and point out to me where I need to do the changes and to the changes you request? :) All I ask is you just give me a tiny spark to direct me in the direction in form of code and from there I will be to finish it!

Thank you so much for everything in advance.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users