1
0
Fork 0
Commit Graph

121 Commits (ee45c8ec1d75e67466cf70e9d732eea8841f9c75)

Author SHA1 Message Date
Jonathan G Rennison d06b371254 Cleanup: Fix various spelling errors 2025-02-12 22:44:51 +01:00
Peter Nelson 588597805d
Feature: Place rocks on "too steep" tiles when fixing slopes. (#13462)
When generating maps or loading heightmaps, the terrain height is altered to prevent slopes that can't be represented.

During this, there is now a chance of these tiles being turned into a rocky tile.

Chance of placing rocks is based on the height. This gives a rocky mountain appearance without affecting all peaks.
2025-02-09 18:37:25 +00:00
SamuXarick adc79aca09
Codechange: Refactor AllocHeightMap to return void since it always returns true (#13379) 2025-02-04 18:52:52 +00:00
Peter Nelson 59354576d4
Codechange: Use EnumBitSet for LandscapeTypes and remove LandscapeID. (#13436) 2025-02-01 23:09:18 +00:00
Peter Nelson 2560339472 Codechange: Use EnumBitSet for Border(Flag)s. 2025-01-29 21:46:39 +00:00
Peter Nelson 3a50b24a8d
Codechange: Replace macros in TGP. (#13346)
Remove use of Amplitude as a percentage.
2025-01-22 07:27:41 +00:00
SamuXarick 05b9b8765c
Codefix 60d0d7b: Incorrect variable in TGP noise calculation (#13350) 2025-01-21 16:41:38 +00:00
SamuXarick 60d0d7b8b2 Codechange: Lowercase variable names and use _ separator 2025-01-20 21:41:03 +01:00
SamuXarick 62002c6eae Doc: Standardize map size notation and multiply operator 2025-01-20 21:40:49 +01:00
SamuXarick 9bf882b3f7 Doc: Change MapSize to Map::Size 2025-01-20 21:40:49 +01:00
SamuXarick 9a3b656a62
Codechange: Capitalise static consts (#13342) 2025-01-19 23:58:21 +00:00
Peter Nelson ce4012b7c7
Codechange: Use enum class for Borders values. (#13290)
This makes water border settings type-safe, and avoids mixing bit numbers with masks.
2025-01-08 17:55:53 +00:00
Peter Nelson 0e13a7d124
Fix 3f81124: Invalid data used for height map curves after first run. (#13039)
Static variable depended on other non-static variables.
2024-10-28 23:18:05 +00:00
Rubidium 4a6ac52d8c Cleanup: remove some unused #defines 2024-10-14 21:37:00 +02:00
Peter Nelson 4224d08e72 Codechange: Replace malloc/free with vector for TGP heightmap processing. 2024-08-20 22:15:30 +01:00
Rubidium 0fdabca605 Codechange: use std::span instead of custom span in TGP 2024-04-26 06:15:29 +02:00
Rubidium b2218e75d4 Codefix: missing space between close parenthesis and open curly brace 2024-04-16 19:28:09 +02:00
Patric Stout a3cfd23cf9
Codechange: rename byte to uint8_t (#12308) 2024-03-16 23:59:32 +01:00
frosch b6c8f301be Codechange: Silence warnings about intentionally unused parameters. 2023-09-19 22:49:59 +02:00
Rubidium eaae0bb5e7 Codechange: automatic adding of _t to (u)int types, and WChar to char32_t
for i in `find src -type f|grep -v 3rdparty/fmt|grep -v 3rdparty/catch2|grep -v 3rdparty/opengl|grep -v stdafx.h`; do sed 's/uint16& /uint16 \&/g;s/int8\([ >*),;[]\)/int8_t\1/g;s/int16\([ >*),;[]\)/int16_t\1/g;s/int32\([ >*),;[]\)/int32_t\1/g;s/int64\([ >*),;[]\)/int64_t\1/g;s/ uint32(/ uint32_t(/g;s/_uint8_t/_uint8/;s/Uint8_t/Uint8/;s/ft_int64_t/ft_int64/g;s/uint64$/uint64_t/;s/WChar/char32_t/g;s/char32_t char32_t/char32_t WChar/' -i $i; done
2023-07-19 19:30:14 +02:00
PeterN d086f288cd
Codechange: Remove duplicated includes. (#10888)
These are now included by stdafx.h so don't need to be included again.
2023-05-29 14:29:00 +01:00
Rubidium 4a5a9f57c4 Fix: conversion to smaller type warnings 2023-05-06 21:26:13 +02:00
Peter Nelson c3cea45ebc Codechange: Rename height_t/amplitude_t to Height/Amplitude. 2023-04-24 09:17:37 +01:00
Peter Nelson 3f811246b1 Codechange: Rename control_point_t to ControlPoint.
The _t suffix is reserved by POSIX 1003.1.
2023-04-24 09:17:37 +01:00
Charles Pigott b282664242 Codechange: Replace all usages of alloca/AllocaM with more modern/less discouraged alternatives 2023-04-15 16:57:00 +01:00
Rubidium fe2bcd2a58 Codechange: migrate size related functions to Map structure 2023-01-21 17:11:40 +01:00
Patric Stout 1fb101eabb
Codechange: address CodeQL issue "Multiplication result converted to larger type" (#10306)
Most are very unlikely to ever be triggered in our codebase; two
stand out: linkgraph and money cheat. Those, potentially, could
wrap earlier than expected.
2023-01-02 20:30:02 +00:00
glx22 87eb997be0 Codechange: Remove FOR_ALL_TILES_IN_HEIGHT 2021-07-09 21:36:09 +02:00
Patric Stout 28e90769f7 Codechange: use "[[maybe_unused]]" instead of a wide variety of other ways we had
While at it, replace OTTD_ASSERT with WITH_ASSERT, as this
is always set if assert() is valid. No matter if NDEBUG is set
or not.
2021-06-03 17:30:00 +02:00
Charles Pigott dd798d688b
Fix #8919: Release builds with asserts enabled (#8925) 2021-04-01 23:57:49 +01:00
Patric Stout fece1c57ca
Codechange: Suppress warnings when asserts are disabled (#8917) 2021-04-01 11:16:19 +02:00
Patric Stout f05e2e0d40 Feature: allow setting a custom terrain type to define highest peak
At least, TGP will try to reach it. It heavily depends on the map
if it is reachable at all. But for sure it will do its atmost to
get there!
2021-03-26 12:22:32 +01:00
Patric Stout 422e132845 Feature: auto-detect map height limit based on generated map
This opens up the true power of the TGP terrain generator, as it
is no longer constrainted by an arbitrary low map height limit,
especially for extreme terrain types.

In other words: on a 1kx1k map with "Alpinist" terrain type, the
map is now really hilly with default settings.

People can still manually limit the map height if they so wish,
and after the terrain generation the limit is stored in the
savegame as if the user set it.

Cheats still allow you to change this value.
2021-03-26 12:22:32 +01:00
Patric Stout 1a1049bc0d Change: rename setting "max_heightlevel" to "map_height_limit"
This better reflects what it is, and hopefully removes a bit of
the confusion people are having what this setting actually does.

Additionally, update the text on the setting to better inform
users what it is doing exactly, so they can make an educated
decision on how to change it.

Next commit will introduce an "auto" value, which should be the
new default. The rename has as added benefit that everyone will
start out on the "auto" value.
2021-03-26 12:22:32 +01:00
Patric Stout 70bc55cfd6 Feature: setting to indicate desert coverage for tropic climate
This is an indication value; the game tries to get as close as it
can, but due to the complex tropic rules, that is unlikely to be
exact.

In the end, it picks a height-level to base the desert/tropic
line on. This is strictly seen not needed, as we can convert any
tile to either. But it is the simplest way to get started with
this without redoing all related functions.
2021-03-26 12:22:32 +01:00
Patric Stout cafe4eed6e Feature: setting to indicate snow coverage for arctic climate (replaces snow line height)
Setting the snow coverage (in % of the map) makes a lot more sense
to the human, while still allowing the niche player to set (by
finding the correct %) a snow line height they like. This makes for
easier defaults, as it decoupled terrain height from amount of snow.

Maps can never be 100% snow, as we do not have sprites for coastal
tiles.

Internally, this calculates the best snow line height to approach
this coverage as close as possible.
2021-03-26 12:22:32 +01:00
Patric Stout 7463c46a54
Fix: for arctic and tropic, make sure we have at least a few hills (#8513)
Without hills, not all industries can be generated, which means
that with a default configuration you get errors. This is far from
optimal, of course.

This now forces that there is at least some hills, even when you
are using very-flat. This is a stopgap solution, but a proper
solution requires a full rewrite of the terrain generator, which
is not a 2 minute (or even 2 week) job.

To make sure flat is still flat-ish, reduce the default
snow-line-height to 10, making it look a lot better on smaller maps.
This is a compromise between being able to have flat maps and
still having all industries on arctic.
2021-01-08 12:02:38 +01:00
Charles Pigott 9b800a96ed
Codechange: Remove min/max functions in favour of STL variants (#8502) 2021-01-08 11:16:18 +01:00
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 2019-11-10 17:59:20 +00:00
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 2019-04-10 23:22:20 +02:00
Gabda 37bb2c9308 Codechange: Make the style of MakeVoid calls uniform (#7192) 2019-02-08 23:05:25 +00:00
nikolas d8ccad91f9 Fix: Some code and comment typos
Found with codespell
2019-01-17 22:01:07 +00:00
frosch d77935f788 (svn r27334) -Revert (r27232) [FS#6342]: No idea what the plan was, but making the main noise coefficients the same for all smoothness types certainly wasn't. 2015-07-16 17:05:40 +00:00
frosch be0b22c9bc (svn r27331) -Cleanup (r26999): Make variety distribution curves more sane. 2015-07-11 11:18:24 +00:00
frosch a11ae39437 (svn r27330) -Fix [FS#6335]: Make variety distribution not assume that sea level is at height 0.2 / 3 * TGPGetMaxHeight(). 2015-07-11 10:46:25 +00:00
frosch b303ba7505 (svn r27329) -Fix: Add more height_t type-correctness to TGP code. 2015-07-11 10:43:34 +00:00
frosch 8437726cca (svn r27328) -Codechange: Add an assertion to check for uninitialised variables when tracing variety distribution's control curves. 2015-07-11 10:41:20 +00:00
alberth 262c3c93c8 (svn r27232) -Fix: Tweak noise generator more precisely for different map sizes (chillcore) 2015-04-11 18:46:01 +00:00
alberth 9db21f6489 (svn r27230) -Fix: Tune down terrain generation to reduce amount of long slopes (chillcore) 2015-04-11 18:44:26 +00:00
alberth f29842316e (svn r27229) -Change: Generate more detailed curves at the coast (chillcore) 2015-04-11 18:43:30 +00:00