smart mobs

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 » Tue Feb 09, 2016 19:37

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

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

Re: smart mobs

by benrob0329 » Tue Feb 09, 2016 20:06

A little buggy, but it'll make fighting mobs a lot harder!!
Social: YouTube Peertube Matrix Room: #minetest:matrix.org | Games: The Infinite IKEA
 

User avatar
TenPlus1
Member
 
Posts: 2637
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: smart mobs

by TenPlus1 » Tue Feb 09, 2016 20:16

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

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

Re: smart mobs

by maikerumine » Tue Feb 09, 2016 20:39

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.
 

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 » Tue Feb 09, 2016 22:50

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


Sure.
1EvCmxbzl5KDu6XAunE1K853Lq6VVOsT
 

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

Re: smart mobs

by benrob0329 » Wed Feb 10, 2016 00:26

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.
Social: YouTube Peertube Matrix Room: #minetest:matrix.org | Games: The Infinite IKEA
 

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

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 » Wed Feb 10, 2016 07:35

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: 1333
Joined: Fri Apr 19, 2013 16:19
Location: northern Germany
GitHub: twoelk
IRC: twoelk
In-game: twoelk

Re: smart mobs

by twoelk » Wed Feb 10, 2016 09:15

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 » Fri Feb 12, 2016 16:11

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 » Sat Feb 13, 2016 14:40

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 » Sat Feb 13, 2016 15:03

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: 1350
Joined: Mon Aug 04, 2014 14:27
GitHub: maikerumine
In-game: maikerumine

Re: smart mobs

by maikerumine » Sat Feb 13, 2016 15:19

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.
 

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 » Sat Feb 13, 2016 19:18

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
(131.73 KiB) Not downloaded yet
1EvCmxbzl5KDu6XAunE1K853Lq6VVOsT
 

Sokomine
Member
 
Posts: 3918
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

Re: smart mobs

by Sokomine » Sat Mar 12, 2016 23:59

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
Location: not here
GitHub: pchicken
IRC: chicken pchicken

Re: smart mobs

by programmingchicken » Mon Jun 20, 2016 02:28

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
<gamerdude> I apologize for the above content
 

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

Re: smart mobs

by ManElevation » Wed Jan 04, 2017 07:07

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

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

Re: smart mobs

by csirolli » Fri Jun 22, 2018 04:02

So is there still a difference between mobs redo and this since tenplus1 added it to mobs redo?
Jesus is the only Way to heaven, the only saving Truth, and the only Life that is worth living.
 

User avatar
TenPlus1
Member
 
Posts: 2637
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: smart mobs

by TenPlus1 » Fri Jun 22, 2018 08:13

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


Return to WIP Mods



Who is online

Users browsing this forum: runs and 10 guests