00:00
00:00
EyeBallTank
Working on Project Nortubel.
https://rentry.co/axmy9

READ MY RENTRY POST

Joined on 8/24/21

Level:
19
Exp Points:
3,892 / 4,010
Exp Rank:
13,361
Vote Power:
6.11 votes
Rank:
Civilian
Global Rank:
> 100,000
Blams:
0
Saves:
18
B/P Bonus:
0%
Whistle:
Normal
Medals:
29

Revising an AI follower character: One of the biggest challenges yet

Posted by EyeBallTank - March 19th, 2023


I felt like redoing a follower based AI for reasons related to how Gonkee's code was settled: Not just the code structure being difficult to wrap around my head but also if OS.get_ticks_msec() could lead to performance related issues (And even if Time.get_ticks_msec() is the better version of this, i still wanted to try something different).

(Also my fault for copying code without understanding most of it, but i also did it when his video was still up but now it's gone while the Github page is still up).

So i made different versions of the Companion: First one that uses another version of Gonkee's Jared AI (Just to make an edit of the sees_player() function) and then a version reinventing the automatic movement, before i made a fourth/purple clone that can jump: CompanionFourth is now the base that i want to use to replace CompanionCopy who's technically the second version (CCopy was the one i used the most and replaces the original Companion whose code was rearranged entirely).

Therefore, i'll have to see if Comp4 (Let's refer to CompanionFourth like that) works with the same objects as CCopy (Who i've been using most of the time and is the most developed iteration).

PROBLEMS:

  • Comp4 's hurtbox doesn't work. I had a similar issue with CompanionCopy and i fixed it by making their hurtbox both monitorable/monitoring but that solution doesn't work here somehow. It's weird because i'm pretty sure i tried to repeat what works with CCopy. And yes, i still made the "iframe/pain" animation based on AnimationPlayer but that's because a certain idea of it being turned off permanently only affected the Player due to a melee attack being an animation and all.
  • Comp4 can't detect the Jumppad when it originally worked with CompanionCopy. I even renamed "velocity" to "vel" just to make it work but still nothing.
  • Comp4 "can" swim and follow the Player underwater but they shake really hard, which is also another old problem coming back (And it's probably worse here because the movement is inconsistent and i can't tell if their vertical swimming is inverted). Need to find a way to make their movement feel "diagonal" and smooth.
  • Climbing is also there but with shaky physics, because there will be parts in the game where both Player and Comp4 will climb close to each other (And THIS is WHEN i made the change automatic: Trying to get Comp4 into any CLIMB state with "if Input.is_action_just_pressed("interactcomp"):" when touching the Ladder somehow didn't work). With CCopy, you could make them attached to the Ladder but only if they were on STANDSTILL state and their climbing was rather smooth.

Meanwhile, the SLOW states work at least and so does pushing objects, entering portals and interacting with switches.

Still, i hope Comp4 becomes better than CCopy because i even want to see if it'd work with something like ice floors.

And once i've added enough states/mechanics to the 2 characters, i could finally try the character sprites and maybe redo levels to feel like actual levels or at least nice tutorial levels (Well, maybe also make the Gong checkpoint actually work and some other stuff).

As usual, project is on Github and this is Comp4's code https://github.com/EyeBallTank/PROJECT-NORTUBEL-main-ish/blob/main/src/play_actors/CompanionFourth.gd in case someone wants to see how this character works (And what does not work).

Even if i end up abandoning CCopy, i may still keep them and the other Companion versions in the game's files just so people see them (And also because my game technically contains renmants of that now-gone Cubio demo).

Meanwhile, i still haven't found a way to fix what's going on with the PauseMenu and SceneChanger scenes (And i'm pretty sure i wanted the Score Counter to be under the SceneChanger's scene changing animation).


Tags:

Comments

Comments ain't a thing here.