Page 1 of 1

mob code for lua

PostPosted: Thu Feb 06, 2014 11:26
by MrElmux
Mobs are a somewhat vital part of the minetest game and there are mods that give you some mobs ( simple mods or mobf) problem is, that mobs
are currently slowing the engine, because everything ( movement etc) is made in slow lua abm's My idea would be , that some vital parts of mob handling (movement, damage dealing ) become engine parts.

PostPosted: Thu Feb 06, 2014 11:27
by MrElmux
wrong forum, can somebody move it to the feature discussion ?

PostPosted: Thu Feb 06, 2014 13:53
by Enke
This idea (or various forms of it) has been suggested numerous times.

PostPosted: Thu Feb 06, 2014 18:37
by rubenwardy
Mobs do not use ABMs.

They use global steps or ABMs for spawning (sometimes).

They use entity.tick for mobs.

PostPosted: Fri Feb 07, 2014 08:13
by MrElmux
Uh oh sorry ,,,

PostPosted: Fri Feb 07, 2014 11:51
by rubenwardy
It doesn't matter too much. A c(++) mob API would be nice.

PostPosted: Sun Feb 09, 2014 15:19
by CitroPotter
Not a bad i dea, well i was just thinking :
what if they get in the game when the engine gets some real power?

PostPosted: Wed Feb 12, 2014 13:10
by MrElmux
When im having more time again i will propably start making it .
I would suppose those fields (in addition to the current Entity code)
(these names are preliminary )
biome ( the biome it is living in) : water air land cave
spawning = dayspawn, nightspawn, startspawn(For mobs that just spawn ones)
notice_distance = The distance to notice a player
movement = (The movement either random or following if in hear distance)
movepoints (classic rougelike-like how long something can move)
I currently only want to suppose one new function :
on_hear()

Whats your idea about it ?

PostPosted: Thu Feb 13, 2014 19:48
by Sokomine
MrElmux wrote:When im having more time again i will propably start making it .

Depending on how complex you want it to be, you may either take the existing mobf (already covers most of what you#re suggesting) or simple mobs (everything a bit more simple). Or improve one or both of them.
If you intend to get it included in the engine, by all means talk to the devs so that they'll actually at least consider taking your code!

PostPosted: Thu Feb 13, 2014 20:17
by MrElmux
thats what i'm trying by posting it here in the forums
i think feature discussion ( what the users wish ) should really have been made here to reach the more
non-technical players, IRC is better for all the technical engine near development.

and i think we should pack the most of mobf into the API because it would make mob mod making a lot easier fast er and the result would run alot faster