ProDnD Prototyping

Standard

Hello folks! Today I’m going to talk about our prototyping sessions for the new ProDnD and what we did this week.

We wanted to explore and add new Unity features on this project and we thought new functionalities that are added to Unity in recent years could help us enormously.

So what we did exactly? Well, first of all, we implemented the UI using new and slick Unity UI. It’s so easy to use and adjust. (It gives me the similar joy that I had when I played Sims 2! I don’t know why, but making UI in Unity gives me the feeling of Build Mode in Sims :D)

Unity UI is love, just look at the panels and the sliders

Sliders on the right are parameters of the generated map. Map on the middle is generated using the sliders’ values (For example width and height.)

The dropdown menu on the left panel indicates the selected noise type. The noise type determines how the map will be generated randomly. The library we are using is LibNoise; it has a couple of noise type choose. 

Noise types from LibNoise library.

Here’s a little glossary for the sliders:

Width / Height = determines the map’s width and height

Frequency: the amount of detail

Octave Count: Addition of noises at different frequencies, this makes the map more authentic and more realistic. In each additional noise, the frequency increases.

Lacunarity: how quickly the frequency increases in each octave. Think of it as, how dramatic the map will get jaggier.

In this example, Octave doesn’t get very extremely jaggy.

On the other hand if we increase the Lacunarity slider to 3:

Look how it got jaggier.

Persistence: how quickly the amplitude decreases in each octave. This leads to more rougher noise.

Do you wonder how we actually generate this map? Textures? Sprites? 

Or… Tilemaps?

Tilemap is one of the Unity’s latest and hottest features.On a Grid, you can put tiles and create a 2D plane with ease.

unity tilemap ile ilgili görsel sonucu

You can find more information here 

How exactly we use this feature since the map is generated procedurally? Well, first of all, we generate a height map in a 2D matrix  array. LibNoise produces a 2D float matrix array using the noise function we’ve chosen. We traverse the matrix array and each slot correspondences a location on the Grid. The slot contains a float value, and according to the value, either we put a tile or not. The decision whether put a tile or not determined by a coefficient. If the value is greater than the coefficient, put the tile on the map. Else, don’t

Tile by tile, the map is generated.

There are two colors ; the light grey tiles have higher values and the darker grey tiles have lesser values. We plan to add adjustable coefficients and tile types to add more variety such as mountain, dirt, tree, sea etc… With these features we’re sure the map will be more fun to play with.

See you in the next update! Stay in tune!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s