smart mobs

Post Reply
User avatar
rnd
Member
Posts: 220
Joined: Sun Dec 28, 2014 12:24
GitHub: ac-minetest
IRC: ac_minetest
In-game: rnd

smart mobs

by rnd » Post

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
Attachments
smart_mobs3.jpg
smart_mobs3.jpg (95.41 KiB) Viewed 1565 times
smart_mobs2.jpg
smart_mobs2.jpg (149.37 KiB) Viewed 1565 times
Last edited by rnd on Tue Sep 13, 2016 13:06, edited 6 times in total.
1EvCmxbzl5KDu6XAunE1K853Lq6VVOsT

User avatar
benrob0329
Member
Posts: 1341
Joined: Thu Aug 06, 2015 22:39
GitHub: Benrob0329
IRC: benrob0329
In-game: benrob03
Location: Michigan
Contact:

Re: smart mobs

by benrob0329 » Post

A little buggy, but it'll make fighting mobs a lot harder!!

User avatar
TenPlus1
Member
Posts: 3715
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Re: smart mobs

by TenPlus1 » Post

Wow, ncicely done rnd :) love the new features... may I add this to mobs redo ?

User avatar
maikerumine
Member
Posts: 1420
Joined: Mon Aug 04, 2014 14:27
GitHub: maikerumine
In-game: maikerumine

Re: smart mobs

by maikerumine » Post

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.
Talamh Survival Minetest-->viewtopic.php?f=10&t=12959

User avatar
rnd
Member
Posts: 220
Joined: Sun Dec 28, 2014 12:24
GitHub: ac-minetest
IRC: ac_minetest
In-game: rnd

Re: smart mobs

by rnd » Post

TenPlus1 wrote:Wow, ncicely done rnd :) love the new features... may I add this to mobs redo ?
Sure.
1EvCmxbzl5KDu6XAunE1K853Lq6VVOsT

User avatar
benrob0329
Member
Posts: 1341
Joined: Thu Aug 06, 2015 22:39
GitHub: Benrob0329
IRC: benrob0329
In-game: benrob03
Location: Michigan
Contact:

Re: smart mobs

by benrob0329 » Post

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.

User avatar
maikerumine
Member
Posts: 1420
Joined: Mon Aug 04, 2014 14:27
GitHub: maikerumine
In-game: maikerumine

Re: smart mobs

by maikerumine » Post

https://www.youtube.com/watch?v=_nxiMBJ ... e=youtu.be
Some testing your pathfinding code with esmobs and excitement!
Talamh Survival Minetest-->viewtopic.php?f=10&t=12959

User avatar
rnd
Member
Posts: 220
Joined: Sun Dec 28, 2014 12:24
GitHub: ac-minetest
IRC: ac_minetest
In-game: rnd

Re: smart mobs

by rnd » Post

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
Last edited by rnd on Wed Feb 10, 2016 09:49, edited 2 times in total.
1EvCmxbzl5KDu6XAunE1K853Lq6VVOsT

twoelk
Member
Posts: 1482
Joined: Fri Apr 19, 2013 16:19
GitHub: twoelk
IRC: twoelk
In-game: twoelk
Location: northern Germany

Re: smart mobs

by twoelk » Post

how about a pestering salesman or a beggar to add life to some medieval market.
I wonder if pickpockets would be possible.

User avatar
rnd
Member
Posts: 220
Joined: Sun Dec 28, 2014 12:24
GitHub: ac-minetest
IRC: ac_minetest
In-game: rnd

Re: smart mobs

by rnd » Post

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
1EvCmxbzl5KDu6XAunE1K853Lq6VVOsT

snowflake
Member
Posts: 215
Joined: Mon Nov 16, 2015 16:50

Re: smart mobs

by snowflake » Post

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

User avatar
qwertymine3
Member
Posts: 202
Joined: Wed Jun 03, 2015 14:33
GitHub: Qwertymine
In-game: qwertymine3

Re: smart mobs

by qwertymine3 » Post

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.
Avatar by :devnko-ennekappao:

User avatar
maikerumine
Member
Posts: 1420
Joined: Mon Aug 04, 2014 14:27
GitHub: maikerumine
In-game: maikerumine

Re: smart mobs

by maikerumine » Post

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.
Talamh Survival Minetest-->viewtopic.php?f=10&t=12959

User avatar
rnd
Member
Posts: 220
Joined: Sun Dec 28, 2014 12:24
GitHub: ac-minetest
IRC: ac_minetest
In-game: rnd

Re: smart mobs

by rnd » Post

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
Attachments
mobs_navigating.jpg
mobs_navigating.jpg (131.73 KiB) Viewed 1565 times
1EvCmxbzl5KDu6XAunE1K853Lq6VVOsT

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

Re: smart mobs

by Sokomine » Post

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 :-)
A list of my mods can be found here.

User avatar
programmingchicken
Member
Posts: 540
Joined: Sat Apr 18, 2015 02:20
GitHub: pchicken
IRC: chicken pchicken
Location: not here
Contact:

Re: smart mobs

by programmingchicken » Post

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
lol the notorious necroposter pchicken is back mwahaha
<gamerdude> I apologize for the above content

User avatar
ManElevation
Member
Posts: 896
Joined: Tue Aug 02, 2016 22:04
GitHub: ManElevation
IRC: ManElevation
In-game: ManElevation
Location: Madrid,Spain

Re: smart mobs

by ManElevation » Post

lol this mobs are smarter than me
My Public Mods! Discord: Rottweiler Games#3368

User avatar
csirolli
Member
Posts: 133
Joined: Mon Jan 15, 2018 21:46
GitHub: HeyITGuyFixIt
IRC: CSirolli
In-game: CSirolli
Location: Florida, USA
Contact:

Re: smart mobs

by csirolli » Post

So is there still a difference between mobs redo and this since tenplus1 added it to mobs redo?

User avatar
TenPlus1
Member
Posts: 3715
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Re: smart mobs

by TenPlus1 » Post

Mobs Redo API is more up to date and honors protection when using smart mob functions.

Post Reply

Who is online

Users browsing this forum: No registered users and 16 guests