[WIP] Goblins [mobs_goblins]

User avatar
TenPlus1
Member
 
Posts: 1874
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: [WIP] Goblins [mobs_goblins]

by TenPlus1 » Sat Sep 05, 2015 16:46

Each goblin now has a do_custom function within their mob register routines that control the search and replacement feature you added but using a local function instead of changing the global api itself... I tested the cobble goblin and it removed stone and torches to replace with moddycobble so works ok, and the do_custom function is called every 1 second like the previous replace_what/replace_with feature in the api... If some of the goblins dont act as planned check the values entered to see if I changed any by mistake...
 

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

Re: [WIP] Goblins [mobs_goblins]

by FreeLikeGNU » Sat Sep 05, 2015 17:26

TenPlus1 wrote:Each goblin now has a do_custom function within their mob register routines that control the search and replacement feature you added but using a local function instead of changing the global api itself... I tested the cobble goblin and it removed stone and torches to replace with moddycobble so works ok, and the do_custom function is called every 1 second like the previous replace_what/replace_with feature in the api... If some of the goblins dont act as planned check the values entered to see if I changed any by mistake...


hmm, I tested the digger and cobble goblins, but again they do not act on nodes.... I have mobs and goblins mods active in my test map with the mods in the paths:

minetest/mods/mobs (latest git)
minetest/mods/goblins (from your zip)

Is there something I'm missing here?
 

User avatar
TenPlus1
Member
 
Posts: 1874
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: [WIP] Goblins [mobs_goblins]

by TenPlus1 » Sat Sep 05, 2015 18:13

Hrm, let me re-check the function and it's settings...
 

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

Re: [WIP] Goblins [mobs_goblins]

by FreeLikeGNU » Sat Sep 05, 2015 18:18

mobs_goblins updated: digger has his own skin and made some adjustments to s&r (search and replace) parameters so that replacement is closer to the goblin entity.
 

User avatar
TenPlus1
Member
 
Posts: 1874
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: [WIP] Goblins [mobs_goblins]

by TenPlus1 » Sat Sep 05, 2015 19:51

do_custom code simplified and working for each goblin type, also added spawn eggs and new digger texture: viewtopic.php?f=9&t=13004&p=189917#p189917
 

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

Re: [WIP] Goblins [mobs_goblins]

by FreeLikeGNU » Sun Sep 06, 2015 02:01

TenPlus1 wrote:do_custom code simplified and working for each goblin type, also added spawn eggs and new digger texture: viewtopic.php?f=9&t=13004&p=189917#p189917

TenPlus1,
goblins are working now, however the simplifications do not allow for varying the frequency of replacing nodes above or below relative to whats around the mob. This is kind of important for the digger so it's not digging straight down as much is around.
The other goblins need to replace nodes that are higher so that they are effective at stealing torches, cobbling, and other nasty things :D

I really like the cleaner code though and I will probably use it in the standalone mobs_goblins as well. Again, many thanks for your port! I have it in a git repo now and will add that to my OP!

I've also added you to the repo: https://github.com/FreeLikeGNU/goblins
FLG
 

User avatar
duane
Member
 
Posts: 776
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r

Re: [WIP] Goblins [mobs_goblins]

by duane » Sun Sep 06, 2015 02:42

ArguablySane wrote:To add more coherence to their digging, each tribe of goblins should have a plan of the tunnels they want to dig out. ... Now, the digger goblins simply find bits of rock which are marked as open space on the plan and remove them, while the builder goblins build bridges wherever a tunnel intersects a natural cave.


I don't like the idea of limiting their spawn locations, but the rest sounds awesome, if ambitious.

I've re-written Goblins to use Mobs Redo as a base without changing the Api, and using the do_custom function from within mob definitions to dig/mine/take torches etc instead...


Good to see everybody collaborating. Keep it up, guys.

I keep trying to make glowing eyes work, but I'm having zero luck. I can't find any way to change an object's lighting without lighting up everything else, and the eyes don't show up in the dark, no matter what color they are. Meh.
 

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

Re: [WIP] Goblins [mobs_goblins]

by FreeLikeGNU » Sun Sep 06, 2015 17:04

goblins can now set nasty traps...
 

User avatar
ArguablySane
Member
 
Posts: 116
Joined: Sun Oct 12, 2014 21:29

Re: [WIP] Goblins [mobs_goblins]

by ArguablySane » Sun Sep 06, 2015 17:41

duane wrote:I don't like the idea of limiting their spawn locations, but the rest sounds awesome, if ambitious.

On further consideration, you wouldn't need to limit their spawn locations. Just have a single tunnel network planning algorithm shared between them all.
The only part I haven't figured out is how to give them an efficient way to find nearby blocks which need to be dug out. It would be very inefficient to have them constantly checking every block around them and measuring its distance from several hundred nearby points and lines. Maybe they first find a point they can path to where one of the planned tunnels intersects open air, then start doing a naive search on nearby blocks and adding them to a digging queue.
It's definitely ambitious, but it's also definitely possible.

duane wrote:I keep trying to make glowing eyes work, but I'm having zero luck. I can't find any way to change an object's lighting without lighting up everything else, and the eyes don't show up in the dark, no matter what color they are. Meh.

I've tried to do this before and didn't have any luck. I don't think it's possible in the current engine.
The above post and any ideas expressed therein are released to the public domain under a Creative Commons CC0 license.
 

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

Re: [WIP] Goblins [mobs_goblins]

by FreeLikeGNU » Sun Sep 06, 2015 18:19

ArguablySane wrote:
duane wrote:I keep trying to make glowing eyes work, but I'm having zero luck. I can't find any way to change an object's lighting without lighting up everything else, and the eyes don't show up in the dark, no matter what color they are. Meh.

I've tried to do this before and didn't have any luck. I don't think it's possible in the current engine.


Yeah it would be nice if we could use a texturemap for luminescence like we can for bumpmaps. This would open a whole lot of possibilities, unless this exists already?
 

User avatar
duane
Member
 
Posts: 776
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r

Re: [WIP] Goblins [mobs_goblins]

by duane » Mon Sep 07, 2015 09:42

FreeLikeGNU wrote:Yeah it would be nice if we could use a texturemap for luminescence like we can for bumpmaps. This would open a whole lot of possibilities, unless this exists already?


I tried changing the lighting directly with voxelmanip, but I think the normal calculation just writes over it again. It didn't seem to make any difference.
 

User avatar
TenPlus1
Member
 
Posts: 1874
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: [WIP] Goblins [mobs_goblins]

by TenPlus1 » Mon Sep 07, 2015 10:40

Updated Goblins redo to use original search & replace code within do_custom, should work same as original now :) Mobs Redo mod updated also with some new additions to help...

viewtopic.php?f=9&t=13004&p=189917#p189917
 

User avatar
Ferk
Member
 
Posts: 330
Joined: Tue Aug 18, 2015 17:18
GitHub: Ferk

Re: [WIP] Goblins [mobs_goblins]

by Ferk » Mon Sep 07, 2015 10:52

TenPlus1 wrote:Updated Goblins redo to use original search & replace code within do_custom, should work same as original now :) Mobs Redo mod updated also with some new additions to help...


Nice! mobs_redo is looking more and more as THE api for mobs.
Hopefully we will start having a clear winner in this mess of incompatible mob mods.

I wonder: if we actually get a client-side lua API in Minetest 0.5 would you say mobs_redo would be able to benefit from it in any way? Do you think an entire new mod would have to be made? or maybe client-side scripting alone wouldn't really help and something else would be needed?

[/sorry for off-topic]
{ ☠ Dungeontest ☠ , ᗧ••myarcade•• }
 

User avatar
benrob0329
Member
 
Posts: 1192
Joined: Thu Aug 06, 2015 22:39
GitHub: Benrob0329
In-game: benrob03

Re: [WIP] Goblins [mobs_goblins]

by benrob0329 » Mon Sep 07, 2015 15:44

The devs are working on a C++ mobs API, so the mobs here would have to be ported.
 

User avatar
TenPlus1
Member
 
Posts: 1874
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: [WIP] Goblins [mobs_goblins]

by TenPlus1 » Mon Sep 07, 2015 15:51

Having a c++ implementation for mob registration with custom functions which can be run inside lua would be an amazing feat for the default game... That would mean the initial c++ api would do all of the work and be flexible enough to run specific tasks for any kind of mob we can think of...
 

User avatar
duane
Member
 
Posts: 776
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r

Tunneling

by duane » Mon Sep 07, 2015 16:09

I put together some code for more rational tunneling in this fork. It does require changes to the mobs redo api, including a new callback.

Here's a screenshot of some of them starting to dig.

+ Spoiler


A problem that occurs is that none of the other goblins are going to follow the diggers down those narrow tunnels.
 

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

Re: [WIP] Goblins [mobs_goblins]

by FreeLikeGNU » Mon Sep 07, 2015 18:29

TenPlus1 wrote:Updated Goblins redo to use original search & replace code within do_custom, should work same as original now :) Mobs Redo mod updated also with some new additions to help...

viewtopic.php?f=9&t=13004&p=189917#p189917

This is great! Working much better, however, I did have to remove the vector.round helper from lines 39-41 to get the goblins to find nodes as before. Does the vector helper orient the coords relative to the object.self instead of the world? If so, that is really cool and we can make sure that goblins are not digging behind themselves. For now, it is disabled and git repo updated!
https://github.com/FreeLikeGNU/goblins

duane wrote:I put together some code for more rational tunneling in this fork. It does require changes to the mobs redo api, including a new callback.

Here's a screenshot of some of them starting to dig.

+ Spoiler


A problem that occurs is that none of the other goblins are going to follow the diggers down those narrow tunnels.


Wow again! I'm going to try your new digger ASAP, it looks really cool. I'm not sure the other gobs need to follow the digger, they will probably discover dug areas from wandering about before too long...
 

User avatar
Nathan.S
Member
 
Posts: 679
Joined: Wed Sep 24, 2014 17:47
GitHub: NathanSalapat
IRC: NathanS21
In-game: NathanS21

Re: [WIP] Goblins [mobs_goblins]

by Nathan.S » Tue Sep 08, 2015 00:41

I'm trying out, what I believe is the latest update, and I keep getting this error spamming the chat.
ERROR[server]:Map::setNode(): Not allowing to place CONTENT_IGNORE while trying to replace "default:mossycobble"

I don't find any errors in the debug file though. I did notice that it seems every Goblin related function is printed out, resulting in an extremely lengthy debug.txt. 15 or 20 minutes of running around resulted in 33,000 lines, most of them being related to the Goblins digging and their locations.
I record Minetest videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website.
 

User avatar
Napiophelios
Member
 
Posts: 752
Joined: Mon Jul 07, 2014 01:14
GitHub: Napiophelios
IRC: Nappi
In-game: Nappi

Re: [WIP] Goblins [mobs_goblins]

by Napiophelios » Tue Sep 08, 2015 00:46

Any time I have gotten that error was when a mod calls to place a node that I dont have;
its usually happens because I misspelled something

edit: line 297 and line 651 he misspelled "default:dessert_stone" is supposed to be "default:desert_stone"

see if that helps

edit2:
or it could be line 768 using "group:stone"
 

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

Re: [WIP] Goblins [mobs_goblins]

by FreeLikeGNU » Tue Sep 08, 2015 03:52

Napiophelios wrote:Any time I have gotten that error was when a mod calls to place a node that I dont have;
its usually happens because I misspelled something

edit: line 297 and line 651 he misspelled "default:dessert_stone" is supposed to be "default:desert_stone"

see if that helps

edit2:
or it could be line 768 using "group:stone"


I fixed the dessert typo, doh. Group stone includes all stone types.

By the way, some goblin traps are now extra nasty... be careful!
 

User avatar
duane
Member
 
Posts: 776
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r

Re: [WIP] Goblins [mobs_goblins]

by duane » Tue Sep 08, 2015 05:13

FreeLikeGNU wrote:By the way, some goblin traps are now extra nasty... be careful!


You know the king must have TNT. He must!
 

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

Re: [WIP] Goblins [mobs_goblins]

by FreeLikeGNU » Tue Sep 08, 2015 16:27

duane wrote:
FreeLikeGNU wrote:By the way, some goblin traps are now extra nasty... be careful!

You know the king must have TNT. He must!


Yeah the king will need to have some special tricks. I still need a solution for him to replace mese nodes with chests with loot that can be somewhat random (and possibly nasty surprises too), I'm getting familiar with abm functions so I don't think it is too far off..

Apologies for the rapid changes to this mod, one of the reasons for it being in the WIP state and debug message spam (you can disable, if you like). It's my first MT mod and I'm learning something new every time I play with it. I really appreciate the feedback and help so far, thank you!
 

User avatar
TenPlus1
Member
 
Posts: 1874
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: [WIP] Goblins [mobs_goblins]

by TenPlus1 » Tue Sep 08, 2015 16:30

FreeLikeGNU: check out Blockmen's Pyramids mod, it has a function that can fill a chest with treasure that you may be able to adapt for Goblins...

also... is the mobs redo version working for you now ?
 

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

Re: [WIP] Goblins [mobs_goblins]

by FreeLikeGNU » Tue Sep 08, 2015 16:51

TenPlus1 wrote:FreeLikeGNU: check out Blockmen's Pyramids mod, it has a function that can fill a chest with treasure that you may be able to adapt for Goblins...

also... is the mobs redo version working for you now ?


TenPlus1, it's working quite well now! I'm thinking about a way to check if redo is active, and if so use that, or use your api, but included with my mod as standalone.
In other words, remove mobs_goblins repo and keep an updated copy of your current api in goblins and make that the one repo to be maintained. That way if folks already have redo (and made their own changes to it), then goblins will use that. Folks that do not have/want the whole redo can still use goblins as standalone.

edit (fix typo)
 

User avatar
Don
Member
 
Posts: 1641
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

Re: [WIP] Goblins [mobs_goblins]

by Don » Tue Sep 08, 2015 17:00

I started working on a treasure mod. The chests are nodes and when you break them they drop random items. You might get a few ideas. Just know that it is a wip.
https://github.com/DonBatman/mytreasure
Many of my mods are now a part of Minetest-mods. A place where you know they are maintained!

A list of my mods can be found here
 

User avatar
TenPlus1
Member
 
Posts: 1874
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: [WIP] Goblins [mobs_goblins]

by TenPlus1 » Tue Sep 08, 2015 18:30

FreeLikeGNU: Glad it's working ok... My only concern was that Mobs Redo has it's own api which is updated quite a bit and the one included in your Goblins mod may end up running an older version with your code included, which is why I recommended using the main API instead and putting your goblin specific code inside the mob definition itself to keep the api clean... This way the two wouldn't clash and cause errors...

Other than that, I love the Goblins mod and end up with loads of the little guys running around underground stealing my torches and setting up traps around me...
 

User avatar
duane
Member
 
Posts: 776
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r

Re: [WIP] Goblins [mobs_goblins]

by duane » Tue Sep 08, 2015 19:22

FreeLikeGNU wrote:By the way, some goblin traps are now extra nasty... be careful!


Thaat's not a trap. This is a trap...

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
minetest.register_abm({
   nodenames = {"mobs_goblins:stone_with_diamond_trap"},
   interval = 1,
   chance = 1,
   action = function(pos, node, active_object_count, active_object_count_wider)
      for _,object in ipairs(minetest.env:get_objects_inside_radius(pos, 3)) do
         if object:is_player() then
            minetest.set_node(pos, {name="tnt:tnt_burning"})
            minetest.get_node_timer(pos):start(5)
            minetest.sound_play("default_dig_crumbly", {pos = pos, gain = 0.5, max_hear_distance = 10})
         end
      end
   end})


+ Spoiler


These would give you more variety.

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
minetest.register_abm({
   nodenames = {"mobs_goblins:stone_with_coal_trap"},
   interval = 1,
   chance = 1,
   action = function(pos, node, active_object_count, active_object_count_wider)
      for _,object in ipairs(minetest.env:get_objects_inside_radius(pos, 2)) do
         if object:is_player() then
            minetest.set_node(pos, {name="fire:basic_flame"})
            if object:get_hp() > 0 then
               object:set_hp(object:get_hp()-2)
            end
         end
      end
   end
})


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
minetest.register_abm({
   nodenames = {"mobs_goblins:stone_with_gold_trap"},
   interval = 1,
   chance = 1,
   action = function(pos, node, active_object_count, active_object_count_wider)
      for _,object in ipairs(minetest.env:get_objects_inside_radius(pos, 2)) do
         if object:is_player() then
            minetest.set_node(pos, {name="default:lava_source"})
            if object:get_hp() > 0 then
               object:set_hp(object:get_hp()-2)
               minetest.sound_play("default_dig_crumbly", {pos = pos, gain = 0.5, max_hear_distance = 10})
             end
         end
      end
   end})
Last edited by duane on Tue Sep 08, 2015 20:28, edited 1 time in total.
 

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

Re: [WIP] Goblins [mobs_goblins]

by FreeLikeGNU » Tue Sep 08, 2015 20:04

TenPlus1 wrote:FreeLikeGNU: Glad it's working ok... My only concern was that Mobs Redo has it's own api which is updated quite a bit and the one included in your Goblins mod may end up running an older version with your code included, which is why I recommended using the main API instead and putting your goblin specific code inside the mob definition itself to keep the api clean... This way the two wouldn't clash and cause errors...

Other than that, I love the Goblins mod and end up with loads of the little guys running around underground stealing my torches and setting up traps around me...


Glad you are enjoying the goblins! Have you considered moving the content (models, defs, sounds, etc) from Mobs Redo so that it is separate from the API as the goblins, water, air and other mobs are?
 

User avatar
TenPlus1
Member
 
Posts: 1874
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: [WIP] Goblins [mobs_goblins]

by TenPlus1 » Tue Sep 08, 2015 20:43

I did that at one point, had a separate api with mobs you could enable and disable, but players wanted a simple pack to install that gives a basic set to the game, default animals and monsters... but it's easy to disable a mob from within the init.lua for those that want it...
 

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

Re: [WIP] Goblins [mobs_goblins]

by FreeLikeGNU » Tue Sep 08, 2015 21:39

TenPlus1: I guess what I'd like is for the goblins to work standalone or with the mobs redo if its installed. Maybe I can have the init check for the api.lua in the goblins folder and, if its been deleted by the user, to use mobs redo api.lua instead?
I really like your API and what you've done with goblins, I'd rather not maintain two repos for goblins. I think your version is the way going forward. It's not a big deal for me to update a file in my repo as you update your API.
 

PreviousNext

Return to WIP Mods

Who is online

Users browsing this forum: No registered users and 15 guests

cron