[Mod] Goblins [goblins]

Post Reply
User avatar
acidzebra
Member
Posts: 75
Joined: Sun Sep 10, 2017 09:11

Re: [WIP] Goblins [mobs_goblins]

by acidzebra » Post

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 » Post

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: 260
Joined: Mon Feb 27, 2017 01:10
GitHub: dawgdoc

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

by dawgdoc » Post

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.
Give a man a fish, feed him for a day. Give a kid a fish, it's going to die.

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

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

by dawgdoc » Post

@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.
Give a man a fish, feed him for a day. Give a kid a fish, it's going to die.

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

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

by Vapalus » Post

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 68 times
A man much wiser than me once said: "go away, you are bothering me"

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

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

by FreeLikeGNU » Post

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 » Post

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: 280
Joined: Tue Oct 28, 2014 02:50
GitHub: FreeLikeGNU
IRC: freelikegnu
In-game: FreeLikeGNU

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

by FreeLikeGNU » Post

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 » Post

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: 260
Joined: Mon Feb 27, 2017 01:10
GitHub: dawgdoc

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

by dawgdoc » Post

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.
Give a man a fish, feed him for a day. Give a kid a fish, it's going to die.

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

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

by Vapalus » Post

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: 260
Joined: Mon Feb 27, 2017 01:10
GitHub: dawgdoc

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

by dawgdoc » Post

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)
Give a man a fish, feed him for a day. Give a kid a fish, it's going to die.

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

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

by Vapalus » Post

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 99 times
A man much wiser than me once said: "go away, you are bothering me"

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

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

by FreeLikeGNU » Post

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

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

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

by FreeLikeGNU » Post

please ignore/delete this post... ><

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

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

by dawgdoc » Post

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
Give a man a fish, feed him for a day. Give a kid a fish, it's going to die.

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

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

by Vapalus » Post

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: 650
Joined: Sat May 25, 2019 00:15
GitHub: is proprietary I use NotABug
Location: United States
Contact:

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

by FreeGamers » Post

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.
FreeGamers.org has moved to MeseCraft.net | FreeGamers on this forum is now MeseCraft

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

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

by Melkor » Post

-deleted-
Last edited by Melkor on Mon Oct 30, 2023 23:16, edited 2 times in total.

User avatar
Hamlet
Member
Posts: 766
Joined: Sat Jul 29, 2017 21:09
IRC: H4mlet
In-game: Hamlet
Location: Lombardy, Italy

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

by Hamlet » Post

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.
My repositories: Codeberg.org | My ContentDB's page

User avatar
QwertyDragon
Member
Posts: 20
Joined: Sat Dec 24, 2016 15:37
Contact:

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

by QwertyDragon » Post

I only ran this mob on minetest-5.1.1 for like a day and did not dig down deep enough for goblins to spawn, so have no idea if this is new only for minetest-5.2.0, but it definitely crashes server when on minetest-5.2.0
2020-04-08 04:54:59: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from m
od 'default' in callback luaentity_Step(): ...ni/minetest-5.2.0-linux/bin/../mods/mobs_goblins/api.l
ua:131: attempt to index local 'v' (a nil value)
2020-04-08 04:54:59: ERROR[Main]: stack traceback:
2020-04-08 04:54:59: ERROR[Main]: ...ni/minetest-5.2.0-linux/bin/../mods/mobs_goblins/api.lua:
131: in function 'get_velocity'
2020-04-08 04:54:59: ERROR[Main]: ...ni/minetest-5.2.0-linux/bin/../mods/mobs_goblins/api.lua:
810: in function <...ni/minetest-5.2.0-linux/bin/../mods/mobs_goblins/api.lua:208>
My GitLab, and Obior pages, and YouTube as QuixoticalPig, and Twitter as vuvvobUd. irc as QwertyDragon

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

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

by FreeLikeGNU » Post

Hi, it's nice to you are interested in Goblins. Please try Goblins from https://github.com/FreeLikeGNU/goblins and Mobs Redo API. The standalone is most likely broken, but the Mobs Redo addon version seems to be working when I tested with Minetest 5.3 (github) and Mobs Redo 1.50. The standalone version will no longer be developed (though PRs are always welcome for either standalone or Mobs Redo addon version).

EDIT: playing a bit more I ran into the get_velocity crash even with Mobs Redo 1.50 (api version 20200407). Seems it's a known issue https://github.com/minetest/minetest/issues/9528 "The code in Mobs Redo has been querying and modifying entities after deleting them"

EDIT 2: the current Mobs Redo as of 2020/04/11 is working well with the Goblins addon now.
Last edited by FreeLikeGNU on Sat Apr 18, 2020 16:16, edited 1 time in total.

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

Re: [Mod] Goblins [WIP][goblins]

by FreeLikeGNU » Post

There is now a "Goblin Fungiler" who cultivates nourishing mushrooms and a useful and craftable tool made from mossycobble.

EDIT: Many more updates! Please see original post for recent changes!

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

Re: [Mod] Goblins [goblins] [WIP]

by FreeLikeGNU » Post

Gobdogs added!
Image
Attachments
Gobdogs!
Gobdogs!
Screenshot_2020-04-21_09-19-42.png (246.25 KiB) Viewed 1647 times

Bastrabun
Member
Posts: 211
Joined: Mon Nov 04, 2019 19:48

Re: [Mod] Goblins [goblins] [WIP]

by Bastrabun » Post

With the content db version and the ambience mod installed I get the following issue upon server start:

Code: Select all

2020-04-24 04:22:45: ERROR[Main]: ModError: Failed to load and run script from /home/mt/.minetest/mods/goblins/init.lua:
2020-04-24 04:22:45: ERROR[Main]: /home/mt/.minetest/mods/goblins/soundsets.lua:7: attempt to index global 'ambience' (a nil value)
2020-04-24 04:22:45: ERROR[Main]: stack traceback:
2020-04-24 04:22:45: ERROR[Main]:       /home/mt/.minetest/mods/goblins/soundsets.lua:7: in main chunk
2020-04-24 04:22:45: ERROR[Main]:       [C]: in function 'dofile'
2020-04-24 04:22:45: ERROR[Main]:       /home/mt/.minetest/mods/goblins/init.lua:4: in main chunk
When I comment out the soundsets.lua, it loads. Release seems to be release = 3545
Whatever I say is CC0

Post Reply

Who is online

Users browsing this forum: No registered users and 20 guests