Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Tom

58
Posts
14
Topics
35
Followers
2
Following
A member registered Jun 09, 2016 · View creator page →

Creator of

Recent community posts

It looks pretty nice. It would be even better if the PNGs were resized (or just added padding) to be power-of-two sizes. Unity, for example, won't apply the best compression unless images are pow2.

This has become an amazing little generator. Just brilliant!

Looks interesting. Any chance for a MacOS build ?

While I can see a few things in analytics, it is not a complete view. So post here which quests you managed to complete (no spoilers, please), where you are struggling, and what else you managed to do in the game.

Just released this into early access exclusively here on itch.io



Legacy is a roleplaying, adventure, visual novel mix. Heavy on conversation and focus on bringing NPCs alive, such as them gossiping behind your back and remembering if you were rude the last time, the game is about exploration and discovery. As the player, you can discover plenty of hidden options and paths, as the character you will discover your family's past.


The game is currently unfinished, a true early access, but playable. It is released for Mac, Windows and Linux.

More info and downloads are here: https://lemuriaorg.itch.io/dragon-eye-legacy

brilliant little game. one problem: I have a knight stuck on the edge of the map, not moving - and thus the map doesn't end. :-(

Ah yes. Yes, similar to MFCG. Azgaar's uses those permalinks, for example.

Your JSON isn't proper GeoJSON. Here's a PHP script to translate to GeoJSON:


<?php

/*
    when importing into QGIS, you want to simplify the linestring with a tolerance of about 0,00001 degrees
*/

if ($argc < 4 ) {
    exit( "Usage: place_village lat lon scale - with scale in s, m, l\n" );
}

$fp = fopen("php://stdin", "r") or die("cannot open stdin");
$lat = floatval($argv[1]);
$lon = floatval($argv[2]);

    // conversion:
    //   latitude = distance * 360 / (2*PI * 6400000)
    //   longitude = distance *360 * / (2*PI* cos(latitude) )
    switch ($argv[3]) {
        case 's':
        case 'm':
            $scale_lon = 0.5 * 360 / (2 * M_PI * 6400000); // for projection correction: ... 6400000 * cos($lat));
            $scale_lat = 0.5 * 360 / (2 * M_PI * 6400000);
            break;
        case 'l':
        default:
            exit("scale must be one of s, m, l - instead of '".$argv[3]."'\n");
    }

$input_data = file_get_contents("php://stdin");
$json = json_decode($input_data);

foreach ($json->features as &$feature) {
    if (isset($feature->coordinates)) foreach ($feature->coordinates as &$coordinate) {
        move_this($coordinate);
    }
    if (isset($feature->geometries)) foreach ($feature->geometries as &$geom) {
        if (isset($geom->coordinates)) foreach ($geom->coordinates as &$coordinate) {
            move_this($coordinate);
        }
    }
}

function move_this(&$coordinate) {
    if (is_array($coordinate[0])) {
        foreach ($coordinate as &$c) {
            move_this($c);
        }
    } else {
        global $lat, $lon, $scale_lat, $scale_lon;
        $coordinate[0] = floatval($coordinate[0]) * $scale_lon + $lon;
//        $coordinate[1] = -1 * floatval($coordinate[1]) + $y; // old pre-json-export files needed Y flipped
        $coordinate[1] = floatval($coordinate[1]) * $scale_lat + $lat;
    }
}

// now convert to GeoJSON
$new_features = array();
foreach ($json->features as &$feature) {

    if (isset($feature->coordinates) && $feature->id != "earth") {
        // buildings
        $coords = close_rings($feature->coordinates);
        $new_features[] = array("type"=>"Feature", "properties"=>array("id"=>$feature->id), "geometry"=>array("type"=>$feature->type, "coordinates"=>$coords));
    }

    if (isset($feature->geometries)) {
        // roads
        $coords = [];
        foreach ($feature->geometries as $geom) {
            $coords[] = $geom->coordinates;
        }
        // "type" is the GQIS road type string - here "local" for local roads
        $new_features[] = array("type"=>"Feature", "properties"=>array("id"=>$feature->id, "type"=>"local"), "geometry"=>array("type"=>"MultiLineString", "coordinates"=>$coords));
    }
}
$new_json = array("type"=>"FeatureCollection", "features"=>$new_features);

function close_rings($coordinates) {
    if (is_array($coordinates[0][0])) {
        $all = [];
        foreach ($coordinates as $c) {
            $all[] = close_rings($c);
        }
        return $all;
    } else {
        $coordinates[] = $coordinates[0];
    }
    return $coordinates;
}

echo json_encode($new_json, JSON_PRETTY_PRINT);

?>

Also: Possible to get a PNG export with transparent background (without the ground) ?

Is there a way to get a link with seed out of this, to replicate a village?

Or set parameters like population?

This is absolutely brilliant. Any chance to get an export as SVG or transparent PNG or even as GeoJSON shapes? (you knew I'd ask that, right?)

The shift-mousewheel to rotate objects doesn't seem to be working, does nothing. Rotating via the hotkeys does work.

Why not export the ward data? Just as polygons with a "type" field that says "building zone" or "park"? That would be INCREDIBLY useful for zooming in, where at distance only the wards are visible and then they fade into individual buildings as you zoom in, the way Google maps does it. And you could export the ward names that way as well.

Would it be much work to include them in the GeoJSON? So as to not repeat a calculation step and do tangent calculation?

The array is the GeoJSON format, that's correct. It doesn't use objects there.

The unts are world units. If you import it into GIS, you get a proper scale on your map.

I just noticed that the GeoJSON export doesn't include the wall's towers or gatehouses, apparently - or am I missing something?

Brilliant! It works now, QGIS can split the multipart into single parts. I can now add the 400 city maps to my game world. :)

(here's what my own conversion script managed: https://notveryprofessional.com/dragoneye/atlas/Phonas -- you'll see the problems in the town wall, for example).

Question: Do you export parks as well?

Yes, that's what it looks like. I would do one polygon per building. It also makes debugging and editing a LOT easier.

I think I know what you mean by awkward. You export all buildings as one object. That's not how GeoJSON works. The MultiPolygon should be split up, one polygon per building. MultiPolygon can be used for a city gate, which has two towers but they're part of the same building really.

There's also something wrong in the MultiPolygon that I can't quite figure out, but QGIS is unable to split it into single parts, which it should be able to do.

Nevertheless, it's a huge step forward, already better results than the svg2json script I wrote for myself.

It's relatively easy to do, though of course an option to do it at export time would be more comfortable. I'll see if I can make a short script the next days.

Absolutely fantastic! Please do keep the GeoJSON. It seems awkward but is by far the most useful format with the most options to convert into other formats.

Fantastic, thanks.

@watabou - any chance to get access to the JSON before the desktop version? Here's a look at what I'm doing with it (zoom in on the city in the center, Phonas) - http://notveryprofessional.com/dragoneye/atlas/Phonas -- JSON would be perfect, at this low scale straight-out turning it into GeoJSON is ok because we're talking about a few mm of difference.

I'm happy with the most rough interface. I wrote a GeoJSON export for Azgaar's tool myself (he accepted the PR, so it's now in his codebase). If I understood this Haxe thing, I'd do the same here, but sadly I don't.

For the convex hulls problem - if you export the "blocks" version of buildings, you actually get exactly the convex hulls. I'm using that instead of calculating them myself.

You seem to have a really fantastic tool there - would you share it? I'm trying to convert the generator data into GIS data, and it seems that your analysis of roads, etc. is exactly what I would need.

Talking about this - can we also have the roads inside the town as paths or linestrings, maybe? It would be really great to not have to trace them by hand. I assume you have them in the algorithm anyway, they just get culled from the SVG?

Basically, if it can export to any standard 3D format - .obj, .fbx or whatever - then Unity will be able to import it.

Would it be possible to add an export option to GeoJSON? It's not difficult to make it if you have the data, but SVG does not always translate cleanly to it and my converter tool is giving me ok, but not perfect results.

I'm asking because I am working with GIS systems and want the actual polygon data to import. SVG doesn't work in that context.

No, I'm talking about SVG. Right now the SVG export and the image shown in the browser have little in common. Specifically, the SVG is always portrait and includes a lot of empty space. That means editing every exported file manually.

The most useful addition for me would be to set the viewport for export. Maybe simply make it the current visible window area, so it can be set by resizing the browser window?

(1 edit)

Do the opposite - if you can export to SVG, then things such as editing names is easy in an SVG editor and doesn't have to be in this one.

On the other hand, I'd wish for more control over size than just "small, medium, large" buttons. I have size data for my towns and would want a slider for population size or building number.