Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Procedural Content Generation for Unity Game Development

You're reading from   Procedural Content Generation for Unity Game Development Harness the power of procedural content generation to design unique games with Unity

Arrow left icon
Product type Paperback
Published in Jan 2016
Publisher
ISBN-13 9781785287473
Length 260 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Ryan Watkins Ryan Watkins
Author Profile Icon Ryan Watkins
Ryan Watkins
Arrow right icon
View More author details
Toc

Data structures


Now that we know the instruction set of our dungeon creation, we need to figure out how we plan to store the dungeon board. We are building the Dungeon Board in a similar manner that we built the world board, so we might be able to use similar data structures. There are enough differences though, that we will need to evaluate what works best.

Back to the map

We are using a dictionary to store our world board because it has an easy and fast lookup method, plus it can be added to dynamically. For all those same reasons, we can use a dictionary to store the important points in our dungeon. Remember, we don't need to know every point in the dungeon, we only need to know the essential and random paths.

The tricky part is that we need to place the essential path first but then revisit every point in the path to potentially add a random branch. There is the option to iterate over the dictionary where we are storing our dungeon. However, we will be adding new points to the dictionary...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime