Game
Rogue Cadet
9 years ago

Day 121


Day 121: Today I have some good news! I finished the sprint. And I’m finally happy with the AI. Well, at least until a play tester will find a ton of situation I haven’t encountered… And if that’s not good enough news for you, well I don’t have anything else. I could maybe say that I finally started watching Firefly and that it kicks ass. But that’s not really important.

Daily interesting stuff:

Tasks done:

  • Finally made a decent tracking AI. It took almost all the day, but I did it. It’s crazy how every time I change this behaviour, it was better AND worse at the same time. I don’t know how many things I tried in total, but it did require a lot of ideas. Today, I end up with five major improvements:

    • First instead of casting a box of the size of the collider, I used a parameter to multiply it by around 1.3. So the enemies can detect collisions in all direction before actually being in the wall.

    • I multiplied the casting box size by the local scale of the enemy. Because if I don’t the detection is totally wrong! The exposed size of the collider doesn’t take the scale into account, so weird things were happening.

    • When the actual collider is in a wall, the bool “isWall” is set to true. Then the enemy will perform an “emergency reverse”. It sets the direction to the normal of the box cast as long has the distance of said cast is 0. When it’s not 0, it means that the casted box isn’t in the wall anymore.This solves the enormous problem I had with enemies ending up in walls.

    • When choosing the direction to avoid an obstacle (left or right), the enemy looks which direction would get you closer from the player. Then it saves the choice and don’t choose another for the obstacle. I had to make on choice by obstacle because if it’s calculated at each frame, the enemy is stuck in “parkinson indecision”. Thanks to that the AI looks much more natural. It doesn’t works as well as pathfinding would. But obviously I don’t compute a whole path so that’s to be expected.

    • Fixed a really ugly bug. When you’re not seeing enemies, their behaviour gets stopped to save perf. The problem was that the velocity was not set to 0. So when an enemy was disabled, it would continue to go in the same direction and with no wall check!

  • Fixed a bug where when the enemies changed rooms sometimes it would throw an undefined index exception. It was simply because I put them in the first child of the enemy parent without any check. So when there were no children or no parent, an exception would be thrown.

  • Disabled the mouse in the main scene UI. My menu are navigable with the gamepad and the keyboard only. So I did the same thing that for the main menu. I replaced the Unity Input Module by a slightly modified one with no mouse input.

Sprint end: This concludes the “technical sprint”. I pretty much fixed my tools and other bugs. That leaves the “content” and “polish” sprint before the beta milestone.

What went wrong:

  • It was too long. Three weeks is really big.

  • I didn’t finished in time.

  • It was badly named, because I was too lazy to cut it.

  • I was too depressed to work well some days

What went right:

  • I made it. I’m happy with the solutions I found.

  • I’m only one day late. Considering I spent two days desperately trying to learn some C++ for a test, it’s not so bad.



0 comments

Loading...

Next up

Just as Pecaminosa's musicians #improvise this rendition of #LittleSunflower 🌻, so do we improvise with this post you're reading. 😂

What's coming out of your own improvs? 🤔

#Pecaminosa | #IndieDev | #OST | #Jazz

Been working lately on lots of 'behind-the-scenes' boring stuff that no one really cares about, so here’s a guy playing the sax for some reason.

#screenshotsaturday

Shoobies leave a sticky trail of mucus in their wake, which can impede movement for any creature that steps in it.

Path of Kami: The Evolution of the Lore

Have a good Boi

Werehog transformation process. #sonicunleashed

In the quest for accessibility, I'm adding Resurrection Shrines for players on the 'novice' end of the platforming spectrum.

In order to unlock the power of a Shrine, you must collect 3 'Souls' from your dead corpses! (the floating blue orbs)

A house I've built a while ago. :)

It nicely separates the snowy biome from the grassy one.

It's built with painted Ebonstone.

Spaaaace~

These are background sprites I've created for a game I'm working on at school ^w^ Click on the post to see how the sprites connect. You won't regret it! (personally, I think it's pretty heheh)

Drawn in Piskel using my mouse. Whaddya think?

An infected room from the second part of Cybel ! Are you up for some cleansing?