Personal Website Update + Survival Game Prototype Devlog #1

Greetings fellow tech nerds!

I am here again, with another blog post. In this blog post, I am going to talk about a small update on this website and a survival game prototype that I am working on in Bevy Engine!


Let's begin with a more interasting thing, the game prototype.

One day, I sat down, and said: "Hey, let's make a procedurally generated Mesh in Bevy Engine, based on Perlin Noise!"

Now, you may be asking yourself: "What the hell is Perlin Noise?", well I was getting to that!

Perlin Noise is a special type of a noise that looks like a bunch of black circle gradients on a white image, like this one bellow:

Perlin Noise Image

So I used the noiselib Rust Crate to generate my first noise image, and then I used Bevy's Mesh struct to insert indices and vertices into the Mesh.


So it is done! The experiment is over, time to go to sleep, right?

Well, not exactly. I decided to go a bit further and add collisions as well as a character controller. I used the bevy_rapier3d crate to make collisions work. As for the character controller, I found an amazing one made by Quintin, you can find it here.

After that I decided, hey, let's make some biomes. Why? Why not?

So I took the same perlin noise as the one I used before, but I made it with colors. Each color represents it's own biome. Simple, yet nice.

I added a pine forest biome, with 3 different kinds of trees:

  • Regular Pine
  • Small Pine
  • Old Lifeless Pine

Hmmm... Seems like enough for now, right? Heck no, that would be boring! I need more! So I got to work, and I made 3 more simple biomes, which are kinda nice.

They are of course:

Crystal Biome:

A biome full of crystals. Really original.

Maple Forest Biome:

I decided that if I will continue working on this prototype (And I will most likely will), Maple will be the best material in the game. Maple is for sure, my favorite tree.

Star Forest Biome:

Please insert a meme with "Regular tree: Hell no! Star tree: Hell yeah!" So yeah, a tree with stars on it. I did not add any glow to it yet, but I will add some later.


But we need to place those objects somewhat far from each other, yet not in a grid, so it would seem more natural. This is where the Disk Poisson Sampling algorithm comes into play. It allows us to place objects not far from each other, in somewhat random positions, but they will not collide with each other. Great, eh?


Now that we have some super simple biomes done, and the scope creep is killing me from the inside out, it is time to get to harvesting resources. Sounds simple, right? Well, it actually was pretty simple. But I did not say that it was easy.

Okay, it was not really that hard. I just needed to make a shapecast towards the direction that the player is facing, and if it hits anything, apply damage. I added a Component with health on it to anything that can be destructed, so it is easy to make the objects break. I even added a start for dropping items, but that is for later.

I modeled the worst axe model you have ever seen, and now the player can hold an axe, which works like a charm, eh?

A Broken Image Of An Axe Upside Down

I will fix it later, for now, I will keep it like that to cringe at myself when I see it.


So of course, now we need an inventory.

So I lied down on my chesterfield, and started coding. I already made some User Interface for it, but it was not completely ready yet. Hoo boy... I added a bunch more code, and now we can remove items from the inventory, and it is all with Rust safety and performance 😄.

At the initial setup, the User Interface looked really bad, but I rounded the corners and now it looks good. Or at least I think it does. I will not go further into User Interface for now, because the scope creep is getting at my tail.


So yeah, some inventory is done, now it is time to make this actually a survival game!

What do we need to make a survival game? Here are some things:

  • Health + Hunger.
  • Building System.
  • Enemies.
  • Maybe day and night cycle.

I got day and night cycle already, so that is good, eh?

Now I just have to add hunger, which is SUPER SIMPLE to make. Just a timer, and then we get a fraction of time from it, and this way we can get how hungry the player is.

We can un-tick the timer back when the player eats something, speaking of which, the player can indeed eat, because the inventory system that I made has this functionality.

Now we need ENEMIES, and BUILDING SYSTEM. The first one is pretty simple. Do some raycasts, state machines, and shapecasts when attacking, add a new Component with health and boom, we can make an enemy.

But the building system... It needs to be ACTUALLY GOOD, and not a gong show, otherwise, I am going to have a kerfuffle with my inner self. If you do not know, I love building in games, and I especially like survival games with building. They are just the best.

So, I made so the player can place building blocks anywhere he wants. But that is not ideal, because we need some snap points. How to make them with Bevy Engine? I have no idea. So I will have to figure it out. I do have some ideas of what to do.

From the start of me working on this game, people like @netzwerk2:matrix.org, @greenlemonade:matrix.org and @aviac:solarpunk.social from the Bevy Matrix Communtiy helped me out a lot of times. They gave me lots of useful ideas, helped me to fix my begginer's code, and were actually a really good support, so big thanks to them!


I will continue working on this prototype, and will post more blog posts here. If you do not want to miss them, subscibe to my Mastodon here.

I might even make a video about this devlog, in a more playful format. If you liked this part of the blog post, please tell me what you think about it on Mastodon! Just ping @lupuscrystal:mastodon.social and tell me your thoughts!


Now for the website update. I added an RSS feed that you can subscribe to, here is the link:

https://lupuscrystal.github.io/LupusCrystalFeed.xml

And I added a new section with a few tracks I made with Linux Multi Media Workstation.

In any case, you can call me Crystal, and until then:

  • The Call To Code