1 min
The eleventh CGD blog post about Don’t Walk By
I implemented this week the door system
Sometimes when the ai gets of the bus they do not go through the entrance doors and instead path along the grass to the exit.
To help deal with this I set up a pathToDoor
function. This function finds the nearest internal doors to the ai and sets the ai to path to the point of the door’s position. Once they hit the door’s trigger a script on the door causes them to start their default behaviour and path to points of interest.
I also set up an isInside bool which is checked by the script on the doors, if it’s true then the pawn is already inside and startDefaultBehaviour
shouldn’t be called. Initially isInside was set to true when the ai hit a door’s trigger but it was changed being equal to if the ai was on an interior (true) or exterior (false) tile.
It was changed to this because there where still times where the ai would decided to path along the grass even after hitting a door’s trigger. So when this happened pathToDoor
would be called again forcing the ai to go to the door.
This still didn’t completely get rid of the issue so I decided to set the grass tiles to be unpathable using the tile system. This caused the ai to be unable to walk along the grass at all.
There’s still issues with the system but the ai has stopped walking on the grass.
Subscribe to this blog via RSS.
C++ 30
Directx12 11
Mario kart 11
Commercial games development 15
Unity 15
Low-level programming (19) C++ (30) Text based adventure (5) Ex-machina (9) Game engine programming (11) Directx12 (11) Mario kart (11) Land of gold (5) Audio visual production (1) Commercial games development (15) Unity (15) Don't walk by (15)