Git Product home page Git Product logo

timberbornterraingenerator's Introduction

Random map generator

A work in progress project for generating random maps for the game video game Timberborn. Minimum supported map size is 32x32, maximum is 384x384. All maps are squares and the Y parameter on "new map" is used as a seed. If the Y parameter is the same as x, it is completely random and unseeded from the user. It once used several open source projects, including the works of Caps_Errors (initial python code), reddit user u/savanik (updated with river handling), MSterczewski (some plugin modeling), but as of the C# rewrite (version 0.9.0 release) the plugin is completely comprised of independent code, other than the use of one OSS C# noise library, known as FastNoiseLite. FastNoise is very fast at producing noise, and well, it was helpful.

It used to be that if you were on a Mac, Python was needed for this thing to work. That is no longer the case. This is now a pure C# plugin with the only dependencies being it, the game, Bepinex, and TimberAPI.

Generating a map

Generating a map is simple! Install the plugin, and generate a new map! Be aware all maps will be square due a (hopefully temporary) limitation of the generator, and all maps generated will by default use the settings profile in settings.ini, codenamed "PlentifulPlains." They are a good starting point but other map types and presets are possible with all the options. Please look in the included ini files for examples (such as HardyHills, our other "hard mode" preset), and if you want to use them, just copy and paste the values into the actual settings.ini. You can also edit the values individually. If you want to do that, you'll probably want to look at the settings readme here: https://github.com/R-T-B/TimberbornTerrainGenerator/blob/main/SettingsReadme.md

Once the map is generated, feel free to run the water sim, drop a starting location somewhere nice, and load in. That's really all there is to it, and most of the maps it makes are playable (at least on the presets, especially on PlentifulPlains). though you may want to generate a few times to "optimze" your start. I won't judge you... heh.

Performance

A word about performance... The C# version we just realeased as of version 0.9.0 is both massively more powerful and more flexible... and massively slower than the python script version that preceeded it. This isn't due to the language. Frankly, python is slow, and the script had no business being that fast. The reason it was that fast was only because it was a list of hardcoded assumptions and as such, did almost no thinking. This obviously made customizing map parameters hard however, and the C# version is the infinitely better way forward. But yes, when you click to generate your map, be advised it MAY APPEAR FROZEN for a bit. This is normal! Some numbers on expected load times, on PCs ranging from Supreme to Potato, is available here: https://github.com/R-T-B/TimberbornTerrainGenerator/blob/main/timings.md

That said yes we consider performance a priority issue. See this ticket: #3

As of December 2022, we consider the performance issue solved.

Installation

In order to install the mod follow the instructions from BepInEx website: https://docs.bepinex.dev/articles/user_guide/installation/index.html

As of 08/24/2022, we no longer track releases beyond two major subversions back in the main readme. See the elder release notes here: https://github.com/R-T-B/TimberbornTerrainGenerator/blob/main/HistoricalReleases.md

Changelog:

v1.6.0: Fix river sloping (again, doh!) and improve water source block placement.

v1.6.1: Add (very primitive) profile exporting/importing support. A better GUI is coming soon.

v1.6.2: Fix stock map settings GUI not retaining settings on a mod update. They will now stay going forward.

v1.6.3: Better load/save GUI. It's still a little ugly duckling but now much more functional, at least. Enjoy!

v1.6.4: Some GUI hardlock bugfixes.

v1.7.0: Basic Alpha 0.4.0 support. Not retro-compatible, seed compatible, or profile compatible. Please delete BepInEx\config\TimberbornTerrainGenerator folder when upgrading.

v1.7.1: Improvements to rivermap flooring logic.

v1.7.2: Moved user configs to Timberborn documents folder, will be automigrated.

v.1.8.1: Basic Badwater update support.

Feedback

If you have any feedback, please reach out to me at github or on Timberborn Discord in the modding channel.

Authors

R-T-B

timberbornterraingenerator's People

Contributors

r-t-b avatar pmduda avatar

Stargazers

Takuya Shiraishi avatar

Watchers

 avatar  avatar  avatar

Forkers

hytonhan aperion

timberbornterraingenerator's Issues

Program crash when trying to create new map

v0.2.4.1-9edd51d-xsw
Win32Exception: ApplicationName='C:\Users\User\AppData\Roaming\Thunderstore Mod Manager\DataFolder\Timberborn\profiles\Default\BepInEx\plugins\RTB-TimberbornTerrainGenerator/dist/terrainGenerator.exe', CommandLine='128 128', CurrentDirectory='C:\Users\User\AppData\Roaming\Thunderstore Mod Manager\DataFolder\Timberborn\profiles\Default\BepInEx\plugins\RTB-TimberbornTerrainGenerator/dist/', Native error= The system cannot find the file specified.

Map scaling (scale existing maps)

This is a long term stretch goal, but it'd be very cool if we could scale the features on existing maps, like resizing an image. (128x128 to 256x256, or 256x256 to 128x128, etc).

A few `suggestions` abut the mod.

It would be nice if we had a few settings, to generate a more specific map more easily:

  • Number of rivers.
  • Number of water sources (in total).
  • Height contrast. (Look at the map ViperHead, for example. I attached a modified version with underground ruins added.)
  • Starting Point distance from the water source.
  • Starting Point distance from water.

256x256 Viperhead Canyon (v1) withMine.zip

Localization

We should support this properly, not just forcing english and hacking our way around euro decimals (as we presently do as of v1.0.5).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.