How to make a minimap by pixels without second camera

I’m doing a procedural, grid based game, and want to make my minimap by allocating each grid coordinate a colour. Then having the minimap show 1 pixel per grid coordinate.

The only game I can think of that does something similar is TibiaTibias Map

In the above picture, each square is one pixel and represents one tile on the map. All the different grass is just “Green” and trees are “Dark green”. Roads / Dirt / stone are grey or dark grey. This then gets used as the minimap “texture”.

It’s also only discovered in a rectangle around the player (hence the ocean turning black) but that’s optional and relatively easy.

I can’t find any resources to work in this way.

How can I do this? The only thing I can work out so far is to have a C# section of code that uses image libraries to draw a PNG or other indexed image and load that image in as the map in x * y sized chunks. The actual world itself is procedural, so can’t be known ahead of time.

Edit: More detail on question

How can I turn an array of values (or list, or any collection) such as

20002002
21112002
20002002
11111111

Into an image or texture that I can draw as 4x8 rectangle of pixels? (Or use as a texture for a poly?

Creating the image once you have the data can be done via many different tutorials - but getting the proper data will be the hard part.

I see a couple of options -

  1. Raycast down at every grid position. This will be expensive, and you’ll have to either do it all at once when the game loads (and put up a loading screen or something), or do it over time, while the player is moving around, doing a few raycasts per frame. Depending on performance of your game / how fast you move / how big your grid size is, this maay work.

  2. Have each object report its location, and type to a manager. This will only work if you have grid/voxel based objects, but would be much easier. Since you mentioned creating the world procedurally, you might already have some load time and could do this as you create each object, report the type and grid position to a manager.