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 / Damn FPS A.I.

Author
Message
M00NSHiNE
21
Years of Service
User Offline
Joined: 4th Aug 2003
Location: England, UK
Posted: 4th Aug 2003 14:18
I really need help with some A.I and maybe some pathfinding - its buggin me. I had an idea though - I managed to code a program that sets matrix tiles into zones, e.g on a 16*16 tile grid, there were numbers 0 to 15. (Starting at 0 helps preserve memory when making an array, a 16*16 array = 256 entries, but 15*15 = 225). The code is similar to the type where you can check the mouse pointer over an invisible grid in 2d, except this is 3d.

I thought this could be useful in an fps, you could set zones on a matrix to be a certain number, like hotspots, and then enemies could think "I can hide behind something on this tile" and run to the nearest cover.

Any other suggestions?

P.S. While I only joined on 4th August 03, I have owned DB since Nov 2000, I dont own DBPro.
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 4th Aug 2003 15:55
How is it bugging you? You seem to have the perfect idea. Now time to code it!

You are the th person to view this signature.
GRAVITY: I fought the law but the law won
Lecks
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: - Please Select -
Posted: 4th Aug 2003 19:45
i wont claim to be an expert by any means at this (i've only made ai for a car game before) but like david said, it sounds like you're 90% of the way there. i probrably wont be any help at all, but i'm intrigued by your idea, and would like to figure out mentally how it could practically work. since i have a bad short term memory, i may as well type it here
i'll try and make a function that would work for doom-like line of sight (using X and Z, not Y)
i'll assume you can pass the playerx and z tile, and the enemy x and z tile to the function, and the 'zones' are in an array zones(15, 15) (x,z).
set the 'zones' that your enemys should be able to see/walk through to 0, set the ones they shouldnt be able to see through to 1. by s and d i mean source and destination.


please note, this is 100% theoretical, and i have no idea whether or not it works, it's completely untested. it could be completely wrong for all i know, but it's how i see it working. some abs's could be in the wrong place.

i've mentioned before that i'm no mathematician or speller, so pls dont make the insults too harsh . hehe actually make them harsh, so i can reveal your TRUE characters. muahahahahah

M00NSHiNE
21
Years of Service
User Offline
Joined: 4th Aug 2003
Location: England, UK
Posted: 4th Aug 2003 19:56
Check the 'Matrix Hotspots Help!!!' thread for the code i posted regarding my matrix tile index code.

By the way, the initial idea for this came from an old official uk playstation magazine article i read last night, about The World is Not Enough. It mentioned something about 'the enemies know which areas of the map they can hide behind' and i was intrigued. Hmmmm.

Pathfinding is a very difficult subject and it would be required if, say, you attacked an enemy and then ran, thuogh i suppose it would be more important if you fired a gun and then the enemy has to run to the source of the sound.

Im also in need of fuzzy logic type AI, where an enemy reacts to a situation differently depending on the circumstances. For example in the upcoming FPS Judge Dredd game Dredd vs Death, you attack a gang and they fight back, but kill their leader or toast a gang member and their morale drops making them easier to arrest.

Login to post a reply

Server time is: 2025-05-19 19:35:51
Your offset time is: 2025-05-19 19:35:51