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 Professional Discussion / Artificial Intelligence Help

Author
Message
Giles Papworth
23
Years of Service
User Offline
Joined: 7th Feb 2003
Location: In my own little reality
Posted: 20th May 2003 14:05
Ello, it is me again.

i have been looking for some decent AI tutorials on fps games made in DBPRO but with no luck.

Has anyone got any ideas on how to do at least 1 AI charactor capable of moving round a bsp map, by itself, shooting at the user charactor and having enough sense to run away at times and get more ammo and health?
I am the Superchief, Funk Lord of the universe
Giles Papworth
23
Years of Service
User Offline
Joined: 7th Feb 2003
Location: In my own little reality
Posted: 20th May 2003 14:15
Even a link to a few sites would help.

Any help given will be put in the credits of the game i make

I am the Superchief, Funk Lord of the universe
Dr OcCuLt
23
Years of Service
User Offline
Joined: 27th Nov 2002
Location: a Dark Deep Dark pit, it dark in here
Posted: 20th May 2003 14:53 Edited at: 20th May 2003 14:54
this is how i doing it in may game

Q)AI charactor capable of moving round a bsp map

A)i set up zones where the AI can go so if the AI has to move passt a wall it stays in the zone and wark around it.this is abit hard to do so i`l post the code.

Q)shooting at the user charactor

A)this is easy

1) fig out how far away the player is from the AI ie


fig out the line of site of the AI you can do this by


if the AI in a set range and cy# is less then say 20 or more then 640 it fires at the player.

--Dr 0--

Most people are other people.Their thoughts are someone else`s opinions,thier lives a mimicry,their passions a quotation
Oscar Wilde
Attreid
23
Years of Service
User Offline
Joined: 27th Nov 2002
Location:
Posted: 20th May 2003 17:16
I think that the basic IA .. hmm AI in english ^^ has functions :
- moving => it has to displace, if it doesn't, it's too easy .. it is the first thing to do, with an array, you can stock waypoints
- shooting at the player => if it see you, then it attack
- looking for the player => the last thing to do it to make it add a waypoint where you were the last time it saw you, so if you fallback, it follow you

then, you can add others functions (if you make noise, it comes, if it is hurt, it fallback, ...), and if you like doing things like it, you can try to make a pathfinder that make the ia learn the smartes way ^^

hmmm ... I could do it, it should be fun, but I have a lot of work this week (a test per day (french (hard), german (vocabulary), geography (it's so boring) and mathematics (I really like it ))
good luck for your AI

Bu$herie
How many civilians is he going to kill ? he's going to burn in hell, and I hope that his pain will make him inderstand !
UberTuba
23
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Brittania
Posted: 20th May 2003 21:16 Edited at: 20th May 2003 21:17
AI is the most difficult part of virtually any game. Probly what u should do first is find out whether the Baddy can see the player and then make it shoot.Doing that would suffice for any game that's non commercial.
and the ammo and health things have virtulally never been done even in top games

Life is a terminal disease.
You never survive it.
Giles Papworth
23
Years of Service
User Offline
Joined: 7th Feb 2003
Location: In my own little reality
Posted: 22nd May 2003 16:35
i mean how difficult is this going to be, i mean i am gunna have to have the ai know that if it is trying to shoot at me and there is an object infront of it, it doesn't shoot. I mean the AI example in the original Dark Basic was good but not really what i want

I am the Superchief, Funk Lord of the universe
Andy Igoe
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: United Kingdom
Posted: 23rd May 2003 07:45
AI is one word that describes an awful lot, without knowing your plans it is impossible to point you to a specific tutorial, although you could try some of these tutorials: http://www.gamedev.net/reference/list.asp?categoryid=18

Personally I tier my AI onto several layers, at the lowest level is path finding between A and B, above that is tactical assesement between the AI and the player which tells the AI whether to be taking cover or shooting back - this is multidimensional for chained commands.

Above that is platoon assesement allowing the AI to operate in co-ordination with other AI's and above that is brigade assessement allowing multiple platoon groups to interchange. This allows for dynamic allocation of platoon groups based upon strategic requirement.

Finaly at the top level is the strategic AI that co-ordinates the battle plan. I heuristically calculate strategic objectives and assign null brigades which are then fullfilled by the lower tiers.

What of this are you trying to do? Then perhaps I can guide you in on a more specific tutorial or explain some of the techniques I have used on my big AI projects.

Pneumatic Dryll
Giles Papworth
23
Years of Service
User Offline
Joined: 7th Feb 2003
Location: In my own little reality
Posted: 23rd May 2003 14:07
Basically i want an AI that can work with other ai's. Has the intelligence to take cover when needed, shoot with different weapons, depending on distance.

Know where it is in the bsp map and be able to move, hide round the bsp map

I am the Superchief, Funk Lord of the universe
Andy Igoe
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: United Kingdom
Posted: 23rd May 2003 14:39
That's an AI in excess of Quake and most other commercial games because of the co-operative nature of your AI, unit co-ordination or 'strategy' is perhaps the hardest aspect of AI coding and fails all too often in commercial games. Infact it's the key reason why I don't play commercial RTS games anymore simply because in commercial games the AI has been sacrificed for graphics.

I'm sorry to say I can't just turn around and give you source code, you are going to have to do this yourself. The strategic aspect of your AI will be the single most complex part of your program - if it isn't then it probably has very limited strategic value and not worth coding. There's some conceptual papers on the link I gave you earlier.

However you don't want to flaff around with all of that complicated stuff when there is a simpler way...

You can perform a few simple tricks to simulate co-ordinated movement such as having a 2nd bot follow in anothers footsteps (by constantly giving it a destination waypoint of it's partner), so that they appear to be a team - and when they engage in combat (if playerFired()) they break off individually to seak their own cover etc.

You could add a test that if a bot 'wingman' is in cover and another is not - then he fires wildy to keep your head down whilst the other moves.

I'll leave the rest to your imagination and game design.


The second most complex part of a game is probably route finding, and for that I recommend looking up examples of A* as it seems ideal for use with BSP. - here's a link to a DB coded one: http://www.realgametools.net/forums/index.php?board=8;action=display;threadid=15264.



Choosing the weapon on range is so simple I wont insult you with a theoretical answer, i'll just give you a few range calculation functions...



Hope that gets you started.

AI IS the flesh of the game, everything you've done until now was just the peticoat.

Pneumatic Dryll

Login to post a reply

Server time is: 2026-07-11 13:56:54
Your offset time is: 2026-07-11 13:56:54