A quick question that popped up: How do the blue lizards react to the green ones? Did you make them afraid of green ones by default, or do they realise that they are being hunted and then register the hunter as a threat? Or maybe they are just completely oblivious to the fact that they are about to be eaten?
I also loved the lizard backing up when he suddenly sees the slugcat below him in the reverse rain world gif! The way you handle the AI makes the creatures feel truly alive!
Thanks! That specific relationship is pretty much just me testing the system by this point, I don't know whether it'll make it to the final game. It might though! Or maybe green lizards could become aggressive towards blues if they're competing over prey. In any case, the creatures are going to know what other creatures to watch out for by default. They've been living in this world a long time, so they have a hunch. If they'd have to actually figure out what's dangerous and not, they'd not really stand a chance - because they're unable to see through walls they'd spot the threat as it was currently charging at them, and wouldn't really have any time to draw conclusions. I guess that the same rule as in actual nature could apply though: if something is bigger than you, get out of there!
Sounds really cool.
Are multiple lizards of the same color able to hunt cooperatively? For example not choosing the same path and/or keeping a constant distance to each other?
The yellow lizards (not in yet) have cooperation as their trait, the others are rivals with varying hostility towards each other.
I must admit that I haven't read all of the 102 pages, but just wanted to say that I really like the style of this project. It looks awesome and, judging from the gifs you're posting, has a great feel to it. Any chance to get an ETA on when this game will be released?
Thank you! No exact date yet, James and I need to pin down some design choices first!
Update 313Got a utility based AI system up and running, with a little class keeping track of each utility level, multiplying it by a strength, etc. Seems to run pretty well! Also made it so that you can give it a bias to continue the current behavior, and a function that compares all utilities and returns the highest.
One problem I ran into today was this - I want the Fear parameter to tick down slowly rather than just drop as soon as the creature is out of the threat's immediate proximity. It makes sense to continue staying away for a bit, right? The problem I encountered is that even very minor threats (say 0.2 on the "how afraid am I of this thing"-scale) should be able to cram the Fear meter up to max if they're very close.
You might be more afraid of bears than wolves, and that should make a difference if you spot either creature on a distance. If you walk around a corner and end up eye-to-eye with either animal the difference in shock and panic wouldn't be very big though.
I have something like this in - the threat alert divides with an exponential of the distance, making it so that a threatening creature has a large blob of super scary tiles around it, while a less threatening creature is only really scary in its immediate neighborhood.
The problem is that if the AI is scared by a less scary creature, but scared to max scaredness, it still takes a long time for the Fear to tick down. I don't quite know how to tackle this one just yet. One idea is that every frame that the Fear parameter is something high, a counter ticks, and then the Fear parameter ticks down slower depending on that counter... Like, if the creature was panicked for 20 seconds it takes longer to calm down than if it was only scared for 4 seconds. Hmmmm....
I wanted to post a gif of some lizards hunting each other and the player today, but the fleeing behavior never quite got to a place where it didn't look stupid, despite some efforts to make it look more consistent. I know you guys liked the panicked hesitation, but there was a bit much of it, making it look like a flickering back and forth rather than a somewhat consistent following of a flight path.
The problem is mainly that the creatures don't commit to a flight path, instead they constantly change their mind as to where they're going. I have been able to tackle some of that today though. I identified the problem to be that when evaluating if a certain spot is a good place to flee to, you can't only look at how scary it is at the destination, you have to look at how scary it is along the path to get there. Example - a safe place that is behind a threat, meaning that you have to move by very close to the threat in order to get there.
The correct solution for this would be to actually calculate the entire path, I guess, and evaluate how scary every tile is along that path. This isn't viable though, as these evaluations have to happen several times per frame. Instead I made some kind of hacky little approximation, where I check the tiles in a straight line between the creature and the possible target position. This actually seems to get rid of the absolutely worst running-straight-into-threat scenarios.
Things are moving along rather well. I found myself playing the game as a game from time to time when playtesting, which is a first for the Unity version. The very core elements of sneaking, running and out-maneuvering are in now, and the ability to very quickly change creature relationships on a whim creates a lot of cool opportunities for experimentation. Tomorrow I hope to be able to show you something.