Ok! It's been a while! Godoctober days 5-8 were spent working on the guards' brains to make it so that they can come after the little rat. Took me a bit since I took a break Monday to watch Look Back(please watch Look Back). Read on if you want to know more!
If the guards hear a sound, they will begin their search at the location of the sound. It's fairly easy to lure guards away, they aren't the smartest. If they happen to see you, they'll chase you down and squeaky-toy you unless you're able to stay out of their vision long enough.
If you manage to slip away, they'll continue walking past you to check the next room/area for you. If they can't find you there, they'll search the last place they saw you. After that they'll give up and go back to their original positions for now, but I plan on adding alternatives for them if I've got time. They'll stay on high alert for some time after they get back, so you'll have to be careful if you see them again!
Once we start building the levels out, I'll make the different vision cones and mess with the detection values until everything feels nice and crisp, but the systems are in place!
Ok, so the month of October decided to go crazy and I haven't been able to work on the game consistently for some time now. BUT! I was able to figure out how I want the visuals and gameplay to co-exist. The walls now fade away as you get closer to the room so that you can spot guards or other disgusting creatures hiding behind them. Should make the stealth aspects feel much nicer.
Choosing to do a 2D game with fake 3D space/perspective was likely a grave mistake that will continue biting me in the ass until long after the game has been shipped, but I will persist! It wasn't even something I'd set out to do, it just kinda happened because that's what I'd seen in my head. Good luck @glitcheli
Ok, late post for yesterday (Day 4 of Godoctober) but I got the guards' vision working. They have eyes now!! Long story short, a guard's vision is made up of one or more of VisionAreas(Area2Ds) that contain a vision modifier variable that can be unique for that specific area. This means that certain areas of the vision can have lower visibility than the others, like peripheral vision, while the center can have a higher vision capability.
When the goblin is in a vision cone, a ray is cast to it and if there is nothing blocking the guard's vision, the guard checks the light visibility of the goblin.
The guard starts with a base vision threshold, we'll say 50 for this example. This vision threshold is multiplied by the VisionArea's vision modifier variable, in this case 1.3 which makes the new vision threshold 65. This modified threshold is then multiplied again by the alert state of the guard. Since the guard in this example is vibing, he's in a low alert state which will set this modifier to 1.3 again. We multiply the modified threshold by that to get 84.5.
We then take this twice-modified threshold and compared it to Little Goblin's light visibility at the time of being seen. (This number is explained in a previous post but it's basically just a number from 0-100 representing the goblin's illumination in the scene). If Little Goblin's light visibility is lower than the guard's modified vision threshold, the guard cannot see the goblin.
This should make building out the lighting in the levels and getting to stealth through them super fun! Even more fun is that I set it up to be modular, so I can create as many custom cones as I want, made with as many vision areas as I want, and I can change the modifier values on all of them. This'll let me make different cones for the guards' different alert levels, different activities, and whatever else I want! I also made it so that these vision cone nodes can be added to whatever else I want to give vision, from animals to cameras to sentient brooms.
Another mechanic is down and I can't wait to start building out the levels for Little Goblin!
Taking a break from Reincarnation Trial to do Godoctober! We're making a short stealth game I've had in mind for a while called Little Goblin. Day 2 and I was able to put the system in place to modify sound as it passes through certain objects.
Thank you, Defoko and Rei, for singing in the background to make it easy. The song I used for testing is below.
Godoctober days 9 and 10 were spent making a quick and easy pause menu and then creating the inventory, items, and interactivity. My list of tasks for Little Goblin is slowly disappearing and soon I'll be able to start working on levels and content!
Day 3 of Godoctober progress was huge! I made it so that guards can hear player-caused sound effects based on the distance to the sound and the muffling of objects between the sound and guard.
I ALSO figured out the light detection bit. The square on the right is showing the view of a sub viewport, where there is a camera pointed at a white sprite. When I am in light the sprite is bright white, but when I enter any shadows it will darken accordingly.
The left square is the average color of that camera's view. I use it to get the luminance of the view, which turns into a handy number from 0 to 1 that I can use during the guard's vision checks to see if the guard should be able to see the Little Goblin.
The little freak's game may actually be playable by the end of the month