[Mod] Multinode [20120810] [multinode]

mauvebic
Member
Posts: 1550
Joined: Fri Jan 27, 2012 11:32

[Mod] Multinode [20120810] [multinode]

by mauvebic » Post

Simple tool to manipulate multiple nodes from the chat interface. Like worldedit, though written from scratch

Chat commands [priv:server]

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

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)

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
Last edited by mauvebic on Sat Dec 08, 2012 00:03, edited 1 time in total.

cornernote
Member
Posts: 844
Joined: Wed Jul 11, 2012 15:02

by cornernote » Post

Very cool! Is the building format the same as worldedit?

mauvebic
Member
Posts: 1550
Joined: Fri Jan 27, 2012 11:32

by mauvebic » Post

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.

mauvebic
Member
Posts: 1550
Joined: Fri Jan 27, 2012 11:32

by mauvebic » Post

bugfix for win32 clients


Soon:
Image
Last edited by mauvebic on Thu Jul 19, 2012 18:56, edited 1 time in total.

mauvebic
Member
Posts: 1550
Joined: Fri Jan 27, 2012 11:32

by mauvebic » Post

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
Last edited by mauvebic on Fri Jul 20, 2012 13:31, edited 1 time in total.

User avatar
VanessaE
Moderator
Posts: 4655
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE
Location: Western NC
Contact:

by VanessaE » Post

Topic moved. :-)
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

mauvebic
Member
Posts: 1550
Joined: Fri Jan 27, 2012 11:32

by mauvebic » Post

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
Last edited by mauvebic on Fri Jul 20, 2012 13:28, edited 1 time in total.

User avatar
Neuromancer
Member
Posts: 964
Joined: Tue Jun 12, 2012 22:28
GitHub: Neuromancer56

by Neuromancer » Post

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 ... 470#p32470

mauvebic
Member
Posts: 1550
Joined: Fri Jan 27, 2012 11:32

by mauvebic » Post

whats the scale conversion, 1/10, 1/100?
Last edited by mauvebic on Fri Jul 20, 2012 13:38, edited 1 time in total.

User avatar
Neuromancer
Member
Posts: 964
Joined: Tue Jun 12, 2012 22:28
GitHub: Neuromancer56

by Neuromancer » Post

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.
Last edited by Neuromancer on Sat Jul 21, 2012 02:50, edited 1 time in total.

User avatar
Neuromancer
Member
Posts: 964
Joined: Tue Jun 12, 2012 22:28
GitHub: Neuromancer56

by Neuromancer » Post

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.
Last edited by Neuromancer on Fri Jul 20, 2012 14:03, edited 1 time in total.

mauvebic
Member
Posts: 1550
Joined: Fri Jan 27, 2012 11:32

by mauvebic » Post

Hmm, sounds like it might be more convenient to design nodeboxes on 3D modelling software

User avatar
Neuromancer
Member
Posts: 964
Joined: Tue Jun 12, 2012 22:28
GitHub: Neuromancer56

by Neuromancer » Post

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.
Last edited by Neuromancer on Sat Jul 21, 2012 00:19, edited 1 time in total.

mauvebic
Member
Posts: 1550
Joined: Fri Jan 27, 2012 11:32

by mauvebic » Post

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.

User avatar
Neuromancer
Member
Posts: 964
Joined: Tue Jun 12, 2012 22:28
GitHub: Neuromancer56

by Neuromancer » Post

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.
Last edited by Neuromancer on Sun Jul 22, 2012 22:39, edited 1 time in total.

User avatar
Neuromancer
Member
Posts: 964
Joined: Tue Jun 12, 2012 22:28
GitHub: Neuromancer56

by Neuromancer » Post

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
Last edited by Neuromancer on Sun Jul 22, 2012 20:52, edited 1 time in total.

Temperest
Member
Posts: 651
Joined: Tue Nov 15, 2011 23:13
GitHub: Uberi

by Temperest » Post

The new WorldEdit format looks like the following:

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.)
WorldEdit 1.0 released

The Mesecons Laboratory - the art of Mesecons circuitry
Latest article: Mesecons Basics.

mauvebic
Member
Posts: 1550
Joined: Fri Jan 27, 2012 11:32

by mauvebic » Post

Not bad neuromancer, though i had already made a few changes/optimisations to spheres (spawn much faster):

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)
Last edited by mauvebic on Mon Jul 23, 2012 10:52, edited 1 time in total.

mauvebic
Member
Posts: 1550
Joined: Fri Jan 27, 2012 11:32

by mauvebic » Post

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

User avatar
VanessaE
Moderator
Posts: 4655
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE
Location: Western NC
Contact:

by VanessaE » Post

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.
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

mauvebic
Member
Posts: 1550
Joined: Fri Jan 27, 2012 11:32

by mauvebic » Post

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
Last edited by mauvebic on Thu Jul 26, 2012 16:03, edited 1 time in total.

mauvebic
Member
Posts: 1550
Joined: Fri Jan 27, 2012 11:32

by mauvebic » Post

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

User avatar
sdzen
Member
Posts: 1170
Joined: Fri Aug 05, 2011 22:33
Location: Paradise (your not allowed)

by sdzen » Post

ive got a radius 100 in the works ill post a screenshot when its done

Zen S.D.

The next generation of tranquility!
malheureusement mon français n'est pas bon :<
Owner of the Zelo's
In game name: MuadTralk, spdtainted, sdzen, sd zen, sdzeno

mauvebic
Member
Posts: 1550
Joined: Fri Jan 27, 2012 11:32

by mauvebic » Post

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

mauvebic
Member
Posts: 1550
Joined: Fri Jan 27, 2012 11:32

by mauvebic » Post

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
Last edited by mauvebic on Sun Jul 29, 2012 12:51, edited 1 time in total.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests