.com.unity Forums

.com.unity Forums (http://forum.shrapnelgames.com/index.php)
-   Dominions 3: The Awakening (http://forum.shrapnelgames.com/forumdisplay.php?f=138)
-   -   Moving Through Multiple Provinces (http://forum.shrapnelgames.com/showthread.php?t=41071)

lch November 1st, 2008 04:12 AM

Re: Moving Through Multiple Provinces
 
Quote:

Originally Posted by Ironlord (Post 649614)
Also, I took the other poster's advice to try another nation. I chose R'yleh. Going to have to read up on that nation now.

But you didn't really take LA R'lyeh next, did you? Did you?

Endoperez November 1st, 2008 05:08 AM

Re: Moving Through Multiple Provinces
 
LA Ermor: gets freespawn units, must summon all its commanders, all population is killed in their dominion rather quickly.

LA R'lyeh: gets freespawn units, can also recruit commanders, but lots of population is killed in their dominion automatically

Everyone else except PERHAPS EA R'lyeh: recruit all their units and commanders with gold (they gather from population), conquer more provinces, growth/death scale taken during pretender creation doesn't have noticeable effects before a province has been under your dominion for 30 or so turns. After some research and site-searching, may start replacing their normal armies with summons and supporting their normal mages with summons.

Gandalf Parker November 1st, 2008 11:39 AM

Re: Moving Through Multiple Provinces
 
You might also avoid the Maenads spawning version of Pangaea.

Ironlord November 3rd, 2008 06:56 PM

Re: Moving Through Multiple Provinces
 
But you didn't really take LA R'lyeh next, did you? Did you?

No. early Age. I have enough water and air to outfit my mages with air breathing items. Interesting nation. I am going to try MA Ulm next, to see what develpoing a land army is like, and play withthe item creation options.

Loren November 4th, 2008 02:21 PM

Re: Moving Through Multiple Provinces
 
Quote:

Originally Posted by Tifone (Post 649411)
Also, the .trn files would become pretty bigger to memorize all the waypoints and pathfinding etc., requiring more time and bandwith from the servers to send in pbem. Not a thing to overlook.

The only thing I feel the need of, to reduce micro, is really the forge monthly command. :smirk:

I got to thinking about this. A simple move-to-<x> command would not need to alter the saved game format at all.

If <x> could not be directly reached you take the best move to head towards <x> with the provision that if <x> is friendly it will not attack an enemy to do so and if <x> is not friendly it will always prefer friendly provinces.

If <x> can't be reached you'll get a message in the results.

"The army heading for <x> stopped in <y> because no acceptable path could be found."
"The army heading for <x> stopped in <y> because we no longer control <x>."
"The army heading for <x> stopped in <y> because ownership of <y> changed."

By doing the pathfinding calculations each turn there is nothing that needs to be saved and it will react better to changes.

This would *NOT* cover fancier things like picking up the troops on the way or the like but it avoids the headaches of changing the file format.

Loren November 4th, 2008 03:00 PM

Re: Moving Through Multiple Provinces
 
Quote:

Originally Posted by lch (Post 649420)
In my opinion, there are too many variables about moving armies that you really can't let the AI do this for you. Some of those just include:
- which way to move, depending on terrain

Non-issue. Algorithm (I hope the line wrapper leaves this alone!):

Data structures: An array with one cell per province. Each cell holds a turn count and a pointer to a province. Queue of provinces and turns used. Inner queue of provinces & movement remaining.
Load the stating province into the queue.
Repeat
Read province from queue, add to inner queue.
Repeat
Read province from queue.
Iterate across neighbors, add them to the inner queue along with remaining movement.
If the province in the map is empty, fill it with the turns used and the origin of the current move segment. Add the province to the outer queue.
Until inner queue is empty.
Until the target province has data or the outer queue is empty.
If the target has data:
Current = Target.
While Map[Current].ComesFrom <> Origin do
Current = Map[Current].ComesFrom
Move the army to current.

Runtime: This is linearly dependent on the number of provinces * the average number of provinces you can reach in one turn.

Quote:

- what to do about enemy provinces and/or enemy attacks along the way
Recalculate every turn.

Quote:

- adding units encountered in provinces along the way
The simple answer, albeit with a file format change wouldbe to add two movement modes:
Gather like--the commander attempts to add any units that match what he's already got. They are added to the same groups.
Gather any--the commander picks up any troops he can.

Quote:

- how to handle supply problems when moving with multiple big armies
See my previous approach. Run the calculation as above twice. Once normally, once rejecting a province if adding the current army to the already-planned contents of the province would result in starvation. If the second run is no more than one turn longer simply use it. If it's more than one turn longer look at what's eating the supply--if it's armies on move orders then wait, otherwise take the longer route. (Actually, internally you would do both calculations at the same time.)

This handles almost all cases. It will fail in a case where you need to distribute the armies through multiple bottlenecks--they'll all queue up for the shorter one and won't optimize the food use (Say, A needs 100, B needs 80 and C needs 60. The province feeds 160. This approach makes A go first, B & C wait.) It will also fail if two armies are trying to pass each other in opposite directions through a two-province bottleneck where neither province will feed both armies (This case will be detected, though, and you'll get a message.) Such bottlenecks are rare and armies crossing like that is also rare.

Quote:

In general, I think that even a sophisticated solution for this, which would take an immense amount of work to set up, would be inadequate and require constant fine-tuning all the time anyway. Shortcuts to pool gems and so on that are already present in the game are usually pretty simple stuff, and as soon as it gets a little more complex (e.g. remote site searching) people are not too impressed with the results. Something like army movement is decidedly non-trivial to me.
In a situation like this an exhaustive search is a realistic option. The only time I've seen pathfinding problems in a game that could use such an approach involved fog of war issues or improper handling of an impossible route. The army came along and found the path blocked. It turned back to take another route, once it got far enough away that the blocker was lost in the fog it turned around to take the short route again. (The real culprit here was mishandled fog of war--stationary items in the fog should be as you last saw them, not vanish.)

Loren November 4th, 2008 03:04 PM

Re: Moving Through Multiple Provinces
 
Quote:

Originally Posted by SlipperyJim (Post 649450)
That said, I totally agree with lch's point about the drawbacks in the automated remote site-searching. I use it gladly, but there are a few shortcomings in the way it determines which sites to search. On the one hand, I really don't want to waste gems and mage-turns to search captured enemy capitals. I already know which site will be in Niefel's capital -- it's Niefelheim, thanks -- and I don't need to search for it. On the other hand, it would also be good if my remote site searchers would be willing to search a province that had already been searched by a level-1 or level-2 mage, because that first search could have missed a site or two. I gladly use the automated remote site-searching, and I consider it to be a huge boon to the gamer, but it's definitely not perfect.

The basic problem is that it doesn't attempt to rank targets, it's using too simplistic an approach.

It shouldn't be too hard to build a table of precalculated odds: Current search level, terrain type and path being searched. The mage should consider each province and cast at the one with the highest probability. Terrain type capital would have a zero probability.

lch November 4th, 2008 03:32 PM

Re: Moving Through Multiple Provinces
 
Loren, that's very cute, but I'm afraid it still won't make this feature be implemented any sooner.

You'd probably have a better chance of convincing JK to make the AI scriptable and then implement the exhaustive province movement algorithm yourself. Which still is a very dim chance, if any at all.

Gandalf Parker November 4th, 2008 04:23 PM

Re: Moving Through Multiple Provinces
 
Nice pseudo coding Loren.
It might have stood a chance in the early days. But it does show that a change would not be fast and simple as the other things we have been getting in patches.

MaxWilson November 4th, 2008 06:37 PM

Re: Moving Through Multiple Provinces
 
Quote:

Originally Posted by Meursy (Post 649573)
Yeah Max what were you thinking! Using 'your' as a generic pronoun to express an opinion!

The cheek! :D

Mea culpa. :)

-Max


All times are GMT -4. The time now is 08:35 AM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.