Code review comment for lp:~widelands-dev/widelands/terrain_affinity_as_int

Revision history for this message
Arty (artydent) wrote :

Yes, the exponential function is the problem. Approximating it with highish precision using only integer calculations would require a lot of computation, which isn't really feasible. There are reasonable options though if we don't mind straying a little. The function we use here is basically a three-dimensional Gauß-curve, and I think we could find an alternative that roughly preserves the shape and can be done with a small number of integer operations.
It's probably not necessary though, but if we keep getting desyncs because of such platform/compiler-dependent computation differences, this would provide an option.

I also replied to your replies.

« Back to merge proposal