Giter Club home page Giter Club logo

mapi's Introduction

A collection of tools for map creation and generation.

WebTool

Interface with the API and create custom maps with an interface.

Generator API

Generate unique maps and provide file endpoints.

Endpoints

  • http://[HOSTNAME]:5000/post_map?map=[MAP_GENERATOR]&item=[ITEM_GENERATOR]&entity=[ENTITY_GENERATOR]&size=[SIZE]
  • http://[HOSTNAME]:5000/get_map?id=[MAPID]
  • http://[HOSTNAME]:5000/get_generators
  • http://[HOSTNAME]:5000/get_map_list

Map Gen

Map generators generate the actual "maze" structure of a map file.

Must have the following functions:

def main(size):
    return {ROOMS}
def meta():
    return "META STRING"

Must output the following object:

{
    "1":{
        "1":{ROOM},
        "2":{ROOM}
    },
    "2":{
        "1":{ROOM},
        "2":{ROOM}
    }
}

Item Gen

Item generators create a set of items for the map, as well as placing items in each of the rooms.

Must have the following functions:

def populate({ROOMS}):
    return {ROOMS WITH ITEMS}

def meta():
    return "META STRING"

def load():
    return {ITEMS}

Must output the following object:

{
    "1":{ITEM},
    "2":{ITEM},
    "3":{ITEM}
}

Entity Gen

Entity generators create a set of entities for the map, as well as placing entities in each of the rooms.

Must have the following functions:

def populate({ROOMS}):
    return {ROOMS WITH ENTITIES}

def meta():
    return "META STRING"

def load():
    return {ENTITIES}

Must output the following object:

{
    "1":{ENTITIES},
    "2":{ENTITIES},
    "3":{ENTITIES}
}

Map files (Map + Items + Entities + Meta)

{
    "map": {
        "1": {      // x coordinate
            "2": {      // y coordinate (contains room)
                "x": 2,
                "y": 1,
                "description": "room description (Minus items)",
                "items": [ // references for items in room
                    "[itemID]", "[itemID]", "[itemID]" 
                ],
                "entities": [ // references for entities in room
                    "[entityID]","[entityID]","[entityID]" 
                ],
                "doors": { // openings into adjacent rooms
                    "n": false, "s": true, "e": false, "w": false
                }
            },
    },
    "items": {
        "1":{ // item id (used as key)
            "name": "Item Name",
            "id": "Item ID", // same as key
            "appearance": "Item appearance",
            "visibility": "Item visibility",
            "description": "Item Description",
            "sprite": "Sprite Reference",
            "volume": 1.1, // volume in m^3? cm^3?
            "weight": 7.5, // weight in kg
            "max_quantity": 4,
            "rarity": 1
        }
    },
    "entities": {
        // To Do
    },
    "meta":{
        // meta information from generators
    }
}

Item Dataset

Standard item definitions and sprites.

Definitions

name id appearance visibility description sprite volume weight max_quantity rarity
string int string float string path float float int int
Potion 1001 "appearance of item" 1.0 "description of item" "/sprites/potion_red.png" 0.1 0.001 8 1

Sprites

  • Potions
    • Red
    • Purple
    • Teal
    • Lightgreen
  • Ring
    • Gold
  • Sword
    • Black
    • Blue
    • Gray
  • Book
    • Green
    • Red

mapi's People

Contributors

probably-not-porter avatar

Watchers

 avatar

mapi's Issues

Add perlin noise layers to represent room weights

weights can be incorperated into item generators

  • rooms should produce weights for each of the following generators, maybe multiple
  • item generators should accept one or multiple weights to populate appropriately
  • entity gen should do the same

Refactor display

currently using divs to represent rooms, could use canvas or some other method to increase performance with large maps, maybe even a map service like leaflet.

Fix generator loading method

there is probably a more abstract and clever way to load maps other than importing them and adding them to a list.

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.