Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Tatjam's Map Viewer 0.0.2 (8th Feb) Cloud Shadows!  (Read 3118 times)

Tatjam

  • Bay Watcher
    • View Profile
Tatjam's Map Viewer 0.0.2 (8th Feb) Cloud Shadows!
« on: February 06, 2016, 07:58:46 pm »

Version 0.0.2, released 8th February 2016

This is a program that reads exported maps from legends and builds a nice looking map from them!

First of all, here are the links:
Download (Windows): https://github.com/tatjam/DFMapViewer/releases
Source: https://github.com/tatjam/DFMapViewer

I will provide a Linux build soon (hopefully). Code is portable so if anybody is willing to compile this for Mac, feel free to do so ;)

As an image is worth more than a thousand words, here are some screenshots:

Features:

- Creates a map pixel by pixel from exported legends maps
- Creates clouds from the rainfall map
- Allows taking screenshots of the whole map and clouds
- Allows moving and zooming around!
- Command line "interface"
- Cloud shadows
- Easily configurable

Stuff not yet done:


- Being able to see cities/structures
- Easy interface
- Better way to open maps
- Implement all biomes
- Better rivers and sea


It comes with a map included so you can run the program directly after downloading it!

Usage: (Instructions are in the program)
 
- Placing the maps into the program is not too easy, but you have instructions in the program for doing so
- Once you have placed the maps following the instructions you will be able to do stuff using these keys:
       
     - WASD: Move around
     - Q: Zoom out
     - E: Zoom in
     - SHIFT: Move faster
     - C: Toggle cloud display
     - V: Toggle cloud shadows
     - F5: Export map/clouds image


Known Issues:

- Some tundra biomes are not yet implemented (they display as forests)
- If you rescale the window, the view resets
- If you set the view to fill the whole screen the view behaves strangely

Credits:

- SFML, the graphics library I'm using
- Toady One, the great maker of Dwarf Fortress
- Microsoft, the C library for windows, Visual Studio, etc...

Visual Studio 2015 redistributables are included!

Tell me if you can't run it or if there is any issue!
« Last Edit: February 07, 2016, 05:55:43 pm by Tatjam »
Logged

ragundo

  • Bay Watcher
    • View Profile
Re: Tatjam's Map Viewer [0.0.1](7th February)
« Reply #1 on: February 07, 2016, 04:11:51 am »

Good work.

I want to do something similar (but in 3D) and adding names to everything (rivers, sites, bridges, etc).
In fact, I began using IDA to understand how DF export their maps.

I'm finishing developing a DFHack plugin that exports most legend mode maps as:
  • raw data or PNG
  • all maps export simultaneously (using threads)
  • works in any DF game mode : fortress, adventure or legends, provided a world is loaded.

I think you would like to use the raw data for your map, as it's not corrupted by the mix of colors from other things in the exported DF BMP.
One dataset for biomes, another for vegetation, another for elevation, rivers, temperature, etc

Greetings
Logged

Tatjam

  • Bay Watcher
    • View Profile
Re: Tatjam's Map Viewer [0.0.1](7th February)
« Reply #2 on: February 07, 2016, 05:48:17 pm »

Good work.

I want to do something similar (but in 3D) and adding names to everything (rivers, sites, bridges, etc).

...


It would be interesting, specially biome maps as there is no documentation anywhere about what color means what biome :)



I finished a new release, now it allows cloud shadows, and has a configuration interface!
The configuration file is located at 'Resource/config.txt'.

Will upload in a moment and update screenshots!
Logged

ragundo

  • Bay Watcher
    • View Profile
Re: Tatjam's Map Viewer 0.0.2 (8th Feb) Cloud Shadows!
« Reply #3 on: February 08, 2016, 02:50:58 am »

About biome colors

Code: [Select]
RGB_from_biome_type(int biome_type)
{
  unsigned char r = -1;
  unsigned char g = -1;
  unsigned char b = -1;

  // The following biome types are not processed
  // POOL_TEMPERATE_FRESHWATER
  // POOL_TEMPERATE_BRACKISHWATER
  // POOL_TEMPERATE_SALTWATER
  // POOL_TROPICAL_FRESHWATER
  // POOL_TROPICAL_BRACKISHWATER
  // POOL_TROPICAL_SALTWATER
  // SUBTERRANEAN_WATER
  // SUBTERRANEAN_CHASM
  // SUBTERRANEAN_LAVA

  switch (biome_type)
  {
    case 0:     // biome type MOUNTAIN
                r = 0x80; g = 0x80; b = 0x80; break;

    case 1:     // biome type GLACIER
                r = 0x40; g = 0xff; b = 0xff; break;

    case 2:     // biome type TUNDRA
                r = 0x80; g = 0xff; b = 0xff; break;

    case 3:     // biome type SWAMP_TEMPERATE_FRESHWATER
                r = 0x60; g = 0xc0; b = 0x80; break;

    case 4:     // biome type SWAMP_TEMPERATE_SALTWATER
                r = 0x40; g = 0xc0; b = 0x80; break;

    case 5:     // biome type MARSH_TEMPERATE_FRESWATER
                r = 0x60; g = 0xff; b = 0x80; break;   

    case 6:     // biome type MARSH_TEMPERATE_SALTWATER
                r = 0x40; g = 0xff; b = 0x80; break;   

    case 7:     // biome type SWAMP_TROPICAL_FRESHWATER
                r = 0x60; g = 0xc0; b = 0x40; break;   

    case 8:     // biome type SWAMP_TROPICAL_SALTWATER
                r = 0x40; g = 0xc0; b = 0x40; break;

    case 9:     // biome type SWAMP_MANGROVE
                r = 0x40; g = 0xff; b = 0x60; break;       

    case 10:    // biome type MARSH_TROPICAL_FRESHWATER
                r = 0x60; g = 0xff; b = 0x40; break;       

    case 11:    // biome type MARSH_TROPICAL_SALTWATER
                r = 0x40; g = 0xff; b = 0x40; break;       

    case 12:    // FOREST_TAIGA
                r = 0x00; g = 0x60; b = 0x40; break;       

    case 13:    // FOREST_TEMPERATE_CONIFER
                r = 0x00; g = 0x60; b = 0x20; break;           

    case 14:    // FOREST_TEMPERATE_BROADLEAF
                r = 0x00; g = 0xa0; b = 0x20; break;           

    case 15:    // FOREST_TROPICAL_CONIFER
                r = 0x00; g = 0x60; b = 0x00; break;           

    case 16:    // FOREST_TROPICAL_DRY_BROADLEAF
                r = 0x00; g = 0x80; b = 0x00; break;               

    case 17:    // FOREST_TROPICAL_MOIST_BROADLEAF
                r = 0x00; g = 0xa0; b = 0x00; break;           

    case 18:    // GRASSLAND_TEMPERATE
                r = 0x00; g = 0xff; b = 0x20; break;               

    case 19:    // SAVANNA_TEMPERATE
                r = 0x00; g = 0xe0; b = 0x20; break;               

    case 20:    // SHRUBLAND_TEMPERATE
                r = 0x00; g = 0xc0; b = 0x20; break;               

    case 21:    // GRASSLAND_TROPICAL
                r = 0xff; g = 0xa0; b = 0x00; break;               

    case 22:    // SAVANNA_TROPICAL
                r = 0xff; g = 0xb0; b = 0x00; break;                   

    case 23:    // SHRUBLAND_TROPICAL
                r = 0xff; g = 0xc0; b = 0x00; break;                   

    case 24:    // DESERT_BADLAND
                r = 0xff; g = 0x60; b = 0x20; break;                   

    case 25:    // DESERT_ROCK
                r = 0xff; g = 0x80; b = 0x40; break;                   

    case 26:    // DESERT_SAND
                r = 0xff; g = 0xff; b = 0x00; break;                       

    case 27:    // OCEAN_TROPICAL
                r = 0x00; g = 0x00; b = 0xff; break;

    case 28:    // OCEAN_TEMPERATE
                r = 0x00; g = 0x80; b = 0xff; break;

    case 29:    // OCEAN_ARCTIC
                r = 0x00; g = 0xff; b = 0xff; break;

    case 36:    // LAKE_TEMPERATE_FRESHWATER
                r = 0x00; g = 0xe0; b = 0xff; break;

    case 37:    // LAKE_TEMPERATE_BRACKISH_WATER
                r = 0x00; g = 0xc0; b = 0xff; break;

    case 38:    // LAKE_TEMPERATE_SALTWATER
                r = 0x00; g = 0xa0; b = 0xff; break;   

    case 39:    // LAKE_TROPICAL_FRESHWATER
                r = 0x00; g = 0x60; b = 0xff; break;   

    case 40:    // LAKE_TROPICAL_BRACKISH_WATER
                r = 0x00; g = 0x40; b = 0xff; break;   

    case 41:    // LAKE_TROPICAL_SALT_WATER
                r = 0x00; g = 0x20; b = 0xff; break;       

Hope that this helps you.
Logged