# Build #251

Build #251 is up - A small but important update since it fixes the ongoing issue of the area production bonus.

The problem was that it was basically not calculating the area correctly. Or rather, it was correct in theory, but failed in the real world because computers suck at numbers. Maybe an explanation is in order :)

The land areas in DR9 are built from connected cells in a Voronoi map - they have the nice attribute of being convex polygons so you can find their area by calculating the determinant of the polygons vertices. This mean cross multiplying coordinates and alternately adding and subtracting the result.

The problem we ran into is that the DR9 map is big, so coordinate values are also big. When you multiply big numbers on a computer, you lose precision. This is mostly acceptable because when you're dealing with large numbers (or areas in our case), it doesn't matter if you're a few decimals off. It *does* matter if you're trying to calculate a tiny area far away from the origin (0,0) since you'll get a major bias in the average error away from the center, yielding an area that is way too big.

The simple solution is to transform the polygon so that it is centered around the origin *before* calculating the area. This way you get an even bias in all directions and an accurate(ish) area.

Not sure why it took so long to figure this out, but it's what happens when you do a small scale test and everything looks fine.

## Files

**deep-rift-9-win.zip**386 MB

**deep-rift-9-mac.zip**399 MB

## Get Deep Rift 9

### Deep Rift 9

Multiplayer strategy gaming on the alien world of Deep Rift 9

Status | In development |

Author | Norsedale |

Genre | Strategy |

Tags | 3D, Massively multiplayer, Sci-fi, Unity |

Languages | English |

### More posts

- Build #248Mar 21, 2021
- Build #241 and a lesson about temporary filesFeb 26, 2021
- Build #235 Test NightFeb 18, 2021
- Build #232 Battle Sound EffectsFeb 17, 2021
- Build #228Feb 15, 2021
- Build #226 Lots of tiny fixesFeb 13, 2021
- Build #227Feb 13, 2021
- Build #224Feb 07, 2021
- Build #222 Chat, Tutorial Character and Animated Army MarkerJan 25, 2021

## Leave a comment

Log in with itch.io to leave a comment.