Random Map & Route Finder
This project is a Flask application that generates random or noise-based maps, displays them in a browser, and allows the user to select start/end points to calculate a terrain-aware route. The application demonstrates pathfinding (A*), various terrain types, and a simple front-end interface with 2D tile rendering.
Technologies Used
Backend: Python (Flask)
Frontend: HTML, CSS, JavaScript (Canvas for rendering)
Pathfinding Algorithm: A* Algorithm
Random & Perlin Noise-based Terrain Generation
Features and usage
Generate Maps: Choose between random or noise-based (realistic) generation, plus different styles (e.g., plains, mountains, water).
Terrain Types: Water, land, mountains, snow, each with different movement costs.
Route Finding: Click two points on the map to calculate the most efficient route using A* with terrain cost.
Customizable UI: Toggle grid overlays, pick map width/height, and adjust terrain style thresholds.
Project Structure
RandomMapWayFinder/
├── app.py # Main Flask application, defines routes and pathfinding
├── requirements.txt # Python dependencies
├── templates/
│ └── index.html # Main HTML interface
├── static/
│ ├── js/
│ │ └── main.js # Front-end logic for map generation, path display
│ ├── textures/
│ │ ├── water.png
│ │ ├── land.png
│ │ ├── mountain.png
│ │ └── snow.png
└── README.md
Prerequsites python 3.x Flask (verson in requrements) Noise (verson in requrements)
Running the application
Create a virtual environment: python -m venv venv
Activate the virtual environment:
On Windows: venv\Scripts\activate
On macOS/Linux: source venv/bin/activate
Install dependencies : pip install -r requirements.txt
Run the Flask server: python app.py
Open in browser: Navigate to http://127.0.0.1:5000/
** RECOMENDATION: when testing the application with bigger size map there is bigger variety of the terain. Max recomended size is 500x500.