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.

Dark Physics & Dark A.I. & Dark Dynamix / Constructing DarkAI obstacles from image

Author
Message
monotonic
13
Years of Service
User Offline
Joined: 24th Mar 2006
Location: Nottinghamshire, England
Posted: 29th Jul 2011 15:03 Edited at: 29th Jul 2011 15:05
Hi Guys,

I've not been on these forums for a long time and haven't been using DBP for an equal amount of time, due to work etc. Nice to see loads of new "faces" on the forums and the old troop too

I have a quandary, I've decided to re-enter the world of DBP by making an RTS game. I have an image map that defines various types of terrain, green pixels denoting passable terrain, blue water, red impassable and so on. I'm using DarkAI for the pathfinding, to save me time writing my own from scratch. Now the problem I'm facing is converting this terrain type map into DarkAI obstacles. I'm toying with various ideas of how to go about this. The first thing I thought of was to iterate through each pixel, determine if it's an impassable bit of terrain then construct an obstacle in DarkAi for it. But this method seems very inefficient, as it will result in loads of obstacles that are not needed. Another idea was to use an edge finding algorithm to build islands of impassable terrain and use that to construct the obstacle.

I was just wondering if any of you guys have done this in the past and what method did you use.

Cheers in advance.

01100001 01101110 01101111 01110100 01101000 01100101 01110010
01110000 01101111 01101001 01101110 01110100 01101100 01100101 01110011
01110011 01110011 01101001 01100111
Quisco DaLuse
12
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: USA
Posted: 31st Jul 2011 16:09
Hi monotonic,

I'm trying to understand what it is you are trying to do. Maybe I haven't had enough coffee yet

I take it you are using a bitmap image as a guide to make objects that you can include in a DarkAI system. It seems to me that this method would necessitate the use of primitives in the creation process. I can't imagine how that would come off working in a game.

I guess I don't understand why you just don't make the objects (i.e. terrain, water, impassable, etc.) and then add each object to the AI system using the command, AI Add Static Obstacle (?)

Perhaps you could clarify a little bit for me.
monotonic
13
Years of Service
User Offline
Joined: 24th Mar 2006
Location: Nottinghamshire, England
Posted: 31st Jul 2011 21:30
Just adding the terrain as an obstacle wouldn't work, that only really works when you have a level map or smaller obstacles within the level, for terrain it would be no good.

Ok what I am doing is loading an image that defines parts of the map and what they are I.e. water, cliff faces etc. So for a cliff in the terrain I would colour it red, denoting that its impassable, then when I load the map I add the vertices into darkai so that it sees the cliff as an obstacle. Creating loads of objects and using the add obstacle commands is not the way to go, also using the make obstacles from level function would be no good because that requires the map to be level where terrain is not. Using the image method is the best way to go as far as I can see, I currently have a version working at the minute, but its not as efficient as I'd like.

01100001 01101110 01101111 01110100 01101000 01100101 01110010
01110000 01101111 01101001 01101110 01110100 01101100 01100101 01110011
01110011 01110011 01101001 01100111
Quisco DaLuse
12
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: USA
Posted: 31st Jul 2011 22:24
What about writing some code that would allow you to manually create waypoints?

You could make the camera move around the world you have created, and then when you are at a point you would like to be made into a waypoint, you place a temporary object there to show you have declared it as a waypoint and store the location information in an array. When you are done, you save the array.

In the game itself, I believe you could load in the array with the waypoints and give this info to the AI system.

One difficulty would be having varying heights. In this case you might have to create separate containers for different heights on your terrain.
monotonic
13
Years of Service
User Offline
Joined: 24th Mar 2006
Location: Nottinghamshire, England
Posted: 31st Jul 2011 22:36
That would be over complicating the issue, all I need to do is write an edge detection algorithm that detects the edges of the obstacle defined in the image then add the vertices to darkai. It's for an rts so it only needs to to be single level in the eyes of darkai at least, so a single.container approach is best.

01100001 01101110 01101111 01110100 01101000 01100101 01110010
01110000 01101111 01101001 01101110 01110100 01101100 01100101 01110011
01110011 01110011 01101001 01100111
Kezzla
10
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 3rd Aug 2011 07:09
what about something along these lines?


just step it to your desired waypoint resolution.

kezzla

Sometimes I like to use words out of contents

Login to post a reply

Server time is: 2019-06-16 04:22:10
Your offset time is: 2019-06-16 04:22:10