HOWTO: Make A New Nexuiz Playermodel.

Post anything to do with editing Nexuiz here. Whether its problems you've had, questions, or if you just want to show off your work.

Moderators: Nexuiz Moderators, Moderators

Thu Mar 12, 2009 5:48 pm

  • glennxserge wrote:Given the two Maya exporters, Prall or Valve, which would be better to use? I haven't had luck with either regarding bones/weighting.

    I myself am using Valves SMD exporter. I tried Prall's but I also use newer version of Maya so either the plugin doesn't work or I don't know how to use it. It does say it should work with the 8 version, I did try it but I was unsuccessful. It was for me too complicated to use.
    Thanks to Valves SMD plugin my life got a lot easier. I have seen people using Prall's successfully, but unless you absolutely know what you're doing it's hard to make it work in my opinion.

    However, I use Prall's SMD plugin to import .smd files. I found that Valve breaks or can't import the .smd's that exist in Nexuiz. Weird indeed, hopefully it's just me it doesn't work for.

    glennxserge wrote:Does Nexuiz use a standardized bone naming convention or do I have some room there?

    I don't know, I suppose someone else should answer this question. What advice I can give you is to import (if you haven't done so already) the existing skeletons (the source is available somewhere, forgot the link for now. If you want it I bet I can dig it up) and use them on your model.

    glennxserge wrote:Should I use Rigid binding on my skeleton or Smooth Bind with Max influences set to 1 (essentially 100% weighting per vertex)? I have tried both with no luck.

    I'd say go with Smooth Bind, RIgid Bind is too awkward and wouldn't give good result. I believe DarkPlaces should be able to handle that.

    glennxserge wrote:I noticed that when I am exporting my mesh the weighting isn't getting caught. My geometry is all assigned as a child to the mesh and not the bones. So all the triangles in the geometry block of the SMD are assigned the handle of the mesh instead of their corresponding bones.

    First of all, which export option are you using? Exporting model with animation?
    Secondly, I don't really understand what you mean. The geometry isn't your mesh or you have multiple objects which aren't combined? As far as I know a player model is one single object/mesh which then is bound to a skeleton. And what do you mean with that last sentence?

    glennxserge wrote:I tried importing some SMDs from the actual playermodel's and haven't been able to reproduce the proper skinning out of Maya, even with the exact model and mesh.

    Hmm, do you know how Nexuiz does the player model animations? The .zym is working like so that you have several animations (bones only, no geometry) in separate .smd files. Then one .smd file (called mesh.smd or something) which only includes the mesh and no bones or animations, just clean geometry.

    Now I too am trying to learn this process, I haven't been able to understand this process fully. How to create player models and make the animation work. I've had some weird stuff going on when I rigged the CTF flags with bones at first (never the result I actually went for) but it did show that I was on the right way.
    I hope we can learn each other if you actually stick through this. :)
    Cheers.
    User avatar
    ai
    Forum addon
     
    Posts: 2131
    Joined: Sun Mar 05, 2006 3:54 pm
    Location: Behind you

Fri Mar 13, 2009 7:08 am

  • thank you both for your prompt replies.

    I will clarify my process since I am probably only missing a simple step somewhere in here.

    I came to the same conclusion about importing. Valve kept failing with the nexuiz models. I wanted to make sure my own rig and skeleton wasn't to blame so I imported one of the robot animations using Prall, to get its skeleton (so far so good).
    I smooth skinned one simple mesh (a triangulated cube in fact) to the skeleton and made sure the max influences were set to 1. I select the mesh and go to "Export Selection", and choose the Valve Model. As far as my understanding goes, the Valve Animation is just for bones to create the idle, run, die1, etc..., and Valve Model is for mesh.smd.

    Once the mesh.smd is created I open it up in a text editor and check it. Everything looks fine in the skeleton section of the code:

    Code: Select all
    version 1
    nodes
      0 "Bip01"             -1
      1 "Bip01_Footsteps"    0
      2 "Bip01_Pelvis"       0
      3 "Bip01_L_Thigh"      2
      4 "Bip01_L_Calf"       3
      5 "Bip01_L_Foot"       4
      6 "Bip01_L_Toe0"       5
       . . .
      68 "pCube1"            -1
    end
    skeleton


    Referencing http://developer.valvesoftware.com/wiki/SMD_file_format has been useful for details on the SMD structure. It was helpful in identifying what the data in the triangle block was, particularly the order.

    Code: Select all
    triangles
    lambert1
    68   -8.21721  -8.21721 68.215496    0       0      1      0      0          1  35    1       
    68    0          -8.21721    68.215496    0       0      1      0.5    0         1  35    1       
    68   -8.21721     0          68.215496    0       0      1      0      0.5       1  22    1       
    lambert1
    68    0          -8.21721    68.215496    0       0      1      0.5    0         1  35    1       


    starting from the left is the Parent Bone, x,y,z, nx,ny,nz, u, v, link, bone ID, weight.
    So the problem is the value 68 above is referencing the mesh (pcube) in my skeleton. Eeek! the entire triangle block looks this way. When comparing it to an actual Nexuiz mesh.smd, which looks like:

    Code: Select all
    nexus.tga
    20 0.0000 -12.6964 69.4068 0.0000 0.9763 0.2165 0.9690 0.9789
    20 3.6677 -13.7728 69.0497 0.4677 0.7536 0.4619 0.9236 0.9715
    20 4.1963 -12.9598 66.2430 0.3140 0.9151 0.2529 0.9299 0.9342
    nexus.tga
    22 1.8506 -16.1344 74.9871 0.4262 0.2151 0.8787 0.2138 0.9274
    22 0.0000 -15.1944 75.1177 0.0000 0.4071 0.9134 0.2156 0.9933
    22 0.0000 -17.1106 75.2997 0.0000 -0.0216 0.9998 0.1487 0.9767
    nexus.tga
      2 0.0000 -24.0376 36.8271 0.0000 -0.9166 -0.3997 0.7704 0.5893
      2 2.7195 -22.8170 36.5031 0.3378 -0.6979 -0.6315 0.7595 0.5622
      2 3.0839 -23.0801 38.3437 0.3281 -0.9211 -0.2094 0.7411 0.5690


    you can see this model's Parent Bone value varies appropriately to the bone it is weighted against, whereas mine only uses 68 (the handle of the pCube mesh).

    I understand how to export the animation SMDs and understand the compiling process, but I just can't seem to get a good fit with exporting the mesh.

    I have tried selecting just the mesh to export, selecting the mesh and the bones, selecting the bones and then the mesh.... and so on. That about sums up where I am in the process. I stopped working on the animations cause I wasn't sure if I would be able to use the current rig, and didn't want to do everything over again, but the model is done and textured and the rig is ready provided it will export. I will definitely post it when I am done, although it is more of an easter egg character (now your curiosity should be piqued).

    On one last note, I have been browsing the how to's on writing custom shaders and was wondering exactly where to put those and how to compile them for Nexuiz, seemed like bits and pieces of how to do it are scattered around the forums, but I didn't find anything definitive. Have been looking at the shader bible and the code seems fairly straight forward. Thanks again, hopefully my blundering around is also helping someone else out too.
    glennxserge
    Member
     
    Posts: 11
    Joined: Wed Mar 11, 2009 6:55 am

Fri Mar 13, 2009 11:13 am

  • You pretty much summed up where I am as well.
    However, I think I found a bug with the Valve plugin. I once exported a model that was rigged and had it smooth bound. But when I selected only the model and exported as Valve Model I in fact got more information (excessive in this case) in the .smd. I got bone information and such, I think that breaks it.
    So try to unbind your model, have no rigs or skeletons attached to it just clean geometry (delete history) then export that as Valve Model for your mesh.smd. You can duplicate it (but make sure not to move it of course) if you don't want to mess up your existing model.

    See if that helps in some way.

    On another note.
    The node number is defined for each single object (I also believe it applies to bones as well). A cube is only one single object so it will only have one number (68 in your case). I don't really know how your rig for the cube looks like but I believe it would be like 5 bones?
    So what you would want is a mesh.smd with only the cube (which in your case the code would be correct), animate the bones in some way and export the bones with Valve Animation. Try to compile that.
    But, with a Smooth Bind, all bones together would result in max influence (1). If you take away some influence on one bone, another will gain some. So I don't really know about that '1' in the end of that cube code. I believe that not everyone should have a solid 1 (the Nexuiz code just below shows what I mean).
    However, I'm not that knowledgeable in the code just yet.

    Lastly, some other (unrelated) info, but something one might want to keep in mind:
    I haven't found a use of the Valve Animated Model feature. If you don't use bones and only animate a model (rotating it, scaling it or whatever, no deformers) the Valve Model works great. I've used dpmodel to compile it into a .md3 and .dpm, I haven't tried zmodel but I believe it should work as well.
    User avatar
    ai
    Forum addon
     
    Posts: 2131
    Joined: Sun Mar 05, 2006 3:54 pm
    Location: Behind you

Sat Mar 14, 2009 3:27 am

  • However, I think I found a bug with the Valve plugin. I once exported a model that was rigged and had it smooth bound. But when I selected only the model and exported as Valve Model I in fact got more information (excessive in this case) in the .smd. I got bone information and such, I think that breaks it.


    I think this is actually correct. In Maya the mesh has skinning history and the exporter is picking that up. How else would we build our mesh.smd with the proper bone weigthing assigned to it? All of the mesh.smd files from Nexuiz seem to contain both the mesh and the bones. Here is a snippet from the Marine mesh.smd file. You can see that the bones come first and are assigned numbers that are later used to reference them in the triangle block. So 2 of the vertexes are assigned to "Bip01 Pelvis" while 1 is assigned to "Bip01 Spine". (see below)

    Code: Select all
    version 1
    nodes
      0 "Marine"  -1
      1 "Bip01"  -1
      2 "Bip01 Footsteps"   1
      3 "Bip01 Pelvis"   1
      4 "Bip01 Spine" 3
      5 "Bip01 Spine1"   4
      6 "Bip01 Spine2"   5
    . . .
    end
    skeleton
    . . .
    triangles
    marine.tga
      3   0.4654  -3.0518  54.8639  -0.7375  -0.5651   0.3699   0.0081   0.0613
      4  -1.5803   1.2848  57.4095  -0.7729  -0.4725   0.4234   0.0601   0.0873
      3  -1.9974  -1.0700  52.9720  -0.7564  -0.5457   0.3606   0.0416   0.0398
    . . .
    end


    So try to unbind your model, have no rigs or skeletons attached to it just clean geometry (delete history) then export that as Valve Model for your mesh.smd. You can duplicate it (but make sure not to move it of course) if you don't want to mess up your existing model.


    If I do that I end up with just a bunch of triangle statements that have the parent bone still assigned as pCube.

    The node number is defined for each single object (I also believe it applies to bones as well). A cube is only one single object so it will only have one number (68 in your case). I don't really know how your rig for the cube looks like but I believe it would be like 5 bones?


    Yes, the node number seems to apply to bones as well. My rig is imported directly off of one of the Nexuiz characters. So it has 67 bones (a waste for a simple cube I know, but I am merely doing a really quick test with bone naming conventions).

    It seem like since we are both stuck at this point, maybe we should bring in some outside help. Do we know who did the original models and if they are available for contact?

    If I am fundamentally misunderstanding what you are saying, feel free to clobber me with a 2X4 :shock:

    I will keep testing to see if I can't get something working.

    Before I forget, one last question for anyone reading this forum. How is the player's weapon attached? Is there something in the rig I need to account for?
    glennxserge
    Member
     
    Posts: 11
    Joined: Wed Mar 11, 2009 6:55 am

Sat Mar 14, 2009 1:36 pm

  • Weapon is attached by referencing bone handle (name, number) in the code.

    Morphed knows how to make those models.
    Alien
    Forum addon
     
    Posts: 1212
    Joined: Tue Apr 22, 2008 7:12 am

Sat Mar 14, 2009 7:56 pm

  • Thanks Alien, I will try contacting Morphed for more info.
    glennxserge
    Member
     
    Posts: 11
    Joined: Wed Mar 11, 2009 6:55 am

Sun Mar 15, 2009 3:08 am

  • There difference i have noticed between valve and nexuiz SMD's is Nexuiz can't use smooth binds. All the code which adds all those smoothed weights (last in each row in the mesh-type smds) should be disabled.

    As far as i have seen the only standard bones which must be in each in your skeleton is bone1 and bip01. bip01 holds your weapon and bone01 is the root of your skeleton. This is just an observation, developers will have to give the facts.
    User avatar
    ihsan
    Alien trapper
     
    Posts: 305
    Joined: Fri Mar 03, 2006 3:33 pm
    Location: Trinidad (Where Obama met Chavez)

Sun Mar 15, 2009 10:03 am

  • Cool, thanks Ihsan.

    So I noticed that even having Smooth Bind with Max influences set to one, both the Prall and Valve exporter try to add the weights on the end. I couldn't find any settings that would disable that feature so I went back to using a rigid bind and Valve behaves properly while Prall still attempts to add weighting on the end of the line. So I am throwing Prall out the window for now and just focusing on getting the valve exporter to work.

    I went through every option in the Valve exporter and couldn't get it to write the parent bones properly. I am stumped. So I am gonna sleep on it and maybe see if I can't find another solution.
    glennxserge
    Member
     
    Posts: 11
    Joined: Wed Mar 11, 2009 6:55 am

Sun Mar 22, 2009 9:38 am

  • Success!! Finally, got the behavior I wanted in the mesh and it didn't come from the exporter. I gave up on relying on Valve's plugin as I couldn't find any settings that would match the output of the Nexuiz smds. Instead I wrote a perl script to correct the parent bone order and now... voila animation works!

    The script is just a regular expression that rewrites the files substituting:
    Code: Select all
    37   12.109526  -40.477092  -19.507335    0.94921     0.062465   -0.308379    0.690844    0.190893    1  2  1

    for:
    Code: Select all
    2   12.109526  -40.477092  -19.507335    0.94921     0.062465   -0.308379    0.690844    0.190893

    So the weights on the end become the parent bone at the beginning. Kind of hacky, but hey I was starting to get desperate.

    Now that I have that hurdle crossed I can focus on actually making the real animations. Will post some more findings or issues as they come up.
    glennxserge
    Member
     
    Posts: 11
    Joined: Wed Mar 11, 2009 6:55 am

Sun Mar 22, 2009 10:59 am

Mon Mar 23, 2009 2:31 am

  • Ai, if you are interested I can send you the file. You will need to have, perl installed to execute the script. I am using Strawberry Perl, but you can use whatever. The script just reads in the mesh.smd file and does substitution to correct the parentbone then spits out a new file. Just pm me with an email address and I will send it to you.
    glennxserge
    Member
     
    Posts: 11
    Joined: Wed Mar 11, 2009 6:55 am

Tue Mar 31, 2009 5:03 am

  • don't know if anyone is still following this thread, but I thought I would post another finding. another problem with Maya. In order for the weapon to show up in the right hand there has to be a bone named "bip01 R Hand", but Maya's naming convention only allows '_' for spaces. So I have to manually edit the smd to make sure it has a space instead of an underscore. a little bit annoying.

    progress is still coming along on the model. :)
    glennxserge
    Member
     
    Posts: 11
    Joined: Wed Mar 11, 2009 6:55 am

Fri Apr 10, 2009 9:27 pm

  • So, let's say, just hypothetically, of course ;), that I was a Mac user who had never done any 3D modeling ever. Let's say I wanted to see what I could do and hopefully develop at least one useable Nexuiz player model. Any good open source apps that would be useful there? I don't have the money to spend on all this software and what-have-you.... :(

    Any tutorials anyone knows of for such programs are also welcome....
    User avatar
    MC SE7EN
    Alien trapper
     
    Posts: 294
    Joined: Fri Apr 10, 2009 8:56 pm

Fri Apr 10, 2009 11:27 pm

  • blender of course
    timotity
    Member
     
    Posts: 24
    Joined: Mon Mar 23, 2009 2:18 am

Fri Apr 10, 2009 11:29 pm

  • Thanks. I actually looked for it earlier and couldn't find it, but it came right up now... :P

    Thanks again though. This should be fun....
    User avatar
    MC SE7EN
    Alien trapper
     
    Posts: 294
    Joined: Fri Apr 10, 2009 8:56 pm

Sat Apr 11, 2009 2:33 am

  • Hmmm... there's not like any easily re-skined templates or anything out there, are there?
    User avatar
    MC SE7EN
    Alien trapper
     
    Posts: 294
    Joined: Fri Apr 10, 2009 8:56 pm

Sat Apr 11, 2009 9:23 am

Sat Apr 11, 2009 11:10 am

  • ai wrote:What do you mean with templates? Just any examples file to learn the skinning process, or a template of the player models? If it's the latter then no, no more than the source for them (the .smd models).


    Either works. Full templates or example files, but if there are none, that's fine, too. :D
    User avatar
    MC SE7EN
    Alien trapper
     
    Posts: 294
    Joined: Fri Apr 10, 2009 8:56 pm

Sat Apr 11, 2009 12:36 pm

  • Well, there are no templates more than what I mentioned above (the .smd files for current player models). As for examples on the skinning process it's just up to look for tutorials and such on the Internet. There is nothing specific to Nexuiz more than what you possibly can find on these forums or other Nexuiz related (like Nexuiz Ninjaz and such).
    User avatar
    ai
    Forum addon
     
    Posts: 2131
    Joined: Sun Mar 05, 2006 3:54 pm
    Location: Behind you

Sat Apr 11, 2009 10:16 pm

  • ai wrote:Well, there are no templates more than what I mentioned above (the .smd files for current player models). As for examples on the skinning process it's just up to look for tutorials and such on the Internet. There is nothing specific to Nexuiz more than what you possibly can find on these forums or other Nexuiz related (like Nexuiz Ninjaz and such).


    Cool thanks. I'll check it out.
    User avatar
    MC SE7EN
    Alien trapper
     
    Posts: 294
    Joined: Fri Apr 10, 2009 8:56 pm

Sat Apr 11, 2009 10:24 pm

Sun Apr 12, 2009 8:03 am

  • MC SE7EN wrote:http://svn.icculus.org/nexuiz/trunk/data/models/player/

    This is the correct link that should be listed in the first post.

    Uhm.. what?
    If it's for the source models then that is not correct. That's just the .zym files (which Nexuiz uses) but as far as I know you cannot actually open any .zym files in any application. There is a script for Blender to import Half-Life format (.smd) and it also exports to a .zym, but I don't think you can import it.

    Here is a link however to the sources: http://svn.icculus.org/nexuiz/trunk/mis ... ce/models/
    Download 'Players.zip'.
    User avatar
    ai
    Forum addon
     
    Posts: 2131
    Joined: Sun Mar 05, 2006 3:54 pm
    Location: Behind you

Sun Apr 12, 2009 5:06 pm

  • ai wrote:
    MC SE7EN wrote:http://svn.icculus.org/nexuiz/trunk/data/models/player/

    This is the correct link that should be listed in the first post.

    Uhm.. what?
    If it's for the source models then that is not correct. That's just the .zym files (which Nexuiz uses) but as far as I know you cannot actually open any .zym files in any application. There is a script for Blender to import Half-Life format (.smd) and it also exports to a .zym, but I don't think you can import it.

    Here is a link however to the sources: http://svn.icculus.org/nexuiz/trunk/mis ... ce/models/
    Download 'Players.zip'.


    Hm, i must have posted the wrong link... I was looking around at all the different folders...

    Thanks for the correction!
    User avatar
    MC SE7EN
    Alien trapper
     
    Posts: 294
    Joined: Fri Apr 10, 2009 8:56 pm

Sun Apr 12, 2009 8:01 pm

  • Alrighty, so I've got my .smd files, but now what? I need to know...

    A) How to get the skin/textures actually ONTO the model
    B) How to compile a .zym on a Mac. All the solutions I've seen after reading quite a few pages into the thread have been for Windows.
    User avatar
    MC SE7EN
    Alien trapper
     
    Posts: 294
    Joined: Fri Apr 10, 2009 8:56 pm

Tue May 12, 2009 7:33 pm

  • So what about the player cameras (default and chase) positions, weapon positioning and hitbox dimensions for player characters?

    Are these hardcoded to be always the same for all models? If so, what are the coordinates and dimension values for them?

    Or can these be changed for each character model? If so how?


    This is where the rubber (content) meets the road (engine), without this information, player models will look really wacked in game, with weapons floating above or below the character's arms, cameras positioned inside the player model or small characters that die when you shoot near them or big characters that don't suffer any damage when you shoot them in most places (like their head) :shock:.
    Flying Steel
    Keyboard killer
     
    Posts: 623
    Joined: Fri May 08, 2009 9:13 pm

Thu May 14, 2009 5:50 pm

  • Bump.

    So why no response to the questions I posted?

    Is this a bad place to post them or was I not clear enough about what I was asking?
    Flying Steel
    Keyboard killer
     
    Posts: 623
    Joined: Fri May 08, 2009 9:13 pm

Thu May 14, 2009 7:07 pm

  • weapon position is control by bones, so those get the right pos if you rig it right.
    you don't see you own chara in non case, so you wont end up looking inside the model either.

    as for sizes:
    constants.qh wrote:vector PL_VIEW_OFS = '0 0 35';
    vector PL_MIN = '-16 -16 -24';
    vector PL_MAX = '16 16 45';
    vector PL_CROUCH_VIEW_OFS = '0 0 15';
    vector PL_CROUCH_MIN = '-16 -16 -24';
    vector PL_CROUCH_MAX = '16 16 25';


    so the player hitbox is 32x32x69 units. make your model roughtly fit in this box and your fine.
    HOF:
    <Diablo> the nex is a "game modification"
    <Diablo> quake1 never had a weapon like that.
    <Vordreller> there was no need for anything over 4GB untill Vista came along
    <Samua>]Idea: Fix it? :D
    <Samua>Lies, that only applies to other people.
    User avatar
    tZork
    tZite Admin
     
    Posts: 1337
    Joined: Tue Feb 28, 2006 6:16 pm
    Location: Halfway to somwhere else

Thu May 14, 2009 8:54 pm

  • tZork wrote:weapon position is control by bones, so those get the right pos if you rig it right.


    And so I take it this will also determine where the weapon shots originate from.

    Is there a hard limit on how many bones a model can have?

    as for sizes:
    constants.qh wrote:vector PL_VIEW_OFS = '0 0 35';
    vector PL_MIN = '-16 -16 -24';
    vector PL_MAX = '16 16 45';
    vector PL_CROUCH_VIEW_OFS = '0 0 15';
    vector PL_CROUCH_MIN = '-16 -16 -24';
    vector PL_CROUCH_MAX = '16 16 25';


    so the player hitbox is 32x32x69 units. make your model roughtly fit in this box and your fine.


    Ah good, I didn't even remember to ask about the crouch hitbox, thanks. :)
    Flying Steel
    Keyboard killer
     
    Posts: 623
    Joined: Fri May 08, 2009 9:13 pm

Wed May 27, 2009 5:58 pm

Wed May 27, 2009 6:50 pm

  • Taiyo.uk wrote:I've restarted work on the "karotep" playermodel, but I've hit a problem while assigning my mesh to the Pyria armature. I have weighted all of the vertices to the bones, but the model becomes distorted - see the images below:

    http://www.haosredro.com/nex/img/editbones.png
    http://www.haosredro.com/nex/img/objectbones.png

    I have tried rolling the offending bones but to no avail. Does anyone know what I'm doing wrong?


    Is this the first time you've rigged a model in blender?

    Also, it might help to diagnose the problem, if you would post this .blend file itself.
    Flying Steel
    Keyboard killer
     
    Posts: 623
    Joined: Fri May 08, 2009 9:13 pm

PreviousNext


Return to Nexuiz - Editing




Information
  • Who is online
  • Users browsing this forum: No registered users and 1 guest