Jump to content

Viewmodels & Ghoul2


Recommended Posts

Posted

SoF2 made first person arms (one GLM per arm, but shares the same GLA), that were bolted to the weapon via the 'gun' bone. They have a different GLA than the weapons, and with slightly different names. I'm guessing the animations are told to run at the same time via code. The arms GLA contains a 'master list' of every weapon animation it has animations for. It's a clever method, but don't I think we need to do things this way. Their scene file must have been massive to have every weapon mesh, every weapon bone, and every weapon animation. :P

 

Here's a sample of my idea:

 

- e11_fp.GLA (E-11 first person weapon & arms GLA)

e11_fp.GLM (first person weapon mesh, runs off of e11_fp.GLA)

- default_arms.GLM (first person arms mesh, runs off of E11_fp.GLA)

 

Load the weapon GLM, then load the arms GLM similar to how the code looks for _hand.MD3 but in this case _arms.GLM. If we separate the arms and weapon mesh, we can set things up for later on if anyone decides on changing viewmodel arms depending on the player model chosen.

Posted

Sounds like a solid plan to me. Do note that the loading order is actually backwards - the _hand.md3 (_arms.glm in this case) actually gets loaded first, and then the weapon GLM/MD3 gets bolted to the tag_weapon on the hand. BUT. if the tag doesn't exist, it puts it at 0 0 0. Currently I'm working on a chunk of code that allows you to specify what _hand model to use (or, if you don't want to specify one, simply flag with NoHandModel and it'll just not use it and use 0 0 0)

Tempust85 likes this
Posted

Well at least it loaded and you can see it, good progress. :D

 

EDIT:

 

Will this overwrite the current MD3 view model code, or is MD3 to be treated as a fallback incase GLM isn't found?

Posted

Well at least it loaded and you can see it, good progress. :D

 

EDIT:

 

Will this overwrite the current MD3 view model code, or is MD3 to be treated as a fallback incase GLM isn't found?

It checks the extension. If it's .md3, it uses the original viewmodel code. If it's .glm, it uses the custom GLM code, but both sections of their code are almost identical (just checks for GLM/MD3 in a few spots). I have to actually write the code that does muzzle flashes and animations yet. I'd like it if you could rotate and position the gun model properly for me, so I can get a better view of the animations. :)

Posted

The weapon is positioned the same way player models are in modview, Z axis as up. The image you posted looks to be using the model's X axis as up. Must be a leftover MD3 tag axis thing which rotates the model 90 degrees along the Y axis, resulting in the X axis being up.

Posted

The weapon is positioned the same way player models are in modview, Z axis as up. The image you posted looks to be using the model's X axis as up. Must be a leftover MD3 tag axis thing which rotates the model 90 degrees along the Y axis, resulting in the X axis being up

Except I disabled MD3 tags. I checked and the code it's using only does angle calculations based on viewaxis, which ought to be correct.

Viewmodels are weird like that, that's why Raven opted for the weird positioning of stuff in _hand. It's not your model though, because it looks fine in third person (other than being more forward than it should be)

 

EDIT: nope, it's bobbing calculation that does it, I think.

 

EDIT2: nope, not it.

Posted

@@DT85: ingore me, i am an dum nob

 

 

shot2014-02-06_20-53-10.jpg

 

 

There WAS some leftover tag crap. D'oh. As you can see though, positioning is still a little wrong, this is probably because they set some positioning and scale stuff externally via some plaintext files, BUT the scale looks correct relatively speaking for JA. Lemme manipulate cg_gun_x and cg_gun_y to get some results.

 

EDIT: Looks more menacing than a blaster, i'll give it that.

 

 

shot2014-02-06_20-56-14.jpg

 

 

 

fix position tho pls cuz it breaks animations when i use cg_gunx/cg_guny :<

Posted

Yeah don't worry about the position, that will be fixed when I make my own view model. The model_root (used as the view position no doubt) is positioned far away from the weapon mesh, but I'll be sure to position it closer in mine. ;)

 

Brilliant work though eez. :D

Posted

Not quite. I have a plan on how to accomplish things though. It might be easier if the animations.cfg was in the same folder as the .glm though, as there isn't a way (currently) to get the animations.cfg when it's in other folders (such as skeletons/)

 

Probably going to hammer stuff out more this weekend. I also got a fix for Angelscript stuff, so I have a big weekend ahead of me in terms of coding.

Stoiss and Tempust85 like this
Posted

On objects with custom animations that aren't player models the animation.cfg should be in the same folder, models using the _humanoid.gla are the only exception.

 

Not sure if that helps any to know that though.

 

Nice progress so far though.

Posted

Alright then. Also note, you'll need a *flash tag in order for muzzle flashes to show up in their proper position.Otherwise, it should be alright. Have you got any plans for other GLMs? That SOF2 model has no *flash tag or an animations.cfg in the proper place (+ bad positioning)

Posted

I'll need to tweak it ingame to get the position just right, which I can't do because JK2HD's code doesn't compile for me. I get a bunch of unresolved externals that look to be due to angelscript in the JK2 game library.

Posted

I'll need to tweak it ingame to get the position just right, which I can't do because JK2HD's code doesn't compile for me. I get a bunch of unresolved externals that look to be due to angelscript in the JK2 game library.

Two things -

1. There's a code release in the news section which you can use

2. Yea, that's a bug with CMake. Go to CMake and copy the AngelScript_LIBRARY_DEBUG (or AngelScript_LIBRARY_RELEASE) field's contents. Paste them into the JK2 Game Library's project properties, in Linker -> Input (pasting it at the beginning and adding a semicolon after that)

Tempust85 likes this
Posted

Ok so now it's compiling. I run the game and all looks fine until after the STAR WARS then there's several missing 2D textures mentioned in the console and no models loading whatsoever in the first level including player models. Tried both debug and release, same thing. I have +set com_jk2 1 +set fs_game JK2HD in my shortcut, so I have no idea what's going on.

Posted

Ok so now it's compiling. I run the game and all looks fine until after the STAR WARS then there's several missing 2D textures mentioned in the console and no models loading whatsoever in the first level including player models. Tried both debug and release, same thing. I have +set com_jk2 1 +set fs_game JK2HD in my shortcut, so I have no idea what's going on.

Would this perhaps be due to your skeleton? You are using JK2 assets, correct?

Posted

I have JKA assets in the base folder, and JK2 assets in the JK2HD folder.

 

 

EDIT:

 

Putting JK2's assets in the base folder instead of JKA's causes a crash when creating a new game.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...