'Storing Procedurally Generated Map Data Inside a NumPy Array
So, I am making a roguelike game using Python as my language. I am using NumPy and tcod currently for libraries, and I have been trying to figure out how I can take the procedurally generated map "cells," and append them to indexes within a NumPy array.
Context: I have followed the 2020 tcod tutorial found on the roguelikedev subreddit to get to the point I am at now (Here is a link to the source on GitHub. I have made only trivial changes to colors and such so far). I've coded simple stuff in Java before but never messed with Python much, nor have I ever tried something like this. In short, I feel a little lost.
Basically, I want to change the way the maps are generated. Currently, an area the size of the terminal is preocedurally generated, and when the player moves down some stairs, a new map is generated, and the old one is basically thrown away. The idea being that it's a dungeon. I don't want this. My goal is to have it be an open map, where the player can go North, South, East, or West.
This would require the engine to save the map (I assume to a list or an array or something), and keep updating it whenever the player moves to a new cell on the grid.
Now I'm not asking anyone to write the code for me, but I just can't seem to really wrap my head around how to go about actually doing this.
So far, my problem is I don't know exactly how to put the gamemaps onto a list. Should I make them entries within a dictionary? Use a list? Is what I'm trying to do even possible?
Figured I'd give this site a shot. Any help is appreciated.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
