.com.unity Forums

.com.unity Forums (http://forum.shrapnelgames.com/index.php)
-   Dominions 3: The Awakening (http://forum.shrapnelgames.com/forumdisplay.php?f=138)
-   -   ritual site search bug/feature request (http://forum.shrapnelgames.com/showthread.php?t=35043)

Baalz June 12th, 2007 01:21 PM

ritual site search bug/feature request
 
The automated monthly site searching via ritual is great now that you can have more than one mage casting the same spell, but there is one minor annoyance which seems like it'd be easy to code a fix for. The auto-targeting logic targets provinces which can't have any more magic sites. In particular I'm talking about national capital provinces, but also to a much less common degree provinces which already have 4 discovered sites. I'm sure I'm not the only one who's anal retentive enough that seeing the mages target something that I *know* is a waste of gems and time is enough to make me manually re-target them...but then the next turn they're right back to targeting the waste of time because it still hasn't been searched! http://forum.shrapnelgames.com/images/smilies/frown.gif If you've captured two additional capitals, that's a swing of about 45 gems and 24 mage-turns to just grin and bear it if you're searching all paths...not trivial.

Anyway, not a huge thing, but if it's an easy change I'm sure I'm not the only one who would like it.

thejeff June 12th, 2007 01:37 PM

Re: ritual site search bug/feature request
 
I'll second the request, but I don't think it's quite that simple.

Is it always targeting capitals for you? I know I've seen it search some and skip others. It also will skip other provinces at times, for no obvious reason. I haven't seen it target provinces with 4 sites, but I haven't really looked.

It looks to me like the intent to skip capitals is there, but there's something wrong with whatever it's using to determine "capitalness". I haven't noticed a pattern though.

Maybe I'll put together a test game or two and see if I can pick something out.

DrPraetorious June 12th, 2007 01:44 PM

Re: ritual site search bug/feature request
 
If you're going to make the search math more complicated at all, it might as well generate a priority array of provinces each turn, and crawl through that list in descending order.
I'm just guessing about how this works and then writing in C to get what I mean accross.

<font class="small">Code:</font><hr /><pre>
for (prov = 0; prov &lt; num_prov; prov++){
if (owners[prov] == currentplayer){

slevel = map.sitefrequency + sitefrequencyadjust(terrain[site]);

for (i = const_FIRE; i &lt;= const_HOLY; i++){
/* If a site has been searched for one type and nothing has been found, chances of seeing something of another type go up. http://www.stat.sc.edu/~west/javahtm...MakeaDeal.html
Also Bayesian inference generally. This is not strictly the right adjustment. */
slevel += currentsearch[currentplayer][prov][i] * 25 / 7;
}

for (i = const_FIRE; i &lt;= const_HOLY; i++){
spri[prov,i] = slevel * (4 - knownfeatures[i]);
spri[prov,i] /= exp(2,currentsearch[currentplayer][prov][i]);
/* This assumes that half of the sites are level 1, a quarter are level 2, etc. */
if (currentsearch[currentplayer][prov][i] &gt;= 4){spri[prov,i] = 0;}
/* And of course no sites are above level 4. */
}

if (isForest(prov)){spri[prov,const_NATURE]*=1.2;}
if (isMountain(prov){spri[prov,const_EARTH]*=1.2; spri[prov,const_AIR]*=1.1;}
if (isWater(prov){spri[prov,const_WATER]*=1.2;}
if (isSwamp(prov){sprit[prov,const_DEATH]*=1.2; spri[prov,const_WATER]*=1.1; spri[prov,const_NATURE]*=1.1;}
if (isWaste(prov){sprit[prov,const_DEATH]*=1.1; spri[prov,const_FIRE]*=1.2;}
}
}
</pre><hr />

And then you sort the province #s according to their priority for each given search type. For Akashic Record or Voice of Tiamat, just some the priorities before sorting.

If someone wants to do a statistical analysis of Edi's site list and get real values... actually I'm probably the only person here who'd want to do that.

Gandalf Parker June 12th, 2007 01:47 PM

Re: ritual site search bug/feature request
 
Technically a capital can have other sites but its a map thing so not very likely in most games.

I dont remember my mages hitting my castle.

Baalz June 12th, 2007 01:50 PM

Re: ritual site search bug/feature request
 
Yeah, mostly it's the capitals I noticed, I just figured it'd be the same case for provinces with 4 sites. The capitols are really the main issue anyway, as it's pretty rare to have 4 magic sites on a province with any significant amount of site searching left undone on it. I've noticed it most in targeting capitals I've captured, but I've certainly also seen it target my own capital (and to be clear there are other valid targets). It seems like it steps up the province numbers looking for the next valid target, and I haven't noticed it skipping any capitals.

Yeah Dr. P, I thought about mentioning a prioritization, but I figured a change like this would be a low priority next to some of the other bugs, so the only way it'd be likely to get in is if it was trivial to do. http://forum.shrapnelgames.com/images/smilies/happy.gif

thejeff June 12th, 2007 01:57 PM

Re: ritual site search bug/feature request
 
That would be nice, but could you add in something to prioritize more easily defended provinces as well.
At least ones which are farther within your empire. Or castled?
It's frustrating to be expanding downwards on the map and have your searchers always searching the just taken provinces, that are most likely to be fought over again.

More seriously, while a more efficient gem gaining algorithm would be good, the current version seems broken. It searches provinces it shouldn't and ignores some that it should. Fixing that seems more urgent than improving the algorithm.


The current version also has another unrelated flaw. The next province is chosen based on those provinces held during the ritual magic phase of the turn. A province can be targeted and then lost in the battle phase. The search will still be cast on the next turn.

DrPraetorious June 12th, 2007 02:46 PM

Re: ritual site search bug/feature request
 
All ritual magic happens before battles, changing that is a non-starter. Site searching spells are a minor point to make them an exception to the ordinary order of turn resolution.

As far as I can tell, what it does now is: it crawls through the list in order until it finds a site that isn't being targeted and that has none-zip-zero search points in that magic path.

Now, on the one hand, you do *eventually* want to cast Haurspex on provinces that got only a nature-1 search. OTOH, it would be a major pain if the spell searched those provinces *first*. So if you're going to change the way it works at all, you should have a prioritization algorithm.

Gandalf Parker June 12th, 2007 02:53 PM

Re: ritual site search bug/feature request
 
Anything could be made more efficient but sometimes I think they cut back on all the possible efficient code for hosting time.

Its too bad though. I would rather that ALL of the efficient code was put in. I dont really care how long a hosting takes.

thejeff June 12th, 2007 03:20 PM

Re: ritual site search bug/feature request
 
You may be misunderstanding the problem. It's not that the province is searched and then taken on the turn the spell is cast. That's expected and can occur casting the spells manually.
It's that the automated caster can target a province that is then taken, leaving the caster with orders to cast on a province you no longer own. This can't be duplicated manually, since you can't select that province.

It could be fixed with a quick cleanup check after the battle phase to clear out any monthly orders no longer valid. (Or preferably re-target to a now valid province.)

Actually a better fix would be to handle all of next months monthly orders later in the sequence. This would let you use this months gem income on monthly spells.


As for the current order, it looks to me like you are right about the intent, except that it skips some provinces, often, but not always and not all, capitols.

DrPraetorious June 12th, 2007 04:13 PM

Re: ritual site search bug/feature request
 
Ah, you're right. I was 100% mistaken and thejeff makes a good point. An extra phase for autogenerated orders (after gem income) would probably be a good idea.


All times are GMT -4. The time now is 02:13 PM.

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