Help: Random Game Dungeon Generator

thaddles

New Member
Joined
Oct 17, 2022
Messages
2
Office Version
  1. 2016
Platform
  1. Windows
Fairly new to VBA and have an idea that I think is possible but need a ton of help. Any assistance would be appreciated.

I am looking to create a Random Dungeon Map Generator in Excel with the intention to make printouts. I think I have the steps down but I have no clue on how to do this and am hoping that once this project is complete my understanding of VBA will significantly increase.

Input Values:
Max Tunnel Length
Loop Times


Designate a static range or "boundary grid" this will be the print area and give each cell in that grid a value of "1"
11111
11111
11111
11111

Locate a "StartingPoint" by selecting a random cell in the range and change that cell value to "0"
11111
11101
11111
11111

From the "StartingPoint" offset in a random direction for a variable amount of cells (from 1 to "MaxTunnelLength") or until it hits the boundary creating a row or column of "0"s creating something like a "tunnel"
11101
11101
11111
11111

From there loop the tunneling process a variable amount of cycles determined by input "Loop Cycles" each time offsetting in a new direction (example of six consecutive loops using a very small grid)
11100 11100 11100 11100 11100 11100
11101 11100 11100 11100 10100 00100
11111 11110 10000 10000 10000 10000
11111 11111 11111 10111 10111 10111

After I get a range full of "1" and "0" I can then work on using conditional formatting as a quick fix until I learn another program to format the cells based on their value and position related to neighboring cell values. I found something similar in ww.freecodecamp.org/news/how-to-make-your-own-procedural-dungeon-map-generator-using-the-random-walk-algorithm-e0085c8aa9a/ but it wasn't in VBA. I know this is a huge ask but any help would be greatly appreciated. Thank you
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Welcome to the MrExcel Message Board!

Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!

Cross posted at: Board Game (dungeon) Map Creator Printout
If you have posted the question at more places, please provide links to those as well.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
 
Upvote 0
Sorry about that. It won't happen again. Still need assistance on this though if possible.
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,191
Members
452,616
Latest member
intern444

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top