[Devlog] – Switching to XNA/MG – 10/08/2018

It took me a long time to give new informations here :

After working hard on Unity, i’ve quickly noticed that every way to optimize brings me back to the beginning. It is not ready to handle infinite voxel terrain. I had to find a new way to make a voxel world.
I tried to use MonoGame (or XNA). The basics took a few day to master and i had good basics with Unity’s C#. All i had to do was understand Matrices and how to build my own lighting and collision systems.

I tried to make a first Voxel project in 2D, inspired by Terraria. Drawing on screen was good but i needed to use a matrix for the world view. Like everything next, it was all about finding if MonoGame supports it or if there was already a way to make it instead of writing a new system. Fortunately, there is a way to draw on a matrix (See my guides about it on the main site) .

9

After drawing my world and playing a bit with mouse position and grid, i needed a noise system. I wanted to use Perlin noise like i always did. I searched for a long time to have  a good implementation and i remembered FastNoise by Auburns. (Here)

I tried to add it to the project and searched for a long time to have good mathematical values. I had to map a value, given between 0 and 1 to 0 and 50. That’s what i did :

(givenValue – min1) / (max1 – min1) * (max2 – min2) + min2;

This gave me good looking results :

11.PNG

I also played with more values like Frequency and Amplitude. I also wanted to implement a smooth terrain system. So i took Terraria’s tiles and made a tileset from it. From here, i wrote every texture given for each event, meaning that i looked at every block around and chose the texture corresponding to the best event.

This took a long time to write and i noticed that MonoGame kept the last changes i did to an image, so i couldn’t give a texture to a block and then draw what was given, but instead calculate the texture at every draw loop.

I will try to optimize it anyway. But for now, that’s what i got :

unknown

Next i tried to change noise values again, playing with them to have something better :

unknown (1).png

Now that i had the terrain, i needed caves. To implement them, i tried 2D Perlin noise instead of 1D. I also had some little lines to make sure i didn’t draw on and above the surface, unless it was another noise made for it :

unknown (2).png

Finally, i tried to call a Noise function which was more or less flat depending on the biome of the chunks. This also gave me good results for a biome system :

unknown (3).png

Now, i will work with Noise on a new project until i have perfect results. I need a good shape for the world.

Laisser un commentaire

Ce site utilise Akismet pour réduire les indésirables. En savoir plus sur la façon dont les données de vos commentaires sont traitées.