GithubHelp home page GithubHelp logo

praxismapper / praxismapper Goto Github PK

View Code? Open in Web Editor NEW
46.0 4.0 2.0 134.38 MB

Backend API for location-based games or mapping applications powered by OpenStreetMap data. Renders maptiles without external dependencies in C# from SQL Server, MariaDB, or PostgreSQL

License: Apache License 2.0

C# 96.47% Dockerfile 0.04% CSS 0.70% HTML 1.32% JavaScript 1.46%
location-based openstreetmap-data praxis game map-game openstreetmap-renderer mariadb sqlserver gps csharp

praxismapper's Introduction

PraxisMapper

An open-source server for location based games. Powered by OpenStreetMap data. To focus on the player, and to let them play without excess tracking. Follow my on Mastodon

The fast-setup guide is readable here

The Godot 4.1 components are available over here if you want to get a fast start on client development.

Or, a fully function Godot 4.2 example can be found at Weekend Space Command (Prototype) to get a functional framework with global, minimized data.

Requirements

  • Visual Studio 2022 17.0+ Community (or the mac/linux equivalent)
  • .NET 8.0
  • [optionally] MariaDB 10.6+ (Recommended) OR SQL Server 2016+ OR PostgreSQL
  • System resources may vary with content.
    • Running a county-sized game (500 square miles/1200 square kilometers)? A server can run with as little as 1GB RAM and storage space, with the webserver and DB on the same box.
    • Running a server for a continent? You'll want at least 64GB of RAM on the DB server, and 200GB+ of storage space to handle map data and drawn tiles.

Features

  • Simple API handles all the baseline needs for a location based game. It handles locations, map tiles, and interactions, you can focus on the gameplay.
  • Built-in GameTools handle the common tasks you'd expect for a location-based game.
  • Load data in from OpenStreetMap exports.
  • Create map tiles on demand or ahead of time, from the source map or from gameplay data.
  • Draw map tiles in multiple styles, and draw gameplay data to overlay tiles.
  • Supports any sized area for gameplay.
  • Server stores as little data as possible about users.
  • 4 backend database options: LocalDB is the automatic, no-config default, MariaDB is free and simpler than other options, Microsoft SQL Server for commercial supported backend, and PostgreSQL is popular among OpenStreetMap projects.

Performance Examples

  • Setting up a county-sized game server (1,200 square miles) takes about 5-30 minutes and can be done with almost no configuration of the server. Disk space use can vary between 200MB in MariaDB with a low density county, to 8GB+ in LocalDB with Los Angeles County.
  • Setting up a state-sized game server (53,000 square miles) takes 30+ minutes to process data. You will want to use a full-sized database like MariaDB or SQL Server for this except for the smallest of states.
  • Most continents can be converted from source data to working server in under 48 hours of processing time and a little extra planning. Europe requires significantly more space than North America.
  • planet.osm.pbf takes about 4 days of processing to convert into usable elements in the suggestedMini style. The speed impediment on planet.osm is disk access speed, as each block is dramatically larger than they are in extracts (extracts tend to use 1 group per block, planet.osm uses 5-180). Compared to a typical extract file, it takes about twice as long to create data using planet.osm.pbf for a given area. If you need global-scale servers, use multiple continent extracts, and then use Larry to cherry pick in any missing elements.

How to Use PraxisMapper's APIs

  • /MapTile handles all the drawing logic for creating baseline map tiles, or overlays to layer multiple tiles together on your client.
    • Call YourServer/MapTile/Area/{PlusCode} to get a maptile for a gameplay area, or MapTile/AreaPlaceData/{PlusCode} to draw an overlay with gameplay data from the elements.
  • /Data handles storing and reading data for players, Places, Areas, and global information or settings.
    • Use GET Data/Area/{PlusCode} to read info from a grid cell, or PUT Data/Area/{PlusCode} to save data to the server
    • Use GET Data/Place/{ID} and PUT Data/Place/{ID} to read and write data based on the items drawn on the map.
  • /SecureData allows for entries to be encrypted, blocking them from being viewed by unauthorized users.
    • GET and PUT calls both add a password entry
    • SecureData endpoints are appropriate if you want to attach users to places or store location data, so as to not expose it to other players (or the server owner, if the password is provided by the player)
  • See the APIDocs.txt file or the wiki tab on GitHub for a full set of API endpoints and expected values.
  • More examples are available in Hypothesis, the example mobile client.

At this time, you are expected to have some programming experience to use PraxisMapper for making games. Building a location-based game with PraxisMapper is not currently suitable as a first coding project.

Minimal Fast-Setup Instructions (Windows)

  • Unzip all files from PraxisMapper.zip to C:\Praxis.
  • Download the smallest usable PBF map extract file you can find for the area you want to cover for gameplay from Geofabrik.de to C:\Praxis
  • On OpenStreetMap.org, search for the area (County or City) you want your game to cover, and write down its Relation ID.
  • Open C:\Praxis\appsettings.json, and change the "useRelationForBounds": value from 0 to the Relation ID you wrote down for your County/City
  • Run PraxisMapper.exe. It should fire up and start reading data from your PBF file. Some time later, you should get the words "PraxisMapper configured and running." If you go to http://localhost:5000/Server/Test and see "OK", You have a minimum functional PraxisMapper installation.

Scale Changes

It is entirely feasible for small games to run the entire server on a single PC, with surprisingly low resources. A US county is often an entirely viable space for a local game, particularly in a testing phase of development. Huge games will require some manual work to set up. Continent-sized servers, or countries that take up most of a continent, will require deleting indexes after creating the database schema, processing and importing data, then re-creating indexes after import in order to remove a few days from that initial load time. This index juggling process is handled with the -makeServerDb command.

praxismapper's People

Contributors

drakewill-crl avatar praxismapper avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

praxismapper's Issues

Webserver doesn't run on t4g servers

AWS Linux ARM is weird. Larry ran fine on it to generate data, but the webserver project doesn't.

Current roadblock: SkiaSharp
Unhandled exception. System.DllNotFoundException: Unable to load shared library 'libSkiaSharp' or one of its dependencies. In order to help dia
gnose loading problems, consider setting the LD_DEBUG environment variable: liblibSkiaSharp: cannot open shared object file: No such file or di
rectory
at SkiaSharp.SkiaApi.sk_compatpaint_new()
at SkiaSharp.SKPaint..ctor() in SkiaSharp.dll:token 0x6000cf3+0x0
at CoreComponents.TagParser.SetPaintForTPP(TagParserPaint tpe) in /home/ec2-user/praxismapper/PraxisMapper-master/CoreComponents/TagParser.c
s:line 58
at CoreComponents.TagParser.Initialize(Boolean onlyDefaults) in /home/ec2-user/praxismapper/PraxisMapper-master/CoreComponents/TagParser.cs:
line 37
at PraxisMapper.Startup..ctor(IConfiguration configuration) in /home/ec2-user/praxismapper/PraxisMapper-master/PraxisMapper/Startup.cs:line
26

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.