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.

Newcomers DBPro Corner / Has anyone done advanced AI?

Author
Message
LeaderOne
20
Years of Service
User Offline
Joined: 9th Jan 2004
Location:
Posted: 1st Jul 2005 12:58
I'm needing to do an AI for a TBS 2d streagy game. Has anyone done something similar and could possibly help?

I know that i'll need pathfinding. (that can handle teleporters)

"Chicken is nice"
NanoBrain
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 1st Jul 2005 16:52 Edited at: 1st Jul 2005 16:56
LeaderOne,

I would have to say that you haven't searched these forums at all, supposively. Because, there are many profound topics on this very subject. However, due to the great excitement and need of the subject, another thread might as well be started on it.

The style, called Advanced A.I., I believe, is a mixture of several basic a.i. techniques. So, there truly is no advanced a.i., but just a series of basic intelligence algorithms, in hierarchy, working towards a single goal, or solution.

As you stated, you will need to learn pathfinding. In one other thread, a while back, I had created two programs for an individual to use as a learning tool to simple, not complex, pathfinding. I will show them to you. The programs are in code snippets below, each being a seperate source code, each needing to be copied and paste and ran in your DarkBasic editor.

The first snippet is the path creator. The source you do not need to learn. That is, unless your interested in learning simple 2D graphics and reading and writing of files. It allows you to place circles onto the screen at specific points(coordinates), and then records those points into a formatted text file.

The second, is the file of the source code you should study. It is full of REM comments to help you understand its processes. It displays a guard which walks from point to point, his path depending on the path you made. It gives you the option to either have the guard follow the path, in a loop, sequentially(in the order you placed the points in the first program), or randomly(no true order). The guard's destination point is lit in red, with all other points a dull green, I believe.

Copy these into your editor and save them into one folder as two seperate .dba files. Study the REM comments thourouly, and ask me if you have any peticular questions that arise, in which you cannot figure out after some time.

Waypoint Generator:


Waypoint Follower:


Don't forget also make use of the thousands of posts that have already been created on this subject, by many other users.


+NanoBrain+
LeaderOne
20
Years of Service
User Offline
Joined: 9th Jan 2004
Location:
Posted: 4th Jul 2005 15:25
I did search for 'ai,' but the five topics not about waiting or rain where relating to 3d monster handling. (i.e. doom emenies)

Thanks anyway.

p.s. Someone should sticky an all round A.I. topic.

"Chicken is nice"
NanoBrain
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 4th Jul 2005 18:22
LeaderOne,

Did you take a look at the path follower source code? I would love to continue this topic with you, that we may both learn from it. I have done several closed experiments about and involving a.i.


+NanoBrain+
Dark Flame
19
Years of Service
User Offline
Joined: 15th Feb 2005
Location: England
Posted: 4th Jul 2005 22:24 Edited at: 4th Jul 2005 22:25
No one has done A.I because A.I doesn't exist in games...It's algorithms.

James Morgan
19
Years of Service
User Offline
Joined: 17th Apr 2005
Location: Behind you
Posted: 5th Jul 2005 05:11
Algorithms in turn is A.I.
There was a debate ages ago on A.I. on one of these fourms to define exactly what is A.I.....

For teleportation, this is VERY easy. If the player (or sprite as its a 2D game) is in a certain position then change the player position to somewhere else. Or in DBP terms:

pX = Players screen X position
pY = Players screen Y position
Asuming you are using sprites and ? is the new position



James

Hello!
NanoBrain
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 5th Jul 2005 06:38 Edited at: 5th Jul 2005 06:42
Dark Flame,

Let's not get technical, as to try to ruin this topic. A.I. could also stand for algorithm intelligence. A.I. doesn't exist within anything, seeing that any program claiming to be artificially intelligent, is just using algoritms themselves, too.


+NanoBrain+
Dark Flame
19
Years of Service
User Offline
Joined: 15th Feb 2005
Location: England
Posted: 5th Jul 2005 07:26
Yeah dude...your right!

Baggers
20
Years of Service
User Offline
Joined: 31st May 2004
Location: Yonder over dem dere hills
Posted: 5th Jul 2005 18:42
Plus artificial Intelligence to date is only about mimicry. The code is designed to mimic intelligence so AI is a perfectly acceptable term.
http://www.policyalmanac.org/games/aStarTutorial.htm
to date this is my favourite article of pathfinding, it really is the easiest out there (though still a challenge).

I also look into finate state machines, they are a good method to base your AI on.
Good luck man.

NanoBrain
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 5th Jul 2005 19:36
Baggers,

Wow. Very nice link you have there. I like the given method.


+NanoBrain+
LeaderOne
20
Years of Service
User Offline
Joined: 9th Jan 2004
Location:
Posted: 11th Jul 2005 14:44
THanks everybody. XD
@Baggers. Yay! tender link.

The problem is that it needs to handle teleporters, in the route. maybe lower the F score for the square, but a teleporter could go the wrong way.

"Chicken is nice"
LeaderOne
20
Years of Service
User Offline
Joined: 9th Jan 2004
Location:
Posted: 4th Aug 2005 16:36
Finally had a look at your experiments Nanobrain. Good stuff, but sadly unhelpful due to it's real time nature and the fact i need turn-based

"Chicken is nice"
master programmer
19
Years of Service
User Offline
Joined: 30th May 2005
Location: 3D Space
Posted: 5th Aug 2005 12:10
That is a good link Baggers. I'll read all the way through it later when I have more time.

Baggers
20
Years of Service
User Offline
Joined: 31st May 2004
Location: Yonder over dem dere hills
Posted: 7th Aug 2005 01:42 Edited at: 7th Aug 2005 01:47
No prob, Amit is a genius, knows exactly how to write for a beginner...which is just as well as otherwise my pathfinding routine never would have happened !

Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 7th Aug 2005 03:54
Quote: "http://www.policyalmanac.org/games/aStarTutorial.htm
to date this is my favourite article of pathfinding, it really is the easiest out there (though still a challenge)."


I just used that tutorial 2 days ago to write A* in a java program. It seems so confusing, but once you've written it it'll seem so simple you'll be asking yourself "is that it?" (at least I did)

PETA - People for the Eating of Tasty Animals
Baggers
20
Years of Service
User Offline
Joined: 31st May 2004
Location: Yonder over dem dere hills
Posted: 7th Aug 2005 12:50
Yeah same here, its awesome seeing the characters run around more realistically.
Did you implement the binary heaping aswell ?...those things give such a great boost to the speed. Theres a tutorial on how to do them (writen by amit again) down towards the bottom of the page.

LeaderOne
20
Years of Service
User Offline
Joined: 9th Jan 2004
Location:
Posted: 11th Aug 2005 15:18
could anyone (or Baggers) give me a ai link?

"Chicken is nice"
Baggers
20
Years of Service
User Offline
Joined: 31st May 2004
Location: Yonder over dem dere hills
Posted: 11th Aug 2005 18:08
Here's a link to help understand the concepts of Finite state machines, a useful tool in AI programming.
http://www.ai-junkie.com/architecture/state_driven/tut_state1.html
Hope it helps

Kim Possible
19
Years of Service
User Offline
Joined: 13th Aug 2005
Location: Where ever there\'s trouble.
Posted: 14th Aug 2005 06:52
Nanobrain, Baggers, James - GREAT STUFF!

Thank you for sharing!

Login to post a reply

Server time is: 2024-11-27 21:45:07
Your offset time is: 2024-11-27 21:45:07