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 / can someone help me in A.I?

Author
Message
sorcre
22
Years of Service
User Offline
Joined: 13th Dec 2002
Location: United States
Posted: 10th Jul 2003 01:45
i have made a fps. it was from an old game i was makign but quit. but now i renewed it and it is pretty good.cept i have no idea how to make the ai and how to make the apponents shoot you..... anyone have any advice?
think of your plans as a man of action and act out your plans as a man if thought.........
Leonard
22
Years of Service
User Offline
Joined: 14th Jan 2003
Location:
Posted: 10th Jul 2003 02:13
i'm a noob and have only made one game(with no AI), but DB come with a FPS tut that teaches some AI so that might help.

"Thou hast only to follow the wall far enough and there will de a door in it."
sorcre
22
Years of Service
User Offline
Joined: 13th Dec 2002
Location: United States
Posted: 10th Jul 2003 05:36
mines dosen't

think of your plans as a man of action and act out your plans as a man if thought.........
Hell Forged Angel
22
Years of Service
User Offline
Joined: 3rd Jan 2003
Location: United Kingdom
Posted: 10th Jul 2003 15:04
ok when progamming AI its usally best to completely forget about programming at first and just think of a logical way of doing things. for example for a simple AI i may want a guard to walk around and shoot anyone it sees. Next i would go on to think about how to structure this AI eg. should i make him randomly walk and if it sees someone shoot them or the other way around. This doesnt seem important with my example but if you try anything more complicated then you will need to think about the structure alot. I usally take this oportunity to just write up the actions i want to be performed in the structure i previously worked out into notepad. I then slowly go through the txt document and convert it into DB code. Although this reply hasnt helped you actully code anything i think if you use a similar way of thinking then once you come to coding the AI it will be much simpler as you wont be thinking about what your doing you will just need to convert plain text into DB code which can be done easily with the DB documentation.

Darkness will claim us all
sorcre
22
Years of Service
User Offline
Joined: 13th Dec 2002
Location: United States
Posted: 10th Jul 2003 18:16
is there like a nexample i can downlaod somewhere

think of your plans as a man of action and act out your plans as a man if thought.........
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 10th Jul 2003 18:29
No. Ai is too specialised for one game, it can't just be transplanted from one project to another.

You are the th person to view this signature.
GRAVITY: I fought the law but the law won
sorcre
22
Years of Service
User Offline
Joined: 13th Dec 2002
Location: United States
Posted: 10th Jul 2003 19:05
i am not gona i just wana see it to get an idea

think of your plans as a man of action and act out your plans as a man if thought.........
Philip
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 10th Jul 2003 19:11
A.I. is simple.

Forget the computer. Sit back. Think like a human. What EXACTLY would you do if you were the bad guy/alien/evil person?

Write it down. Hell, make a flow diagram if you can. Then look at that and work out how to program it.

For example, assume you are in a game of driving chicken. You need to write the AI for the other car. What is the other car thinking?

Every second its thinking: do I swerve? Do I keep driving at the other car?

Then, at some point, it may decide to swerve. What causes that decision? The distance? The speed? Increasing fear?

Once you've decided what causes it, write a routine that replicates the same behaviour. Simple.

Phil

What do you mean, bears aren't supposed to wear hats and a tie?
Philip
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 10th Jul 2003 19:13
I've attached my DBPro Noughts & Crosses code for you to look at. Its a complete game. It shows how the computer "AI" goes about playing the game.

Phil

What do you mean, bears aren't supposed to wear hats and a tie?
Hell Forged Angel
22
Years of Service
User Offline
Joined: 3rd Jan 2003
Location: United Kingdom
Posted: 11th Jul 2003 11:40
yer phillip your saying what i was trying to say lol sorry my post isnt very clear. if you get a well thought out flow diagram of how you want the actor to behave thenn actully programing it will be much easier

Darkness will claim us all
Furiousuk
22
Years of Service
User Offline
Joined: 10th Jan 2003
Location: United Kingdom
Posted: 11th Jul 2003 18:41
Quote: "Brian Reynolds (working on Colonization) : "I've got a game where I can move all the pieces around and play, but the AI doesn't know how to. Where do I start?"

Sid Meier : "Start by teaching it how to play one turn. Then teach it how to play two turns, and then worry about teaching it how to play ten turns.""


The same rules apply to any genre of game.

Oh, while I'm thinking about it, another of Sid Meier's tricks is this : 'if you have a value or effect, and you think you need to adjust it, either double it or halve it.' You'll be surprised at how many times you think doubling a value will make it ridiculously high, but, after testing, you discover you have to double it again to get the desired effect.
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 11th Jul 2003 22:52
For my FPS AI, I gave each enemy one of 5 states:

0 - Idle - stand still / patrol
1 - See player (player is within 100 units) - walk towards player
2 - See player, in shooting range (player is within 60 units) - walk to player and shoot
3 - Shooting player (player is within 40 units) - stand still and shoot
4 - Dead (health depleted) - do nothing

When each enemy has a given state, its easy to add actions and get realistic AI.

You are the th person to view this signature.
GRAVITY: I fought the law but the law won
Mattman
21
Years of Service
User Offline
Joined: 5th Jun 2003
Location: East Lansing
Posted: 11th Jul 2003 23:54
nice idea David, mind if i use that as base of my ai?

---Mattman
DID YOU KNOW THAT ???
Arkheii
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: QC, Philippines
Posted: 12th Jul 2003 06:07
Perhaps the hardest part about ai is the pathfinding. If the level is just a wide open space with no walls, collision or anything then it should be pretty simple. But when you have a desert or something with one giant building in the middle (wierd, but possible) then you have minor pathfinding to worry about. In a complicated level with lots of collision and multiple z-axis motion then things get tedious.

Login to post a reply

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