[Mod] Mobs Redo [1.61] [mobs]

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

Re: [Mod] Mobs Redo [1.56] [mobs]

by TenPlus1 » Post

Pandas will spawn in the bamboo biome when Ethereal mod is active, it's a special mob :) and penguins spawn on snowblocks.

BlueTangs Rock
Member
Posts: 204
Joined: Sun Jul 10, 2016 05:00
Location: Under Le' Sea

Re: [Mod] Mobs Redo [1.56] [mobs]

by BlueTangs Rock » Post

TenPlus1 wrote:
Fri Aug 20, 2021 10:31
Pandas will spawn in the bamboo biome when Ethereal mod is active, it's a special mob :) and penguins spawn on snowblocks.
Ah, Thanks for this information!
Look at that, a signiture box! To bad I have nothing to put in i-... Wait...

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

Update:

by TenPlus1 » Post

- Mob babies can now be picked up by the lasso.
- Fixed a bug when sneak + right-clicking mob.

isaiah658
Member
Posts: 168
Joined: Sun Jan 24, 2016 14:58
Contact:

Re: [Mod] Mobs Redo [1.56] [mobs]

by isaiah658 » Post

@TenPlus1 I have a technical question about mobs_redo. I'm making a mod where the goal is to have a bunch of very simple aimlessly roaming mobs. The catch though is that there will be at least 100 unique mobs, potentially 200. From looking at the mobs_redo code, this means every unique mob has an abm for spawning. Would the performance be better if I switched to something like mobkit and used a single spawning timer for all mobs? Something like this: https://github.com/Xanthus1/cube_mobs/b ... spawns.lua I'd obviously need to consider the spawning rates of the different mobs to get similar spawning as the abms, but it should be possible.

User avatar
IFRFSX
Member
Posts: 71
Joined: Fri Mar 09, 2018 09:50
GitHub: IceCatX
In-game: IFRFSX

Re: [Mod] Mobs Redo [1.56] [mobs]

by IFRFSX » Post

It is recommended to use github or gitlab, notabug and other code management platforms

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

Re: [Mod] Mobs Redo [1.56] [mobs]

by TenPlus1 » Post

Use whatever you are comfortable with, I use notabug.org because it's fast and simple :)

User avatar
MisterE
Member
Posts: 693
Joined: Sun Feb 16, 2020 21:06
GitHub: MisterE123
IRC: MisterE
In-game: MisterE

Re: [Mod] Mobs Redo [1.56] [mobs]

by MisterE » Post

isaiah658 wrote:
Tue Oct 05, 2021 11:31
@TenPlus1 I have a technical question about mobs_redo. I'm making a mod where the goal is to have a bunch of very simple aimlessly roaming mobs. The catch though is that there will be at least 100 unique mobs, potentially 200. From looking at the mobs_redo code, this means every unique mob has an abm for spawning. Would the performance be better if I switched to something like mobkit and used a single spawning timer for all mobs? Something like this: https://github.com/Xanthus1/cube_mobs/b ... spawns.lua I'd obviously need to consider the spawning rates of the different mobs to get similar spawning as the abms, but it should be possible.
mobkit does have lower overhead code running anyways, I'm told. but you can write your own custom spawing for mobs too, you would have to anyways with mobkit. for 200+ simple mobs my suggestion at this point in mob api development is just to use mobs redo and write your own spawning useingminetest.add_entity

isaiah658
Member
Posts: 168
Joined: Sun Jan 24, 2016 14:58
Contact:

Re: [Mod] Mobs Redo [1.56] [mobs]

by isaiah658 » Post

MisterE wrote:
Tue Oct 05, 2021 23:31
mobkit does have lower overhead code running anyways, I'm told. but you can write your own custom spawing for mobs too, you would have to anyways with mobkit. for 200+ simple mobs my suggestion at this point in mob api development is just to use mobs redo and write your own spawning useingminetest.add_entity
I've heard that as well, so I decided to do some testing using the Minetest profiler. I don't know if I'm not using mobkit correctly or if my testing is flawed, but in every test mobs redo did better than mobkit. I attempted to make the tests as comparable as possible. I followed the same steps in every test, used the same world seed, the same base game, etc. I made the same mob that just roams around in mobkit and mobs redo. I also did extra tests where I used my own abm to make the spawning condition identical in both mods. The mobkit on_step function appears to slower than the mobs redo on_step function, at least that's what the results were pointing towards. When I scaled it up to 100 unique mobs and thus 100 abm's, mobs redo was still a lot better than mobkit in the profiler results.

The important question though was whether a spawning timer like the one in cube mobs was better than an abm and the tests did show that timer was a bit better. My plan now is make my own spawning code for mobs redo and do more tests.

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

Re: [Mod] Mobs Redo [1.56] [mobs]

by TenPlus1 » Post

Making custom mobs using Mobs Redo api can easily make use of the do_custom function to bypass most of the api functions or a custom on_step to skip them completely. As for spawning, you could make your own wide checking abm that quick checks conditions and surrounding nodes to spawn one of many mobs (I use such a thing to spawn a ob with different textures or attributes).

https://notabug.org/TenPlus1/mobs_redo/ ... i.txt#L315

revevil
Member
Posts: 49
Joined: Tue May 14, 2019 03:11

horde spawning?

by revevil » Post

Hello I've just got an idea. But I want to know what other people think about this. How about spawning hordes of monsters? I think it might be fun to fight off groups of monsters but it would mean certain death for me early in the game. I like the idea but I don't know if I would survive.

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

Re: [Mod] Mobs Redo [1.56] [mobs]

by TenPlus1 » Post

By tweaking the mob api settings (mob_difficulty and mob_chance_multiplier) you can have hourdes appear using current mobs, or you can change the chance and interval settings in a mob:spawn() function to create your own monster hourde.

https://notabug.org/TenPlus1/mobs_redo/ ... gtypes.txt

SFENCE
Member
Posts: 280
Joined: Sun Sep 29, 2019 07:13
GitHub: SFENCE
In-game: SFENCE

Re: [Mod] Mobs Redo [1.56] [mobs]

by SFENCE » Post

Is it somehow possible to make mobs like horses drowning only in deep water?
Actually, it looks like one node deep water caused the horse to drown. It doesn't look well, because the horse head is still above water in one node deep water.
cdb_3P0AYqjEIn68

User avatar
Linuxdirk
Member
Posts: 3217
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: [Mod] Mobs Redo [1.56] [mobs]

by Linuxdirk » Post

Is there a way to prevent friendly mobs from despawning by default and spawning them based on the "mob density" of an area (i.e. there are 2 cows within an area of 4 blocks but there should be 3, so spawn another one but do not despawn any of them).

SFENCE
Member
Posts: 280
Joined: Sun Sep 29, 2019 07:13
GitHub: SFENCE
In-game: SFENCE

Re: [Mod] Mobs Redo [1.56] [mobs]

by SFENCE » Post

Linuxdirk wrote:
Mon Feb 14, 2022 08:53
Is there a way to prevent friendly mobs from despawning by default and spawning them based on the "mob density" of an area (i.e. there are 2 cows within an area of 4 blocks but there should be 3, so spawn another one but do not despawn any of them).
Mobs should be tamed (by feeding) to prevent despawn.
cdb_3P0AYqjEIn68

User avatar
Linuxdirk
Member
Posts: 3217
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: [Mod] Mobs Redo [1.56] [mobs]

by Linuxdirk » Post

SFENCE wrote:
Mon Feb 14, 2022 15:14
Mobs should be tamed (by feeding) to prevent despawn.
I know. My question/request is specifically about untamed mobs.

Duvalon
Member
Posts: 43
Joined: Thu Jun 18, 2020 00:32
Location: Canada

Re: [Mod] Mobs Redo [1.56] [mobs]

by Duvalon » Post

Hi.

I've been looking for a way to execute some code when an entity is added to the game by the mobs_redo API. I looked at lua_api.txt but there doesn't seem to be a global callback for minetest.add_entity. The only thing I've found is cmi which looks like it would allow this with register_on_activatemob. Does that sound right?

Thanks for the help.

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

Re: [Mod] Mobs Redo [1.56] [mobs]

by TenPlus1 » Post

Mob definition has on_spawn, after_activate and do_custom functions that let you do something when a mob spawns:

https://notabug.org/TenPlus1/mobs_redo/ ... i.txt#L294

...also the mobs:spawn function itself has an on_spawn for when it appears in the world:

https://notabug.org/TenPlus1/mobs_redo/ ... i.txt#L406

Duvalon
Member
Posts: 43
Joined: Thu Jun 18, 2020 00:32
Location: Canada

Re: [Mod] Mobs Redo [1.56] [mobs]

by Duvalon » Post

Those appear to be functions for custom mobs. I don't want to make my own, I just want to be notified when one is spawned; in other words, some sort of global callback I can register to. I don't want to be periodically polling all entities and override their notify function either.

It looks like cmi does what I need, and mobs_redo seems to support it. I'll give it a try and see where it takes me.

Thanks.

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

Re: [Mod] Mobs Redo [1.56] [mobs]

by TenPlus1 » Post

Ah ok, I assumed you wanted it to do something specific when a mob spawned :) Yeah cmi will let you know when a mob spawns.

roscoeb
Member
Posts: 16
Joined: Fri Jan 21, 2022 22:27

Re: [Mod] Mobs Redo [1.56] [mobs]

by roscoeb » Post

hi
i cannot seem to download from notabug, are there any other download sites, i just need the npc and trader mod

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

Re: [Mod] Mobs Redo [1.56] [mobs]

by TenPlus1 » Post

Use https://content.minetest.net/ for downloads and information, also notabug site was down the other day, it's back online now :)

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

Update:

by TenPlus1 » Post

- Translations updated
- Added 0.4.x compatibility for older clients
- Bug fixes and tweaks

auouymous
Member
Posts: 195
Joined: Sun Dec 07, 2014 09:39
GitHub: auouymous
IRC: air
In-game: auouymous

Re: [Mod] Mobs Redo [1.56] [mobs]

by auouymous » Post

Why is acceleration and other velocity modifiers not multiplied by dtime in mobs.drive() in mount.lua? The velocity is being modified at inconsistent rates when dtime jitter is high. Changing entity.accel / 10 to entity.accel * dtime applies the correct amount of acceleration per step. And any other value added to entity.v, such as 0.02 * s and whatever happens to v, should also be multipled by dtime.

The max speed should be enforced by clamping to max speed, not by subtracting 1 from it. If the max forward or reverse speed is only 0.5 with a slow accel, it will ping pong between 0.5 and -0.5. Replacing all of the limiting code with the following would properly clamp it to max forward or reverse velocities.


-- enforce speed limit forward and reverse
if entity.v > entity.max_speed_forward then
entity.v = entity.max_speed_forward
elseif entity.v < -entity.max_speed_reverse then
entity.v = -entity.max_speed_reverse
end

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

Update:

by TenPlus1 » Post

- Tweaked mobs.drive() speed (thanks auouymous)

auouymous
Member
Posts: 195
Joined: Sun Dec 07, 2014 09:39
GitHub: auouymous
IRC: air
In-game: auouymous

Re: [Mod] Mobs Redo [1.56] [mobs]

by auouymous » Post

Thank you for making those changes.

Minetest's tick rate appears to be the same as FPS, at least in single player. So players with high FPS would turn, accelerate and decelerate faster than those with low FPS.

The entity.v = entity.v - 0.02 * s should be changed to entity.v = entity.v - CONSTANT * s * dtime, but that 0.02 constant needs to be an actual deceleration drag (m/s/s) value. The constant could also be moved to a variable in entity so mods can tweak it.

There are four velo.y = velo.y ... lines whose constant should be multiplied by dtime. Like the 0.02 drag constant, the 1 and 0.1 must become actual vertical acceleration and deceleration values, and could be moved to entity variables adjustable by mods. There should also be max_speed_up and max_speed_down limits because the vertical velocity is incorrectly clamped to the accel value.

The two horz = horz ... lines should also have the constant an actual turn rate value, multiplied by dtime, and moved to a variable for mods.

The v = v * 0.25 should also use dtime but I'm not sure what it is used for or why the velocity is reduced by 75% per tick, and simply multiplying by dtime would be wrong. It should probably use something like the drag equation, with a much higher drag constant, and clamp to zero if the sign changes.

Post Reply

Who is online

Users browsing this forum: Google [Bot], SFENCE and 20 guests