.com.unity Forums

.com.unity Forums (http://forum.shrapnelgames.com/index.php)
-   Dominions 3: The Awakening (http://forum.shrapnelgames.com/forumdisplay.php?f=138)
-   -   The scale bug is caused by province neighbors (http://forum.shrapnelgames.com/showthread.php?t=37001)

vfb November 29th, 2007 08:24 AM

The scale bug is caused by province neighbors
 
Summary:
The scale bug occurs when you have more than 6 foreign (indy or hostile) neighbors attached to your home province, and those neighbors have inferior scales to your home.

This includes "ghost" neighbors. "Ghost" neighbors exist in provinces with less than 6 real neighbors, when you create a new game without exiting the dom3 application. They are left over data from the previous game.

If you have less than 7 neighbors attached to your home province, including having no "ghost" neighbors, you will not get the scale bug.

Once your dominion spreads to neighbor #7, this bug will be temporarily squished in the game. If it spreads to neighbor #1 but not #7, you will only see partial scale loss.

If you acquire an additional province which also has more than 6 neighbors, once you have positive dominion in the province, it is also vulnerable to the bug.

There may of course be additional bugs which cause the scales to start vanishing later in the game.



I stepped through the application, specifically the host_scales() function. The scales for the home province are adjusted based first on a comparison with the 7th neighbor (esi register is initially 6, and is used as an index into the geo table, whose neighbor entries are offset from 0). If the home province has any positive scale (which is represented as a negative number) better than the neighbor, that scale is incremented (made worse). Then the process loops up to 19 more times comparing to the first neighbor (esi=0), each time sucking away scales.

It will not compare the scales to provinces under the dominion the nation. I realize this conflicts with reports of scales also disappearing in the late game. I could be misinterpreting offset 0x41 in the land table, I think it's the province owner (nation number) but I'm not sure. Edit Nope, 0x41 is the offset for the id of the nation whose dominion the province is under.

I was able to reproduce no initial scale loss by creating random MA Rlyeh games where the home province had 6 or fewer neighbors. And I was able to reproduce initial scale loss by creating random MA Rlyeh games where the home province had 7 or more neighbors.

But since my assembler is a bit rusty, I'm not entirely sure this is 100% correct.

So I'd appreciate it if people in games where the home province has 7 neighbors and no scale bug, (or 6 or less neighbors and the scale bug) could post their saves to this thread.

Edit: More testing: I created a few more games with O3P3 scales, all nations (all human), random starts. All nations with 6 or less neighbors at their home province did not lose scales. All nations with 7 or more neighbors lost scales.

Edratman November 29th, 2007 08:45 AM

Re: New theory about the scale bug: >6 neighbors
 
I've got one at home I will submit that I started last night. It will be about 10 hours before I can get there. It is a province with 9 (that is correct)neighbors, MA Tien Chin, I put #poptype 30 in it last night and have not had the problem through about 6 turns.

calmon November 29th, 2007 08:47 AM

Re: New theory about the scale bug: >6 neighbors
 
This morning i had absolute the same thoughts. I tested on orania and found the bug only in provinces with more than 6 neighbours.

Well than i did mass tests on silent sea (wrap) and got the bug in provinces like 35 which has only 4 neighbours!

vfb November 29th, 2007 08:49 AM

Re: New theory about the scale bug: >6 neighbors
 
Edratman: Can you please tell me the map, the province you started in, and the scales you chose? I'd like to run turn 2 in the game. Or I can just wait. http://forum.shrapnelgames.com/images/smilies/happy.gif

calmon: Can you pelase email me a zip/tgz of your game at turn 1? I can't reproduce the bug on Silent Seas wrap with a land nation.

calmon November 29th, 2007 09:03 AM

Re: New theory about the scale bug: >6 neighbors
 
1 Attachment(s)
Sure i attach my test games to this post.

There 3 testgames.

For "Pretender Test1":
Provinces bugged:
35, 30, 11 and 52

For "Pretender Test2":
Provinces bugged:
30, 49, 11 and 1

For "Pretender Test3":
Provinces bugged:
35, 49, 15, 44 and 28

The bug has a 50-75% occurance chance in this provinces.

Well like i said in the other tread, i also had the feeling that provinces with a lot of neighbors are prefered for the bug but for example province 35 had a 100% bug occurance in all of my tests in "Pretender Test1" + "Pretender Test3". And this one has only 4 neighbours.

Edratman November 29th, 2007 09:06 AM

Re: New theory about the scale bug: >6 neighbors
 
It is a randomly created map. I map editted everything to ensure that I started in that 9 neighbor province, so all scales are at the top of the map file. I will send the map files and the save game.

vfb November 29th, 2007 09:23 AM

Re: New theory about the scale bug: >6 neighbors
 
Thanks calmon. Your map is slightly fuller than the ones I was testing with http://forum.shrapnelgames.com/images/smilies/happy.gif.

I'll run it through the debugger and see what I can find. 35 and 28 border each other, there could be another bug with that. But I see the bug in 49 too, so I'll have a look.

vfb November 29th, 2007 09:41 AM

Re: New theory about the scale bug: >6 neighbors
 
Oh no! The geo table is polluted!

<font class="small">Code:</font><hr /><pre>
0xad6bc14 &lt;geo+2356&gt;: 0x002b0001 0x0033002d 0x00000032 0x00390035
0xad6bc24 &lt;geo+2372&gt;: 0x00000000 0x00000000 0x00000000 0x00000000
0xad6bc34 &lt;geo+2388&gt;: 0x00000000 0x00000000 0x00000100 0x03f10331
</pre><hr />

The above is for Marverni, neighbors:
0x01 = 1
0x2b = 43
0x2d = 45
0x33 = 51
0x32 = 50
0x00 --&gt; no more neighbors
0x35 &lt;-- Ack! This is neighbor #7, the invisible neighbor.

I'll see if I can find where the 0x35 gets inserted into the geo table.

Edit: It's from the save file itself. The getfatherland() function loaded the value into the geo table.

calmon November 29th, 2007 09:55 AM

Re: New theory about the scale bug: >6 neighbors
 
(Its in "Pretender Test3")

Well 0x35 is 53! And in my test game ermor (35) got dominion in 53 and its far away from his home province! I'm sure it has also this province as an additional entry in his table.

However this "invisible" neighbour explains another strange appearance i've from time to time:
My dominions spread into a far away province!

Well done vfb! Johan should take a deep look into this. It explains some of the strange things the game still has!

vfb November 29th, 2007 10:03 AM

Re: New theory about the scale bug: >6 neighbors
 
New information:

If you create a new game in dominions without exiting the application, the geo table is not cleared. You will end up with scale bugs in provinces with less than 6 neighbors. And other mysterious problems are possible too.

Exit the application first, then create a new game. That will prevent the problems calmon found.

calmon, if you have time can you please try to reproduce the bug again, but this time always exit the dom3 program before creating each game.

Edi November 29th, 2007 10:28 AM

Re: New theory about the scale bug: >6 neighbors
 
http://koti.welho.com/ehalttun/Image...s/icon_eek.gif http://koti.welho.com/ehalttun/Image...s/icon_eek.gif

Okay, so how you guys ferreted these numbers out looks like black magic to me, but if I'm reading that right, the scales bug will probably go SQUISH come patch time, and it looks like this same thing explains the so far unsatisfactorily covered random dominion spread to faraway provinces (previously thought to result from the skipping in Dominion spread mechanics according to one hypothesis).

I'm also wondering if the corrupted geotable could be behind the bug where two opposing armies are unable to move against each other or armies getting "stuck" for no particular reason, which has been discussed earlier at some length.

calmon, vfb, great job! Props also to IndyPendant who got the whole Vanishing Scales discussion restarted and to Lord_Bob whose thread helped explore some of the scale mechanic possibilities and eliminate them as a consideration.

calmon November 29th, 2007 10:28 AM

Re: New theory about the scale bug: >6 neighbors
 
Ok i did some more tests with 2 games (each with brand new dominions open) and 5 First turn hosts for each game.

Now i can't find the bug in provinces with 6 or less provinces as neighbours. All bugs occurs in provinces with 7 or more neighbours!

It seems you found it http://forum.shrapnelgames.com/images/smilies/happy.gif!

Daynarr November 29th, 2007 10:38 AM

Re: New theory about the scale bug: >6 neighbors
 
Nice vfb. Looks like you are on to something here. http://forum.shrapnelgames.com/images/smilies/happy.gif

vfb November 29th, 2007 10:48 AM

Re: New theory about the scale bug: >6 neighbors
 
Thanks! I'd still like to have a look at Edratman's map later, where he had a 9-neighbor province and did not see bugs. So there may be a little more to it, but for now ... always start a clean instance of the application for new games, and try to avoid home provinces with more than 6 neighbors.

calmon November 29th, 2007 10:54 AM

Re: New theory about the scale bug: >6 neighbors
 
Well the bug doesn't occurs every time when having more than 6 provinces.

I think when having more than 6, the chance getting it increases with every additional neighbour.

vfb November 29th, 2007 11:01 AM

Re: New theory about the scale bug: >6 neighbors
 
I'm not sure. In the games I debugged, it definitely looks at the 7th neighbor first, and if it is foreign and there is any scale difference, it will first remove that scale from the home province. Then it moves on to the first neighbor, and if it is foreign it totally removes any positive (aka negative aka good) scales from the home province that do not exist in the first neighbor (looping up to 19 times just to make sure).

If you can please attach a save of a 7-neighbor game where the scale bug does not occur, I might be able to find out more exceptions to the above.

calmon November 29th, 2007 11:09 AM

Re: New theory about the scale bug: >6 neighbors
 
1 Attachment(s)
Sure, here it is. The game is called "Dominions Closed and New" and its the second turn. Look at oceania which still have all scales and there are 10 neighbors. (If you need the First turn files just write it)

vfb November 29th, 2007 11:31 AM

Re: New theory about the scale bug: >6 neighbors
 
Great! Thanks calmon.

Okay, now I understand what offset 0x41 in the land table is. It's whose dominion is in the province. I thought it was the owner of the province.

The 7th neighbor of 53 in your file is 47. It's under Oceania dominion.

Once your dominion spreads to either province 7 or province 1, then the scale bug should disappear. At least until it reappears for another reason http://forum.shrapnelgames.com/images/smilies/happy.gif. This also helps explain why the more neighbors you have over 6, the more likely you are to see the problem. Dom spread happens before scale adjustments, so with exactly 7 provinces you've got a decent chance to hit #1 or #7 before your scales get whacked. With 15 provinces (hello water nations) the chance of that happening is less.

Sir_Dr_D November 29th, 2007 12:02 PM

Re: New theory about the scale bug: >6 neighbors
 
In the epic heroes II game the Tithe Collector of Marigon makes a giant statue of vfb.
____

In my game as R'lyey where I am on turn 69, and still witnessing the scale bug, my home province is 115 in Cradle which is surrounded by 10 provinces. I have had positive dominion in my home province, but very few in any of the neigboring provinces. In province 78 I have another fort which is surrounded by 10 provinces, and I am encountering the same thing. So the bug just doesn't occur in the home province. It occurs for any province at any time in the game where you have positive dominion in that province, but not in the surrounding 7+ provinces.

This explains why the bug seems to happen with R'lyey so much, and why it occurs on some maps more then others.

vfb. You are a genius.

vfb November 29th, 2007 12:21 PM

Re: New theory about the scale bug: >6 neighbors
 
Ha ha ha, no, not a genius, just got friendly with the debugger. But thanks in advance for the statue. http://forum.shrapnelgames.com/images/smilies/happy.gif

To fix 115 in Cradle, you could try to to expand your dominion to 130, that's the 7th neighbor in the map file. 91 should help too, it's the 1st neighbor.

You are right about other provinces, they are vulnerable to the bug too. To fix your dominion in 78, expand your dominion to 82, that's the 7th neighbor. 53 should help too, it's the 1st neighbor.

Time to put your Insane Void Cultists to work at some preaching! http://forum.shrapnelgames.com/images/smilies/happy.gif

Lord_Bob November 29th, 2007 12:35 PM

Re: The scale bug is caused by province neighbors
 
Very convincing testing and answer.

As far as I can tell, you have run down 2 seperate bugs.

The Scale Bug and "Ghost Connections" to provinces all over the map.

IndyPendant November 29th, 2007 02:43 PM

Re: The scale bug is caused by province neighbors
 
Heh. Wow. I go away for less than a day and it's (practically) all done! Very cool.

Tip my hat to vfb and Lord_Bob for tracking this down. I got the ball rolling by being able to reliably reproduce the scale bug--but there's no way in *hell* I would have been able to figure out what vfb just did!

(Heck, the first time I read his post I was going "Uh, what? Invisible neighbours? Is this a spoof on all the sudden excitement about the scalebug, like that spoof of the Scorched Earth thread a while back?" *reads on* "Nope, it's serious. Wow, that's...bizarre..." : )

Congratulations!

Edratman November 29th, 2007 03:01 PM

Re: The scale bug is caused by province neighbors
 
I refuse to accept your modesty vfb. I concur with Sir_Dr_D and acknowledge your genius .

I think you might even be eligible for a HOF promotion up to "VFB". http://forum.shrapnelgames.com/image...es/biggrin.gif


I'll still send my 9 province map tonight.

Edratman November 29th, 2007 06:57 PM

Re: The scale bug is caused by province neighbors
 
1 Attachment(s)
Here are the files.

Edratman November 29th, 2007 07:12 PM

Re: The scale bug is caused by province neighbors
 
1 Attachment(s)
Oops. Couldn't send all three files at once I just found out. Here is the MAP file.

Morkilus November 29th, 2007 07:12 PM

Re: The scale bug is caused by province neighbors
 
Wow, the people on this board are hardcore. No wonder I never win my games!

Edratman November 29th, 2007 07:13 PM

Re: The scale bug is caused by province neighbors
 
1 Attachment(s)
Here is the save file

vfb November 29th, 2007 07:28 PM

Re: The scale bug is caused by province neighbors
 
Thanks! I started the game on this map and immediately lost all my good scales. So I made a stealth prophet and sent her to province #7 (159) to preach. Province 159 did not have friendly dominion. As soon as I got one candle in #159, all my order (and some productivity and growth) came back in the capital. Two turns later and the scales were back at full strength.

Edit: I started a new game because I didn't have the save. I'll have a look at that now.

Lord_Bob November 29th, 2007 07:46 PM

Re: The scale bug is caused by province neighbors
 
The Monkey King will erect a massive statue of vfb made from astral pearls!

Really, I think your thread should be stickied!

Sticky this thread!

vfb November 29th, 2007 08:10 PM

Re: The scale bug is caused by province neighbors
 
Edratman, I looked at your save game. You had positive dom in 159 and 113. Probably the high initial dom set up in the map caused early spread. So, I killed your prophet, researched const6, and sent a bunch of stone idols to province 159 (neighbor #7, the trigger province) and province 113 (neighbor #1, the leech province). Dom hit zero first in 159, but I didn't see much of a scales change, since there's only one possible scales decrease for neighbor #7. When Dom hit zero in 113, all the positive scales vanished in the capital.

I then removed the idols from 159 and parked them in 113. Scales then started to recover in the capital. It took about 5 turns for them to get back to full strength, but they did recover and stay there.

Thanks for posting the test case!

Edratman November 29th, 2007 08:18 PM

Re: The scale bug is caused by province neighbors
 
You have it all figured out. You can always create the problem and make it go away. That is positive proof.

Arralen November 30th, 2007 11:27 AM

Re: The scale bug is caused by province neighbors
 
I have told the devs for over 2 years that there's at least one bug with dominion spread and province neighbours,
but no-one ever really listened to me .. .
http://www.shrapnelcommunity.com/thr...mp;o=&amp;vc=1

Maybe you want to check if it's really the same one ?!

Good to see it tracked down (what was beyond my technical ablities, as I must confess).


vfb November 30th, 2007 11:51 AM

Re: The scale bug is caused by province neighbors
 
Well, when I was reading about the scales bug, I kind of had a couple of ideas, and I got curious, and I fired up the debugger, and then it was all reminiscent of life several years ago and I kind of got swept up in the whole thing and got a wee bit compulsive and couldn't stop until I figured it out. But I didn't actually ask anyone for permission to examine the object code. I'd hate to accidentally divulge any secrets of the game, and I could possibly spoil the fun of playing for myself too. So I don't think I'll jump in and look at host_spreaddominion() right at the moment.

But the idea of the "Ghost" province connections causing mysterious dominion spread is certainly possible. The "Ghost" province connections are definitely the cause of the scale bug when the scale bug occurs in a province with less than 7 real neighbors.

To avoid "Ghost" province connections, if you have been playing Dom3, do not create a new game without first exiting the application. Exiting to the main menu is insufficient, you need to close the program and start it again.

Edit: Oops, forgot to mention ... Arralen, that's great you figured out the cause too! I'm new to Dominions this year, so I wasn't around during the previous thread you linked to.


All times are GMT -4. The time now is 06:43 PM.

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