Page 1 of 2

[Mod] Multinode [20120810] [multinode]

PostPosted: Tue Jul 17, 2012 13:49
by mauvebic
Simple tool to manipulate multiple nodes from the chat interface. Like worldedit, though written from scratch

Chat commands [priv:server]
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
/p1 (coords optional, defaults to player pos) define first corner
/giveme multinode:m1 (to use a node)
/p2 (coords optional, defaults to player pos) define opposite corner
/giveme multinode:m2 (to use a node)
/giveme multinode:pasteref   useful for setting the paste reference coords.
/clear    clear positions, clipboard and paste reference points
/reload   reloads the last set of multinode coords

/fill <nodename>  fills the area with given node
/fill -light     fix persistent shadows
/remove <nodename>     remove specific nodes from area
/remove -a   removes all nodes from the area
/replace <nodename> replace specific node from selection
/with <nodename>  what it should be replaced with
/doit    completes /replace /with
/copy    copy the selection
/saveas <building name> store contents of /copy for later use
/load <building name> load a saved building, use /paste to spawn.
/paste <+90|-90|+180 or leave empty>  paste the selection


Spheres & hollow spheres
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
/p0   sets the center of the sphere (using your position)
/radius <number>   sets radius of the sphere, defaults to 12
/thickness <number>   sets thickness of hollow sphere, defaults to 1
/sphere <nodename> spawns a sphere
/hollowsphere <nodename> spawns a hollow sphere


Cylinders (thanks to neuromancer)
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
/length   length of cylinder (p0 is midpoint) ~ defaults to 12
/xcylinder <nodename>   spawn cylinder on x axis
/ycylinder <nodename>   spawn cylinder on y axis
/zcylinder <nodename>   spawn cylinder on z axis



Image
Image
Image
Image
Image
Image
Image
Image
Image

PostPosted: Wed Jul 18, 2012 02:48
by cornernote
Very cool! Is the building format the same as worldedit?

PostPosted: Wed Jul 18, 2012 09:18
by mauvebic
i dont know what the worldedit schematics look like, but if theyre like mine (nodename:coords) then it wouldn't take much tweaking to get them to work.

PostPosted: Thu Jul 19, 2012 11:47
by mauvebic
bugfix for win32 clients


Soon:
Image

PostPosted: Thu Jul 19, 2012 19:48
by mauvebic
still testing

a radius 54 sphere ( i had to run the command 3x to get it to fill out in its entirety)

Image
click for 1:1 scale

inside the sphere (we built stuff):
Image
Image

PostPosted: Thu Jul 19, 2012 22:49
by VanessaE
Topic moved. :-)

PostPosted: Fri Jul 20, 2012 12:13
by mauvebic
Thanks :-)

Success in programming automated hollow spheres, thickness optional (default 1)

a radius 30 hollow sphere from the inside:
Image
Image
click imgs to enlarge

PostPosted: Fri Jul 20, 2012 13:34
by Neuromancer
Here's a doosy of an enhancement request.

add a /SaveAsNodeBox option. That's right, allow users to place a bunch of blocks, designate the area with /p1 & /p2, /copy it and then when they /SaveAsNodeBox it actually converts the shape they have created to a node box. It could be simple at first, just treating any node in the range as a cube.


See the following post for more details.
http://minetest.net/forum/viewtopic.php?pid=32470#p32470

PostPosted: Fri Jul 20, 2012 13:38
by mauvebic
whats the scale conversion, 1/10, 1/100?

PostPosted: Fri Jul 20, 2012 13:44
by Neuromancer
mauvebic wrote:Thanks :-)
Success in programming automated hollow spheres, thickness optional (default 1)

This is truly awesome, and we can build some really cool cathedrals/temples out of this. Geodesic domes on Mars built of glass. I'd still like arches. Is there some way to tweak this to build arches? For example that would be sweet for building huge bridges for railroad tracks, aqueducts, buildings etc. I'm thinking I could try to just create a sphere and then chop away at it by filling with air until I get an arch, but that might not work so well. Cylinders would be kick butt too. Silos, Rockets... Turn them on their sides, arched train tunnels, and dare I dream it..... SEWER SYSTEMS with flowing water and rats! Now I just need to convince sapier to add alligators :)

EDIT:
I think I have bridges with arched supports, aqueducts and arches in walls figured out. Just create a wall. Then create a sphere of air to remove a circle from the wall, then remove a rectangle below the removed circle.

PostPosted: Fri Jul 20, 2012 13:53
by Neuromancer
mauvebic wrote:whats the scale conversion, 1/10, 1/100?

It depends. If the user specifies a 20x20 area that gets converted into 1 nodebox. The problem is what if the user doesn't mark off a cube shaped region? I would say that you would then justify/position the object and fill in with air around it. The user would need to specify whether the object was center, top or bottom, right or left, front or back, justified. That's a pain, but I don't think you would want to stretch the object to fit a cube.

PostPosted: Fri Jul 20, 2012 14:17
by mauvebic
Hmm, sounds like it might be more convenient to design nodeboxes on 3D modelling software

PostPosted: Fri Jul 20, 2012 14:33
by Neuromancer
mauvebic wrote:Hmm, sounds like it might be more convenient to design nodeboxes on 3D modelling software

Try out the blueprint function in Mythruna. It's so easy a little kid could do it. Everyone who plays Minetest knows how to build stuff out of blocks. Not everyone knows how to use 3D modelling software. It has to be doable. Maybe using multinode is not the way to do it though.

But the cool thing is that multiple players could easily collaborate on building Nodeboxes using Multinode. They could even build rounded objects using the latest feature you added to multinode. And what if the user specified a "/cube 20" and a cube of size 20 was created with a glass bottom and at each corner of the cube a glass pillar was created. Then anything the builders put inside the cube would get saved to the nodebox when the user typed "/SaveAsNodeBox"? You wouldn't need to worry about positioning, and the user could see exactly where what they were building would go.

I admit this would be a bit of a gamble. While it would be easy enough to create things like chairs and tables that are mostly rectangular shapes, could people really create good looking things with cubes? The more cubes you gave them the easier it would be. But perhaps you are right, and Mythruna is a different beast because you don't have to build just using cubes. And 3D modelling software is so much more sophisticated than this would be and could create better looking objects.

PostPosted: Sun Jul 22, 2012 09:24
by mauvebic
TBH i wont be doing anything with nodebox in the foreseeable future. For starters im considering a downgrade so i can get back the performance i had pre-20120606. Im not buying another graphics card within a six month window so i can sit on a 3D toilet lol.

PostPosted: Sun Jul 22, 2012 13:44
by Neuromancer
mauvebic wrote:TBH i wont be doing anything with nodebox in the foreseeable future. For starters im considering a downgrade so i can get back the performance i had pre-20120606. Im not buying another graphics card within a six month window so i can sit on a 3D toilet lol.

Yeah, the more I thought about it, the less of a good idea it seemed. (Although I must say the thought or relieving myself on a 2d toilet is not something I relish.) I have come up with something that is easier to do, and perhaps far more useful.

The purpose is to make building traintracks, roads, skyscrapers, tunnels, etc. easier. Add a parameter to paste so that it pastes multiple copies of what you have loaded one after the other. "/paste +90 10" would paste 10 of whatever was loaded one after the other. Otherwise, it can be difficult (impossible) to position yourself to do this by hand. To do skyscrapers you would have to do "/paste up 10" or something like that. But that way it could replicate an entire floor of a skyscraper 10 times no matter how complicated it is. You could also paste really sophisticated roads with trees, sidewalks, crosswalks, fire hydrants, etc. Fancy arched railroad bridges, etc.

Think of it as streetbuilder on roids.

This may be the same thing as worldedit //stack command. Haven't tried it yet.

PostPosted: Sun Jul 22, 2012 18:24
by Neuromancer
I made a nasty hack of Mauvebic's Multinode code and added cylinders (and circles).
Multinode with Cylinders
It works just like sphere with an additional parameter, length.
/p0
/radius 8
/length 10
/hollowcylinder <node>
OR /cylinder <node> if you want a solid cylinder

If you want circles, just do /length 1

Needs: Currently the cylinders only are oriented around the y axis (up and down). There needs to be an axis parameter that lets cylinders to be created along the x & z axis to create round tunnels and arches (using a node of "air").

Mauvebic, if you like it, feel free to add it to Multinode and tweak it as you like.

Image

PostPosted: Sun Jul 22, 2012 20:59
by Temperest
The new WorldEdit format looks like the following:

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
<X> <Y> <Z> <nodename> <param2> <param2>
<X> <Y> <Z> <nodename> <param2> <param2>
<X> <Y> <Z> <nodename> <param2> <param2>
...


Where each component is separated by one or more spaces or tabs.

Everything is human readable and editable by hand. It's also supported by MeseconEdit, allowing you to directly export to this format.

Would it be possible for Multinode to support this as well? If we have a standard node interchange format, it will be easier to share saves between all users (Multinode users could share with WorldEdit users, etc.)

PostPosted: Mon Jul 23, 2012 10:49
by mauvebic
Not bad neuromancer, though i had already made a few changes/optimisations to spheres (spawn much faster):

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
    -------------------------------------------------------
--------------        SPHERES & HOLLOW SPHERES        ---------------------------
        ---------------------------------------------------------------
local SPHERE_SIZE = 12
local POINT_ZERO = nil
local HOLLOW_THICKNESS = 1

local function sphere(pos,nodename)
     pos.x = math.floor(pos.x+0.5)
     pos.y = math.floor(pos.y+0.5)
     pos.z = math.floor(pos.z+0.5)
--[[     local operations = SPHERE_SIZE + SPHERE_SIZE
     operations = operations * operations * operations
     print(operations..' node operations')
     local count = 0    ]]--
     for x=-SPHERE_SIZE,SPHERE_SIZE do
     for y=-SPHERE_SIZE,SPHERE_SIZE do
     for z=-SPHERE_SIZE,SPHERE_SIZE do
         if x*x+y*y+z*z <= SPHERE_SIZE * SPHERE_SIZE + SPHERE_SIZE then
                minetest.env:add_node({x=pos.x+x,y=pos.y+y,z=pos.z+z},{type="node",name=nodename})
--                count = count + 1
--                print(math.floor(((count/operations)*100)+0.5)..'% complete')
         end
     end
     end
     end
end
local function hsphere(pos,nodename,hollow)
     pos.x = math.floor(pos.x+0.5)
     pos.y = math.floor(pos.y+0.5)
     pos.z = math.floor(pos.z+0.5)
--[[     local operations = SPHERE_SIZE + SPHERE_SIZE
     operations = operations * operations * operations
     print(operations..' node operations')
     local count = 0     ]]--
     for x=-SPHERE_SIZE,SPHERE_SIZE do
     for y=-SPHERE_SIZE,SPHERE_SIZE do
     for z=-SPHERE_SIZE,SPHERE_SIZE do
            if x*x+y*y+z*z >= (SPHERE_SIZE-hollow) * (SPHERE_SIZE-hollow) + (SPHERE_SIZE-hollow) and x*x+y*y+z*z <= SPHERE_SIZE * SPHERE_SIZE + SPHERE_SIZE then
                minetest.env:add_node({x=pos.x+x,y=pos.y+y,z=pos.z+z},{type="node",name=nodename})
--                count = count + 1
--                print(math.floor(((count/operations)*100)+0.5)..'% complete')
         end
     end
     end
     end
end
minetest.register_chatcommand("p0", {
    params = "<none>",
    description = "spawn a sphere",
    privs = {server=true},
    func = function(name, param)
        POINT_ZERO = minetest.env:get_player_by_name(name):getpos()
        minetest.chat_send_player(name, "p0 set")
    end,        })
minetest.register_chatcommand("radius", {
    params = "<radius>",
    description = "set radius of sphere, default 12",
    privs = {server=true},
    func = function(name, param)
        SPHERE_SIZE = param
        minetest.chat_send_player(name, "radius set")
    end,        })
minetest.register_chatcommand("sphere", {
    params = "<nodename>",
    description = "spawn a sphere",
    privs = {server=true},
    func = function(name, param)
        if POINT_ZERO == nil then minetest.chat_send_player(name, "there is no p0 only zuul") return end
        minetest.chat_send_player(name, "spawning...larger spheres = more time, may need to retry if partial spawn")
        sphere(POINT_ZERO, param)
    end,        })
minetest.register_chatcommand("thickness", {
    params = "<hollow sphere thickness>",
    description = "set thickness of hollow spheres, default 1",
    privs = {server=true},
    func = function(name, param)
        HOLLOW_THICKNESS = param
        minetest.chat_send_player(name, "thickness set")
    end,        })
minetest.register_chatcommand("hollowsphere", {
    params = "<nodename>",
    description = "spawn a hollow sphere",
    privs = {server=true},
    func = function(name, param)
        if POINT_ZERO == nil then minetest.chat_send_player(name, "there is no p0 only zuul") return end
        minetest.chat_send_player(name, "spawning...larger spheres = more time, may need to retry if partial spawn")
        hsphere(POINT_ZERO, param, HOLLOW_THICKNESS)
    end,        })


Ill add the cylinders (and saucers) for the next release :-) Ill credit you in the OP for multinode - and multinode will likely be part of default mods for Nullspace :-)

@Temperest
mine is almost the same format, except i dont save param2 or node metadata, and instead of spaces i use special characters. The only thing i need to mull over is weather to write import/export functions or simply convert my format. Though i need to know if there are any strings/licensing issues attached to using WE formats? (i doubt it but w/ my luck id rather be safe than sorry lol)

PostPosted: Mon Jul 23, 2012 11:08
by mauvebic
It also occurs to me there are practically two of us working on multinode, and two of yous working on worldedit :P one of these days we should team up and create the next generation of worldedit/multinode. Alternatively im thinking of putting some of my own mods on github, if i can figure how that site works lol

PostPosted: Mon Jul 23, 2012 11:31
by VanessaE
Github's dead easy to use. Just make an account, then go to https://github.com/yourname/ and look for the dark grey "New Repository" button. After giving your new repos a one- or two-word name and a quick description, it'll give you easy instructions on how to set it up.

Then it's just `git add .` and `git commit` to register your changes, and `git push -u` to upload them.

PostPosted: Thu Jul 26, 2012 13:51
by mauvebic
Should have an update for this mod today,
- (finally) include neuromancers' cylinder function,
- add the finished hollow-saucer command
- code + add "full" saucer

and perhaps more useful: an auto-sphere builder. (for the really big ones so you dont need to keep running the commands manually)

testing the spheregen:
Image

here i made a radius 12 sphere (which it did fast) then got it started on a radius 70 sphere (biggest ive done):
Image

PostPosted: Fri Jul 27, 2012 10:27
by mauvebic
I put the autonode sphere gen to work on a sphere with a radius of 94 nodes, (something the chat commands couldn't finish without restarting the server a few times). Its starting to look like a small planet :P

Image

PostPosted: Fri Jul 27, 2012 12:15
by sdzen
ive got a radius 100 in the works ill post a screenshot when its done

PostPosted: Fri Jul 27, 2012 13:57
by mauvebic
i wanted to go for 100 but the other ppls on my server would kill me for the lag lol so far ive built 5 ages: 3x64(radius), 1x24, and 1x94 lol

PostPosted: Sun Jul 29, 2012 12:50
by mauvebic
Update released:
automatic sphere gen (use /hsnode to call the genenrating-node to your players' position, set it, and forget it. You can even stop and start the server and itt'l pickup where it left it off, no need to re-enter settings unless you wish to generate a new sphere from the same pos. But the thing works as an ABM, so no sphere-building if there are no players in range.

Plus a bunch of experimental spherical functions. Look at the bottom of the file, its all there :P

PostPosted: Sun Jul 29, 2012 14:18
by Neuromancer
mauvebic wrote:Update released:
automatic sphere gen (use /hsnode to call the genenrating-node to your players' position, set it, and forget it. You can even stop and start the server and itt'l pickup where it left it off, no need to re-enter settings unless you wish to generate a new sphere from the same pos. But the thing works as an ABM, so no sphere-building if there are no players in range.

Plus a bunch of experimental spherical functions. Look at the bottom of the file, its all there :P

Hey, you still planning on adding cylinders?

PostPosted: Sun Jul 29, 2012 15:04
by mauvebic
yeah, i just need to copy and tweak so we can have cylinders on all 3 axis :-)

PostPosted: Sun Jul 29, 2012 15:45
by Neuromancer
mauvebic wrote:yeah, i just need to copy and tweak so we can have cylinders on all 3 axis :-)
Sweet. That will rock!

PostPosted: Fri Aug 10, 2012 16:53
by mauvebic
update posted - added neuromancers' cylinder function times every axis :-)

PostPosted: Sat Aug 11, 2012 02:22
by Neuromancer
mauvebic wrote:update posted - added neuromancers' cylinder function times every axis :-)

Awesome! Thanks for adding that. Please update the instructions in the first post to indicate that /thickness and /radius can and should be used for the cylinder commands as well. I checked and these seem to work. It was cool building some underground cylinders out of air.

You might want to fix the messages I got wrong initially.
description = "spawn a hollow sphere", should be: "spawn a cylinder along the x-axis"

and
minetest.chat_send_player(name, "spawning...larger spheres = more time, may need to retry if partial spawn")
should be:
minetest.chat_send_player(name, "spawning...larger cylinders= more time, may need to retry if partial spawn")

Image