 |
|  |
 |
|
Miznia
|
 |
Madison WI
Jul 2001 time: 23:16
|
|
Is there a good way to do this? For instance, say there's a ship in the Mediterranean which wants to go home, to say, Vietnam. No Suez. Is there an obvious way to find the way home without using a routine that investigates paths through the Black Sea, North Sea, ducking under Australia, etc?
The only thing I can think of is to create a "zoomed out" map for the AI, representing the actual map but with fewer squares, so that the AI can use it to sort of approximate first. What a pain. But I bet it would work.
I'm going to take a shortcut for the over-land path finding. You know how, in Civ2, the Germans could fight a war with the Chinese by sending Horsemen across Eurasia? I'm going to have a "supply penalty" to discourage the human from doing that, and not program the AI to even think to do that. Other than that I intend to have the AI stick to roads, or board a ship. I hope that doesn't turn out lame...
Semester's done, so I'll finally be getting to work. Spent six hours playing Civ1 today. I call it "research" and have a clear conscience. 
|
|
|  |
 |
|
Miznia
|
 |
Madison WI
Jul 2001 time: 23:16
|
|
Mark:
Actually, a long time ago I checked out that site and ran the sample program. Pretty interesting, although I suspect it provides more functionality than I need, or plan to incorporate, for the AI. It won't be able to appreciate the importance of Panama, for instance.
Dale:
Your idea is pretty much what I was thinking of, although I see that yours is better while being easier to program. My plan was to have square "regions" (say, 6x6 tiles or something) that could include ocean and land, meaning there would be no guarantee that a boat could travel between adjacent regions.
Oddly (now that I think of it), my backup plan was to use regions, anyway, and abstract naval activities as they're done in Imperialism.
(I just figured out that you don't need Java 2 for transparency. Jeez I'm stupid. I always wondered why colors needed to |= (255<<24)... Opacity! Anyway, expect a better screen capture from me in a couple of weeks... With beaches instead of blunted tiles!)
Miznia
|
|
|  |
 |
|
Miznia
|
 |
Madison WI
Jul 2001 time: 23:16
|
|
Hmm. I think I was thinking too much. Panama is important in that it's a likely route to getting somewhere, I understand that. I was thinking that the purpose of the whole method went beyond path-finding, in also giving the AI some sense of what land is strategically important to control (bottlenecks). It's this kind of insight that I don't think my AI needs.
I can increasingly see that the method would be really handy, especially on land, which has more "obstacles" to be wary of than ocean. Dividing land into regions wouldn't help much.
I think on land I'll just have it search for any path, favoring roads, and aborting (as impossible) paths with too much non-road.
Mark, can I ask if there are Virtual Machines that you prefer or avoid, or demand of Clash users? I notice with alarm that "java" runs my programs very slowly, although partial transparency looks beautiful (I don't use it, though); "jview" runs lightning fast, dithers for partial transparency (OK with me), but substitutes SansSerif for the Serif I ask for (bad). I'm very worried about how I could distribute anything with these discrepancies.
Thanks for any info/advice...
|
|
|  |
 |
|
Mark_Everson
|
 |
Canton, MI
Jan 1970 time: 00:16
|
|
Hi Miznia:
quote: Originally posted by Miznia
Mark, can I ask if there are Virtual Machines that you prefer or avoid, or demand of Clash users? I notice with alarm that "java" runs my programs very slowly, although partial transparency looks beautiful (I don't use it, though); "jview" runs lightning fast, dithers for partial transparency (OK with me), but substitutes SansSerif for the Serif I ask for (bad). I'm very worried about how I could distribute anything with these discrepancies. |
We just use the Jit that comes with the SDK 1.3.1. Its a bit slow, but Clash isn't very grapihics-heavy. You can ask Gary on our forum if you like. He knows his java very well, and might have some insights. Or you can try the java forum at gamedev.net. There should be lots of people who know their sh*t there 
The Map AI thing has purposes:
1. divide the map into regions (I believe this is much more important than you think, FE see 3)
2. identify important strategic areas, as you said
3. Enable sensible long-distance path finding
I didn't stress 3 in the writeup, but I think its important to your project, or will be eventually. Because regions have been identified your pathfinding can use region borders as areas any one-mode (all-land or all-sea) path must take. With regions my pathfinding will know that to go from Beijing to Capetown land paths Must have a waypoint through Siani. That is where the Regions Africa and EurAsia meet! If you know this, the cost in time of computing the path comes down dramatically. At least that's my take on it.
The idea of No-road-no-go is going to cripple your AI IMO, unless all your scenarios start out with a good road network...
|
|
|  |
 |
|
Miznia
|
 |
Madison WI
Jul 2001 time: 23:16
|
|
quote: You can ask Gary on our forum if you like. He knows his java very well, and might have some insights. Or you can try the java forum at gamedev.net. There should be lots of people who know their sh*t there |
I'll get around to that after I try some more things. In particular, I bet the thing will run a lot faster once I get rid of all the createImage()'s I had to use to simulate transparency.
quote: but I think its important to your project, or will be eventually. Because regions have been identified your pathfinding can use region borders as areas any one-mode (all-land or all-sea) path must take. With regions my pathfinding will know that to go from Beijing to Capetown land paths Must have a waypoint through Siani. That is where the Regions Africa and EurAsia meet! If you know this, the cost in time of computing the path comes down dramatically. At least that's my take on it.
The idea of No-road-no-go is going to cripple your AI IMO, unless all your scenarios start out with a good road network... |
Well, it's more like "too-much-no-road-no-go." I actually don't want the AI to walk land units from Beijing to Capetown if there are no/few roads; I would prefer the AI to decide that the trip is impossible without a boat. The main exception that comes to mind is "exploration units." They wouldn't need path-finding to explore, but they would in order to return home, or reach new "black" areas to uncover.
But that said, I do think you may be right about no-regions crippling the AI. I'm not sure. My worry about land regions is that there are more things to consider than at sea. For instance, the shortest route by road may not be the most direct route according to region adjacency. There's also ZOC and enemy possessions to worry about, creating similar problems. ...I think I see that your path-finding method could help with the roads concern. It seems, though, like an awfully expensive calcuation to have to update whenever there's a new road!
Huh. This might be more complicated than I was thinking...
|
|
|  |
 |
|
dexter4dxm
|
 |
CA, USA
Jul 2001 time: 21:16
|
|
quote: Originally posted by Miznia
It seems, though, like an awfully expensive calcuation to have to update whenever there's a new road! |
There is a similar thing in Civ3 that many people have complained about. Whenever a piece of road is built or destroyed, the game re-evaulates all the trade routes to see who can trade with each other. Needless to say, this takes up processing power, and people with systems towards the minimum requirements really take the hit on this issue.
What you have here is a simple matter of a trade-off. You have to decide what the best way to do it in gameplay terms, compared to the best way to do it in processing time terms. In my game, I had to figure out how and when you evaluate city connections to the capitol (similar to Civ3). I decided on a system that is run once each turn for each city. Things aren't updated right away, but it doesn't hurt the gameplay very much either. I suppose there are a lot of factors that go into the decision, like how many cities you will be working with, how big your maps are, and so on.
I hate pathfinding 
|
|
|  |
 |
|
Miznia
|
 |
Madison WI
Jul 2001 time: 23:16
|
|
quote: Could you do me a favor? A lot of people are having trouble getting Clash D6 to run. But I'm not getting back error messages... It occurred to me you'd be ideal, since if there are errors you're a java guy and will know how to get them... |
I'm a step ahead of you. A couple days ago I got around to checking out ClashD6 (as well as Civiliza 4 and HoE's first).
I didn't do the installation quite as your webpage says to. This probably limits the helpfulness of my experience... But, after putzing around with putting the JAR in different places, I got the most success from putting it in \jdk1.2\bin, where I would then run "java -jar clashd6.jar." I get the start-up menu, then scenario selection, then player selection, and then it halts, with the console window saying a certain field didn't exist. It was from/about "javax.swing.JDesktopPane," regarding a field... "OUTLINE_something_something" I think. Clash did create two text files, "economy" and "tech," I believe, which convinces me that it got to the point of doing *something*...
There's a method list, I mean a stack trace, but I don't remember what was up. Sorry I can't be more help at the moment; I'm at a lab computer, with no internet from my home computer.
quote: since if there are errors you're a java guy and will know how to get them |
Clash is the first java program I've ever downloaded. My most astute observation is that if you use "javaw" instead of "java" you won't get an error message because it's not a console app
quote: What you have here is a simple matter of a trade-off. You have to decide what the best way to do it in gameplay terms, compared to the best way to do it in processing time terms. |
I'm sure you're right, but the factors involved are not all clear to me. A fast over-land system would use regions, but potentially trespass a lot and ignore viable road solutions. I'm not sure if this is acceptable. I'm also not sure how to make a happy marriage of regions and some brute force path-finding.
I wonder what all Civ1/2 uses for path-finding? Is it really pretty stupid? In Colonization, on the northern coast of SAmer, there's a three-square bay that the computer boats can't seem to find their way out of... God forbid I have to settle for that.
|
|
|  |
All times are GMT. The time now is 05:16. Apolyton Time is 00:16. |
top of page
|
|
|
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
|
|
|
|
|
|