[Mod] assign Mobs to spawn in given habitats [mobshabitats]

User avatar
taikedz
Member
 
Posts: 587
Joined: Sun May 15, 2016 11:11
GitHub: taikedz
IRC: DuCake
In-game: DuCake

[Mod] assign Mobs to spawn in given habitats [mobshabitats]

by taikedz » Tue Oct 25, 2016 11:26

A supporting mod for spawning mobs made with mobs_redo

The intent is for mobs modders to be able to define where their mobs should spawn, and be able to assign the mobs to those places in bulk. Add a dependency to mobshabitats or just copy-in the api.lua file.

+ Server admins


Features:

    * Define main characteristics of a habitats
    * Define group mobs into families
    * Assign individual mobs or mob groups to habitats
    * Simple syntax, defaults taken care of

+ Predefined biomes (can be overridden)


An example of adding mobs to ethereal biomes:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
-- ethereal biomes

mobsbiomes:add_biome("ethereal:firepits",{
        floors = {"ethereal:fiery_dirt"},
        plants = {"ethereal:dry_shrub"},
        walls = {"default:obsidian"},
})

mobsbiomes:add_biome("ethereal:bamboo",{
        floors = "ethereal:bamboo_dirt",
        trees = "ethereal:bamboo",
        plants = "ethereal:bush",
})

-- spawning example


if minetest.get_modpath("dmobs") then
        mobsbiomes:add_spawn("dmobs:panda","ethereal:bamboo") -- use default spawning values from mobsbiomes
end

if minetest.get_modpath("mobs_monster") then
        mobsbiomes:add_family("firemonsters",{
                lavaflan = {mobstring="mobs_monster:lavaflan",spawnon="floors",spawnby="walls"},
                dungeonmaster = {mobstring="mobs_monster:dungeon_master",spawnon="floors",spawnby="walls",max_light=10},
        })

        mobsbiomes:add_family("groundmonsters",{
                oerkki = {mobstring="mobs_monster:oerkki",spawnon="floors",spawnby="walls"},
                stonemonster = {mobstring="mobs_monster:stone_monster",spawnon="floors",spawnby="walls"},
        })

        mobsbiomes:add_family_spawn("firemonsters","ethereal:firepits")
        mobsbiomes:add_family_spawn("groundmonsters","ethereal:firepits")
        mobsbiomes:add_family_spawn("groundmonsters","default:caves")
end


Git: https://github.com/taikedz/minetest-mobsbiomes
Zip: https://github.com/taikedz/minetest-mob ... master.zip
License: LGPLv3
Last edited by taikedz on Thu Dec 22, 2016 14:49, edited 4 times in total.
 

User avatar
Andrey01
Member
 
Posts: 431
Joined: Wed Oct 19, 2016 15:18
In-game: Andrey01

Re: [Mod] Mobs Biomes [mobsbiomes][wip]

by Andrey01 » Tue Oct 25, 2016 13:48

Taikedz, i haven`t understood, what have you added are these biomes for, if do they be default?What are mobs will be spawn in it?
 

User avatar
taikedz
Member
 
Posts: 587
Joined: Sun May 15, 2016 11:11
GitHub: taikedz
IRC: DuCake
In-game: DuCake

Re: [Mod] Mobs Biomes [mobsbiomes][wip]

by taikedz » Tue Oct 25, 2016 15:43

Andrey01 - this is a supporting mod for anyone to use.
 

User avatar
D00Med
Member
 
Posts: 712
Joined: Sat Feb 07, 2015 22:49
GitHub: D00Med

Re: [Mod] assign Mobs to spawn in given Biomes [mobsbiomes][

by D00Med » Tue Oct 25, 2016 19:37

So the idea is that biome mods can make mobs spawn on them?
Look! I have a signature :]
My subgame: https://forum.minetest.net/viewtopic.php?f=15&t=14051#p207242
dmobs2 is coming...
 

User avatar
taikedz
Member
 
Posts: 587
Joined: Sun May 15, 2016 11:11
GitHub: taikedz
IRC: DuCake
In-game: DuCake

Re: [Mod] assign Mobs to spawn in given Biomes [mobsbiomes][

by taikedz » Tue Oct 25, 2016 20:27

The idea really is that mobs mods themselves can define biomes generally and assign mobs to them in bulk.

I developed it with nssm in mind but thought it could also generally be useful....

Mob modders can then declare the biome types thdir mobs will spawn in, and server admins can add swathes of mobs to multiple similar (or not) biomes
Last edited by taikedz on Wed Oct 26, 2016 12:42, edited 1 time in total.
 

manawy
Member
 
Posts: 10
Joined: Sat May 28, 2016 20:14

Re: [Mod] assign Mobs to spawn in given Biomes [mobsbiomes][

by manawy » Wed Oct 26, 2016 02:37

This looks like a very interesting library for game developer. I tried this by hand and it's indeed quite difficult.

I'd like to suggest some changes :

- it seems to me that mobs spawn on top of nodes, so instead of trees, it should be leaves (but I may be wrong)

- The default interval shouldn't be "1", it what make the goblin mods very difficult to play in a larger world. If the interval is one, the chance parameter doesn't matter and the mobs will spawn anyway (for large enough biomes). From my tests, it seems better to play with the chance parameter and leave the interval parameter at 30. It should also be less resource intensive (though I don't know how much in practice)
 

User avatar
taikedz
Member
 
Posts: 587
Joined: Sun May 15, 2016 11:11
GitHub: taikedz
IRC: DuCake
In-game: DuCake

Re: [Mod] assign Mobs to spawn in given Biomes [mobsbiomes][

by taikedz » Wed Oct 26, 2016 12:14

manawy wrote:- it seems to me that mobs spawn on top of nodes, so instead of trees, it should be leaves (but I may be wrong)


Mobs spawn on top of specified nodes indeed. If you want mobs to spawn on leaves, define an environment that has leaves

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
mobsbiomes:add_biome("treetops:pine",{
    floors="default:pine_leaves",
    walls="default:pine_tree"
})

mobsbiomes:add_spawn("mymobs:eagle","treetops:pine")


Floors will often be where the mob spawns *on*, you can define it to be anything.

Defining by floors, walls, plants and trees is just a handy way to be able to use shorthands. "spawn an owl in [treetops] and in [plains]" without having to also say "if in trees, spawn on the plants, if in plains, spawn on the ground".

It's easier if you define the "floor" from the point of view of the mob: what is a ceiling to a bear is a floor to a bird.

manawy wrote:- The default interval shouldn't be "1", it what make the goblin mods very difficult to play in a larger world. If the interval is one, the chance parameter doesn't matter and the mobs will spawn anyway (for large enough biomes).


I've never seen the behaviour you describe. Though it is entirely possible that the goblins mod does something funny, as I know that it forked a copy of mobs_redo instead of adding a dependency.
 

User avatar
taikedz
Member
 
Posts: 587
Joined: Sun May 15, 2016 11:11
GitHub: taikedz
IRC: DuCake
In-game: DuCake

Re: [Mod] assign Mobs to spawn in given Biomes [mobsbiomes][

by taikedz » Wed Oct 26, 2016 12:30

D00Med -- sorry I was on mobile device yesterday, should have just held off on responding

For a mobs mod (taking dmobs as an example), I could imaging adding a file "spawns.lua" (either the server admin could make their own, or shipping one in the mod) containing something like

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
mobsbiomes:add_family("woodlandcreatures",{
   {mobstring="dmobs:panda",spawnon="floors",spawnby="floors",chance=5000}, -- make the panda rare
   {mobstring="dmobs:fox",spawnon="floors",spawnby="trees"},
   {mobstring="dmobs:hedgehog",spawnon="floors",spawnby="plants"},
})

mobsbiomes:add_family_spawn("woodlandcreatures","default:forest")
mobsbiomes:add_family_spawn("woodlandcreatures","default:pineforest")
mobsbiomes:add_family_spawn("woodlandcreatures","ethereal:bamboo_grove") -- which could be defined by ethereal itself, or in another mod entirely


So rather than having spawning interspersed around the place and having to manage each spawn params separately, manage them in a single place and add them to multiple "biome" types.
 

manawy
Member
 
Posts: 10
Joined: Sat May 28, 2016 20:14

Re: [Mod] assign Mobs to spawn in given Biomes [mobsbiomes][

by manawy » Wed Oct 26, 2016 13:22

taikedz wrote:It's easier if you define the "floor" from the point of view of the mob: what is a ceiling to a bear is a floor to a bird.


Ok, I didn't understood it like that. I'll give it a try

taikedz wrote:I've never seen the behaviour you describe. Though it is entirely possible that the goblins mod does something funny, as I know that it forked a copy of mobs_redo instead of adding a dependency.


For me it has to do with how many time you launch the dice. It does not matter that you have 1/100000000000000 chance of spawning a mob, if you try it 10000000000000000000000000 you will spawn it.
By increasing the interval, the mob spawning is a bit more random. It all depends on what you want, but it may be better as a default value to avoid a mob of angry users . But at least the option is available so it's good :)
 

User avatar
azekill_DIABLO
Member
 
Posts: 3458
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO

Re: [Mod] assign Mobs to spawn in given Biomes [mobsbiomes][

by azekill_DIABLO » Thu Oct 27, 2016 11:15

i like this support mod!! i will see if i can merge it with mila... may not be hard at all XD
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
Hi, my username is azekill_DIABLO and i'm an exelent bug-maker(yeah...i know...i have a bad reputation)

azekill_DIABLO said: Mineyoshi+ABJ+Baggins= TOPIC HIJACKED.
My Mods and Stuff | Voxellar | VoxBox on GITHUB | M.I.L.A Monster engine
WEIRD MODDING CONTEST !!!
 

User avatar
taikedz
Member
 
Posts: 587
Joined: Sun May 15, 2016 11:11
GitHub: taikedz
IRC: DuCake
In-game: DuCake

Re: [Mod] assign Mobs to spawn in given Biomes [mobsbiomes][

by taikedz » Thu Oct 27, 2016 12:19

Really, the only part that is "dependent" on mobs_redo is the spawning call

So only that call needs to be adjusted to match what MILA expects
 

User avatar
azekill_DIABLO
Member
 
Posts: 3458
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO

Re: [Mod] assign Mobs to spawn in given Biomes [mobsbiomes][

by azekill_DIABLO » Sat Oct 29, 2016 16:48

Juste what i thought. O:-)
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
Hi, my username is azekill_DIABLO and i'm an exelent bug-maker(yeah...i know...i have a bad reputation)

azekill_DIABLO said: Mineyoshi+ABJ+Baggins= TOPIC HIJACKED.
My Mods and Stuff | Voxellar | VoxBox on GITHUB | M.I.L.A Monster engine
WEIRD MODDING CONTEST !!!
 


Return to WIP Mods

Who is online

Users browsing this forum: No registered users and 3 guests

cron