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.

DarkBASIC Discussion / AI - please!

Author
Message
Pricey
22
Years of Service
User Offline
Joined: 22nd Feb 2003
Location:
Posted: 14th Sep 2003 19:22
i seriously need object number 2 to track down object number 1 without going through walls

code enclosed

My programs don't crash... your computer does

http://johnsgamesuk.topcities.com
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 14th Sep 2003 19:44 Edited at: 14th Sep 2003 19:46
for that code, every time the other object hits a wall set it to walk left or right at random (checking for collision) for a while, then when it has finished then get it to walk towards the player again, if it hits a wall before its finished then turn it round 180, if it hits a wall again then get it to face forwards and walk backwards a set amount and then go left or right again and then aproach the player, AI is tricky and unique to the code it runs in, you need to work out these solutions for yourself cos most of the time nobody will reply to posts like this, even for a simple scenario like this the AI will be long winded (unless you use something like a modified drunkards walk), basicaly the simplist AI would be to get it to walk towards the player when it can, and if it hits something to walk left/right or backwards if those directions are blocked, the trouble with that simple map is that being random you can have mazes and dead ends turn up that could trap a simpler AI, if you could ensure the blocks stood on their own then a simple turn left (world left, no rotated boxes) and walk x distance would work whenever it hit an obstruction, also, surround your object with a slightly larger collision sphere, theres nothing looks worse than a NPC that gets partly embeded into the wall whenever it hits one or stops exactly at the wall, like it didn`t see it was there, cheers.

Mentor.
Pricey
22
Years of Service
User Offline
Joined: 22nd Feb 2003
Location:
Posted: 14th Sep 2003 19:52
ok

i'll give that a try

sounds tricky!

My programs don't crash... your computer does

http://johnsgamesuk.topcities.com
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 14th Sep 2003 20:08
thats why AI requests don`t get answered very often , it can be a lot of work and time for even something relatively stupid compared to how a human would do it, time and effort that people are not inclined to give away at the drop of a hat, try reading up on pathfinding and you will see why

Mentor.
Pricey
22
Years of Service
User Offline
Joined: 22nd Feb 2003
Location:
Posted: 14th Sep 2003 20:22
i know about that matrix zoneing and certain paths blah... blah...

but i think that's too advanced for a tag game!

My programs don't crash... your computer does

http://johnsgamesuk.topcities.com
hexGEAR
22
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Naytonia
Posted: 17th Sep 2003 19:38
i guess the easiest way is the way-point method. check this out and see if it helps : pathfinding

to live is to suffer, to survive, well, thats to find meaning in the sufferening.....
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 17th Sep 2003 22:11
I'd use the A* method - divide the world into a grid. Then take the distance from each tile around the enemy to the player, then move onto the tile which is closest. Rinse and repeat.

However, it has it's flaws - you cna get stuck down dead-ends etc.

c:/dos
c:/dos run
run dos run
Pricey
22
Years of Service
User Offline
Joined: 22nd Feb 2003
Location:
Posted: 17th Sep 2003 23:10
waypoints wouldn't work very well for a random level :-(

My programs don't crash... your computer does

http://johnsgamesuk.topcities.com
D I G I T A L
21
Years of Service
User Offline
Joined: 22nd Jun 2003
Location: Dubai, UAE
Posted: 17th Sep 2003 23:58
hello people,
well, if this was just talking about movement, id like to see something about decision making for the enemy, e.g if threat=1 then shoot the hostages or arm a bomb, if target is in sight then shoot at it, stuff like that! i hope i'm not exagurating, but they say "u can do anything with DB"
thankx

‘Those who ignore the lessons of the past are doomed to repeat them’ (Napoleon)
M00NSHiNE
21
Years of Service
User Offline
Joined: 4th Aug 2003
Location: England, UK
Posted: 19th Sep 2003 03:05
There must be other ways of pathfinding surely?

I want to see one that does not rely on a grid and therefore moves more realistically - the best example I can give is that of COMMANDOS 2 on the PC, PS2, etc

The pathfinding in this game was great - not only did they move exactly to the point you wanted to, but they didnt follow a grid pattern and they found their way up steps, through buildings, water, and loads more.

"It's amazin' what you can do with a computer and access to t'internet"
JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 19th Sep 2003 05:25
Halo 2. the programmers say that the AIs dont follow lines, but they make their own decision. it would be cool to see someone do that

<{^_^<}
Pricey
22
Years of Service
User Offline
Joined: 22nd Feb 2003
Location:
Posted: 19th Sep 2003 20:12
the thief games AI were good but had flaws

My programs don't crash... your computer does

http://johnsgamesuk.topcities.com

Login to post a reply

Server time is: 2025-05-20 05:07:40
Your offset time is: 2025-05-20 05:07:40