Code Monkey home page Code Monkey logo

pokemap's Introduction

drawing

Pokemap

Pokemon map generator



drawing

📃 Description of the project

Project realised in the IAS (Artificial Intelligence) module at ENIB. The aim of this project is to explore the procedural generation of content, by procedurally generating levels of video games inspired by the Pokémon universe.

We wanted to use the Tiled tool inside the project in order to be able to edit tilemaps (tmx file) using Tilesets (tsx files). These are usable files in XML format. It also allows exporting to image format.

First of all, we implemented the procedural generation of our map by defining rules for placing the different elements. Then in a second step, we reused the previously generated map as an input file to generate a new map using the Wave Function Collapse (WFC) algorithm.

We have encountered problems using the WFC, with .tmx files, so we convert them into an image (wfc.png). Once the WFC has finished and generated the output image, we re-convert the map to .tmx format to view it in the Tiled software.

We used the following technologies for the first part:

  • Noise Perlin: algo used to generate the relief
  • A*: to generate the paths between the houses

After running the programme, the following files are created:

  • /assets/pokemap.tmx: procedurally generated map
  • /assets/pokemap-generated.tmx: map generated via WFC
  • /assets/wfc.png: temporary image sent to the WFC input.
  • /assets/wfc-generated.png: temporary image generated by WFC

📂 Contents of the repository

The src directory contains 3 files:

  • Tiled.cs: to manipulate the Tiled files
  • PokemonLevelRandomizer.cs: main file
  • MapGenerator: generator

The assets directory contains the following files:

  • Terrain.tsx: tileset of the project
  • Terrain.png: image of the tileset

📦 Installation

  1. Install the 2D level editing tool Tiled tiled

  2. Clone the GitHub repository to your directory

git clone https://github.com/dorianleveque/Pokemap.git
  1. Going to the directory using a terminal
cd Pokemap

📜 Running

To execute the project, simply execute the following command inside the project

dotnet run <size> <HouseCount> <?Seed>

Example: The following command will generate a map of 200 by 200 with 50 houses with seed 12353 as seed.

dotnet run 200 50 12353
dotnet run 200 50 johto

⚠ Be careful

If nothing happens during the execution, you may have filled in too many houses or there may be only ocean. This can be solved by changing the input parameters.

pokemap's People

Contributors

dorianleveque avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

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.