Apolyton Archive  |  Preserved copy of the Apolyton Civilization Site and its forums as they stood in September 2005. Read-only; nothing here can be posted to or replied to.  |  Forum index |  About this archive |  The 1998–2001 UBB forums
Today on Apolyton WARDELL INTERVIEW PROMO A.C.S. HISTORY CHAPTER 4 GET CIV4 /w FREE PLUS! A.C.S. PHOTO GALLERY GET A.O.M. V1.1
Apolyton Civilization Forums
main| civ2| civ3| civ4| smac| ctp2| ron| moo3| galciv| galciv2| alt| about|
ApolytonPLUS | register | search | faq | new posts | pm (-/-) | upload | members
hall of fame new! | civgroups | civgroups news | interviews | the column | radio | chat | directory | news | store | PLUS
Apolyton Civilization Forums : Powered by vBulletin version 2.0.3 Apolyton Civilization Forums > Alternative Civs > Clash of Civilizations > Map AI so far....
Show a Printable Version | Email This Page to Someone! | Receive updates to this thread | Report this to Apolyton news!
04.Sep: `FC` 2.0.5 COMPLETED AND RELEASED
27.Jul: `FC` 2.0.4 COMPLETED AND RELEASED
16.Jul: `FC` 2.0.3 COMPLETED AND RELEASED

bottom of page
  
Author
Thread    < Last Thread     Next Thread > Post New Thread     Post A Reply
JimC is offline JimC
Chieftain
Birmingham, England
May 1999
time: 05:13
  Old Post 27-05-1999 05:27 Visit JimC's homepage!
Edit/Delete Message Reply w/Quote
#1 Report this post to a moderator
Map AI so far.... Support Apolyton, buy Alpha Centauri



Path Intensity Algorithm Demo

Obviously some people care more than others about this area of the project, but this is my contribution so far....

I've had mixed reports about how well these Applets run - I personally can't get the Path Intensity Applet to run in a web browser at all, although it works using Sun's tools.

I've sent Java class files to those who I know can run them - if anybody else wants a copy just give me your e-mail address.

These are only partially complete - I'm hoping to make the tools as flexible as possible, to allow them to be used in map-development (if people think I'm heading in the right direction).

Any comments/questions/suggestions etc... ??

Jim

Mark_Everson is offline Mark_Everson
Clash of Civilizations Project Lead
Canton, MI
Jan 1970
time: 00:13
  Old Post 27-05-1999 05:50 Visit Mark_Everson's homepage!
Edit/Delete Message Reply w/Quote
#2 Report this post to a moderator
Avatar Enlargement: We've got the solution

Others: For some background here is the basic idea Jim is working from.
home.akademie.de/~DToussaint/clash/map_ai.htm

Jim:
The applet is Great, really user friendly. Just for future reference, I didn't notice the sliders at the start and had trouble understanding the initial results until I said duh... (there's more map there!) The results were interesting and (fortunately) fairly similar to the expected.

Interesting things after about 30 min of playing around:

1) Did you include a penalty for previous paths crossing a square? I'll elaborate in (1') below.
2) I think we can get better results by first using a floodfill algorithm to identify and number all the land and sea areas. Then you only need look within each continent / sea or whatever for the path intensity.
3) Would it be too hard to put in the paths between random points as an option? I think this has some dangers associated with it, but it will also allow for identification of Important necks very quickly. You could just designate how many paths you want to do at the start.
4) A zoom-out mode so you can see the whole map w/out the slider bars would be nice too.


1') From the results of the applet I *think*
you didn't include one important element. I wrote about it on the Map AI web page and will quote it below. Specifically there are some large path intensities at the edges of interior features where the terrain is not all that strategically significant. Here's what I wrote on the web page...

[if you did include this part then I a) apologize, and b) don't quite understand the results]

"In addition to large weights at necks, this method will also give large values at the edges of interior features, for instance inland seas. Since such bands of large numbers of shortest path crossings aren't generally strategically significant (you can just move around the sea at a distance from
the shore, for instance) we want to give "pretty good" paths equal weights with shortest paths. Pretty good paths can be obtained by using a weighted A* algorithm. (Jim, I know you know this... this info just for the others) With an evaluation function f = g + xh where x >= 1 we change from shortest paths to simply pretty good ones. With this modification with x maybe 2 or so we'll get a random good path rather
than the shortest one.
Another way to accomplish this (suggested by Tim Smith) is to use previous "path intensity" (from previous paths crossing a square) as an additional cost of moving into the square. This will spread out "path intensity" across necks without significantly changing anything, and yet prevent shores of interior seas from racking up huge scores. This type of treatment will give results
like those shown in the figure above on the right side. "

I would use the method in the final paragraph of the quote to eliminate this difficulty. Essentially one should add a fraction, maybe 1/3, of a square's current path intensity to the cost to move through the square. This
will spread out the path intensity where there are a large number of nearly identical alternatives, and yet still produce high values at strategically important sites. Otherwise the AI units will IMO be continually garrisoning the edges of lakes or impassible mountain ranges thinking that they are strategically significant points!

BTW what are the terrain costs you're using. You can really see the effect with roads so they must be 3-4x better than plains at a guess.

Great Work!

-Mark


[This message has been edited by Mark_Everson (edited May 26, 1999).]

F Smith is offline F Smith
Chieftain
Austin, Tx, USA
May 1999
time: 05:13
  Old Post 27-05-1999 06:08
Edit/Delete Message Reply w/Quote
#3 Report this post to a moderator
Support Apolyton, buy Alpha Centauri

I care!

I like it very much.

Work's pretty hectic right now, just opened a new phase of the project and the Senior VP wants a demo of the database query tool.

Sorry if I don't contribute much, but my mind's kinda swirling with SQL/JDBC stuff.

Blade Runner is offline Blade Runner
Prince
Belgium
Jan 1970
time: 06:13
  Old Post 27-05-1999 12:32
Edit/Delete Message Reply w/Quote
#4 Report this post to a moderator
Enter the AD-FREE zone

JimC,

Wow!

1. I made a continent with a few lake inside. I got numbers on the surface of the water when I was looking for land path. Is this a bug or I misunderstand something?
2. Is there any possibility to draw the landmap and the intensitymap together?
Idea: you can cut the map squares half. One part can contain the original map value (land, road, etc..) the other half the intensity color code.
I was impressed with the system.

Blade Runner

JimC is offline JimC
Chieftain
Birmingham, England
May 1999
time: 05:13
  Old Post 27-05-1999 16:25 Visit JimC's homepage!
Edit/Delete Message Reply w/Quote
#5 Report this post to a moderator
Lose 30 kilos (of popups)

OK some details:

current terrain values -

roads - 0.5
plains - 1.0
forest - 2.0
hills - 3.0
mountains - 5.0

the above are impassable to sea movement

ocean - 1.0
rough ocean - 2.0

the above are impassable to land movement

air movement is 1.0 for all squares
amphibious movement is combined land/sea movement (e.g. hovercraft)


The current algorithm consists of three main phases:

1- path calculation / counting
2- spreading / averaging iterations
3- 'standardising' vs a maximum value, at the moment this is 255 (8 bits)

I'll include options to turn 2/3 on or off so that users can see their effects more easily.

Mark:

1) You can modify the heuristic under 'Properties' - default value is 1.1 to give it a slight tug in the right direction

I can work on an option to increase terrain values based on path intensity, it may take a while though.

2) I'll think about it - again, it may take a while.

3) Easy - one of the main problems at the moment is that a node is 'lost' if it falls on impassable terrain. A random set of nodes could be forced to lie on passable terrain.

4) Easy


Blade Runner:

1) The spreading iterations basically involve each terrain square 'influencing' neighbouring squares. At the moment, impassable terrain is set at v.high resistance to change; however some spreading still occurs because IMO controlling ocean areas next to heavily travelled land areas is important for controlling that stretch of land (shore bombardment etc)

I'll make the 'resistance' of impassable terrain tweakable in my next version.

2) Easy


Anyone who cares to listen:

I'll make details of the algorithms more widely known once I've actually finalised them.

I'll release the source code of the MapNodeGenerator class as soon as I've commented / debugged it fully.

My goal is to make all values + assumptions fully adjustable by the user so that anybody can draw a map and 'play' with it.

Jim

Mark_Everson is offline Mark_Everson
Clash of Civilizations Project Lead
Canton, MI
Jan 1970
time: 00:13
  Old Post 28-05-1999 09:32 Visit Mark_Everson's homepage!
Edit/Delete Message Reply w/Quote
#6 Report this post to a moderator
Remove this text

Hey Jim:

On my issue 1, I did try changing the heuristic, and it didn't change much. Yeah, the good point about doing my 2 is that for either water or land paths you can reduce the number of nodes significantly IMO. And reducing something that's to the fourth power is Big

-Mark

Glak is offline Glak
Warlord

Apr 1999
time: 05:13
  Old Post 28-05-1999 08:13
Edit/Delete Message Reply w/Quote
#7 Report this post to a moderator
Support Apolyton

Actually I think that the areas around interior lakes are strategically important and that you shouldn't try to get rid of that. They aren't as important as some other features can be but I think that they matter.

JimC is offline JimC
Chieftain
Birmingham, England
May 1999
time: 05:13
  Old Post 28-05-1999 23:28 Visit JimC's homepage!
Edit/Delete Message Reply w/Quote
#8 Report this post to a moderator
Suffering from ads?

Latest demo version:

Path Intensity Applet

Changes:

Random paths are now an option - if this is selected, 300 random paths will be used to generate the results. All 300 pairs of nodes will be forced onto passable terrain (ensuring that they all get used), whereas with evenly spaced nodes this wasn't possible.

The spreading iterations / standardising steps can be toggled on and off, so that the raw data can be viewed.

btw Mark - I found a bug that caused the heuristic value to be ignored; changing the heuristic multiplier now has a clear effect. Higher heuristic values also speed up the process.

I'm still working on the other suggested improvements.

On a different note - performance issues. I've just upgraded to the hotspot JIT; with the old interpreter, I was getting around 10-20 paths per second. With hotspot I'm getting about 200-300 paths per second, and it still seems to improve every time I run it.

I suggest that we look into it....

Jim

Druid2 is offline Druid2
Warlord
Dallas,TX
May 1999
time: 05:13
  Old Post 29-05-1999 00:47
Edit/Delete Message Reply w/Quote
#9 Report this post to a moderator
Put an end to popups!

Wish I could go and look at it
*pout*

Am [trying] to use Win 95b & Netscape to do so, but *NYET*

F_Smith is offline F_Smith
Prince
Austin, Tx 78728
May 1999
time: 05:13
  Old Post 29-05-1999 01:36
Edit/Delete Message Reply w/Quote
#10 Report this post to a moderator
Put an end to popups!

Ya'll *must* get HotSpot.

Java at the speed of C.

Sorry, no more time!

Ciao.

[This message has been edited by F_Smith (edited May 28, 1999).]

JimC is offline JimC
Chieftain
Birmingham, England
May 1999
time: 05:13
  Old Post 29-05-1999 02:32 Visit JimC's homepage!
Edit/Delete Message Reply w/Quote
#11 Report this post to a moderator
Support Apolyton, buy Call to Power 2

Druid2: what's the problem?

Any specific error messages etc?

Jim

Mark_Everson is offline Mark_Everson
Clash of Civilizations Project Lead
Canton, MI
Jan 1970
time: 00:13
  Old Post 29-05-1999 03:37 Visit Mark_Everson's homepage!
Edit/Delete Message Reply w/Quote
#12 Report this post to a moderator
Support Apolyton, buy Call to Power 2

Jim:

Great Job. And your news about HotSpot is some of the best I've heard in a while. I only tried a few things with it this time. I have to force myself to write up the econ system now...

Cya, Mark

Druid2 is offline Druid2
Warlord
Dallas,TX
May 1999
time: 05:13
  Old Post 29-05-1999 09:00
Edit/Delete Message Reply w/Quote
#13 Report this post to a moderator
Inflate your Upload Space

Sorry.. that prev. msg wasnt very helpful was it...

I get a large grey box on black bkgrnd. Title at the top "Back to Homepage" link at the bottom, and nothing else.

The msg is:
Applet MapNodeApplet/MapNodeAPplet can't start: error: java.lang.ClassFormatError: MapNodeApplet/MapNodeApplet != MapNodeApplet

btw: I'm running Netscape Communic. 4.05 from Win95b on Pentium II

[This message has been edited by Druid2 (edited May 29, 1999).]

JimC is offline JimC
Chieftain
Birmingham, England
May 1999
time: 05:13
  Old Post 29-05-1999 14:45 Visit JimC's homepage!
Edit/Delete Message Reply w/Quote
#14 Report this post to a moderator
Support Apolyton, buy Galactic Civilizations

Maybe Netscape_4.05 isn't compatible with JDK1.2 - I've used Netscape_4.51 on a Unix box and it works.

Hmmmmmm....

Jim

Blade Runner is offline Blade Runner
Prince
Belgium
Jan 1970
time: 06:13
  Old Post 29-05-1999 20:25
Edit/Delete Message Reply w/Quote
#15 Report this post to a moderator
Support Apolyton, buy Alpha Centauri

Netscape 4.05 or 4.06 compatible only Java 1.0.2 :-(
Netscape 5.0 will be compatible fully with Java 1.2 (They promis). I use Win95 OSR2 and Netscape 4.51 and everything is fine.

Blade Runner


[This message has been edited by Blade Runner (edited May 31, 1999).]

Druid2 is offline Druid2
Warlord
Dallas,TX
May 1999
time: 05:13
  Old Post 31-05-1999 00:15
Edit/Delete Message Reply w/Quote
#16 Report this post to a moderator
Help yourself to an AD-FREE life

Upgraded to Netscape 4.6 last nite, and now the applet runs fine.

I have no idea what it's doing, mind you.

But if it's supposed to put numbers in the map squares, it's running fine. *LOL*

Rebel is offline Rebel
Settler
Athens Ohio, USA
May 1999
time: 05:13
  Old Post 07-06-1999 16:34
Edit/Delete Message Reply w/Quote
#17 Report this post to a moderator
Support Apolyton buy from Amazon

Druid:

And here I thought I was the only one that was totally lost in the woods.

Rebel

But seriously, it looks like it is doing a great job of figuring the intensitys, at least i hope that is what it was doing.

BTW, am running 98,communicator 4.5, on an AMD K6/350 and the applet seems to run fine.
Just to let you know that it does run on other processors.

Rebel

Blade Runner is offline Blade Runner
Prince
Belgium
Jan 1970
time: 06:13
  Old Post 08-06-1999 01:07
Edit/Delete Message Reply w/Quote
#18 Report this post to a moderator
Support Apolyton buy from Amazon

Rebel,

I use AMD too (K6-II 300). I plant to change K-7 as soon as possibile. (IMHO the best processor of the century) ;-)

Blade Runner

Druid2 is offline Druid2
Warlord
Dallas,TX
May 1999
time: 05:13
  Old Post 09-06-1999 09:01
Edit/Delete Message Reply w/Quote
#19 Report this post to a moderator
Put an end to popups!

JimC,

[I cant get the app to run this morning, so I'm commenting on what I remember from the last time.]

As I remember it, the app goes on calculating the intensity value for each square, eventually, it will fill the entire displayed area until the goal is reached.

A) This suggestion involves some "pseudo-hueristic" pruning of the squares you need to calculate. "Pseudo" because in some cases, you will have to go back and re-activate the pruned branches.

After you've gone out n squares in each direction, you prune out the least desirable 50% of the squares. The you go about finishing the path calculation.

Only if the remaining paths lead to dead ends do you go back and calculate the already eliminated 50%.

Of course it wont be perfect; sometimes you'll wind up taking a "longer" path. But that would only be when the path goes in the "wrong" direction at first because there's a dramatic increase down there somewhere.

B) Also, I didnt try to look at the details of each loop, but this occurred to me as I was watching the numbers appear on the squares. If there are 3 squares [x(1), x(2), x(3)] , all of which could lead to square y, does the app calculate the value for each of the x(i)to y paths? or only for the most desirable of the x(i)?

Again, a compromise down from the "pure AI" maximized path, but a reasonable way of cutting down the number of iterations.

C) This one is more problematical, but might be a real time-saver if it can work. It is based on expanding particular paths, instead of calculating a value for a square. I cant explain it without an example [and maybe I cant explain it WITH an example ]:

The path is to be from X to Y, over some distance. X is roughly south of Y. Lets assume that a human would consider 3 paths: one heading NE from X and working back to Y, one heading N from X to Y, one heading NW from X and working back to Y.

As the app gets n squares out from X, you make the first path pruning. You identify the most desirable, 2nd most and 3d most desirable. I'll give them arbitrary values: [low value=more desirable]
1st = 2000, 2nd=3000, 3rd=4000 of "desirableness". {wrong term, but I want to purposely stay away from the ones you've used, in case I use them wrong.}

The concept is that there is now no reason to consider expanding any path except the 1st, until the value for path1 exceeds 3000 [the path2 value], then you need to expand them both. If either exceeds 4000 [path 3 value], you go back to expanding only one, until they are all over 4000.

Then you go back and get the path4 [path 4=5000, for example]. you continue expanding path 1,2 & 3 until one of them exceeds 5000.

At that point you continue to expand the paths until ALL of them are over the path4 value, or you get to the objective, etc etc.

[This is, to the degree I remember it, a swipe of some thing I saw in trying to do the "Knights Tour" on a chessboard.]



[This message has been edited by Druid2 (edited June 08, 1999).]

Mark_Everson is offline Mark_Everson
Clash of Civilizations Project Lead
Canton, MI
Jan 1970
time: 00:13
  Old Post 09-06-1999 09:10 Visit Mark_Everson's homepage!
Edit/Delete Message Reply w/Quote
#20 Report this post to a moderator
Increase the size of your Attachments

Druid:

I think you need to read the description in the link in my first post in this thread to know what's going on. This intensity thing is using multiple paths spanning different parts of the map to find the strategic spots like isthmuses (You know, the ones people block off in civ, but the AI has No clue about). The path intensity calculation will be run in the background, so it won't slow the game down. Doing this work in the background should actually make unit pathfinding easier and quicker.

Druid2 is offline Druid2
Warlord
Dallas,TX
May 1999
time: 05:13
  Old Post 09-06-1999 09:17
Edit/Delete Message Reply w/Quote
#21 Report this post to a moderator
Suffering from ads?

Mark,

Aw *CHIT*

I said all along, I didnt grok the intensity thing.. *LOL* at myself.

But if this is in background, and available when the moves are being determined, then I dont understand the 'tileless' movement problems...

Communication by forum post is NOT the best way.. *L*

JimC is offline JimC
Chieftain
Birmingham, England
May 1999
time: 05:13
  Old Post 17-06-1999 18:42 Visit JimC's homepage!
Edit/Delete Message Reply w/Quote
#22 Report this post to a moderator
Enter the AD-FREE zone

bump....

Just in case anyone wonders where I've been - I'm working on a Genetic Programming package that may be of some use to this project.... who knows.

Jim

Mark_Everson is offline Mark_Everson
Clash of Civilizations Project Lead
Canton, MI
Jan 1970
time: 00:13
  Old Post 18-06-1999 06:17 Visit Mark_Everson's homepage!
Edit/Delete Message Reply w/Quote
#23 Report this post to a moderator
Get a bigger avatar today!

Hey Jim:

I was wondering, but hey, people have Lives and stuff . I'd certainly like to see your package when its ready.

-Mark

JimC is offline JimC
Chieftain
Birmingham, England
May 1999
time: 05:13
  Old Post 18-06-1999 14:43 Visit JimC's homepage!
Edit/Delete Message Reply w/Quote
#24 Report this post to a moderator
Tired of ads?

It's pretty much finished, but I'm doing some extensive modifications to prevent the computer 'cheating'

examples - multiplying a subtree by -1 twice, then claiming that it's a good mutation because a high fitness value has been maintained

or - 'fudging' the integer value 0 by taking the sin of a random value about 10 times

or - mutating a value which has been multiplied by 0 and claiming it as a valid mutation

etc. etc....

It doesn't seem to like running under the Hotspot JIT for some reason - I've sent a bug report to JavaSoft and it will hopefully be sorted out in the next release.

That's all for now.

Jim

  < Last Thread     Next Thread > Post New Thread     Post A Reply
All times are GMT. The time now is 05:13.
Apolyton Time is 00:13.
    top of page
Rate This Thread:
Forum Jump:
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is ON
vB code is ON
Smilies are ON
[IMG] code is ON
 




Contact Us - Apolyton Civilization Site - Support Us!

Building a better Apolyton through better information. Click here and take our poll!
Non-US visitors, click here!

Powered by: vBulletin Version 2.0.3
Copyright ©2000, 2001, Jelsoft Enterprises Limited.

Page generated in 0.0550 seconds (93.31% PHP - 6.69% MySQL) with 30 queries
Page Loading Time:

Support Apolyton: Amazon USA | Amazon UK | Amazon DE | Amazon FR |
Support Apolyton and get FREE PLUS, Buy from Chips&Bits: Galactic Civilizations | Galactic Civilizations: Deluxe Edition | Call to Power 2 | Civilization: The Boardgame | GURPS/ Alpha Centauri | Alpha Centauri | Civilization IV | Civilization III: Complete |


Front Page | Civilization IV | Civilization III | Civilization II | Call to Power II | Alpha Centauri | Master of Orion III
Rise of Nations | Galactic Civilizations | Galactic Civilizations II | Misc
Alt.Civs | Civ I | C:CtP I | About | News | Directory | Apolyton Store | Forums | Chat | Columns | Interviews | Newsletter
Scenario League | CSC | Clash of Civs | Spanish Site | CtP Maps | Cradle of Civ | WesW's Ctp1/2 Site | Civ3 Haven

apolyton.net | apolyton.com | civilization2.net | civilization3.net | civilization4.net | civilizationiv.info | calltopower.net | galciv.net | galciv2.net | moo3.net