I’ve spent some time looking for how an editor could work to move from ideas and speculation to facts and logic. The answer is meatballs. (Metaballs, 3d objects that connect to each other smoothly) In this post I will explain the core idea of creating a mesh. Rigging, weights and uvs will be discussed another time.
-Introduction
In this editing tehnique everything is made out of metaballs. If possible, there will be more shapes included like sharp ending claw mesh and a long part useful for bones, limbs and more sticking out parts. Implementing objects other than spheres would require different calculations but is very beneficial. There is also an option to be able to extend a metaball but it’s way more complicated than having two separate shapes. Location of every placed metaball will be saved and used in the editor, during gamplay they should be converted into a mesh.
Here is some helpful information about metaballs.
-Process
Every creature will consist of different tissues. The default tissue is the one which is the most common, in the simplest and most efficient scenario it would symbolize muscle, fat, skin, wood, whatever organism’s style is so the overall shape and internal organs would be inside of it. Different tissue types will not stick to each other, they will still be connected but they will interact on a vertical level only with it’s own tissue type.
Every piece of tissue is a metaball with a center point and a ray distance with the value same as it’s center to surface distance. This would let other metaballs move only in the ray distance to not create any mess. Scaling metaballs will also be restricted to how big the connected parent metaball is but it will still leave a big size variety.
The first metaball will be a parent to any metaballs placed on it, that means children metaballs glued to it and will change position right with it. The amount of child pieces glued to one ball should be restricted too to maybe 4-6. This rule includes only children and not pieces connected to children themselves.
Player will gradually grow and shape his creature to become more complex looking. Placement options for objects would be similar to what is implemented in the microbe editor. One metaball will always be in the center of X and Y dimensions and the player can choose if the creature will have 2 sided, 4 sided symmetry etc. (though more complicated symmetries will be tough to program). For example on a 2 sided creature one sphere would copy the position value of the other sphere but with X set to negative. Non spherical meta objects will require some degree of rotation control so they would copy rotation with Y and Z mirrored. Their origin point would always be on the Edge and facing towards the parent object for the best rotation results.
A very helpful building tool are negative metaballs which can carve holes in the tissue for mouth or anything the player wants it to be.
If the main tissue has a hidden group of negative metaballs it will allow placing tissue over it
without clipping to create shells, armor, claws.
-Summary of how it all works
-
Each object is a child of a metaball from which it was duplicated from. That creates branches which lead to the “origin metaball” making it a main control point (moves entire organism up, down, forward, back in the editor).
-
Parents should have a child limit of around 4, mirrored objects count as 1.
-
When a parent is moved, every child copies the position shift (XYZ).
-
If the parent is a non spherical object, children have to rotate with it using parent’s origin.
-
Every object has a limited scale relative to it’s parent and an absolute size limit to not fill the entire scene with blobs of tissue or tiny invisible points.
-
Non spherical objects can only rotate on X Y and not further than 90° from it’s original position. This rule doesn’t apply to internal organs.
-
When non spherical objects are created on a parent their original position is always facing away from parent’s center with it’s origin point close to parent’s surface.
-
Every object except the “origin metaball” has It’s own X Y Z value set that can’t go outside the distance limit set by it’s parent’s surface.
-
“Origin metaball” is always X=0 Y=0 but can be moved on Z (up down).
-
Probably only one side of symmetrical creatures would be editable, selecting the uneditable part will send you to an editable one. Metaballs on 2-sided organisms (like vertebrates) will copy a location from the editable part but change X to -X. Non spherical objects do the same thing but also copy rotation changing YZ to -Y -Z.
-
Z<0 value is floor and nothing can have a world space value equal to it.
-
There is a negative meta surface on -Z which flattens every metaball making it interact with the ground.
-
Negative metaballs work like regular metaballs but can be moved further from the parent.
-
Negative metaballs have a tissue type assigned but maybe the player will be able to selectwhich tissue group it affects and which not.
-
Main tissue has hidden negative metaballs that only work on other surface tissues.
-
Each tissue has a metaball group which only merges with itself but can still be parented to other tissue spheres and has to follow their parent location limits.
-
Internal organ tissues and bones can only be placed inside external tissues so that they wouln’t have be rendered.
-
Internal tissues can be placed anywhere but are still parented by the “origin metaball” and are not allowed to go outside the external surface.
-
All the data about size, location and rotation of objects is saved and converted into a mesh during the playthrough.
For the end, here is a process of creating a creature from scratch (only used spheres).
+ Meatball Disturbance and some other prototypes