Post your modding questions here

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

Re: Post your modding questions here

by Nathan.S » Fri Apr 24, 2015 19:48

How do I go about finding a node to the left or right of the placed node, I can find nodes behind, in front, above and below, but I need to figure out a node to the side so I can modify either the node next in line or the node being placed.
I record Minetest videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website.
 

prestidigitator
Member
 
Posts: 632
Joined: Thu Feb 21, 2013 23:54

Re: Post your modding questions here

by prestidigitator » Fri Apr 24, 2015 22:36

Nathan.S wrote:How do I go about finding a node to the left or right of the placed node, I can find nodes behind, in front, above and below, but I need to figure out a node to the side so I can modify either the node next in line or the node being placed.

It sort of depends on what you mean by, "left/right." Probably a vector cross product (not included in Minetest's 'vector.*' API) will be helpful:

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
local function vectorCross(v1, v2)
   return { x = v1.y * v2.z - v1.z * v2.y,
            y = v1.z * v2.x - v1.x * v2.z,
            z = v1.x * v2.y - v1.y * v2.x };
end;


Then you'd want to cross the "forward" direction with the "up" direction. If "forward" and "up" aren't perpendicular (for example if "forward" is the direction the player is looking), you'd want to normalize the result:

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
local upDir = { x = 0, y = 0, z = 1 };  -- EDIT: oops! no, should be {x=0,y=1,z=0}
local rightDir = vector.normalize(vectorCross(forwardDir, upDir));  -- EDIT: oops! no, should reverse forward/up


(Things would be more complicated if you were allowed to tip your head to the side like touching your ear to your shoulder, but by design this never happens in Minetest.) Now you have a vector pointing straight to the camera's right. To find a node "in that direction" you PROBABLY want to figure out which of the x or y coordinates has the biggest magnitude (unless you want to consider diagonals...?):

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
local function cardinalDirection(vec)
   local x, y = vec.x, vec.y;
   local xm, ym = math.abs(x), math.abs(y);
   if xm >= ym then
      return { x = x / xm, y = 0, z = 0 };
   else
      return { x = 0, y = y / ym, z = 0 };
   end;
end;
Last edited by prestidigitator on Sat Apr 25, 2015 07:16, edited 1 time in total.
 

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

Re: Post your modding questions here

by Nathan.S » Fri Apr 24, 2015 23:44

Thank you for the response, I'll have to try this out. I have a wall mod I'm working on with DonBatman, and we need a function like this.
I record Minetest videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website.
 

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

Re: Post your modding questions here

by Don » Sat Apr 25, 2015 02:21

prestidigitator wrote:
Nathan.S wrote:How do I go about finding a node to the left or right of the placed node, I can find nodes behind, in front, above and below, but I need to figure out a node to the side so I can modify either the node next in line or the node being placed.

It sort of depends on what you mean by, "left/right." Probably a vector cross product (not included in Minetest's 'vector.*' API) will be helpful:

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
local function vectorCross(v1, v2)
   return { x = v1.y * v2.z - v1.z * v2.y,
            y = v1.z * v2.x - v1.x * v2.z,
            z = v1.x * v2.y - v1.y * v2.x };
end;


Then you'd want to cross the "forward" direction with the "up" direction. If "forward" and "up" aren't perpendicular (for example if "forward" is the direction the player is looking), you'd want to normalize the result:

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
local upDir = { x = 0, y = 0, z = 1 };
local rightDir = vector.normalize(vectorCross(forwardDir, upDir));


(Things would be more complicated if you were allowed to tip your head to the side like touching your ear to your shoulder, but by design this never happens in Minetest.) Now you have a vector pointing straight to the camera's right. To find a node "in that direction" you PROBABLY want to figure out which of the x or y coordinates has the biggest magnitude (unless you want to consider diagonals...?):

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
local function cardinalDirection(vec)
   local x, y = vec.x, vec.y;
   local xm, ym = math.abs(x), math.abs(y);
   if xm >= ym then
      return { x = x / xm, y = 0, z = 0 };
   else
      return { x = 0, y = y / ym, z = 0 };
   end;
end;

Any chance you could give a link to the lua? I don't understand what you are doing here. I would love to learn it
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
 

prestidigitator
Member
 
Posts: 632
Joined: Thu Feb 21, 2013 23:54

Re: Post your modding questions here

by prestidigitator » Sat Apr 25, 2015 02:35

Don wrote:Any chance you could give a link to the lua? I don't understand what you are doing here. I would love to learn it

I wrote the Lua for the response. I'd be happy to help with bits that are unclear though, if you elaborate on what is unclear.
 

Hybrid Dog
Member
 
Posts: 2460
Joined: Thu Nov 01, 2012 12:46

Re: Post your modding questions here

by Hybrid Dog » Sat Apr 25, 2015 06:26

prestigator: Does this use the cross product in some way too?
viewtopic.php?p=174387#p174387

btw: l just managed to spawn a triangle surface:
Image

its not as thin as possible, see the light at the 1/math.huge small edges
Image

and l think this may help understanding this random looking appearance l showed at viewtopic.php?p=176501#p176501 and viewtopic.php?p=176569#p176569
Image

its not real random
Attachments
screenshot_20150425_081512.png
screenshot_20150425_081512.png (189.56 KiB) Viewed 3514 times
screenshot_20150425_080905.png
screenshot_20150425_080905.png (401.05 KiB) Viewed 3514 times
screenshot_20150425_080852.png
screenshot_20150425_080852.png (303.72 KiB) Viewed 3514 times
Last edited by Hybrid Dog on Sat Apr 25, 2015 07:12, edited 1 time in total.
 

prestidigitator
Member
 
Posts: 632
Joined: Thu Feb 21, 2013 23:54

Re: Post your modding questions here

by prestidigitator » Sat Apr 25, 2015 07:10

Hybrid Dog wrote:prestigator: Does this use the cross product in some way too?
viewtopic.php?p=174387#p174387


Yes, it does, and I forgot two critical things, actually:

  • Minetest's up is y, not z, so upDir should have been {x=0, y=1, z=0}.
  • Minetest uses a fricking left-handed coordinate system for some stupid reason (probably because that's the OpenGL default and you need to set transformations if you want to fix it), so my cross product function should have reversed the up/forward directions.

This test:

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
math.abs(dir.x) < math.abs(dir.z)

is being used to test which if the x or z directions the viewer is NOT looking in (equivalent to finding the cardinal direction they ARE looking in and finding the orthogonal/cross-product). Then the statements:

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
right_pos.x = right_pos.x+dir.z/math.abs(dir.z)
-- or
right_pos.z = right_pos.z-dir.x/math.abs(dir.x)


basically carry an implicit cross product, determination of cardinal direction, and vector sum. Using the functions I posted above (if fixed), this would be equivalent to:

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
local forwardDir = placer:get_look_dir();
local upDir = { x = 0, y = 1, z = 0 };  -- fixed
local rightDir = vector.normalize(vectorCross(upDir, forwardDir));  -- fixed
local rightInc = cardinalDirection(rightDir);
local rightPos = vector.add(pos, rightInc);


The code you linked to does this in basically a single step, so it is more efficient, though (IMO) a little harder to follow. Actually, since the cross product is just being used to determine cardinal direction, you can leave out the (expensive) normalization step too, leaving just:

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
local forwardDir = placer:get_look_dir();
local upDir = { x = 0, y = 1, z = 0 };  -- fixed
local rightVec = vectorCross(upDir, forwardDir);  -- fixed
local rightInc = cardinalDirection(rightVec);
local rightPos = vector.add(pos, rightInc);
Last edited by prestidigitator on Sat Apr 25, 2015 07:52, edited 1 time in total.
 

prestidigitator
Member
 
Posts: 632
Joined: Thu Feb 21, 2013 23:54

Re: Post your modding questions here

by prestidigitator » Sat Apr 25, 2015 07:26

Oh, here's another interesting tidbit. If the player is looking (exactly!) straight up or down, both pieces of logic might fail. In that case Player:get_look_yaw() MIGHT be able to resolve the problem, but I haven't tried it (depends on whether it depends on the look direction like our code here, or whether it uses additional knowledge such as the client has about the direction the player is facing prior to tilting the head up/down).

EDIT: For example, if yaw works in all cases and you want an unambiguous "right" direction relative to the camera, use:

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
local function rightDir()
   local ang = (player:get_look_yaw() - 0.25*math.pi) % (2*math.pi);
   if ang < 0.5*math.pi then
      return { x = 1, y = 0, z = 0 };
   elseif ang < math.pi then
      return { x = 0, y = 0, z = 1 };
   elseif ang < 1.5*math.pi then
      return { x = -1, y = 0, z = 0 };
   else
      return { x = 0, y = 0, z = -1 };
   end;
end;

local rightPos = vector.add(pos, rightDir());


Note that unlike the coordinate axes, the yaw angle IS right-handed (increases counter-clockwise, starting to the east/+x).
Last edited by prestidigitator on Sat Apr 25, 2015 08:32, edited 4 times in total.
 

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: Post your modding questions here

by rubenwardy » Sat Apr 25, 2015 08:15

Why is using a left handed coordinate system stupid?
 

Hybrid Dog
Member
 
Posts: 2460
Joined: Thu Nov 01, 2012 12:46

Re: Post your modding questions here

by Hybrid Dog » Sat Apr 25, 2015 08:18

as far as l know its impossible to look exactly straight up or down
 

prestidigitator
Member
 
Posts: 632
Joined: Thu Feb 21, 2013 23:54

Re: Post your modding questions here

by prestidigitator » Sat Apr 25, 2015 08:29

rubenwardy wrote:Why is using a left handed coordinate system stupid?

Because it's the world-wide convention in math and physics to use a right-handed coordinate system. Neglecting that bias it is fine, of course. :-p
 

prestidigitator
Member
 
Posts: 632
Joined: Thu Feb 21, 2013 23:54

Re: Post your modding questions here

by prestidigitator » Sat Apr 25, 2015 08:35

Hybrid Dog wrote:as far as l know its impossible to look exactly straight up or down

Interesting. Okay. Yeah, that seems to be true. As far as I can tell the client does seem to be limiting the camera pitch so that the y coordinate's magnitude is around 0.99992.
 

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

Re: Post your modding questions here

by Don » Sat Apr 25, 2015 13:35

prestidigitator wrote:
Don wrote:Any chance you could give a link to the lua? I don't understand what you are doing here. I would love to learn it

I wrote the Lua for the response. I'd be happy to help with bits that are unclear though, if you elaborate on what is unclear.

Thanks for the offer. I found what I was looking for. I think I have a better understanding now. Hybrid Dog helped me a lot not too long ago. I appreciate how helpful everyone is.
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
Rui
Member
 
Posts: 255
Joined: Wed Oct 01, 2014 12:59
GitHub: Rui-Minetest

[DELETED]

by Rui » Sun Apr 26, 2015 05:45

[DELETED]
Last edited by Rui on Fri Nov 04, 2016 12:56, edited 1 time in total.
 

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

Re: Post your modding questions here

by TenPlus1 » Sun Apr 26, 2015 06:23

Rui, the above code would have to check a lot of water causing lag issues, try this snippet from Ethereal mod instead:

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
-- If torch or plants touching water then drop as item
minetest.register_abm({
   nodenames = {"default:torch", "group:flora"},
   neighbors = {"group:water"},
   interval = 5,
   chance = 1,
   action = function(pos, node)
      local num = #minetest.find_nodes_in_area({x=pos.x-1, y=pos.y, z=pos.z}, {x=pos.x+1, y=pos.y, z=pos.z}, {"group:water"})
      num = num + #minetest.find_nodes_in_area({x=pos.x, y=pos.y, z=pos.z-1}, {x=pos.x, y=pos.y, z=pos.z+1}, {"group:water"})
      num = num + #minetest.find_nodes_in_area({x=pos.x, y=pos.y+1, z=pos.z}, {x=pos.x, y=pos.y+1, z=pos.z}, {"group:water"})
      if num > 0 then
         minetest.set_node(pos, {name="default:water_flowing"})
         minetest.add_item(pos, {name = node.name})
      end
   end,
})
Last edited by TenPlus1 on Sun Apr 26, 2015 09:36, edited 1 time in total.
 

User avatar
Rui
Member
 
Posts: 255
Joined: Wed Oct 01, 2014 12:59
GitHub: Rui-Minetest

[DELETED]

by Rui » Sun Apr 26, 2015 08:06

[DELETED]
Last edited by Rui on Fri Nov 04, 2016 12:56, edited 1 time in total.
 

User avatar
BrunoMine
Member
 
Posts: 902
Joined: Thu Apr 25, 2013 17:29
GitHub: BrunoMine

Re: Post your modding questions here

by BrunoMine » Mon Apr 27, 2015 10:15

How can I check if a player in coordinated (100, 100, 100)?
 

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: Post your modding questions here

by rubenwardy » Mon Apr 27, 2015 10:40

BrunoMine wrote:How can I check if a player in coordinated (100, 100, 100)?


Pretty trivial.

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
local position = player:getpos()

if math.floor(position.x) == 100 and math.floor(position.y) == 100 and math.floor(position.z) == 100 then

end


If you don't have a player, you can get one by name:

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
local player = minetest.get_player_by_name("player12")
 

User avatar
BrunoMine
Member
 
Posts: 902
Joined: Thu Apr 25, 2013 17:29
GitHub: BrunoMine

Re: Post your modding questions here

by BrunoMine » Mon Apr 27, 2015 16:05

Is there a simpler way? I want to prevent a player can put a block in on a coordinate that there is already a player.
note: players use this technique to view caves through the wall (x scann).
 

Hybrid Dog
Member
 
Posts: 2460
Joined: Thu Nov 01, 2012 12:46

Re: Post your modding questions here

by Hybrid Dog » Mon Apr 27, 2015 17:20

BrunoMine wrote:Is there a simpler way? I want to prevent a player can put a block in on a coordinate that there is already a player.
note: players use this technique to view caves through the wall (x scann).

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
local protected = minetest.is_protected
function minetest.is_protected(pos, ...)
   local v = protected(pos, ...)
   if v then
      return v
   end
   for _,player in pairs(minetest.get_connected_players()) do
      local ppos = vector.round(player:getpos())
      local in_node = vector.equals(ppos, pos)
      if not in_node then
         ppos.y = ppos.y+1
         in_node = vector.equals(ppos, pos)
      end
      if in_node then
         return true
      end
   end
   return v
end
 

User avatar
BrunoMine
Member
 
Posts: 902
Joined: Thu Apr 25, 2013 17:29
GitHub: BrunoMine

Re: Post your modding questions here

by BrunoMine » Mon Apr 27, 2015 18:53

Hybrid Dog wrote:
BrunoMine wrote:Is there a simpler way? I want to prevent a player can put a block in on a coordinate that there is already a player.
note: players use this technique to view caves through the wall (x scann).

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
local protected = minetest.is_protected
function minetest.is_protected(pos, ...)
   local v = protected(pos, ...)
   if v then
      return v
   end
   for _,player in pairs(minetest.get_connected_players()) do
      local ppos = vector.round(player:getpos())
      local in_node = vector.equals(ppos, pos)
      if not in_node then
         ppos.y = ppos.y+1
         in_node = vector.equals(ppos, pos)
      end
      if in_node then
         return true
      end
   end
   return v
end

I improved a little bit.
Order to save server memory. (The focus of this check is mining)
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
local protected = minetest.is_protected
function minetest.is_protected(pos)
   local v = protected(pos)
   if v then
      return v
   end
   if pos.y > 80 then
      return v
   end
   for _,player in pairs(minetest.get_connected_players()) do
      local ppos = vector.round(player:getpos())
      local in_node = vector.equals(ppos, pos)
      if not in_node then
         ppos.y = ppos.y+1
         in_node = vector.equals(ppos, pos)
      end
      if in_node then
         return true
      end
   end
   return v
end

Thank you.
This was a big step for safety in minemacro server.
 

CWz
Member
 
Posts: 185
Joined: Tue Dec 24, 2013 17:01

Re: Post your modding questions here

by CWz » Tue Apr 28, 2015 11:29

Hello again i am trying to set up tnt so it will require a priv but it seems to crash
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_node("tnt:tnt", {
   description = "TNT",
   tiles = {"tnt_top.png", "tnt_bottom.png", "tnt_side.png"},
   groups = {dig_immediate=2, mesecon=2},
   sounds = default.node_sound_wood_defaults(),
   on_punch = function(pos, node, puncher)
      if puncher:get_wielded_item():get_name() == "default:torch" then
         if minetest.get_player_privs(puncher).use_tnt then
            minetest.sound_play("tnt_ignite", {pos=pos})
            minetest.set_node(pos, {name="tnt:tnt_burning"})
            minetest.get_node_timer(pos):start(4)
            return
         else then
            minetest.chat_send_player(puncher, "You don't have the required priv to use tnt.")
            return
         end
      end
   end,
   mesecons = {effector = {action_on = boom}},
}
 

afeys
Member
 
Posts: 17
Joined: Thu Mar 26, 2015 08:55

Re: Post your modding questions here

by afeys » Tue Apr 28, 2015 11:37

How to check the biome of a node?

I'm (at least trying to) making a mod which puts content (small buildings, ruins, hidden treasures,....) in the game. But I'd like to put other content in a desert than in a jungle, so I'd like to find out the biome for node at x,y,z.

Is this possible in MineTest? Does anyone have any ideas how to do this?
 

Sokomine
Member
 
Posts: 2980
Joined: Sun Sep 09, 2012 17:31

Re: Post your modding questions here

by Sokomine » Tue Apr 28, 2015 14:44

afeys wrote:I'm (at least trying to) making a mod which puts content (small buildings, ruins, hidden treasures,....) in the game. But I'd like to put other content in a desert than in a jungle, so I'd like to find out the biome for node at x,y,z.

Maybe you'll be intrested in my mg_villages. It does all the tedious stuff that's necessarry to let placed buildings look well - i.e. blend the terrain, avoid cavegen holes, change the materials randomly etc. It does, however, not react to the sourrounding terrain. Single houses may be located inside one biome, but larger buildings and especially villages will often cover at least two biomes.
A list of my mods can be found here.
 

User avatar
oleastre
Member
 
Posts: 81
Joined: Wed Aug 13, 2014 21:39
GitHub: oleastre
In-game: oleastre

Re: Post your modding questions here

by oleastre » Tue Apr 28, 2015 15:32

Using mgv5/7 generators, you can simply use register_decoration and specify a list of biomes where your content should be placed (don't know if it works with mgv6).

Another solution is to register an "on_generated" callback with the current mapgen. This will give you a map of the generated nodes and their biome.
 

Hybrid Dog
Member
 
Posts: 2460
Joined: Thu Nov 01, 2012 12:46

Re: Post your modding questions here

by Hybrid Dog » Tue Apr 28, 2015 15:42

CWz wrote:Hello again i am trying to set up tnt so it will require a priv but it seems to crash
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_node("tnt:tnt", {
   description = "TNT",
   tiles = {"tnt_top.png", "tnt_bottom.png", "tnt_side.png"},
   groups = {dig_immediate=2, mesecon=2},
   sounds = default.node_sound_wood_defaults(),
   on_punch = function(pos, node, puncher)
      if puncher:get_wielded_item():get_name() == "default:torch" then
         if minetest.get_player_privs(puncher).use_tnt then
            minetest.sound_play("tnt_ignite", {pos=pos})
            minetest.set_node(pos, {name="tnt:tnt_burning"})
            minetest.get_node_timer(pos):start(4)
            return
         else then
            minetest.chat_send_player(puncher, "You don't have the required priv to use tnt.")
            return
         end
      end
   end,
   mesecons = {effector = {action_on = boom}},
}

minetest.get_player_privs needs the name of the player (in this case puncher:get_player_name())
same for minetest.chat_send_player
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

Re: Post your modding questions here

by paramat » Tue Apr 28, 2015 17:15

afeys
In mgv5/v7 you can use the 'mapgen object biomemap' (see lua-api.txt) which is available for use in an 'on generated' function.
In mgv6 without the snowbiomes option calculate biome and humidity noise from the parameters:
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
#mgv6_np_biome = 0, 1, (250, 250, 250), 9130, 3, 0.50, 2.0
#mgv6_np_humidity = 0.5, 0.5, (500, 500, 500), 72384, 4, 0.66, 2.0

Then:
if biome noise > 0.4 then desert
elseif humidity noise > then jungle
else normal biome

However biome noise has an offset added, so for (x, z) calculate noise at (x + 150, z + 50)
 

prestidigitator
Member
 
Posts: 632
Joined: Thu Feb 21, 2013 23:54

Re: Post your modding questions here

by prestidigitator » Tue Apr 28, 2015 19:10

paramat wrote:However biome noise has an offset added, so for (x, z) calculate noise at (x + 150, z + 50)

Huh? An arbitrary offset was just added for some reason? That's really screwed up. I hope there's a bugfix request for that....
 

User avatar
Ben
Member
 
Posts: 157
Joined: Tue Mar 31, 2015 20:09

Re: Post your modding questions here

by Ben » Tue Apr 28, 2015 19:35

Is there a way to detect the last modification time of a block, preferable in regards to minetest.get_gametime() or similar?

I'm scanning the nodes in a small area around a central node, and to save time, I'd like to skip previously scanned nodes if "the block hasn't been changed since then". (Bonus question: if this does not make sense, that'd be good to know, too ;-) )
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

Re: Post your modding questions here

by paramat » Tue Apr 28, 2015 19:48

prestidigitator wrote:Huh? An arbitrary offset was just added for some reason? That's really screwed up. I hope there's a bugfix request for that....

Mgv6 has lots of offsets, noise often generates patterns that align with (x=0, z=0) or points at noise 'spread' distances from there, so offsets help to break up those alignments. When hmmmm took over mapgen 3 years ago he luckily didn't bother with offsets to keep thing simpler, they are a headache for sure.
 

PreviousNext

Return to Modding Discussion

Who is online

Users browsing this forum: No registered users and 6 guests

cron