Entity Contribution

Thomas

New Member
  • Name: Thomas
  • Social: https://github.com/personne13, http://www.youtube.com/user/MinecraftlikeC
  • From: Marseille, France
  • Skills / Tools: I'm just 18, so I've didn't made many projects, and only personal ones. I learned alone C language 3 years ago, and it's the only language I know. I know a little bit OpenGL and the SDL librairy. With those two tools, I've made a copy (simplified) of Minecraft, you can see it on my YouTube channel.
  • Found via: I Found Terasology on a french forum (www.siteduzero.com)
  • Interests: I think I had the same ambitions of Terasology with my Minecraft-like project. But I had difficulty to make a proper entity engine, so I've made the entity editor project. It's fully open source and you can create models, apply on a texture and animate them. I tried to make it as user friendly as possible, and I think I succeed it. Share this project with Terasology could be a really good improvement for the two creations I think.
  • Extra: This is some videos of the project :
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
Hi Thomas and welcome :)

I can't view videos from work but will take a look from home when I get a chance and comment further. Just wanted to say hello for now!
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
Aha, now that I have finally had a chance to watch the video I see what you mean! That's very cool :)

I especially like the animation piece. Kinda like a Blender-lite, a really easy alternative specific to voxel creatures. That could indeed be very useful.

What file / model formats are involved for the models and textures? And animaitons? Wondering if they'll all be compatible with the way we store model stuff. Maybe one of our architects or artists can figure that out - pinging begla Immortius A'nW glasz
 

Thomas

New Member
My model is saved in a format I created for : with the .mclmdl extension (minecraft-like model), you can see the syntax on the files on the repository (They are saved with ASCII characters, so you can open them as a .txt file).
The principle is simple :
  • Number of members on the model
  • File for the texture (.png, .jpg, .bmp ...), the path where is the texture
  • Then every cubes are saved :
    • index of the current cube
    • Translation coordinates
    • Rotation coordinates
    • Then the 6 faces are saved :
      • Face color
      • Vertex and texture coordinates of each point of the face
  • The animations are saved after all of this :
    • number of animations
    • Every anims are saved : name, number of movements constituting the anims
      • Each movement has 7 datas : the type of animation (translation or rotation), the axis which is affected (x, y, z), the minimal value, the maximal value, the basic value (value without animation), the initial phase (if the cube should increase or decrease at the begining), and the movement's period
You can see my loader on the file model.c, the function "loadModel". :)
This format has a 2 main defects : the texture is saved out of the model, and my function "animateModel" has undesirable behavior if the maximal value and the minimal value are the same.
Contact me if you have some question or suggestion to do :)
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps

Thomas

New Member
For the skeletal meshes, I think I could export/import .mclmdl format to MD5, because this is the same principle.
However, the MD5 format uses a different way to animate models : for each animation, the editor saves it in a file, with vertex coordinates for each frame (24 by seconds generally). I knew this concept when I began to animate my models, and I found them pretty heavy for really simple animations, as Minecraft's ones.
So I've made a different one : This is based on periodic or static animations, with a few parameters (7), I can make simple animations, like those of Minecraft.
The advantages of this method are the model's size (zombie file is 13 Ko, with every vertex and 3 animations), the facility to make animations in the editor, and it's doesn't use much ressources in game.
The inconvenients are the enability to make other shape than cubes, and you can't make very complex animations with it.
So I can propose to you to make a ".mclmdl" loader directly in Terasology, because I couldn't export to MD5 format without losing all the advantages my editor offers. If you want to keep MD5 format, Blender or any other "bigger" editor are more adaptated than mine :)
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
Okay, thanks for the info :)

I'll probably have to wait for some feedback from our architects/artists at this point then on the custom format. I know we've tried to stick with mainstream formats but on the other hand we've also talked about eventually supporting some sort of limited editor in-game

We can hardly embed Blender, so something lighter is needed. And maybe that would have to come with a custom format. Idea was to build creatures out of blocks, possibly oversized then shrinking the whole thing down, and imbuing it with life through some process. Including simple animations like the ones in your editor would be an awesome way to do that. Sound interesting?

To even begin to embed something it would need to be in Java though. Any idea how much work it would be to port your editor to Java or create something similar?
 

Immortius

Lead Software Architect
Contributor
Architecture
GUI
So I can propose to you to make a ".mclmdl" loader directly in Terasology, because I couldn't export to MD5 format without losing all the advantages my editor offers.
It would only be an export format, not a format you would load and or use while editing, so it doesn't seem like it would affect the capabilities of your editor to me. That said I don't see an issue supporting .mclmdl on our end (we'ld probably pre-calculate the frames on load so as to use our existing animation pipeline), except I'm not sure when someone will get around to it. I might prioritize it up to shortly after core multiplayer is done though, as it would be a good tool to do a player character in perhaps.

As for resources used in game, it is an interesting one. There may be an amount of memory vs cpu trade off here, with precalculated frames using more memory but requiring less calculation. From an architectural pov, assuming we do want to continue supporting MD5 (and probably IQM in the future) we need to be able to deal with frame-based animations and it is easier to convert other formats to frame-based than the other way around.
 

Thomas

New Member
To me, the editor loses interest because it doesn't take much size thanks to really basic animations, if I make an export to md5 model, there will be basic animation with much data used.
So I could make an export (I think it should take to me less than a week), but the tools like blender seem more adaptated to this, you can make more complex models and animations with it.
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
I'm more curious about the potential to use it in-game :)

With a Java-based version you could open it in-game (either obviously via a GUI component or subtly via in-world actions), build a creature right there, including animations and some Terasology-specific properties added on, then set the creature running. Game saves the creature in your light-weight format, optionally exports it for artists to use to make a fancier version if they so desire :geek:

That's what I'd be curious to see if you would have an interest in pulling off :D
 

Thomas

New Member
So I'm ok to make an export to md5 file with pre-calculated frames, or implementing a adaptated loader in Terasology, keeping the periodic concept :)
The first option is more conventional, but I certainly need more time to make (a week aproximatively)
The second way should take to me 4-5 hours, with a little Java help I think.
Tell me what to do :)
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
Immortius and the others might be better at guiding you for model specifics. I'm curious about how we even would implement something like that in-game, since it would surely involve hooking into LWJGL / OpenGL in some format. Do you use any libraries for GUI / 3D stuff in your current editor?

Maybe there's some fairly easy 3d wizardry we can do in Java to support it in-game, but I wouldn't know where to start. That, and there's the whole heading on vacation for three weeks in a couple days :)
 

Thomas

New Member
I don't use any library for the 3d in the editor, and model's caracteristics are really basic (translation, rotation) so I would be surprised if there's no an equivalent in lwjgl, I think it should be simple to make a loader in game :)
 

Immortius

Lead Software Architect
Contributor
Architecture
GUI
For making a loader, the MD5 loader should be an alright reference: https://github.com/MovingBlocks/Terasology/tree/develop/src/main/java/org/terasology/rendering/assetLoaders/md5

There are separate loaders for the main skeletal mesh and the individual animations, which are assumed to be separate files to allow animations to be shared between different skeletal meshes, or additional animations to be added by mods - this was a major reason MD5 was chosen in the first instance. Additionally our asset system doesn't cope well with multiple assets from a single file, which is a weakness we need to address.

The target assets are SkeletalMesh which is the mesh and its skeleton, and MeshAnimation, which has the frame states for the skeleton for a given animation. As long as those are created they can be used by the existing animation system.

The other sane option would be to refactor MeshAnimation into an interface, and then have two implementations - one that holds precalculated frames, and the other which calculates frames on the fly based off of your data. Probably push the code that lerps between frames into MeshAnimation too. Then while you would produce a different MeshAnimation asset it would still work with the existing animation pipeline.
 

Immortius

Lead Software Architect
Contributor
Architecture
GUI
Basically a class in Java or other Object Oriented languages is similar to a struct in C, except you can put the methods to work with the class's data into the class itself and prevent direct access to the data (the private keyword). This provides encapsulation - users of the class work with it through the methods it provides, not the underlying data that forms its implementation. This in turn is the first step of decoupling code - because classes are working with each other's methods and not each other's data, you can change the underlying representation of a class without having to change code that uses it. And Object Oriented languages spun out from there adding more features for decoupling and extensibility and so forth.
 
Top