Border growth: the real story (part 1)

Anything Reus-related that doesn't fit the other forums.

Border growth: the real story (part 1)

Postby yatima2975 » Fri May 31, 2013 12:42 am

I've mostly figured out how border growth works, at least in the absence of danger. TL;DR: it's cheaper to expand to tiles which are
  • close to the center of the village,
  • of the same type as the village,
  • without danger,
  • not on a mountain and
  • with a danger-less animal or plant resource on them.
The last one surprised me a bit, I didn't know that! It also doesn't matter how well your village is doing, contrary to popular belief.

In the process, I've written a standalone (but slightly tricky to get running) program which you can use to set up a planet, populate it with resources, plonk down a civilization and let the game run for as long as you want without actually playing the game. Spoiler: it takes 43 hours, 49 minutes and 40 seconds for a village to grow to encompass an entire forest world, if the only resources are within the initial borders and there are no oceans :-) Filling the world with the pattern Superior Blueberry/Sup. StrawBerry/Sup. Blueberry speeds this up to 37 hours and a bit. The best you can hope for, under absurdly optimal conditions, in 2 hours is a city 27 squares large.

I'll only explain what I discovered here, the program (such as it is) can be found here, but I won't help you set up Visual Studio :-)


Anyway, on to the juicy details!
(I'm going to assume the danger levels are either tranquil or the first level, otherwise borders could theoretically shrink, and that makes the explanation more difficult. In normal play this should most often be the case)

A village has so-called 'reach points', these get increased every 5 seconds by 0.025 points (so a full point every 200 seconds). Also every 5 seconds, a village checks to see whether it can expand its borders. Each new tile has a buy cost, and if a village has enough reach points, it gets the tile (with a slight preference for expanding to the left - but I'm sure which that direction that actually is!). If it can't afford either tile, it just keeps accumulating reach points, so that when a bottled up village has one of it's neighbours destroyed, it can expand quickly.

Therefore, the most important thing is to figure out the buy cost of any neighbouring tile. Once you have that number, you can multiply by 200 seconds and you will know how long it takes to add that tile to the village.

The buy cost is computed as a product of two numbers, a bonus and a penalty.

The bonus starts at 1, is decreased by 0.3 if the tile has the same type as the village, and furthermore by 0.1 if the new tile has a plant or animal on it without any danger. Only stuff planted by the giants count, by the way.

The penalty starts at 0, is increased most importantly by 0.5 times the distance from the village (where I think the first tiles outside a new village count as 2 units away, i.e. count the number of tiles between the tile and the edge of the village). Then it is increased by 0.1 times the danger on the tile, and finally it is increased by 0.5 if the new tile is on a mountain. (Note that this means that it doesn't matter if you're growing your swamp village into a forest or an ocean!).

So in a formula:
Code: Select all
time to acquire tile = 200seconds * [1 - (0.3 if same type) - (0.1 if dangerless plant or animal)] * (0.5 * distance + 0.1 * danger on tile + (0.5 if mountain)


This means, for instance, that it would take 140 seconds for the first two border expansions, if they are towards the same ground type, or even 120 seconds if there is something on the tile that's expanded towards. The next two will take 210/180 seconds. An ocean village will expand in 200 seconds towards an unoccupied tile. This might be interesting for the mackerel people: first let the border expand cheaply overland, then dig an ocean - at least one border pop will come more quickly!

Any questions? I'll go playtest now, see how my predictions turn out :-)
yatima2975
 
Posts: 32
Joined: Mon May 20, 2013 11:18 pm

Re: Border growth: the real story (part 1)

Postby Sonzaisuru » Fri May 31, 2013 3:11 am

Thanks for the info. Nice job figuring it out. I just started playing and that was one of the things that was bothering me.
Sonzaisuru
 
Posts: 2
Joined: Fri May 31, 2013 3:04 am

Re: Border growth: the real story (part 1)

Postby VDZ » Fri May 31, 2013 3:21 am

Thanks for the detailed explanation.

yatima2975 wrote:The bonus starts at 1, is decreased by 0.3 if the tile has the same type as the village, and furthermore by 0.1 if the new tile has a plant or animal on it without any danger. Only stuff planted by the giants count, by the way.


Do I understand correctly, that:

You get a 0.1 reduction if:
-There is a plant on the target tile
-There is a non-dangerous animal on the target tile (as opposed to *there not being any danger on the target tile*)

You do not get a 0.1 reduction if:
-There is nothing on the target tile
-There is a mineral on the target tile
-There is a dangerous animal on the target tile

Is this correct?
User avatar
VDZ
 
Posts: 31
Joined: Wed May 22, 2013 8:27 am

Re: Border growth: the real story (part 1)

Postby yatima2975 » Sat Jun 01, 2013 11:24 pm

VDZ wrote:Thanks for the detailed explanation.

yatima2975 wrote:The bonus starts at 1, is decreased by 0.3 if the tile has the same type as the village, and furthermore by 0.1 if the new tile has a plant or animal on it without any danger. Only stuff planted by the giants count, by the way.


Do I understand correctly, that:

You get a 0.1 reduction if:
-There is a plant on the target tile
-There is a non-dangerous animal on the target tile (as opposed to *there not being any danger on the target tile*)

You do not get a 0.1 reduction if:
-There is nothing on the target tile
-There is a mineral on the target tile
-There is a dangerous animal on the target tile

Is this correct?


Yup, that's right. In fact, it only matters whether the animal is innately dangerous, i.e. if the animal without any aspects generates danger; so Predator and Hunt aspects don't count. As of 1.1.0.0, it's Boar, Fox, Wolf, Coyote, Rattlesnake, Komodo Dragon, Crocodile, Snow Leopard, and White Shark that slow down growth relative to other animals and plants (for some reason, the code checks if the plant is dangerous too, though there are no dangerous plants at the moment :-)
yatima2975
 
Posts: 32
Joined: Mon May 20, 2013 11:18 pm

Re: Border growth: the real story (part 1)

Postby Kalil » Sun Jun 02, 2013 7:16 am

Thank you very much for figuring this out!
It looks like I /was/ actually on the right track in asserting that growth was independent of prosperity.
So sounds like the 'fastest' way to grow a village would be a 100% desert map, covered in shrubs - the shrubs don't attract nomads, but should still accelerate growth.
Kalil
 
Posts: 45
Joined: Wed May 22, 2013 6:22 am

Re: Border growth: the real story (part 1)

Postby yatima2975 » Sun Jun 02, 2013 11:50 am

Kalil wrote:Thank you very much for figuring this out!
It looks like I /was/ actually on the right track in asserting that growth was independent of prosperity.
So sounds like the 'fastest' way to grow a village would be a 100% desert map, covered in shrubs - the shrubs don't attract nomads, but should still accelerate growth.


Indeed, it doesn't matter how much food a plant provides. Running my experiment with a desert world full of normal shrub yielded the following results:
  • The first two border expansions happen after 120 seconds, then the next two after 180, then two after 240, and so on - modulo some rounding errors.
  • The biggest village you can get this way in 30 minutes is 16 squares: 8 expansions take 2*(2+3+4+5) = 28 minutes.
  • In 60 minutes you can get to 20 squares. The difference here is surprisingly small! 2*(2+3+4+5+6+7) = 54 minutes, the next expansion would happen at 62 minutes.
  • In 120 minutes, the maximum size is 27. And that's cutting it close, the last expansion happens after 7140 seconds, so 60 seconds before the giants start falling asleep.

In freeplay, the (increasingly theoretical) milestones are:
  • you get to 30 squares in 154 minutes (2h34m),
  • to 33/34 (if you want 3 villages to use the entire world) in 3h14m/3h28m,
  • to 40 in 5 hours and 4 minutes,
  • to 50 in 8 hours and 24 minutes,
  • 12 hours gets you to 58 squares,
  • a full day(!) and 2 minutes to 81 squares,
  • and, finally, to 100 in 37 hours and 34 minutes.
I won't be checking those last predictions!
yatima2975
 
Posts: 32
Joined: Mon May 20, 2013 11:18 pm

Re: Border growth: the real story (part 1)

Postby TheGodfather » Sun Jun 02, 2013 12:47 pm

Awesome explanation! Anyone here who has 37h spare time to check it out in praxis? :D
I actually wonder: Is there (in the code) a maximum size of a village? Or could it really grow to the size of 100 tiles?
User avatar
TheGodfather
 
Posts: 83
Joined: Sat May 18, 2013 4:03 pm
Location: Vienna

Re: Border growth: the real story (part 1)

Postby yatima2975 » Sun Jun 02, 2013 1:38 pm

TheGodfather wrote:Awesome explanation! Anyone here who has 37h spare time to check it out in praxis? :D
I actually wonder: Is there (in the code) a maximum size of a village? Or could it really grow to the size of 100 tiles?


Well, my simulator doesn't have any problems with it, and that's using the real code for simulating growth. So my guess would be that it's indeed possible! You'd have to babysit the village until it has finished doing project upgrades (let's say for 3 hours), get rid of any other villages (you don't need ambassadors except to get the projects, some of those have requirements on other villages) and then you can go and have 68 cups of coffee (more than 2 cups per hour is bad for your health)!

The next thing I'm investigating is how quickly resource (food/wealth/tech) use can grow, and then I'm going to look more closely at greed and giant hunting.
yatima2975
 
Posts: 32
Joined: Mon May 20, 2013 11:18 pm

Re: Border growth: the real story (part 1)

Postby yatima2975 » Sun Jun 02, 2013 4:15 pm

I've just noticed that the cost for expanding into a mountain has gone down from 0.5 to 0.2 in going from patch 1.0.4.0 to 1.1.0.0; so the formula now reads

Code: Select all
time to acquire tile = 200seconds * [1 - (0.3 if same type) - (0.1 if dangerless plant or animal)] * [0.5 * distance + 0.1 * danger from tile + 0.2 if mountain]


This should make expanding into the mountains quite a bit quicker: if the village is surrounded by mountains the first expansion took 200*1.5 = 300 seconds, but that's now become 240 seconds. Nice! (if you like mountains, that is...)
yatima2975
 
Posts: 32
Joined: Mon May 20, 2013 11:18 pm

Re: Border growth: the real story (part 1)

Postby Touriste » Mon Aug 12, 2013 2:11 pm

Any chance for a "part 2" ? :D
User avatar
Touriste
 
Posts: 575
Joined: Mon May 20, 2013 2:20 am
Location: France, Ile de France

Next

Return to General