[Mod] Goblins [WIP][mobs_goblins]

User avatar
acidzebra
Member
 
Posts: 37
Joined: Sun Sep 10, 2017 09:11

Re: [WIP] Goblins [mobs_goblins]

by acidzebra » Sat Sep 30, 2017 15:02

This is such a great mod and I love the models - I've made the goblins the main underground enemy/nuisance in my game. Which also happens to be the place you need to get to in order to get at the goodies. What could possibly go wrong?

To smooth out their rather brisk spawn rate and capacity for absolute mayhem I have made some changes to the init.lua, specifically adjusting spawn chance, min&max spawn depths but most importantly I've added a severe restriction on light, they will only spawn in places with light between 0 and 4. To keep them out of your mines/underground cities proper light placement has become much more important. And even then you will sometimes be surprised by a digger coming in from a side cave.

Code: Select all
--[[ function mobs_goblins:spawn_specific(
                                name,nodes, neighbors, min_light, max_light, interval, chance, active_object_count, min_height, max_height)]]
mobs:spawn_specific("goblins:goblin_cobble", {"group:stone"}, "air",                                        0, 4, 60, 10000, 2, -30000, -10)
mobs:spawn_specific("goblins:goblin_digger", {"group:stone"},  "air",                                       0, 4, 60, 10000, 2, -30000, -10)
mobs:spawn_specific("goblins:goblin_coal", {"default:stone_with_coal", "default:mossycobble"}, "air",       0, 4, 60, 20000, 1, -30000, -10)
mobs:spawn_specific("goblins:goblin_iron", {"default:stone_with_iron", "default:mossycobble"}, "air",       0, 4, 60, 20000, 1, -30000, -30)
mobs:spawn_specific("goblins:goblin_copper", {"default:stone_with_copper", "default:mossycobble"}, "air",   0, 4, 60, 20000, 1, -30000, -30)
mobs:spawn_specific("goblins:goblin_gold", {"default:stone_with_gold", "default:mossycobble"}, "air",       0, 4, 60, 20000, 1, -30000, -50)
mobs:spawn_specific("goblins:goblin_diamond", {"default:stone_with_diamond", "default:mossycobble" }, "air",0, 4, 60, 30000, 1, -30000, -50)
mobs:spawn_specific("goblins:goblin_king", {"default:mossycobble",},"air",                                  0, 4, 60, 30000, 1, -30000, -150)
 

User avatar
Vapalus
Member
 
Posts: 112
Joined: Wed Nov 15, 2017 17:16

Re: [Mod] Goblins [WIP][mobs_goblins]

by Vapalus » Wed Nov 15, 2017 17:24

Hey,

I just played the mod for a few hours and started reprogramming some parts myself, especially the buggy parts.
First change was, of course, to lower the light level (later I set the light level between 2 and 6, which had the effect that they didn't spawn at first, but as soon as you discovered a cave and didn't light it the right way, they started spawning like pests).
The second thing which was important was to make them spawn at a distance, ignoring the "spawn" event if it was closer than 25-50 units (depending on the type), thus making kings rare, and "not so aggressive" units less rare, and making them a viable, but bothersome trading partner.
Next step was to increase the spawn depth to -30, to be able to build underground constructions without losing everything.

And the last was a workaround for a bug: Since they didn't drop anything on death, I used your "check_if_dead" to kill them if their health was below 100 - and just added 100 hp to each of them on spawn.

Now, I've been playing with them for a while now, and I can say I am quite fond of the mod.
If you want to, I can just put the two files I changed in here...
A man much wiser than me once said: "go away, you are bothering me"
 

dawgdoc
Member
 
Posts: 246
Joined: Mon Feb 27, 2017 01:10
GitHub: dawgdoc

Re: [Mod] Goblins [WIP][mobs_goblins]

by dawgdoc » Thu Nov 16, 2017 00:51

It looks like the mod creator, @FreeLikeGNU, last posted to this thread in Sept 2015. Yet he seems to have updated the GitHub page as recent as June of this year. It's possible that he would consider your changes if you posted the files here or submitted a pull request to his github page. However he did not incorporate the changes posted above by @acidzebra.

I would suggest posting the files here as a minimum. That would let other non-coders make use of your changes.
 

dawgdoc
Member
 
Posts: 246
Joined: Mon Feb 27, 2017 01:10
GitHub: dawgdoc

Re: [Mod] Goblins [WIP][mobs_goblins]

by dawgdoc » Thu Nov 16, 2017 03:37

@Vapalus

I'm not a coder but I am attempting to incorporate what you did into a git repository. (My last/only programming training was in Basic back in '79. That's Basic; not VisualBasic, QBasic, or BasicPlus, just plain old Basic.) This is my first attempt at using git/GitHub to fork a mod. Until today I have only used github to clone mods to my local machine and keep them up to date.

So far I have made some changes to goblins.lua file following your suggestions along the lines of what acidzebra did. Unlike him, you did not seem to suggest changes to the chance of spawning. Here is the result of my changes to light levels, max_height, and interval:
Code: Select all
mobs_goblins:spawn_specific("mobs_goblins:goblin_cobble", {"group:stone"}, "air", 2, 6, 25, 10, 3, -30000 , -30)
mobs_goblins:spawn_specific("mobs_goblins:goblin_digger", {"group:stone"},  "air", 2, 6, 25, 10, 3, -30000 , -30)
mobs_goblins:spawn_specific("mobs_goblins:goblin_coal", {"default:stone_with_coal", "default:mossycobble"}, "air", 2, 6, 30, 2, 3, -30000, -30)
mobs_goblins:spawn_specific("mobs_goblins:goblin_iron", {"default:stone_with_iron", "default:mossycobble"}, "air", 2, 6, 35, 2, 3, -30000, -50)
mobs_goblins:spawn_specific("mobs_goblins:goblin_copper", {"default:stone_with_copper", "default:mossycobble"}, "air", 2, 6, 40, 2, 3, -30000, -50)
mobs_goblins:spawn_specific("mobs_goblins:goblin_gold", {"default:stone_with_gold", "default:mossycobble"}, "air", 2, 6, 45, 2, 3, -30000, -70)
mobs_goblins:spawn_specific("mobs_goblins:goblin_diamond", {"default:stone_with_diamond", "default:mossycobble" }, "air", 2, 6, 45, 2, 3, -30000, -110)
mobs_goblins:spawn_specific("mobs_goblins:goblin_king", {"default:mossycobble",},"air", 2, 6, 50, 10, 3, -30000, -130)

I found "check_for_death" in the api.lua file but don't have the knowledge to deduce your precise changes. My best guess is (and I'll add in line numbers)
Code: Select all
28         hp_min = def.hp_min or 105,      -- from  hp_min = def.hp_min or 5,
29   hp_max = def.hp_max or 110,    --  hp_max = def.hp_max or 10,
----
1432   function check_for_death(self)
1433      local hp = self.object:get_hp()
1434       if hp > 100 then        -- from  if hp > 0 then
or did you change the hp_min/hp_max when each type of goblin was registered in goblins.lua?

The little I have done can be found here
EDIT: so far I have not attempted to play MT with these changes.
 

User avatar
Vapalus
Member
 
Posts: 112
Joined: Wed Nov 15, 2017 17:16

Re: [Mod] Goblins [WIP][mobs_goblins]

by Vapalus » Thu Nov 16, 2017 07:15

I'm going to upload the stuff as soon as I get home!
Edit:
I figured that there is obviously stuff in GitHub that was updated.
That also means that I've got to download the newest github, readd my changes, and readjust the behaviour of "my" goblins.

The target of my changes is to make them behave like pests;
-If you slip up, you got an infestation
-As soon as you see one, you will see several
-It is possible to make pest control, but it takes time. And lots of torches.

It should get harder to fight them the more you dig.
Attachments
important_files.zip
only the api and goblin.lua were changed
(11.69 KiB) Downloaded 21 times
A man much wiser than me once said: "go away, you are bothering me"
 

User avatar
FreeLikeGNU
Member
 
Posts: 125
Joined: Tue Oct 28, 2014 02:50
GitHub: FreeLikeGNU
IRC: freelikegnu
In-game: FreeLikeGNU

Re: [Mod] Goblins [WIP][mobs_goblins]

by FreeLikeGNU » Thu Nov 16, 2017 19:33

Pull requests for bug fixes are always welcome as it helps keep track of contributions. Vapalus, it seems like you understand the direction I would take with these little guys. I'm glad you like this mod enough take it further :D
 

User avatar
Vapalus
Member
 
Posts: 112
Joined: Wed Nov 15, 2017 17:16

Re: [Mod] Goblins [WIP][mobs_goblins]

by Vapalus » Thu Nov 16, 2017 19:53

I actually think this is one of the mob mods with the most potential to be a "standard gameplay feature".
The rest of the minetest mobs I saw up to now where, gameplaywise, a bit boring.

There is a "default:mossycobble_trap" which results in a lots of red text, is that still on git?
Because I am sure I used the newest version...
A man much wiser than me once said: "go away, you are bothering me"
 

User avatar
FreeLikeGNU
Member
 
Posts: 125
Joined: Tue Oct 28, 2014 02:50
GitHub: FreeLikeGNU
IRC: freelikegnu
In-game: FreeLikeGNU

Re: [Mod] Goblins [WIP][mobs_goblins]

by FreeLikeGNU » Thu Nov 16, 2017 20:44

Vapalus wrote:There is a "default:mossycobble_trap" which results in a lots of red text, is that still on git?

Oh nice catch, I think you are referring to line 1001 of goblins.lua:

replace_with = "default:mossycobble_trap",

should be

replace_with = "mobs_goblins:mossycobble_trap",

UPDATE: I've made the changes, with due credit, thank you!
 

User avatar
Vapalus
Member
 
Posts: 112
Joined: Wed Nov 15, 2017 17:16

Re: [Mod] Goblins [WIP][mobs_goblins]

by Vapalus » Thu Nov 16, 2017 20:51

Indeed.
I can't post screenshots here, since screenshots simply don't work, but up to now they work like intended.
Changing the feeling of digging a bit. When you dig down and get into a cave (if there is illuminationshooms, that is), they are already there, changing the cave.
And if you see glowing mossy stone somewhere in the staircase, you are already going a bit nuts, trying to dig them out and get rid of them, just to prevent them from destroying your staircase.
Also, I once found a cave and put torches everywhere, forgot one tiny place, and when I came back, they've build a lair.

But on the other hand, you get illuminated side caves which are easier to explore if they already live in there. You can also follow their noises while digging to find new places.
So I guess, they just feel like they belong there...

But, they make it absolutely impossible to build a large underground base deep down, I guess.
A man much wiser than me once said: "go away, you are bothering me"
 

dawgdoc
Member
 
Posts: 246
Joined: Mon Feb 27, 2017 01:10
GitHub: dawgdoc

Re: [Mod] Goblins [WIP][mobs_goblins]

by dawgdoc » Fri Nov 17, 2017 06:42

Thank you for posting those files Vapalus.

Looking at init.lua I could see nothing different between yours and that on Github put up by FreeLikeGNU. I ran diff in terminal to find your changes to api.lua. One of which is adding min_spawn_dist to function mobs_goblins:spawn_specific. I take it that this was also changed in goblins.lua with the final variable, min_spawn_dist, being between 25 and 50. Searching through api.lua and goblins.lua I didn't figure out what interval does, the variable I was thinking you changed to be 25 to 50.

Since you didn't change mobs_goblins:register_spawn in api.lua, I take it that you did not change it in goblins.lua either.
 

User avatar
Vapalus
Member
 
Posts: 112
Joined: Wed Nov 15, 2017 17:16

Re: [Mod] Goblins [WIP][mobs_goblins]

by Vapalus » Fri Nov 17, 2017 07:28

Dang, I uploaded init.lua instead of goblin.lua!
Not enough coffee.
Sorry!

I didn't know what you were talking about until I checked the zip file, because the init.lua doesn't even belong in there.
Also, if I changed the interval, I did it wrong.
Give me a few hours, I'm currently at work.
A man much wiser than me once said: "go away, you are bothering me"
 

dawgdoc
Member
 
Posts: 246
Joined: Mon Feb 27, 2017 01:10
GitHub: dawgdoc

Re: [Mod] Goblins [WIP][mobs_goblins]

by dawgdoc » Fri Nov 17, 2017 09:00

I'm thinking the old code
Code: Select all
mobs_goblins:spawn_specific("mobs_goblins:goblin_cobble", {"group:stone"}, "air", 0, 50, 1, 10, 3, -30000 , 0)


would become
Code: Select all
mobs_goblins:spawn_specific("mobs_goblins:goblin_cobble", {"group:stone"}, "air", 2, 6, 1, 10, 3, -30000 ,  -30, 25)
 

User avatar
Vapalus
Member
 
Posts: 112
Joined: Wed Nov 15, 2017 17:16

Re: [Mod] Goblins [WIP][mobs_goblins]

by Vapalus » Fri Nov 17, 2017 09:12

Not only that, I also increased the base health, remember?
So there is a few more changes.
But basically, it should work that way, yes.
Attachments
mobs_goblins.zip
Complete mod, this time, just to be sure I didn't forget too much
(325.59 KiB) Downloaded 46 times
A man much wiser than me once said: "go away, you are bothering me"
 

User avatar
FreeLikeGNU
Member
 
Posts: 125
Joined: Tue Oct 28, 2014 02:50
GitHub: FreeLikeGNU
IRC: freelikegnu
In-game: FreeLikeGNU

Re: [Mod] Goblins [WIP][mobs_goblins]

by FreeLikeGNU » Fri Nov 17, 2017 23:03

Out of curiosity, what versions of minetest are you running with this mod?
 

User avatar
FreeLikeGNU
Member
 
Posts: 125
Joined: Tue Oct 28, 2014 02:50
GitHub: FreeLikeGNU
IRC: freelikegnu
In-game: FreeLikeGNU
 

dawgdoc
Member
 
Posts: 246
Joined: Mon Feb 27, 2017 01:10
GitHub: dawgdoc

Re: [Mod] Goblins [WIP][mobs_goblins]

by dawgdoc » Fri Nov 17, 2017 23:43

Vapalus wrote:Not only that, I also increased the base health, remember?

It's interesting that you had a min/max hp range of 1 for the goblin king
min = 139
max = 140
 

User avatar
Vapalus
Member
 
Posts: 112
Joined: Wed Nov 15, 2017 17:16

Re: [Mod] Goblins [WIP][mobs_goblins]

by Vapalus » Sat Nov 18, 2017 08:14

The range before was too much, he IS the king, after all.
First I was thinking about "hit him, and everybody gets angry", but that would take too much resources - and since a beginner cannot really differ the king from a peasant, it would be unfair, I think.
A man much wiser than me once said: "go away, you are bothering me"
 

User avatar
FreeGamers
Member
 
Posts: 334
Joined: Sat May 25, 2019 00:15
Location: United States
GitHub: is proprietary I use NotABug

Re: [Mod] Goblins [WIP][mobs_goblins]

by FreeGamers » Sat May 25, 2019 16:34

Vapalus wrote:Not only that, I also increased the base health, remember?
So there is a few more changes.
But basically, it should work that way, yes.


Thanks for this upload, I found it was more preferrable than the current version in the git repo of "FreeLikeGNU". I still found the goblin spawning behavior to be too agressive but I was able to use the comments and other options to configure it to my liking. I've lowered goblin spawning to -200 elevation and I've lowered the chances of them spawning from 10 to 1. I've also removed the node "defaut:stone" from the spawning nodes because they are just too common and result in goblins spawning in front of players digging. I've buffed the goblin's damage too because I noticed the players in my server started farming goblins for their drops. Goblins become a serious threat when they gang up on a player now.
I have realistic torches on my server (they burn out) so the goblin torch behavior adds a minor layer of difficulty. Like a previous poster, I may add BewareTheDark to my server to make this more intersesting. Thanks for your help.
 

User avatar
Melkor
Member
 
Posts: 328
Joined: Sat Sep 24, 2011 01:03
Location: Underground
 

User avatar
Hamlet
Member
 
Posts: 656
Joined: Sat Jul 29, 2017 21:09
Location: Lombardy, Italy
GitHub: h4ml3t
IRC: H4mlet

Re: [Mod] Goblins [WIP][mobs_goblins]

by Hamlet » Tue Nov 26, 2019 18:55

If someone is going to use this mod, specifically the Mobs Redo version - not the standalone one - be aware that 'monster' goblins will kill 'animal' goblins - if I reckon correctly, the 'animal' ones are those who dig tunnels etc.

It might be worth setting 'attacks animals = false' for the 'monster' classes.
 

Previous

Return to WIP Mods



Who is online

Users browsing this forum: No registered users and 2 guests