Day 119: Today, it’s been two days since the last work day. I’m sure you’re thinking, oh yeah this must’ve been the weekend! Well no. Not at all. A little while ago, I applied for a job at Ubisoft. They sent me a mail saying I need to take a quick online test. This was much sooner than I thought. And I didn’t have the time to raise my C++ skills. So I desperately tried to learn as much in as little time as possible. I gave up on that around noon of the second day. I was learning a lot of stuff, and it was super interesting but I was sure it wouldn’t make any difference. So I took the test and it went horribly. It was basic questions, but I still wasn’t able to do it correctly. That depressed me, and I couldn’t work that day. I mostly spent it staring blankly at walls, pondering about my life. But I got back on track today. Even if it started slowwwwly I still managed to do some cool things.
Daily interesting stuff:
Article complaining on how difficult it is to see new games on steam. I also did the manipulations, and indeed to see the recent release on steam requires a bit of searching. But I saw a cool game in the process. I put it in my wishlist.
First part of a small series on storytelling in games. I don’t particularly agree on people saying the story is so essential. Sure it’s nice but not indispensable. What matters IMO is immersion. If the game manages to capture you in its world, it succeeds. Story is just one way of doing that.
Reddit post, “Why do AAA trailers look better than the game?”. There’s a lot of possible reason, and every one seems valid. It all revolves around the need for marketing content well before having the game ready.
Tasks done:
When I was working on my C++, the artists asked stuff on the slack channel. So I responded. I ended up trying to manage different tileset size to match the repetition. I tried a lot of things to be able to use any kind of asset they would give me. It was complicated to handle the tile asset size, the tiles size in Tiled, the number of tiles in a room, the ratio import to Unity. All that while being limited by my dungeon procedural generation that need precise room size.
I forgot to write this in day 118 but the name of the guns was wrong. So I changed them. Easy easy.Greatly improved the tracking AI. As you may know, I chose to use a raycasting based collision avoidance. It works well and it’s super light in term of performance. But it had some major problems. The Ai would get stuck on obstacles. It would appear janky. And honestly I didn’t think I could really improve it since, I already tried so many things. But I worked on it anyway. I played the game and noted all the problems I could find. Then I tried other ideas I didn’t try before. Some were really bad. Like I thought having the rays change their angle to do a “sweep” would help the detection. I was horrible. But after an absurd amount of messing around with the same 20 lines of code, I end up fixing most of the problems. First I solved a big problem when in a lot of cases, the enemy would decide to go right then the next frame left and the next right again. This happens a lot due to the fact that I use the actual position and not the next. So when the enemy moves it changes the situation and suddenly it’s better to change direction. To fix it I didn’t worked with the next pos it would have been too big to do. I just save the last avoidance strategy (right, left, or none) as well as the time when it was changed. Then I added condition so that the direction can be updated only if the strategy remains the same or if the last time it changed is old enough. This helped, but the behavior was still weird. The second thing was that to avoid an obstacle, I offset the direction by an angle. The closer you are to the obstacle the more offset you had. And if you were too close for this to work you would do an emergency “break”. The idea was ok. But the implementation was exactly doing what I wanted. I found this almost at random. But now the offset is calculated based on the length of the rays. This meant that no matter what the “eyes” length the behavior would not change. This made miracles. It works so much better. Plus I was able to get rid of this “emergency” thingy. Now the offset is just a lerp between 10 and 180 degrees based on the ratio of the current dist vs the eyes length. Oh and lastly I changed the behavior of the wall collisions. Before I just made the enemies “bounce” on it by setting their position to 5 times the current dir. That made them get blocked and shake. To fix this I just offset the dir by 90 degrees instead. I wasn’t sure about this at all. But it works really well. If you look closely you can see that the enemies sometimes get a bit on the walls. But it doesn’t look weird. I still have a few things to do, but it’s getting alright.
0 comments