Page 1 of 1

smart mobs

PostPosted: Tue Feb 09, 2016 19:37
by rnd
Smart Mobs by rnd

License: LGPL
Depends: default
Download: https://github.com/ac-minetest/smart_mobs


Description
In an attempt to make more challenging mobs i added pathfinding to great Mobs Redo [1.26] by TenPlus1.
Note: this mod is far from being perfect since builtin pathfinding it uses doesnt seem to work that well, its rather enhancement to previously dumb mobs.

Added:

1. when mob follows you and gets stuck in one place, it will attempt to calculate path to you
2. if it cant do that and if digging option is on, it will attempt to break down wall or place stone block to climb to you. It will even remove one block above its head to do so so it can get to you from cellar. It will only do this if there is no protection around.
3. if it has path it will slow down to walk speed for more precision and follow path until it gets to you

mobs from spawner (blue box) coming around up stairs and killing players. Note that protector prevents them from building upwards or digging
Image

they can and will find path to you, even if its more complex spiral staircase as in this example, where mobs find way from blue box below and already attack
Image

I thank WSDGuy2014 for testing

Re: smart mobs

PostPosted: Tue Feb 09, 2016 20:06
by benrob0329
A little buggy, but it'll make fighting mobs a lot harder!!

Re: smart mobs

PostPosted: Tue Feb 09, 2016 20:16
by TenPlus1
Wow, ncicely done rnd :) love the new features... may I add this to mobs redo ?

Re: smart mobs

PostPosted: Tue Feb 09, 2016 20:39
by maikerumine
Boom! my favourite topic! Excellent work on this RND, it is a must add to esmobs as well. Keep up the great work, this is a game changer for sure.

Re: smart mobs

PostPosted: Tue Feb 09, 2016 22:50
by rnd
TenPlus1 wrote:Wow, ncicely done rnd :) love the new features... may I add this to mobs redo ?


Sure.

Re: smart mobs

PostPosted: Wed Feb 10, 2016 00:26
by benrob0329
What if say, dirt monsters placed dirt, sand monsters placed sand, Oerkkis placed Obsidian, etc?

Also:

Perhaps making so that if player is within a certain range, mobs will walk to player until within sight, which it will then chase player in the standard strait line.

Re: smart mobs

PostPosted: Wed Feb 10, 2016 05:34
by maikerumine
https://www.youtube.com/watch?v=_nxiMBJLrAQ&feature=youtu.be
Some testing your pathfinding code with esmobs and excitement!

Re: smart mobs

PostPosted: Wed Feb 10, 2016 07:35
by rnd
Watched maikerumine's video and tried to improve what i could:

update:
1.Fixed bug where mob would go to player stand there and do nothing: when player is in attack range stop following path and reset stuck timer to 0 so attack can begin immidiately
2. mob will now drop one block above its head so it can now dig its way up from the cellar
3. make mob placed blocks temporary ( 30 s) to prevent map looking bad
4. prevent occasional block placing by requiring some time more than 1 second to pass in stuck state

unfixable problems ( due to minetest built in find_path)
- there is no setting in minetest.find_path to consider stuff like grass not solid
- there is no setting in find_path to consider path unpassable if there is not enough head space (2 block tall mob cant crawl through 1 block vertical hole) this in particular can sometimes cause mobs stuck under stairs

Re: smart mobs

PostPosted: Wed Feb 10, 2016 09:15
by twoelk
how about a pestering salesman or a beggar to add life to some medieval market.
I wonder if pickpockets would be possible.

Re: smart mobs

PostPosted: Fri Feb 12, 2016 16:11
by rnd
update: careful rewrote of "mob trying to get to player" process, more responsive mobs, no more "frozen in state" mobs

mobs are now much more aggressive in trying to build/dig to get to you, they dont "daydream" or are "buggy" anymore

Re: smart mobs

PostPosted: Sat Feb 13, 2016 14:40
by snowflake
Hi Rnd

i got the error in init.lua error in the mod when i tryed in single player world

idk what to do can u plz help me

Re: smart mobs

PostPosted: Sat Feb 13, 2016 15:03
by qwertymine3
snowflake wrote:Hi Rnd

i got the error in init.lua error in the mod when i tryed in single player world

idk what to do can u plz help me


There is very little Rnd can do to help you if you don't post the full error text.

This can be found at the end of your debug.txt file after a crash or mod error.

Re: smart mobs

PostPosted: Sat Feb 13, 2016 15:19
by maikerumine
snowflake wrote:Hi Rnd

i got the error in init.lua error in the mod when i tryed in single player world

idk what to do can u plz help me


indeed.

Sno, please post in the code section the following file:
minetest/bin/debug.txt

BUT!!!!!!!!!!

Before you do, please do the following:

1. Open the debug.txt and delete everything and save.
2. Start minetest with the configuration that breaks for you.
3. Test it until error.
4. Go back to the fresh debug.txt and copy all the code and paste in the post according to the mod that errors. Please use the code button to place all that text.
5. Tell us about your computer with the information such as:
operating system: Linux, OSX, windoze, android, etc...
system specs: amount of ram you have, size of video card, processor speed and number of processors.

Re: smart mobs

PostPosted: Sat Feb 13, 2016 19:18
by rnd
update:
-randomized unstucker to prevent mobs from getting stuck near cliff edges on complex paths
-code tidying (main pathfind code now in separate function, by TenPlus1)

example of mob navigating complex path (successfuly)
Image

note: it is best to set "walk_velocity = 2" for mobs, this ensures smooth navigation and is not too slow/too fast

Re: smart mobs

PostPosted: Sat Mar 12, 2016 23:59
by Sokomine
rnd wrote:1.Fixed bug where mob would go to player stand there and do nothing: when player is in attack range stop following path and reset stuck timer to 0 so attack can begin immidiately

But...there ought to be friendly mobs as well! Those that just go to the player in order to say hello :-)

Re: smart mobs

PostPosted: Mon Jun 20, 2016 02:28
by programmingchicken
Sokomine wrote:
rnd wrote:1.Fixed bug where mob would go to player stand there and do nothing: when player is in attack range stop following path and reset stuck timer to 0 so attack can begin immidiately

But...there ought to be friendly mobs as well! Those that just go to the player in order to say hello :-)

yea +1
+ Spoiler

Re: smart mobs

PostPosted: Wed Jan 04, 2017 07:07
by ManElevation
lol this mobs are smarter than me