Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / trying A.I using waypoints

Author
Message
shadey
14
Years of Service
User Offline
Joined: 25th Jan 2010
Location:
Posted: 20th Feb 2018 12:08
Hi, been trying to use waypoints in my 3D engine for using some A.I. I have tried this code


Which obviously is useless as this video shows:



I thought using that small for next of diff would do but not so, I dont think it well ever work.. So the baddie will never move onto the next waypoint

Can someone straighten me out and show me a better way to do this? I just want that baddy to get to the first way point then to the next and so on, I know I dont have a way to get back to waypoint 1 yet but I need to help in getting this right first.. tnx
Hail to the king, baby!
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 20th Feb 2018 15:23
Hey.

I'm not sure there's a quick and easy fix for what you want, there's no ai built into AGK. I built an a* pathmapping routine for 2d, and that alone is 3-4 times the size of your code. I've not done it, but I think flood fill is the most common 3d pathmapping routine. Maybe try searching that and the forums?
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 20th Feb 2018 15:28
Scratch that, apparently you can use node based a* in 3d.

https://stackoverflow.com/questions/19524335/3d-pathfinding-ai-algorithm-recommendation-and-analysis
shadey
14
Years of Service
User Offline
Joined: 25th Jan 2010
Location:
Posted: 20th Feb 2018 15:39 Edited at: 20th Feb 2018 15:40
had some progress using the floor command,so the function is now...


but not quite right, here is the result....



the second run starts off right,going to the first waypoint on the left edge, but then it gets stuck on the the 3rd one
Hail to the king, baby!
shadey
14
Years of Service
User Offline
Joined: 25th Jan 2010
Location:
Posted: 20th Feb 2018 16:14 Edited at: 20th Feb 2018 19:47
never mind,sorted it,here is the final function for those interested...


and the result:


I will have to put the spdx and spdz vars inside the baddy type now to make it better
Hail to the king, baby!
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 21st Feb 2018 09:29 Edited at: 21st Feb 2018 09:29
I once made a node based waypointing engine in DBPro. It will be quite easy to make it work in AGK.

Click here for the playlist
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 21st Feb 2018 12:19
Sorry, think I totally missed your point, I thought you wanted it to pathmap.....ie work out routes around problems etc. My answer made no sense based on this. Lol.

Login to post a reply

Server time is: 2024-04-26 19:31:52
Your offset time is: 2024-04-26 19:31:52