Road collider mess.

Intro.

This is the first post in the series. So before I get into the “Needy Greedy” I’d like to let everyone know why I’m making these. As a developer I often get lost in the sauce of code and development, this can be overwhelming at times and causes me to get un-focused. In this un-focused state I’ll usually peruse the web looking for inspiration of some sort and in reality end up just wasting a ton of time watching some random video that youtube suggested me,(You know how it goes.), watching twitch, or reading countless articles. So I thought to fix this problem, I need to focus on my own development. To stay focused on my own things I should make my own videos, stream my own twitch, and write my own blogs!

We are in the Age of big data, there’s so much content in the palm of your hands it’s soo easy to get distracted or lost in the sauce for hours on end. And you know what they say “If you can’t beat em, join em.” So I might as well try and see if anyone wants to get lost in my sauce…?haha. I might as well improve my own dev skills, writing skills, and video editing skills throughout my journey through game development. That’s why I’m bringing you these DevLogs.

Also I’m making them so that I can personally track my own progress in game development and reference how I go about fixing certain problems. Sorta like my own code documentation, but in a fun medium.

So now let’s get started with this DevLog…

One of my best friends came over today and played my game.

He made it apparent to me that the colliders in the walls of my roads aren’t working as he was able to move through them fairly easily.

That had me thinking…

I messed up!

Whenever I had made these road objects I had made them with simple boxes that Unity3D provided. All of these boxes containing their own box colliders! — This many colliders is not good for performance, and this also makes collisions easy to get past since there’s little gaps in-between each collider.

Deleting the colliders :

Too many colliders slowing down our game.

As you can see above, the green outlines around the objects are all the colliders in the objects. Since there are multiple colliders on the objects, this makes it difficult for the player collider to register and keep a steady collision causing the character to do this :

Character goes through the multiple colliders.

Having all these colliders is not only prone to these bugs, but is also expensive to run! So the simplified colliders in the image below will make our game faster. This is highly beneficial since our game is supposed to run on mobile devices.

Simplified collider setup helps speed up our game and cause less bugs.

Here’s how the player reacts to our simplified collider setup.

Viola! The character gets caught by our collider.

Tried to get the post processing stack camera effects to work

I wanted to add some sort of AO(Ambient occlusion) So that shadows and objects close to each other will have small shadows on themselves. This ended up not working (maybe my graphics card isn’t good enough) doesn’t seem like there’s enough documentation on the post processing stack yet either.

Notice anything different about the shadows? (crisper looking?)

Enabling apple’s METAL

not really sure what this is going to do for users. Maybe make the game run faster on newer devices. Might make the game NOT run on older devices. We shall see once we release!

Now to do some coding

Right now in the game, after you die you get re-spawned back to where you first started on the road. Sometimes there are barricades that are really close to your character when this happens and since the character is automatically moving forward, sometimes this makes you consistently run into this barricade endlessly dying and re-spawning again and again.

Looks like we need to have some sort of larger collider around the character that detects if a coin or barricade is within it. Then re-spawn or re-arrange those objects.

Problems arise with code. I should have known this would happen…

So… After working on the code for a few hours it seems the problem is a bit more difficult than seems. Since I’d like a detail of how I’m fixing things I’m going to make another post dedicated to solving this problem specifically which you can find HERE.

I feel as that this shall conclude this DevLog and now I shall work on our new code mess problems. 😉

Let me know if there’s anything I can do to improve these DevLogs. I’ll try to keep them pretty short or at least include lots of juicy images and Gifs to make them visually appealing. As for the writing content, let me know if you like where I’m going with the format so far and if there’s any way I can improve something. Thanks for tuning in!