Weekly Devlog 3 - Enemies (Level)


This week I worked on getting the pathfinding to work, animating the chests and exit gate,  and creating title screen and end page. 

I worked out why my pathfinding wasn't working: 1. the nodes were not being generated at z=0, hence the enemy wasn't actually able to interact with them. 2: In one of the pathfinding methods I was calling the wrong reference (target instead of other).

For the title I have 2 buttons (Play and quit), play takes you to the game using a scene switcher script, while quit quits the application. For the exit screen I have play again or quit. 



For the chest animations, if you press M near it it will open and stay open, increasing the soul count. I chose not to have any camera affects for opening and closing the chest as enemies still approach and I don't want game play to be paused. 


The gate is similar to the chest however I have a pop up panel that tells you if you need more souls or whether you have enough. I had to prevent the player from shooting when clicking an option by checking whether a panel was open in the player shooting script. I wanted to have the camera zoom into the opening gate if you choose to leave Limbo, but encountered a fair bit of trouble. I set up a cinematrack like we did in the tutorials, however the camera would still only follow the player and not switch over to the intended ones. I realised I had a camera component on my virtual camera which was displaying on the same channel as the main camera and suspected this might be why, however when I removed that component the camera went entirely black. I changed the background colour of the camera to see if that was what I was seeing and it was.  I had a quick look online to see if anyone else had problems like this and clipping planes came up pretty often. I tried to change them on the main camera but it would let me edit it, so I changed them on the virtual cameras (from 0.3 - 1 to 0.1 - 1000). This let me see everything again which was great, but it still wasn't "zooming" (going from a bigger camera to a smaller camera). I again had a look online and found that the pixel perfect camera can effect what you see, so I had a play around. I found out the pixel perfect camera reference resolution effects whats in frame of the camera, so I decided to turn it off. The zoom worked from then on and I find pixel perfect doesn't really affect the visuals too much so I don't think its worth spending time to find a way to make it work with pixel perfect camera.


Tutorial feedback: The pathfinding enemy sometimes gets stuck if two of them are very close, soul count can go negative,  enemy soul drop is always 2 and camera needs some touching up. 

Pathfinding: I tried recreating the scenario by placing 2 enemies and running circles around them and noticed they seemed to be getting stuck from each other, so I adjusted the project setting so that the enemy couldn't collide with itself, though that can mean they can overlap. I decided instead to have them collide but change their rigidbody type to kinematic, which is essentially the same and they can still overlap, but now i have the opportunity at some point, if I have the time, to make a collision script that might keep them separated.  

Negative souls: I never encountered the problem as I use my trackpad and not a mouse so I hadn't realised the souls could go negative. I adjusted the script from if (souls != 0) to if (souls >0) for shooting, which fixed that issue. I also implemented a shooting delay of 0.2 seconds so rapid fire can't happen, though I need to find a mouse to test if this is actually working!

Camera: I haven't had the time to fix this, I want to make the camera follow the player a little better especially when Lich dashes. I noticed a bit late that after changing the camera to more square, I forgot to update the itch screen size, which may have been cutting the top off a little.

Soul drop: My code for checking the enemy's name and comparing to an array in a loop was logically incorrect and hence always went to the first option (bat), so once I got it properly going through the for loop, the soul drop worked correctly

Files

Tut 3 - Enemies 2.zip 8 MB
May 03, 2023

Get Lich in Limbo

Leave a comment

Log in with itch.io to leave a comment.