Posts: 721
Threads: 77
Joined: Apr 2014
Thanks: 113
Given 130 thank(s) in 91 post(s)
04-29-2015, 07:12 AM
(This post was last modified: 04-29-2015, 07:23 AM by LogicParrot.)
I'm going to submit a pull request. I think this is mature enough for this.
There are a few of things that can be improved in the pathfinder, and there is MUCH to improve with the AI.
Pathfinder:- Special treatment to water, higher G cost.
- Add vertically aligned waypoints when a jump is needed, should assist the mobs in jumps.
- Move in straight line when there's a line of sight with target, this should also prevent mobs from stacking up as often as they do.
- Higher G cost around other entities to encourage spreading?
- Flight parameter. Flight is already "built in", it works by modifying some lines of code, I should make a constructor parameter for flight.
AI: - Zombies should be more aggressive when it comes to hit frequency / hitting while walking.
- Cleanup of the older path-not-finder
- Pretty much everything. The current drawbacks of the AI are eclipsing the awesomeness of the Pathfinder, I set up something which works well for the zombies, but on the long run an overhaul should be made.
I think the code is ready for merging, (unless there's a performance bottleneck, please test that). As I said before, I have to take a break for a couple of weeks. After that, I'll resume adding features (and optimizations if needed).
Please note that the zombies are not "optimal", their invisible paths are indeed optimal but they don't always follow them correctly due to the horrible AI, I did some AI changes which make this tolerable but there's room for improvement, this will be done when I resume this.
Nevertheless, it's no longer "brainless floating zombies".
Posts: 721
Threads: 77
Joined: Apr 2014
Thanks: 113
Given 130 thank(s) in 91 post(s)
04-29-2015, 07:28 AM
(This post was last modified: 04-29-2015, 07:38 AM by LogicParrot.)
The zombies are having a hard time doing precise movement (e.g) walking across a 1x1x20 plank. Can't I just make them "float" to their waypoints, disregarding all solids? the pathfinder will make sure they don't behave weirdly because the waypoints are all placed in the right places.
Edit: This is actually a pathfinder bug, it doesn't check correctly if diagonal movement is legal. (NOW FIXED)
Posts: 721
Threads: 77
Joined: Apr 2014
Thanks: 113
Given 130 thank(s) in 91 post(s)
Fixing the diagonal issue and centering the bounding box seems to have made the AI behave much better
Posts: 721
Threads: 77
Joined: Apr 2014
Thanks: 113
Given 130 thank(s) in 91 post(s)
04-29-2015, 08:09 AM
(This post was last modified: 04-29-2015, 08:10 AM by LogicParrot.)
Done a few more commits, the zombies are now very Vanilla-like, 2 main issues remain:
1. The zombies sometimes have a hard time jumping, adding vertically aligned waypoints should fix this, this is my 1st priority right now.
2. The AI is weird in daylight. Can someone find out why?
Posts: 116
Threads: 3
Joined: Sep 2014
Thanks: 31
Given 15 thank(s) in 11 post(s)
The zombies might be getting knocked around by fire damage ? OR The burning code is making path following execute with a delay ? (Just a wild guess, i haven't looked at the code much)
Posts: 721
Threads: 77
Joined: Apr 2014
Thanks: 113
Given 130 thank(s) in 91 post(s)
Can someone give me a hand here? https://github.com/wiseoldman95/MCServer...rtPointers
I am trying to convert cPath to use smart pointers but it's compiler errors all over the place.
Posts: 6,485
Threads: 176
Joined: Jan 2012
Thanks: 131
Given 1075 thank(s) in 852 post(s)
It would be nice if you wrote the actual error messages
Posts: 721
Threads: 77
Joined: Apr 2014
Thanks: 113
Given 130 thank(s) in 91 post(s)
04-30-2015, 01:46 AM
(This post was last modified: 04-30-2015, 01:48 AM by LogicParrot.)
I'll deal with it later, I just want to see zombies in MCServer first!
I'll post the error messages soon.
Original post updated, code integration with master will probably be soon, stay tuned!
Posts: 4,634
Threads: 115
Joined: Dec 2011
Thanks: 695
Given 495 thank(s) in 424 post(s)
I've tried the new pathfinder, and I have to say I'm impressed. Most mobs were able to follow me through a maze The mobs really move great, but I did notice a few bugs. - Sometimes a mob just does nothing. I spawned 2 zombies and they just stood there. I was in survival mode, and I could punch them and they would still not come after me. This could also be due to something other then the new pathfinder of course, but I thought I'd mention it.
- The path finder doesn't work when there is no block below me. For example like this: http://puu.sh/hvkoi/7754e62fd2.jpg
- When no path can be found the mobs stop stop moving. They should probably at least try to get as close as possible. It could be that issue 1 is because of this? That the mob thinks there is no path, so it stops doing anything.
Posts: 721
Threads: 77
Joined: Apr 2014
Thanks: 113
Given 130 thank(s) in 91 post(s)
04-30-2015, 05:07 AM
(This post was last modified: 04-30-2015, 06:23 PM by LogicParrot.)
(04-30-2015, 04:05 AM)NiLSPACE Wrote: I've tried the new pathfinder, and I have to say I'm impressed. Most mobs were able to follow me through a maze The mobs really move great, but I did notice a few bugs.- Sometimes a mob just does nothing. I spawned 2 zombies and they just stood there. I was in survival mode, and I could punch them and they would still not come after me. This could also be due to something other then the new pathfinder of course, but I thought I'd mention it.
- The path finder doesn't work when there is no block below me. For example like this: http://puu.sh/hvkoi/7754e62fd2.jpg
- When no path can be found the mobs stop stop moving. They should probably at least try to get as close as possible. It could be that issue 1 is because of this? That the mob thinks there is no path, so it stops doing anything.
As I said before, I was disappointed that the AI's drawbacks eclipse the pathfinder's awesomeness. Note that the next to-do in my roadmap (first post) is improving the AI. This isn't directly a pathfinding thing, but it's important. Issue 1 is most likely an AI thing, issue 3 is also AI-related.
Issue 2 is definitely a pathfinder issue, I explicitly programmed it to do nothing when there's no block beneath the player , I did not consider the situation in your screenshot.
Issue 3 is a hybrid issue. If no path is found, the pathfinder returns nothing. Making it return the "second best" shouldn't be too hard, but it isn't always the desired behavior; the zombie should start pathing only after spotting you. (You don't want 10 zombies waiting outside your cobblestone bunker, they shouldn't have seen you wanyways!), and it might be the cause for issue 1.
Thanks for the feedback, I'll add those things to my to-do list.
btw: Jiggling when trying to go up is an AI issue, I have a plan in mind for that.
|