3D meshes for players and creatures [Models are now upstream!]

User avatar
MirceaKitsune
Member
 
Posts: 809
Joined: Sat May 21, 2011 22:31
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune

by MirceaKitsune » Wed Nov 14, 2012 22:19

And the moment everyone's been waiting for is here: We have a 3D player! I created the model in Blender today, rigged and UV mapped it, and added the basic animations: Standing, walking (forward backward left and right) and mining / punching. The player.lua script contains definitions for all frame ranges so they can easily be used. It is a lot like the MineCraft model, only that arms and legs can be bent.

There's also a surprise I've had in store for this model: It's fully compatible with any MineCraft skin. I did the UV mapping so the exact same areas of the texture are used. So if you have a favorite custom skin you use in MC, simply apply it as a texture to the mesh and it will work :) Just for clarity... this is not to copy MineCraft, but to allow people to use their custom skins in both places, since I think many would like that.

In my test I use the default MineCraft player skin... but for obvious licensing reasons it's not included in GIT. To use it, get the texture from HERE, rename it from Char.png to player.png, and place it in the same folder (models) as the mesh.

Needed next is help from lua scripters: The player script needs functions to detect when the player is walking forward, backward, or strafing left or right... and with what speed. Also when the player is mining (holding the left mouse button). If you can help with that, please checkout the game branch and modify player.lua accordingly. Feel free to put the changes on your own repository or pastebin them to me or post them here. This is very needed, since currently the script just loops one player animation!

Also, we need a MineCraft skin that's license compatible. If you know one link it here, or feel free to make your own. This shouldn't be hard.

Other than that, the code is now ready for testing. I still haven't figured out why manually editing joints makes the mesh break, but hopefully that will be fixed soon. I'll post instructions later about how to test. Soon after that I will pull request it so it can be added to MineTest.

Code branch: https://github.com/MirceaKitsune/minetest/tree/models
Game branch: https://github.com/MirceaKitsune/minetest_game/tree/models

Screenshots:

http://i50.tinypic.com/35kvrro.png
http://i49.tinypic.com/2w7jt02.png
http://i48.tinypic.com/2jg2fx3.png
http://i50.tinypic.com/1zmmrd5.png
http://i50.tinypic.com/1zzjgb8.png
http://i47.tinypic.com/2nvuvmf.png
http://i49.tinypic.com/4fu1a9.png
http://i47.tinypic.com/rvk1vp.png

Image
 

User avatar
VanessaE
Member
 
Posts: 3894
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaEzekowitz

by VanessaE » Wed Nov 14, 2012 22:32

Beautiful work!

Suggestion: name the skin file player_3d.png to distinguish it from default 2D player skins, so texture packs won't break.
You might like some of my stuff:
Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (16-512px)
Tips (BTC): 13LdcdUFcNCFAm7HfvAXh5GHTjCnnQj6KE
 

User avatar
MirceaKitsune
Member
 
Posts: 809
Joined: Sat May 21, 2011 22:31
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune

by MirceaKitsune » Wed Nov 14, 2012 22:38

VanessaE wrote:Beautiful work!

Suggestion: name the skin file player_3d.png to distinguish it from default 2D player skins, so texture packs won't break.


I noticed this causes the sprite player to get the texture too. I think I'd rather rename its texture instead... not sure. But I'll look into that.

BTW, another thing I need help with and forgot to post earlier: Does everyone think the arms and legs bending looks ok? There's only one edge loop, so bending them too much will cause the limbs to look as if they're shrinking toward the middle. I'm tempted to remove that and make the limbs whole boxes... but then this will be exactly like the MineCraft model and will give people more reason to accuse us of copying MC :P I think it looks very good apart from this, and might go for whole limbs since I'm unsure about the deformations.
 

User avatar
InfinityProject
Member
 
Posts: 1009
Joined: Sat Mar 17, 2012 00:52

by InfinityProject » Wed Nov 14, 2012 23:51

The helmets that can be added to minecraft skins; is that supported?
 

User avatar
MirceaKitsune
Member
 
Posts: 809
Joined: Sat May 21, 2011 22:31
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune

by MirceaKitsune » Thu Nov 15, 2012 00:31

InfinityProject wrote:The helmets that can be added to minecraft skins; is that supported?


Not that part... no implementation for wearables yet. But that can be easy to add later on perhaps.

Also, it seems the bug with animating joints is a known Irrlicht issue regarding skinned meshes, and won't be fixed in any recent update. The functions will stay coded in MineTest of course, but won't be usable for probably many months from now. So things like the head looking where the player is facing will have to wait... but thankfully that's a less important part. More info here:

http://irrlicht.sourceforge.net/forum/viewtopic.php?f=1&t=47579

http://irrlicht.sourceforge.net/forum/viewtopic.php?f=7&t=47041
 

User avatar
BrandonReese
Member
 
Posts: 836
Joined: Wed Sep 12, 2012 00:44
GitHub: bremaweb
IRC: BrandonReese
In-game: BrandonReese

by BrandonReese » Thu Nov 15, 2012 03:51

The title says players and creatures, will we be able to create 3D mobs in lua with your new feature?
 

User avatar
VanessaE
Member
 
Posts: 3894
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaEzekowitz

by VanessaE » Thu Nov 15, 2012 04:50

No, don't rename the old 2D player texture - that'll break too much stuff (namely, every MT skin in existence, plus some texture packs). Leave the old player skin as player.png, and give the 3D model its own filename.

It causes less work for us texture pack authors, plus it makes it much easier to support both player sprites and 3d models, since not everyone will necessarily run the latest version of the game.
You might like some of my stuff:
Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (16-512px)
Tips (BTC): 13LdcdUFcNCFAm7HfvAXh5GHTjCnnQj6KE
 

User avatar
Mito551
Member
 
Posts: 1271
Joined: Sat Jun 16, 2012 15:03

by Mito551 » Thu Nov 15, 2012 12:56

what happens if client with default mt (e. g. sfans build) joins this server?
 

User avatar
MirceaKitsune
Member
 
Posts: 809
Joined: Sat May 21, 2011 22:31
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune

by MirceaKitsune » Thu Nov 15, 2012 13:21

BrandonReese wrote:The title says players and creatures, will we be able to create 3D mobs in lua with your new feature?


Certainly. The feature is intended to allow models for both players and lua entities, and has been tested on both. The same lua functions are used for either of the two. So yes, current code should easily allow 3D players for the animals mod and other mobs.

VanessaE wrote:No, don't rename the old 2D player texture - that'll break too much stuff (namely, every MT skin in existence, plus some texture packs). Leave the old player skin as player.png, and give the 3D model its own filename.

It causes less work for us texture pack authors, plus it makes it much easier to support both player sprites and 3d models, since not everyone will necessarily run the latest version of the game.


Ok, I'll try to use different file names for mesh player. The sprite player will only stay useful for consistency however... perhaps I should modify it into a "loading" skin with my branch, since it's now only meant to be visible before the script sets its mesh (as fallback).

Mito551 wrote:what happens if client with default mt (e. g. sfans build) joins this server?


Clients need to have the new code to see models. Haven't tested what happens if not.
 

User avatar
Mito551
Member
 
Posts: 1271
Joined: Sat Jun 16, 2012 15:03

by Mito551 » Thu Nov 15, 2012 14:14

okay, thanks, i'll probably test that out later
 

OdnetninI
Member
 
Posts: 38
Joined: Sun Oct 21, 2012 08:20

by OdnetninI » Thu Nov 15, 2012 14:59

You can add a fuction in inventory plus to change the skin of the player in game. See every player with their own texture.
Last edited by OdnetninI on Thu Nov 15, 2012 14:59, edited 1 time in total.
 

User avatar
MirceaKitsune
Member
 
Posts: 809
Joined: Sat May 21, 2011 22:31
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune

by MirceaKitsune » Thu Nov 15, 2012 15:07

Mesh and texture are now called "character" instead of "player" to fix the conflict discussed above. I also removed the bent limbs and made them whole boxes, since I didn't like how those deformations looked like. Now there's a good reason to be accused of having a mesh exactly like MineCraft's and copying it :P Obviously people can make their own models... this is just the default.

As a reminder, a scripter's help is needed at this point to make the player mesh usable! I need two lua functions that run for each player: One that knows if the player is walking, in which direction (based on where the player is facing) and with what speed. Second is a function that knows when the player is punching (holding the left mouse button). From that I should be able to make players loop the proper animation based on what they are doing.

Also needed next is license compatible player skin to be used by default. Feel free to look one up on http://www.minecraftskins.com/ (but make sure it's explicitly GPL or Public Domain) or draw your own for MineTest if you're good at that.

OdnetninI wrote:You can add a fuction in inventory plus to change the skin of the player in game. See every player with their own texture.


Theoretically that should be possible, if lua scripts can send custom menus to a player (and IIRC they can). But a better scripter than me would have to make a player selection menu for this. Note that in MineTest's case, skins are not the only ones that can be changed and should be selectable, but also models. My suggested implementation to anyone willing to do this is adding a model selector, and each model can have its own list of textures.
Last edited by MirceaKitsune on Thu Nov 15, 2012 15:10, edited 1 time in total.
 

OdnetninI
Member
 
Posts: 38
Joined: Sun Oct 21, 2012 08:20

by OdnetninI » Thu Nov 15, 2012 16:43

I only see this:
Image
 

ashenk69
Member
 
Posts: 230
Joined: Tue Jul 03, 2012 00:08

by ashenk69 » Thu Nov 15, 2012 17:40

I have some experience with the lua api so I'll try and work on that. Most of what you said that you needed though is already in the api. To get a players looking direction you can use "get_look_dir()" and to get velocity use "getvelocity()". The only one is how to tell if the user has clicked the mouse button. I have ideas on how to get that to work but I'll have to test them out.
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Thu Nov 15, 2012 17:53

ashenk69 wrote:I have some experience with the lua api so I'll try and work on that. Most of what you said that you needed though is already in the api. To get a players looking direction you can use "get_look_dir()" and to get velocity use "getvelocity()". The only one is how to tell if the user has clicked the mouse button. I have ideas on how to get that to work but I'll have to test them out.

There is no getvelocity() for players; its for Lua entities only.
 

ashenk69
Member
 
Posts: 230
Joined: Tue Jul 03, 2012 00:08

by ashenk69 » Thu Nov 15, 2012 18:19

Sorry about that I forgot it divides some functions to Lua Entities and not the Player.
 

User avatar
MirceaKitsune
Member
 
Posts: 809
Joined: Sat May 21, 2011 22:31
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune

by MirceaKitsune » Thu Nov 15, 2012 19:08



That's because no skin is included in GIT for this model yet. I'm testing with the MC skin, which is not license compatible. Like I said, if someone knows a free MineCraft skin that looks good I will include that (must be either GPL or Public Domain I believe).

If you want a texture until then, get the default skin from here, rename it to character.png, and put it in the same folder as the model. That will work out of the box.

PilzAdam wrote:
ashenk69 wrote:I have some experience with the lua api so I'll try and work on that. Most of what you said that you needed though is already in the api. To get a players looking direction you can use "get_look_dir()" and to get velocity use "getvelocity()". The only one is how to tell if the user has clicked the mouse button. I have ideas on how to get that to work but I'll have to test them out.

There is no getvelocity() for players; its for Lua entities only.


It really sucks this function doesn't exist for players as well. Maybe I'll see if I can implement it... should be only a few lines of code I imagine. But I'm bad with the lua API, so it might be best to leave this part to someone else. If anyone wishes to help, feel free to clone my code branch and implement the necessary additional hooks there.

Also important: In an IRC discussion, someone suggested letting C++ handle player animations. Personally I think this is a bad idea, because different player models would have different animation ranges, plus that special mods could have special actions adding their own animations to the player. At worst, this could be done in builtin (the default lua scripts), but it's very important that each MineTest game can define the frame ranges of any model plus specify their own animations if needed. The lua functions already in my code should stay as they are so they can be usable by any script in their current form.

Other than that, I'd leave better scripters decide what to do here. Ask me anytime if there's a question about this, either here or on IRC.
Last edited by MirceaKitsune on Thu Nov 15, 2012 19:09, edited 1 time in total.
 

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

by rubenwardy » Thu Nov 15, 2012 19:23

Would this be compatible with this: http://minetest.net/forum/viewtopic.php?id=3587 ?
if it is not, i would be a good thing to see happen
 

OdnetninI
Member
 
Posts: 38
Joined: Sun Oct 21, 2012 08:20

by OdnetninI » Thu Nov 15, 2012 19:29

MirceaKitsune wrote:


That's because no skin is included in GIT for this model yet. I'm testing with the MC skin, which is not license compatible. Like I said, if someone knows a free MineCraft skin that looks good I will include that (must be either GPL or Public Domain I believe).

If you want a texture until then, get the default skin from here, rename it to character.png, and put it in the same folder as the model. That will work out of the box.



I've done, but I see the same.
 

User avatar
MirceaKitsune
Member
 
Posts: 809
Joined: Sat May 21, 2011 22:31
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune

by MirceaKitsune » Thu Nov 15, 2012 19:48

rubenwardy wrote:Would this be compatible with this: http://minetest.net/forum/viewtopic.php?id=3587 ?
if it is not, i would be a good thing to see happen


Like I said on IRC, yes. The script function can customize each player at any time, and set visuals to anything. This means a player can choose any mesh or sprite, and set it to any texture (if a lua script for a visuals selector is also made). That would also allow using the sprite player MineTest had until now, or any other sprite... while someone else on the same server can be wearing the mesh.

OdnetninI wrote:I've done, but I see the same.


Weird, it works here. Make sure the texture is named "character.png" (lower case characters only) and is in the same folder as character.x (meaning the models folder). If not check the script, the image for the mesh is also specified there. Might mean something is broken locally for you.
 

OdnetninI
Member
 
Posts: 38
Joined: Sun Oct 21, 2012 08:20

by OdnetninI » Thu Nov 15, 2012 20:04

all is correct. I don't know why it is making error. I'm goin to wait to improved version of these to make another test. Good Luck.
 

User avatar
MirceaKitsune
Member
 
Posts: 809
Joined: Sat May 21, 2011 22:31
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune

by MirceaKitsune » Thu Nov 15, 2012 21:23

We have a new default skin, which has been added to the GIT. Credits go to Jordach for making it. The texture is licensed as CC BY-SA 3.0 with specific permission for MineTest only. See the original here: http://www.planetminecraft.com/skin/greed-plaid-shirt/

Image

OdnetninI, please update minetest_game from my GIT and try it now. If you still get no texture it's a local bug and I don't know sadly.
Last edited by MirceaKitsune on Thu Nov 15, 2012 21:24, edited 1 time in total.
 

Doc
Member
 
Posts: 75
Joined: Sun Nov 04, 2012 00:21

by Doc » Thu Nov 15, 2012 21:27

Awesome! Now to add some new features like knockback, etc. It'll be good to see some nicer models.
 

celeron55
Member
 
Posts: 430
Joined: Tue Apr 19, 2011 10:10

by celeron55 » Thu Nov 15, 2012 21:36

MirceaKitsune wrote:with specific permission for MineTest only


That will make a lot of problems in terms of forks and whatnot. Only plain open licenses can go upstream.
 

User avatar
MirceaKitsune
Member
 
Posts: 809
Joined: Sat May 21, 2011 22:31
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune

by MirceaKitsune » Thu Nov 15, 2012 21:41

celeron55 wrote:That will make a lot of problems in terms of forks and whatnot. Only plain open licenses can go upstream.


Needs to be discussed with Jordach then, I'll ask him when he's back on IRC. If he's not ok with making it fully CC I'll ask someone else to make a new skin.
 

OdnetninI
Member
 
Posts: 38
Joined: Sun Oct 21, 2012 08:20

by OdnetninI » Thu Nov 15, 2012 23:01

Yes now it works, Thanks.


MirceaKitsune wrote:We have a new default skin, which has been added to the GIT. Credits go to Jordach for making it. The texture is licensed as CC BY-SA 3.0 with specific permission for MineTest only. See the original here: http://www.planetminecraft.com/skin/greed-plaid-shirt/

http://i50.tinypic.com/ic6337.png

OdnetninI, please update minetest_game from my GIT and try it now. If you still get no texture it's a local bug and I don't know sadly.
 

User avatar
babe223
Member
 
Posts: 141
Joined: Mon Nov 14, 2011 13:36

by babe223 » Thu Nov 15, 2012 23:03

how about this player skin for minetest
Image
site where I got the skin of the player
http://minecraft.novaskin.me/#http://i.imgur.com/rx9jL.png
Bem vindos Brasileiros,eu sou primeiro brasileiro daqui do forum, espero que tragam bastante mods

[MOD] torch http://minetest.net/forum/viewtopic.php?id=3021
[MOD]HATCHE:http://minetest.net/forum/viewtopic.php?id=3458
 

User avatar
MirceaKitsune
Member
 
Posts: 809
Joined: Sat May 21, 2011 22:31
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune

by MirceaKitsune » Thu Nov 15, 2012 23:46

babe223 wrote:how about this player skin for minetest
Image
site where I got the skin of the player
http://minecraft.novaskin.me/#http://i.imgur.com/rx9jL.png


Is that skin explicitly under a free license? Doesn't look quite like the style we might want for a default player, but it is of good quality.
 

User avatar
MirceaKitsune
Member
 
Posts: 809
Joined: Sat May 21, 2011 22:31
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune

by MirceaKitsune » Fri Nov 16, 2012 00:26

Bumped protocol version in the code to fix connections for older clients. If I understand right, those who don't have the models code should now be able to connect to a server that does and at least see the old sprite players or not crash. No idea, needs to be tested.

Anyway, RealBadAngel decided to try these HD skins with the model, and posted these screenshots of what he got. Fun fun fun :)

Image Image
 

User avatar
Menche
Member
 
Posts: 994
Joined: Sat Jul 02, 2011 00:43

by Menche » Fri Nov 16, 2012 01:17

Is there supposed to be a walking or digging animation? I'm not seeing any.
An innocent kitten dies every time you top-post.
I am on the Voxelands Forums more often than here.
Try Voxelands (forked from Minetest 0.3) by darkrose
 

PreviousNext

Return to Minetest Features

Who is online

Users browsing this forum: No registered users and 6 guests

cron