Topic: Probability Drive
toptopple Topic Opener |
Posted at: 2016-05-27, 08:03
I want to get rid of an idea concerning the foresters and perhaps also the geologists. The idea is to introduce probability to the choice of work targets. This goes like this; The forester has an area of the map to work on and the walk distance to his next target location can be measured, e.g. from 1 to 10. The choice for the next target is taken randomly. But, and this would be new, the choice undergoes a dropping probability. When dropping occurs, a new choice is selected (randomly). The drop probability is a value associated with the target or walking distance, and e.g. may range from 0 at distance 1 until 70 at maximum distance. The proposed measures make the work behaviour of those workers who have to select a target location appear more natural. It also makes more sense in gameplay as the result of a worker's work (e.g. geologist) is more predictable. In my eyes this clearly improves the game and seems not very difficult to implement. Cheers! Top Quote |
kaputtnik |
Posted at: 2016-05-27, 18:59
Sorry, but i don't understand what your proposing. What do you mean with:
Why is it now unnatural? The only thing i am stumbled of these days is that the geologist doesn't look for resources in the closest spots nearby the flag where he starts to search for resources. Fight simulator for Widelands: |
toptopple Topic Opener |
Posted at: 2016-05-27, 22:37
Ok, I have to explain The result of my proposed changes were, plainly expressed, that the worker under the probability profile would more often choose locations near his hut or staring location than those very far away. "Natural" because no reasonable worker would run from one end of the field to the other for each step to take, self-understanding, but take the nearer locations next. One of the effects is that work is done more efficiently, so through-put is rising for the forester, e.g., also for the the geologist. Second effect is that work results of these workers starts forming a shape, namely concentric circles. How strong this effect comes to life depends on how "steep" or "flat" the probability profile is set. With the work forming a shape it is, e.g., less expensive for the player to put a forester in a corner which is nearer to a mountain. Try it out an see if you like it! Top Quote |
king_of_nowhere |
Posted at: 2016-05-28, 09:51
I know that the algorithm should be random, but i often see foresters surrounded by trees, with less trees at higher distances. I wonder if some snag in the code is already creating a similar effect, or if it is only a mix of coincidence and confirmation bias on my part. But really, the difference should be small enough to be virtually unnoticeable. Top Quote |
GunChleoc |
Posted at: 2016-05-29, 11:05
I noticed this with the geologists too - it would ineed be nice of closer spots had a higher probability to be targeted by a worker than sports further away. Busy indexing nil values Top Quote |
Tibor |
Posted at: 2016-05-29, 20:17
Mathematically, if picking random spot within radius r, average of all spots within that radius is about 0.7r. I mean half of them is closer then 0.7r, and second half is farer than 0.7r. Am I right? Top Quote |
DragonAtma |
Posted at: 2016-05-29, 23:55
Area of a circle is pi*r*r.
Top Quote |
king_of_nowhere |
Posted at: 2016-05-30, 00:50
works with a circle, not sure about a hexagonal grid. let's try to calculate:
ok, it's radius * 3. A circle of radius 10 would have a total of 1 + 1 * 6 + 2 * 6 + 3 * 6 + ... + 10 * 6 = 1 + (55 * 6) = 331 corners. Those outside a radius of 7 are (10 + 9 + * 6 = 27 * 6 = 162. Yeah, it does work pretty well even if an hexagonal grid has not the same properties of the geometrical plane. So with a random picking half the times the worker will to to a field in the 30% more distant area. Suppose we decrease the chance of being picked by 10% for every step away - but never lower than 0.1 to avoid problems with 0 probability.
Nice inversion of numbers we have there, but i see that every radius between 2 and 7 has a very similar probability. Could be good. EDIT: or maybe it would be simpler to have the worker first pick a radius, then pick a spot with that radius, so all radii would have equivalent probability of being picked. Edited: 2016-05-30, 00:53
Top Quote |
GunChleoc |
Posted at: 2016-05-30, 09:00
2 notes:
Busy indexing nil values Top Quote |
toptopple Topic Opener |
Posted at: 2016-05-30, 16:19
Algorithmical, I suggest to keep what is already there - if it is any good - and only plant the dropping mechanism on top. So it's more easy to do a negative work here instead of a positive How a dropping probability translates into a selection probability, I don't know. But I think practice will do the better job anyhow in setting up the values. You have to keep in mind that the "full house" problem must be avoided, i.e. in case there is no working slot available at all, the algorithm must fade. If the dropping is placed on top of the primary selection, this problem should be done already. For security you could run a loop counter and break the procedure when hit a limit. Nice table of P-values there! For distances 1 and 2 the dropping probability could be 0 (which means the selection maintained 100%). This adds a bit to their stance. Cheers! Top Quote |