.com.unity Forums

.com.unity Forums (http://forum.shrapnelgames.com/index.php)
-   Dominions 3: The Awakening (http://forum.shrapnelgames.com/forumdisplay.php?f=138)
-   -   Suggestion to autocasting search spells (http://forum.shrapnelgames.com/showthread.php?t=36197)

Folket September 25th, 2007 08:44 AM

Suggestion to autocasting search spells
 
At the moment mages searches the provinces in order of numbers and skip any province with two or more sites.

Better would be if they started to search in empty provinces, then continues to those with one site, later two sites, three sites and last provinces that have been search with mages of lower level then 4. This would allow for more efficiency early on and would allow people who wants to search for everything everywhere to do that automatically.

It would also be nice if mages recognized capitals and did not search them.

thejeff September 25th, 2007 09:28 AM

Re: Suggestion to autocasting search spells
 
I'm not sue that starting with empty provinces is more efficient.

Are you more likely to find a site in grasslands where nothing has been found or wastes where you've already found a site.

I'd prefer it to prioritize terrain where sites of that path are more likely to be found. Considering both chance of a site in that terrain and the number of sites of that path available in that terrain.

Priority for me, though, would be not searching capitals and not skipping provinces with 2 sites.

Humakty September 25th, 2007 09:29 AM

Re: Suggestion to autocasting search spells
 
Are you sure they avoid provinces with sites ? It seems to me they avoid all provinces that have been searched other way by a mage. Quite frustrating to have to hand pick provinces just because you had a 1X mage searching into it at the beginning of the game.

Folket September 25th, 2007 09:31 AM

Re: Suggestion to autocasting search spells
 
They avoid provinces with two or more sites and any provinces that have been searched.

The priority of terrain is probably even better but propably more demanding to implement.

thejeff September 25th, 2007 09:47 AM

Re: Suggestion to autocasting search spells
 
Yeah, the terrain priority is an ideal. I'd also like a pony.

Essentially, I'm eventually going to want to search everything anyway. If I really care about the order, it's likely when I have minimal income and I'm trying to get enough gems to finance the rest of the site searches. Or I'm trying to avoid searching vulnerable provinces. That I'm going to do manually anyway.
Other than that I want it to search everywhere that could have sites. Skip capitals, skip anything already searched to lvl 4, skip anything with 4 sites already found. That's it.

Don't get me wrong. I love autocasting search spells. It's a drastic drop in micromanagement. Fixing it so I don't have to scroll through the province list to see if anything has been missed is all I care about adding. Efficiency improvements to the order are just icing on the cake.

Sombre September 25th, 2007 09:48 AM

Re: Suggestion to autocasting search spells
 
The most annoying thing to me is that they tend to search from South to North and I'm almost always fighting South, so they always try to search provinces right on the border, meaning I have to manually do it every time, or potentially give my enemy free sites.

llamabeast September 25th, 2007 10:07 AM

Re: Suggestion to autocasting search spells
 
How are you always fighting South?

jutetrea September 25th, 2007 10:15 AM

Re: Suggestion to autocasting search spells
 

I eighth this notion!

no sites
1 site
2 sites
3 sites
Searched by lvl 1
Searched by lvl 2
Searched by lvl 3
Always skip capitals

thejeff September 25th, 2007 10:45 AM

Re: Suggestion to autocasting search spells
 
Do we understand the site placing algorithm well enough to say that there's a better chance of finding a site in province with less known sites than in one with more known sites?

Or is it just the statistics I don't understand...

Hadrian_II September 25th, 2007 11:40 AM

Re: Suggestion to autocasting search spells
 
Quote:

jutetrea said:

I eighth this notion!

no sites
1 site
2 sites
3 sites
Searched by lvl 1
Searched by lvl 2
Searched by lvl 3
Always skip capitals

I would also like this implemented.

Sombre September 25th, 2007 12:00 PM

Re: Suggestion to autocasting search spells
 
Quote:

llamabeast said:
How are you always fighting South?

Just unlucky I guess. It's annoying you can't switch the direction around.

thejeff September 25th, 2007 12:04 PM

Re: Suggestion to autocasting search spells
 
I don't understand the desire to prioritize searches of provinces with no known sites.

The site placing algorithm, as I understand it is:
roll %chance of site
if yes, determine which site then roll again
if no then exit.

Max of 4 sites, but the point is, if there you know there is one site, the chances of another site are just as good as when you didn't know of any.

I'd much rather search a Waste site (+20%) that already had 3 sites than a farm (-10%) that had none.

Am I missing something?

RonD September 25th, 2007 12:32 PM

Re: Suggestion to autocasting search spells
 
Quote:

thejeff said:

I'd much rather search a Waste site (+20%) that already had 3 sites than a farm (-10%) that had none.

Am I missing something?

Hmmm. Suppose you're searching with Acashic Record and the base chance is 50%.

For the Waste province, the chance to find a site is 70%.

For the Farm, the chance to find 0 sites is 0.6^4 = 13%, so the chance to find 1 or more sites is 87%.

Its more complicated when searching with the individual spells (because the Waste site must have already been searched with some).


I wouldn't have spent any more than 10 seconds working that out, because I seriously doubt we will ever see a complicated auto-search algorithm. The devs prefer to spend time adding cool new content - and that's fine by me.

thejeff September 25th, 2007 12:43 PM

Re: Suggestion to autocasting search spells
 
No, the chance in the Farm is 40%.

It's not 4 separate checks against the percentage. If there is one site, then the code checks to see if there is another one, and so on, up to 4 sites.
If the first check fails, there are no sites there.

RonD September 25th, 2007 01:15 PM

Re: Suggestion to autocasting search spells
 
Quote:

Emily Latella said:
Oh. That's very different.


Never mind.



Folket September 25th, 2007 02:10 PM

Re: Suggestion to autocasting search spells
 
I pretty certain that there is four seperate checks for sites.

Try in single player and use the astral spell that searches all sites on all province. You will find that only a few provinces havce zero sites.

RonD September 25th, 2007 02:51 PM

Re: Suggestion to autocasting search spells
 
Quote:

thejeff said:
No, the chance in the Farm is 40%.

It's not 4 separate checks against the percentage. If there is one site, then the code checks to see if there is another one, and so on, up to 4 sites.
If the first check fails, there are no sites there.

It looks like this is not correct. I tweaked Boron's testmap. I took out all the terrain statements (so everything is plains), set ownership for a boatload of provinces to one of the nations (turned out to be 67 provinces total), and used the Seraphs to cast Acashic record on all 67). I created the game with site freq set at 50%.

By your explanation, about 1/2 should have had 0 sites, but here's what I got:

0 sites - 6
1 site - 13
2 sites - 29
3 sites - 17
4 sites - 2

Folket September 25th, 2007 04:26 PM

Re: Suggestion to autocasting search spells
 
Wiiieeehh!!

My 670th post.

DrPraetorious September 25th, 2007 04:30 PM

A quick intro to Bayes rule
 
Yeah, there are 4 50% chances to have a site, which is why the average is 2.

A brief explanation of what order to search in:
Let us pretend that each province has 2 50% chances to have a site, of which half will be fire sites and half will be earth sites.

So, if we look at 160 provinces:
40 will have no sites.
40 will have one fire site.
40 will have one earth site.
20 will have one earth site and one fire site.
10 will have two fire sites.
10 will have two earth sites.

Now, we've done some earth searching, and we want to know: which provinces should we search for fire?
a) Sites which haven't been searched are expected to have: (40 + 20 + 10 * 2) / 160 = 0.5 fire sites each.
b) Sites which have been searched, and which contained two earth sites, have 0 fire sites each (guaranteed).
c) Sites which have been searched, and which contained one earth site are expected to have: 20 / (20 + 40) = 1/3 fire sites each.
d) Sites which ahve been searched, and which contained zero earth sites, are expected to have: (40 + 10 * 2) / (40 + 40 + 10) = 2/3 of a fire site each!

So category B is not worth searching at all.
Category D > Category A > Category B.

This is a particular case of the well-known "Monty Hall" paradox:
http://en.wikipedia.org/wiki/Monty_Hall_problem

thejeff September 25th, 2007 05:55 PM

Re: A quick intro to Bayes rule
 
Apparently I was misled by comments from the devs. The game is complex enough, not even they understand it anymore.

I'm not entirely convinced by the (correct) Monty Hall argument.
Largely because of the terrain modifiers. Provinces with multiple sites are more likely to be in terrain with better chances and thus may still have a better chance of more.
Waste with 2 sites or farmland with none?

More importantly, I really care less about the order they're searched in. I don't want to have to come back and check for skipped provinces once the autosearching is done. Once that's hashed out, tweaking for the most efficient order would be appreciated, but I won't really care.

DrPraetorious September 25th, 2007 08:29 PM

Re: A quick intro to Bayes rule
 
I agree with thejeff 100%.

The only requirement is that the site-searching algorithm should be good-enough that you don't bother by hand.

I'd propose "priority score" like (4 - sites found) * (4 - level in this path searched)^2, and never searching anything with a score of 0.

The issue with non-standard terrains is that, *I BELIEVE*, they have a linear effect on the site frequency.

If the site frequency is 75%, it's 65% in farmland and 85% in swamps, *I THINK*, and who cares?

OTOH, if the site frequency is 30%, sites are twice as frequent in swamps and that makes a big difference.

Lazy_Perfectionist September 26th, 2007 01:52 AM

Re: A quick intro to Bayes rule
 
Hmm... interesting. With that priority score above...

0/0 = 64
1/0 = 48
2/0 = 32
3/0 = 16

0/1 = 36
1/1 = 27
2/1 = 18
3/1 = 9

0/2 = 16
1/2 = 12
2/2 = 8
3/2 = 4

0/3 = 4
1/3 = 3
2/3 = 2
3/3 = 1

#/4 = 0
4/# = 0

So, the very lowest priority is hunting for ultra-rare level 4 sites. Fine, that. I don't like the rest of it because its not very intuitive. But I do like the results, even if I can't predict where it'll search easily. But the auto searching isn't about predicting anyways. The way the numbers fall is fine enough by me.

I would put in a few additional variables. For Dark Knowledge, for instance, I would heavily favor land provinces over water provinces, though there are a few possibilities...

As there are currently zero underseas blood sites in the game, I'd set the priority to something like 1, (if I boosted all other scores by one, so this would be the lowest). This would allow mod-sites to be found eventually, while keeping in mind nothing will likely ever be found underwater - and they'd be searched dead last.

DrPraetorious September 26th, 2007 09:02 AM

Re: A quick intro to Bayes rule
 
I don't want it to get too complicated, but yeah, we could have a priority score modifier for terrain, sure:
Farmlands, x0.9
Mountain, x1.2
Mountain + Earth, x2
Forest, x1.2
Forest + Nature, x2
Swamp, x1.2
Swamp + Death, x2
Wasteland, x1.2
Wasteland + Fire, x2
Ocean + Water, x2
Coast + Water, x1.5
Ocean + Blood, x0.1

Something like that?

thejeff September 26th, 2007 09:44 AM

Re: A quick intro to Bayes rule
 
That would be nice, though unlikely to happen. You could tweak the values and calculate the exact chances of a site in a particular path. (And then the chances of VoT or AR if some paths have already been searched?) If I understand the Bayes argument correctly, the chances go up if you've already searched other paths and found nothing, so add that in.

I'm still going to override it to not search provinces I think are vulnerable. And I'm still going to try to search everything I expect to hold.

So I really see this as fiddling with the details of something that remains basically broken. The important part is letting it search provinces with 2 sites and not searching capitals. My next priority would be searching paths that have been partially searched. Order comes a long way after that.

Lord_Bob September 26th, 2007 01:13 PM

Re: A quick intro to Bayes rule
 
It's more obvious if viewed as two marble bags. You have three marbes, 2 black and 1 white. You put one in one bag and two in another. There is a base chance of 33% of the white marble being in bag one and a base chance of it being in bag 2 of 66%. But then you take a black marble out of bag 2(which you will obviously be able to do). Now there is only one marble in each bag. So reaching in will pull only that marble out. But the BAG PROBABILITIES HAVE NOT CHANGED.


All times are GMT -4. The time now is 10:11 PM.

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