benjajaja / civmap-client

Other
5 stars 25 forks source link

Civcraft Map

This is the repo of the civcraft map currently located at http://txapu.com.

The map is the combination of an older compilation of low-res tiles from civcraft.slimecraft.eu and a newer compilation of hi-res journeymap and journeymap tiles.

The map tileset is at public/tiles/ and can be used with any XYZ tile (slippy) map such as OpenLayers. It does not contain tiles for 100% of the map, but it is getting more complete as more players map out the civcraft world and submit their data.

The voxelmap "master" tileset is at "voxelmap/master".

The journeymap "master" tileset is at data/master. These tiles are in journeymap format (size and naming scheme), to add a player's journeymap tiles to it it has to be merged. When that is done, you can generate the map tilesets for all zoom levels with journeymap.py.

How to contribute imagery

You can add what you have mapped with voxelmap. Go to your voxelmap folder, usually .minecraft/mods/VoxelMods/voxelMap/cache/mc.civcraft.vg/ where mc.civcraft.vg/ could vary depending on what address you use to connect to civcraft. From there, create an archive of all contained folders, usually at least Overworld (dimension 0).
That folder only contains your tiles and not your waypoints or other irrelevant but potentially sensitive data.

You should then post an issue in this repo stating that you have imagery in the issue title, and a download link (google drive, dropbox, mediafire...) to the archive.

How to contribute overlay data

Points (cities, towns, POI)

Also to be submitted as issues (one issue per entry) in this repo.
For points, you must include:

Additionally you can optionally include the following info:

Rails

Create an issue with an image with the rails drawn over the map. Rails MUST follow exact underground path. A rail addition may take longer if it is considered necessary to be verified in person (in game).

How long will it take?

I will try to update at least once a month. The merger process is complicated and uses file modification times to decide how to add images, and since git does not track file mtimes, each time an archive must be created previous merge in case there is bad data.

Land claims

tl;dr to add a land claim you have to do all the work yourself, and do it perfectly

First off, adding land claims is not for the faint of heart. You will have to read through this guide carefully. You will have to draw your claims on the existing svg following extremely strict both technical and aesthetical guidelines. You will have to use git to clone and add your modifications, and use github to create a pull request, which will then be reviewed, and then accepted only if there are absolutely no technical or visual faults, and no disputes.

If you are not familiar with git, you will most likely need the aid of somebody that is. Understanding of the markup structure of SVG files is also required.

Land claims: prerequisites

Land claims: git contribution guideline

The .svg files are located in public/img/, the format must be "plain svg". Any other format WILL generate garbage and your pull request will then NOT BE ACCEPTED.

Land claims: svg technical guideles

I strongly recommend to use inkscape - it is free to use and download. In any case you MUST save as plain .svg. and you MUST NOT create irrelevant svg elements like groupings.

Land claims: svg aesthetical guidelines

Haven is an exception, no other land claims in that style will be accepted

Land claims: how to preview your svg (or, technically, any svg overlay)

Open http://txapu.com/?svg=file:///your/local/path/to/claims.svg in your browser.

Land claims: disputing claims

To dispute another claim, the best moment is during the window of time when the pull request is open. Simply comment on the pull request. If you click the "watch" button on top, you will get notified when new pull request come in.

To dispute merged claims (already on txapu.com), you must can either create a pull request fixing it where you have to notify the author of the claims (with @username), or create an issue in this repo with the details.


Building the client for local development and code contribution

JourneyMap master tiles

See https://github.com/gipsy-king/civmap-journeymap submodule for further info if you want to contribute, read along if you want to build tiles yourself.

To add a player's data, put the journeymap tiles at data/<name> and run python merge.py <name> (from inside data/, cd data). This will merge the player's tiles into the master tileset. New tiles will be copied, and if alreadyexisting, tiles will be placed above or below depending on timestamp (newer on top). This prevents newer master tiles being overwritten by an older tileset.

You can also force a tileset to be below no matter what timestamp with python merge.py <name> under, in case the texture colors vary slightly and you do not want to overwrite existing "good" pixels. The same applies for over.

When done, the master tileset is ready to be used to generate the map tileset, and could also be copied back to journeymap so that you can use them in-game.

To commit changes, you must commit them to the submodule from data/.

Map tilesets

Run python journeymap.py from the repo root, and go plant some potatoes because it will take a while: the journeymap master tiles from data/master will be inserted on top of all existing map tiles inside public/tiles/x/y/z.png.

Under normal circumstances it should not be necessary to commit changes to this repo, you may use journeymap.py to preview your previously merged tileset.

Add other data

Edit cities.geojson or rails.geojson. The structure of the "JSON objects" are in GeoJSON format.

There is a tool built into the web client to place cities and rails, simply insert the result into the corresponding .geojson file.

How to clone this repo and install dependencies

This repo contains only the static client files except the tiles, and the scripts for generating tiles and building the JS. However, the map tiles and the journeymap master tileset are added as submodules at data and public/tiles respectively.

Clone the repo as usually and then

git submodule init
git submodule update --remote
npm install
bower install

You must have git version above 1.8.2 (for the --remote flag to work), and always use the --remote flag or yoou will have to deal with submodules being in a "detached HEAD" state, which makes working on them a nuisance.

To build use the simple ./build.js script, it just runs vulcanize to package polymer and custome components into a single import, and then browserify to package the commonjs modules.

If you want to hack on components, you can also temporarily change the import in index.html to components.html so that you don't need to rebuild. There is no server-side part, it's all static files which is great for hosting. For this reason I recommend to simply open public/index.html from your filesystem with the file:// protocol in your browser, but here you need to enable "insecure mode" because Polymer does some XHRs which are not supported with that protocol; you can allow it if you run Chrome with the --disable-web-security flag or equivalent option in your favourite browser.