Thursday, 25 May 2017

The dirt texture that could have been

So, since starting my newest project, I've been making some textures. The first texture I made was a dirt texture which turned out pretty damn well. It's pictured below.

Unfortunately, this dirt texture was literally too good. It didn't look right when compared to the grass or the background- it looked as though I'd stolen it from another, better game.

Compare the dirt here with the grass. The grass looks pretty amateurish, bad and just doesn't fit with the dirt.

That's pretty sad, isn't it? The one time that I make something which actually looks pretty decent, I can't even use it because it looks too good.

Even at that, it's not exactly revolutionary. It's just a standard dirt texture which doesn't look like a literal 4 year old made it. I've saved the dirt texture, but for now I've decide to replace it with a slightly more "flat" texture.

This looks alright, but the primary thing is that it fits with the rest of the game. The background and the clouds are both very flat with little in the way of detail, and I've removed the third shade from the grass. I don't think that the grass is finished yet, but I feel like this is a step in the right direction.

I suppose the moral of this story is a testament to the importance of consistency over raw fidelity.

In other news, for the first time I programmed my own force integrator, since I was having problems with friction allowing the player to stick to walls with Godot's built-in integrator.

It was surprisingly easier than I expected, since a lot of what I wanted to do was pretty intuitive. I had to steal the bit of code that determines if the player is touching the ground from one of the platformer demos, but apart from that I was able to figure it out easily enough. Besides, I did my research and now, at least I understand what that code means!

Also, try not to think about my implementation of variable jumping heights too hard. It's a bit upsetting to anyone who knows how to do it better. Basically, if the player presses the space bar, they jump. It increases their vertical velocity by a factor of their "jump height".

However, if they release the space bar, it triggers my _input(event) function which sets a flag. If this flag is enabled, the player falls twice as fast as they would usually fall. Once the player touches the ground, this flag is reset for the next jump.

Also, I implemented some (admittedly kinda rubbish) path-finding algorithm. Basically, it detects which "floor" of the map that the player and an enemy is on. If the enemy is on a different floor to the enemy, the enemy will run either to the left or the right- depending on where the entrance is. From there, I just let the AI jumping mechanics take the reigns and it (hopefully) reaches the appropriate floor.

There are some massive restrictions with this method. First of all, if I ever make more than two floors then I'm a bit fucked, though I can adapt the method. Secondly, the route between floors will have to be at the very end of the map, otherwise the AI will just keep going and miss it.

I don't expect that I'm going to leave this algorithm as it is, since it really is quite awful. However, I'll cross that bridge when I get to it!

That more or less wraps this update post up! I haven't done as much as I'd like to, since I've had to divide some of my attention to exams.

I hope this wasn't super boring for you, and I also hope you're not one of the people who either follows my blog or is subscribed to my Youtube channel under the false pretence of my channel or blog being about tutorials. It's not.

No comments :

Post a Comment