a PVC pipe constructor in blender?

i dont care if it uses python or not, i’ll give you the whole rundown of what im doing, i am the official creator of a simulator for these guys: http://seaperch.org well i have a problem, they would like for me to make a “build your own robot” part of the program in which the player would be able to piece together PVC pieces to build a robot(if you read this far then i thank you) now my problem is that i have no clue how to go about doing this, i have a way for the player to choose a piece and move it around, but im not sure how to get that piece to know if it is able to connect to another piece(like the angle is right, and its the right piece)

so a summery of what i need is;

a way for the selected pipe/joint to know what the piece it is trying to connect to is(pipe/joint):confused:

a way to know if it is lined up properly to attach to that piece.:confused:

any ideas are greatly accepted

You can’t give your sim users too much scope to design and articulate robots or else your program will begin to resemble blender itself and the user would have to learn quite a lot.

So it’s got to be simple but provide the user with the illusion that it has more functionality than it really has.

Let’s say you had arms, forearms, legs, lowerlegs, feet, hands, body and head. You might have 2 or 3 different lengths and sizes of each that the user can select from a menu. Even that might be thousands of combinations. You’d have to have walk cycles and stuff already prepared in readiness for any possible combination of selections. Once you got started you’d probably see ways of short cutting the process in creating walk cycles but even then it’s not a project for the faint hearted. It’s probably doable but would take a skilled game blender user a lot of work. Commercial software that does this sort of stuff can take thousands of hours to program and be huge in file size.

Disclaimer: It’s quite possible I don’t know what I’m talking about. If so someone like Monster or Moguri can probably help.

I do niot think you can do that without python (except you have a genius idea :slight_smile: ).

I would add some (invisible) helper objects. When hovering over it with your dragged element, snap the element to the helper (copy position and rotation). Parent the element to the helpers parent and remove or hide the helper.

something like that. But this is a lot of work.

my main problem is getting the objects(pipes/joints) to know if they are lined up properly to connect with the other object, such as a pipe has to be turned correctly to match up with a joint(you cant put a pipe through the back side of a T joint :smiley: ) i think this is possible, possibly by using those empties(like monster talked about) and each having there own property,(like Joint, or pipe) then the pipe or joint that the player is placing could have ray/radar sensors so that it will only let the player connect if those ray/radar sensors are true. tell me what you think of this idea. thank you monster for that idea, i think i will definitely use it.


You got me intrigued a couple of weeks ago. I started thinking about a simple pipe building program like you might have to build/design plumbing for a kit house. I figured that pieces could be limited in the ways they could be rotated and incrementally positioned so that it would be easy for the user to see that they were in the right position. And that since in real life they would be static objects they could just be static in blender and the sim.

Then I thought of something a little(actually a lot) more complex like building a customizable trebuchet. It might only have a max of about 10 cylindrical parts but the parts could be any length within reason and so be arranged with any orientation. I had’'t thought much beyond this but now I’m thinking that the design phase for the user could be done in plan(2d) views and the user draws straight lines between two points. And you would probably want to restrict the user by forcing some kind of snap. You, the programmer, have provided the drawLine function so that the lines are actually being drawn in 3d space. These lines are effectively stand-ins but we can get their length and orientation. From their length, orientation and position copies of a cylinder can be scaled and positioned to match the “blueprint” of the stand-ins. You will have had to do a lot of thinking ahead of time to allow clearance in articulating joints, where to have your object centers for various parts and so forth. And you’d have to figure out whether you wanted to make use, and how much use, of blenders physics, rigid body constraints, collision, ipos etc or whether you wanted to program some, most or all of your own physics. And we haven’t gotten onto robots yet, that will have cosmetic attributes as well. And I don’t know what your user is going to be able to do with the robots, maybe just bend them and look at them like a doll or have them move about controlled by a gamepad.

I don’t think even the huge commercial games attempt this. They might provide the illusion that the user is constructing and modifying a player but I think they already have to have at least most of the prototype in place and hundreds or thousands of prototypes.

It’s a good project but you can see how something that seems pretty simple can become very complex very quickly.

It’s likely that you’ve gotta keep your project pretty simple and it could be simple in a sense yet at the cost of having to use lots and lots of logic bricks, properties and messages.

I lack programming skills (but hopefully I’m learning more) and I’ve tackled things like this before in Visual basic using lots of prebuilt “controls” and repetetive swathes of simple code. Then I found that to add a single simple feature mifgt require 64 times the number of controls and amount of code. So down to my lack of programming ability it becomes ridiculous for me to continue until I can learn more and figure out a better way of doing it.

Having said all that (phew) I might tackle a sim to build kit houses.

Same disclaimer as before.