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(is this the right place to post this)

Author
Message
cusoi
21
Years of Service
User Offline
Joined: 3rd Jan 2003
Location: Netherlands
Posted: 22nd Jan 2003 20:45
Maybe this is very dificult, than I'm sorry and don't answer it. But maybe you have made a firs person shooter and I have a problem. I know how i can make an enemy make decisions and walk to some place. But he walks straight to that point and if there is something on his way he gets stuck. So the question is, how can I make a person walk arround that object?
Current project: Earth Chaos, a FPRTS
Shadow Robert
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 22nd Jan 2003 21:26
you need to make something called a BOT Path

this is basically your level in 2D map form within an array, and your models walks around this level using the precalculated paths

you work in blocks ... so like each block is 10dbu or whatever the width of a person is, and it basically has 1 or 0 in the space meaning the bot can either walk there or can't walk there (this is done through calculating if it collides with anything placed there by putting a box and turning it 15° 3 times and checking each time you turn if for collision)
the moving onto the next square in the block.

you then use that as a guide for your person to walk around the level ... and what you then do is check all the squares between the bot and the point where he wants to go.
then from that you have your "paths" ... and its upto you to randomly choose a path, probably based on being the shortest

simple no

giving any real pathfinding intelligence in db will cause major slow downs (MAJOR SLOWDOWNS, trust me )

Anata aru kowagaru no watashi!
Attreid
21
Years of Service
User Offline
Joined: 27th Nov 2002
Location:
Posted: 22nd Jan 2003 22:05
a few advices :
1. if the range you-enemy is low and if you're walking or doing sound, he knows where you are
2. if he can see you, he know where you are ( there's a code in the 20 lines challenge )
3. if he see you and you hide, he goes to the last place where you were
4. if you make a great sound ( for example : you use your thermo grenad plasma phase 250 watts with tnt schrapnels ), all enemys of the map go where you are when they heard the big-boom

I'm following John, but I'm not john.
Lol, it is funnier in french
hexGEAR
21
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Naytonia
Posted: 22nd Jan 2003 22:56
And after doing what Raven and Attreid tell you correctly, you'll end up with a huge big fat bunch of if's else's and endif's, believe me, i know

your birth was a blessing, sent to live and die on earth as a lesson, we each have a star all you have to do is find it, once you do, everyone who sees it will be blinded - DMX
Shadow Robert
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 22nd Jan 2003 23:00
or you could make a decision function which randomly chooses actions placed in an array
so you have a single if...else...endif
but its works for all of the decisions ... not so great for speed, but easier to read the code

Anata aru kowagaru no watashi!
Kangaroo2
21
Years of Service
User Offline
Joined: 26th Sep 2002
Location: United Kingdom
Posted: 22nd Jan 2003 23:04
lol Exactly Hex

Nice explanation Vegeta an Attreid, thats almost exactly what I do. Is 'BOT Path' an industry term? I only ask because I am programming a level and AI editor, and the term could be used to sum up a section of my editor, but obviously I don't want to use it incorectly, or if is trademarked to a particular developer.

Shadow Robert
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 23rd Jan 2003 00:11
bot path is not as much an industry term ... more like a slang that has been created by the mod teams for quake2
when you wrote Ai for Bots (id's term for computer players) you'd have to write a routine which allowed them to basically do what i've suggested and understand the level's layout.

Early attempts of this oftenly ended up with the bots getting stuck because of collision - which is why i tend to stick with a grid collision for bots paths + my collision engine

try not to get Bots, NPCs and Intels mixxed up
Bot is a randomly intelligentised Computer Player
NPC is a set instruction set Computer Player
Intels are learning computer players (like creatures from black & white)

NPCs are good for storyline based things - because you can increase thier intelligence actions by limiting what actions they're capable of and what they are allowed to do.
Bots are better for Multiplyer and such where you need relatively challeneging people like things which wont' kill the CPU

Intels are what i have for Space Hulk, and are truely remarkable things - because they're capable of writing new code routines to allow for thier own new actions if one doesn't exist. And they LEARN from every encounter.
Not easi to develop but something that makes you feel proud you've done a good job about.
Certainly makes the player think alot more than just walk into a room and blast

I've seen someone else game recently which has you pitted against Space Marines themselves (also for a highend PC waiting for specs to come down enough to handle it) - but these guys not only act intelligently as a team, but the they follow the leaders "lead".
The Squad leader will access "you" the players movements, and from how you're moving will decide on the best set peice action. From then say they're split into a pincer (omega - formation) ... well then the closest Marine will take command of that. Those who follow under him will take actions based on his actions ... so if you shoot at them and the temp command takes cover and issues the order for the other to as well, one will cover his back - the next wil look for another place and another will lay down cover fire whilst following.
They will then sit there and come up with a plan of attack between them.

Truely is remarkable to see in action, and something that caught alot of eyes when he was showing it off.

Most amazing thing is, that the whole game is dynamic, because of the fact that it is set as a single campaign on Piscina IV means that you're likely to fight the same men again (who will retreat to fight another day if nessary) and they will have learnt from the last encounter, some will gain leadership skills meaning they're picked more often, especially if they're sucessful (ie no men are killed).

And whats so cool about it is... the mentalities are taken into account. Because Marines will sit there and devise a plan as well as being quite good shots.
Whereas Orcs will just storm you firing in the general direction hoping they'll hit (combined with thier uselessly inaccurate weaponry) actually means you're safer to stand still right in thier sights than anywhere else.
But if they get in close they're masters with hand-to-hand weaponry.
Brainless but damn'd powerful.

probably going to be shown at E3 from what i know ... and something that has had me more excited for the past 3years than any other game in development. It still have 2years to go too

Anata aru kowagaru no watashi!
Kangaroo2
21
Years of Service
User Offline
Joined: 26th Sep 2002
Location: United Kingdom
Posted: 23rd Jan 2003 14:06
Coool thanks Vegeta that has cleared up a lot for me It should go without saying but considering all the questions you've answered over time for me, you're SOOOoooo gonna get a "thanks to:" naming in the credits of my future big project

Would you be interested in helping me with some simple coding (mostly shading and rendering) and 3D modelling/animation problems? They are problems I could fix myself with time, but yesterday I was asked by a sponsor if I could release in the next 3 months, and I was planning more like 6! If you could fix these problems for me, I could pay you around £1000 on release, with the possibility of a small percentage of profit too I appreciate you're busy but If you are interested, Mail me, I'd be honoured if you would help. Cheers

cusoi
21
Years of Service
User Offline
Joined: 3rd Jan 2003
Location: Netherlands
Posted: 23rd Jan 2003 16:23
Thank you very much Raven and Attreid. You'll be in credits.

Current project: Earth Chaos, a FPRTS

Login to post a reply

Server time is: 2024-05-05 05:09:06
Your offset time is: 2024-05-05 05:09:06