Desperately need help coding Obstacle Avoidance

BlitzMax Forums/BlitzMax Programming/Desperately need help coding Obstacle Avoidance

BugZilla(Posted 2009) [#1]
The TimelineFX particle system has gotten me interested in coding in BlitzMax again. Problem is that I have never been able to figure out how to have my characters steer to avoid obstacles and each other. Every points me to this page:

http://www.red3d.com/cwr/steer/

But that just shows you the behavior.There is no source code. Also I am by no means a math wizard. I can figure out game logic but sin/cosine freaks me out. Does anyone out there have some functions made in BlitzMax they can share with the community? I think it would be a great help to just about any game and I can't believe we don't have this code on the forums yet. Also, I'd like to avoid A Star. It really slows things down and it's hard to set up since you have to keep remaking the map every time something moves.


TaskMaster(Posted 2009) [#2]
The OpenSteer link on that page is OpenSource C++ implementation. You will need to convert it to BlitzMax to use it, or use it as C++, which is possible with BlitzMax.


BugZilla(Posted 2009) [#3]
Wouldn't using a C++ library tie your BlitzMax application to a specific platform? I want it to be released on Mac and Windows.

Does anyone have any idea how to take a library like OpenSteer and use it in a BlitzMax application?

Anyway wouldn't we be better off with a BlitzMax native group of functions to do this? Obstacle avoidance is something that happens in so many games it would be practical to have a set of functions to handle this.


Brucey(Posted 2009) [#4]
Wouldn't using a C++ library tie your BlitzMax application to a specific platform

Only if the C++ was platform specific.


plash(Posted 2009) [#5]
Anyway wouldn't we be better off with a BlitzMax native group of functions to do this?
Probably not. Especially since an existing library might have already implemented it (i.e. OpenSteer).


_Skully(Posted 2009) [#6]
The interesting part is that those demo's have just solved my issue of approach for the behaviors in TileMax... thanks LOL

It really slows things down and it's hard to set up since you have to keep remaking the map every time something moves.


Why are you remaking the map every time something moves? If you test at the pixelmap level, it seems to be fast! Don't write to it though or it gets transferred across the bus of course.


Htbaa(Posted 2009) [#7]
In Programming Game AI By Example written by Matt Buckland the topic of steering behaviors is being handled which also explains obstacle avoidance.

There's also another book, AI Game Engine Programming. The 2nd edition handles the topic as well, but I don't know how well as I've only got the 1st edition.

The first book really helped me a lot as well, and I'm absolutely no math guy. The example code is all in C++ but it's easy enough to translate it to BlitzMax.


Nate the Great(Posted 2009) [#8]
you have just inspired me to write an ai engine... or maybe I should just write a tutorial for blitz max coder? idk.


Jesse(Posted 2009) [#9]
@NTG, I thing that if you do an engine in the form of a tutorial, it would be great. So even if some of us are to dumb to learn from yet another tutorial, at least, we would still have an engine to use. :)


BugZilla(Posted 2009) [#10]
An AI engine would be awesome. If it's full featured and easy to use I'm sure I would buy it if reasonably priced. If that's not your goal then please post some tutorials.


Nate the Great(Posted 2009) [#11]
@NTG, I thing that if you do an engine in the form of a tutorial, it would be great. So even if some of us are to dumb to learn from yet another tutorial, at least, we would still have an engine to use. :)



yeah, that was my second thought after posting.

An AI engine would be awesome. If it's full featured and easy to use I'm sure I would buy it if reasonably priced. If that's not your goal then please post some tutorials.



hmmm I think a tutorial will come first but..

hold on! I have an idea! I think I will make an AI engine within my physics engine... That would make it much more useful to other things because my physics engine was meant for general application, not just physics in games but collision detection or AI in this case!

no promises but a tutorial will definitely come first. :)

edit: if I make one, it will be free with my physics engine which also happens to be free... for now, I will start to mess with some AI and finish my game flood and my physics engine.