Project

General

Profile

Bug #767003

mapgen.c's mountain_pct may decrease as steepness highly increases

Added by Akechi . almost 2 years ago. Updated 7 months ago.

Status:
Closed
Priority:
Low
Category:
Server
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:

Description

It maybe a small? problem when do make_island and map generator is island or fair.
e.g. In classic ruleset with default server settings except minplayer = 0 and generator = island (54x72 map, steepness stays 30), mountain_pct is 19% (desert, forest, jungle, swamp_pct is 7, 17, 2, 6).
When steepness = 61, mountain_pct is 26% (desert, forest, jungle, swamp_pct is lowered to 4, 12, 1, 4, because value factor is lowered).
When steepness = 100, mountain_pct is 15% (desert, forest, jungle, swamp_pct is 1, 4, 0, 1, so grassland / plains / tundra is placed instead).

(server/generator/mapgen.c adjust_terrain_param)

  int polar = 2 * ICE_BASE_LEVEL * game.map.server.landpercent / MAX_COLATITUDE;
  float factor = (100.0 - polar - game.map.server.steepness * 0.8 ) / 10000;

  mountain_pct = factor * game.map.server.steepness * 90;

History

#1 Updated by Jacob Nevins 7 months ago

  • Target version changed from 2.6.1 to 2.6.2

#2 Updated by Marko Lindqvist 7 months ago

So, ignoring 'polar' and constant factors, it's (100 - 0.8 * s) * s -> (100 * s) - (0.8 * s^2). Definitely not healthy looking formula!

#4 Updated by Marko Lindqvist 7 months ago

  • Status changed from Resolved to In Progress

The reduction from 'factor' should be divided by 10000.

#7 Updated by Marko Lindqvist 7 months ago

Undecided about targeting this to S2_6. Fixing it for the steepness setting to work more logically would be good for new users, but do we want to disrupt it for those users who have already found suitable value for themselves?

#8 Updated by Marko Lindqvist 7 months ago

  • Status changed from Resolved to In Progress

I will rework the patch to reduce amount of integer math rounding.

#9 Updated by Marko Lindqvist 7 months ago

Marko Lindqvist wrote:

I will rework the patch to reduce amount of integer math rounding.

S2_6 version

#11 Updated by Marko Lindqvist 7 months ago

  • Status changed from Resolved to Closed
  • Assignee set to Marko Lindqvist

Also available in: Atom PDF