Thread: Sven Co-op 5.0 Special Features for Modellers and Skinners

Results 1 to 15 of 15
  1. #1
    Registered User
    Join Date
    Apr 2016
    Posts
    38

    Sven Co-op 5.0 Special Features for Modellers and Skinners

    This thread is for both new modellers/skinners and for veterans modellers/skinners of other Goldsrc games who want to compile for Sven 5.0 and may be unaware of the special features included with the game that can add extra value and functionality to their work.

    I will simply be linking to the tutorials of The303 (http://gamebanana.com/members/1542895) and giving some quick notes on what you should take from it.


    Fullbright Command and new studiomdl.exe:

    Tutorial - http://gamebanana.com/tuts/12270
    Notes - Included with the Sven Co-op SDK is a new version of the "studiomdl.exe" which can be used to compile and recompile skins. It is available here:

    Steam\steamapps\common\Sven Co-op SDK\modelling

    You need install Sven Co-op SDK to get it (unless someone links it) and it features a new command for compiling skins which is the "$texrendermode mytexture.bmp fullbright" where "mytexture.bmp" is a skin used in the compilation (see The303's tutorial for more details). It is also does a better recompile in my experience when using "Half-Life MDL Decompiler v1.2 2003 by Kratisto" to decompile a model.

    Talking Player Models:

    Tutorial - http://gamebanana.com/tuts/12235
    Notes - This is very simple, I had no idea this functionality existed until I read this tutorial and now I have a moving mouth for my player model based on one line of code in the qc file:

    $controller mouth "mouth" ZR 0 50

  2. #2
    REE3 The303's Avatar  
    Contributor
    Join Date
    Jul 2015
    Posts
    384

    Re: Sven Co-op 5.0 Special Features for Modellers and Skinners

    The ones directly on my site are a tad easier to read than the Gamebanana mirrors I made:
    http://www.the303.org/tutorials/index.html

    Hopefully within next month I can finish the model compile one with pics. Also the fullbright mdl tutorial I wrote works in XASH3D as well I just tested.

  3. #3
    Registered User
    Join Date
    Apr 2016
    Posts
    38

    Re: Sven Co-op 5.0 Special Features for Modellers and Skinners

    It would also be nice if we had access to Shannon Caldwell's animations for the 5.0 player models so we can create better compilations. As everyone knows decompiling to get the animations creates small errors when compared to the original.

  4. #4
    REE3 The303's Avatar  
    Contributor
    Join Date
    Jul 2015
    Posts
    384

    Post Re: Sven Co-op 5.0 Special Features for Modellers and Skinners

    Got around to doing a decent comparison between shading with flatshade and existing things like $flags 256:

    As you can see flags 256 reduces the shadows significantly; this is why flying monsters usually have it so when looking up you still see texture definition and not nothing but shadows. Flatshade completely ignores the models vertex normals thus, only brightens or darkens the texture as a whole.

    I also noticed that setting chrome with the new textureflag seems to differ from texture with the name chrome in that it obeys vertex normals.


    As for "Alpha" texture flag, Sniper said he was gonna get to it soon.

  5. #5
    REE3 The303's Avatar  
    Contributor
    Join Date
    Jul 2015
    Posts
    384

    Re: Sven Co-op 5.0 Special Features for Modellers and Skinners

    I have some more examples of this and also found out that "flatshade" set texture works also in vanilla goldsrc. Also if you have an existing model you can set those texture flags with "P2MV" and save it out without having to decompile/recompile: https://gamebanana.com/tools/6112 (fyi $flags 256 is also called "No Shadelight" in P2MV)



    Showing how flatshade works well with stylized models/models that have drawn shadows or shading.



    Flatshading is also good for "Sprite-style" models because an image plane wont have a wierd top-down gradient muddying it up.

  6. #6
    Registered User
    Join Date
    Apr 2016
    Posts
    38

    Re: Sven Co-op 5.0 Special Features for Modellers and Skinners

    Hey man, I'm really lazy, I was planning on adding something about how you can rename a texture to "Remap1_000_255_255.bmp" and it will change colour as you adjust the topcolor of your player. I have my glowing night sights doing this and it's a great feature which probably not everyone knows about. We need to add a few words about how to do that simple rename of a texture and also how you can do it to more textures by writing "Remap2_000_255_255.bmp" etc. Is that correct? I'm too lazy to check. Then we can also link to your tutorial about it that has the full detail of the power of the team colour feature, however, I have to tell you I wasn't able to follow your tutorial very well. And when I say that, basically not at all. Your tutorial doesn't give any background on what is happening i.e. what feature you are using and how it works, you just jump straight into this advanced method which doesn't help someone who has no idea about how the feature even functions. Somehow I found if I named the texture as above it gave me what I wanted without all of that.

    Another thing we should probably add here is a link to DoomMusic's compiler since everyone should be using it (in my opinion).

    https://forums.svencoop.com/showthre...e-Shifting-fix

  7. #7
    REE3 The303's Avatar  
    Contributor
    Join Date
    Jul 2015
    Posts
    384

    Re: Sven Co-op 5.0 Special Features for Modellers and Skinners

    Your tutorial doesn't give any background on what is happening i.e. what feature you are using and how it works
    Really, because I thought I explained it in the linked image of my site method :

    The "full range" examples are the easiest to do.

    Also the Sven coop SDK compiler has nonshifting as well.

  8. #8
    Registered User
    Join Date
    Apr 2016
    Posts
    38

    Re: Sven Co-op 5.0 Special Features for Modellers and Skinners

    That seems to be a reference chart for people who already know what it is and how it works, it doesn't explain here naming a texture Remapx_XXX_YYY_ZZZ.bmp activates team colours. Also it doesn't tell you how those numbers relate to the colours and how you select the numbers. So, does it work by the first number saying that all pixels starting from the top left square (pixel 0 or 1) until the first number (128) are ignored, then the pixels starting from the next pixel down and to the left (129) until the second number (191) will be used as topcolor (team colour 1) and then starting from the next pixel down and to the left (192) and until the third number (255) will be used as bottomcolor (team colour 2)? This is just my best guess. Is this for a texture that's 256x256 and we have to adjust the numbers for larger textures or does the engine automatically scale? I did see this chart before, it's where I found the texture name for full range and gave it a try to see if it worked.

    Sven SDK compiler does not have the feature of automatically compiling square bitmaps which have dimensions that are a power of two, thus eliminating blurring and giving fully sharp detailed textures (in OpenGL I believe). Of course the DoomMusic compiler requires you to use a certain parameter to adjust textures in order to prevent artifacts, which requires more attention to your final compilation, i.e. checking all textures applied correctly (but I think the extra effort is definitely worth it!).

  9. #9
    Regular player DNIO071's Avatar
    Join Date
    Mar 2016
    Location
    Argentina
    Posts
    68

    Re: Sven Co-op 5.0 Special Features for Modellers and Skinners

    The resolution of a texture does not take part on defining it as a remappable one, the method depends fully on the numbers you assign to it. Remember that models require 8 bit indexed palette (256 colors) images in order to compile. What you're doing with the numbers is setting the start and finishing points where color1 (topcolor) and color2 (bottomcolor) will take place in your texture. Any colors in the palette that are outside of the range you assigned for the colors will not be affected.

    You're not restricted to a range of 32 colors in the palette for each (topcolor/bottomcolor) like it was with models using dm_base, that chart is more of an example of how you can have 128 colors in the palette that covers both, while keeping the non-colorable parts intact at an equal 128 colors.
    I'd recommend to separate the colorable part of a model into its own texture, so that the palette can be used more efficiently.
    A good example of a default model is DGF's robogrunt player model, uses three remappable textures (two are 256x256, one 512x512) and different (albeit a bit similar) number combinations to define how to recolor them.




    Here are some examples I've been using and modified throughout the years after first diving into this feature from GoldSrc:

    Default Sven viewmodel arms -> remapS_128_255_255.bmp (512x512)
    Click image for larger version. 

Name:	svenhands.png 
Views:	15 
Size:	153.4 KB 
ID:	18045

    My only reason to name it "S" is for "Sleeve". Since I have other colors I define them by setting my starting point for topcolor as index 128 from the palette, allowing the colors from index 0 to 127 to stay as they are. As I only want one color to control this I put 255 as the end point, leaving no space for bottomcolor this way.

    Barney's helmet from HEV personnel player model -> remap7_000_091_255.bmp (192x96)
    Click image for larger version. 

Name:	barneyhelmet.png 
Views:	15 
Size:	39.4 KB 
ID:	18046

    Here I wanted to control the texture with just bottomcolor, but this time I start topcolor by defining 000 because the other colors in that texture are grayscale, meaning they won't matter since there's no color at all to be controlled, and I define 091 as my index to start the second color properly, so that it takes up the rest of the palette by setting 255.

    I do have more examples laying around but they go back to the same, define the start of the range of colors for topcolor, define its end which acts as the starting point of bottomcolor, then set the end of the range for the latter.
    Last edited by DNIO071; 21-04-2018 at 09:01 PM.
    Have a nice day, no matter what you went through it'll all be okay by tomorrow.

  10. #10
    Registered User
    Join Date
    Apr 2016
    Posts
    38

    Re: Sven Co-op 5.0 Special Features for Modellers and Skinners

    Quote Originally Posted by DNIO071 View Post
    ... Remember that models require 8 bit indexed palette (256 colors) images in order to compile. ...
    Okay, finally a clue I can work with!

    So now it makes sense:
    "each pixel has one byte associated with it only now the value in that byte is no longer a colour value but an index into a table of colours, called a palette or colour table."
    http://paulbourke.net/dataformats/bitmaps/

    So all that's happening is you are selecting an index range for which to use for topcolor and bottomcolor from a fixed palette of indexed colours (in this case 256 colours). I hope this time I got it right. This is the key bit of missing information for me. I understand that fundamentally colours on computers are displayed using RGB values typically 0-255 (8-bit) but the bitmaps for Sven/GoldSrc use an indexed bitmap limited to 256 colours. I have been using IrfanView to convert from 24-bit bitmap to 256 but I didn't understand what was happening in that conversion until now. I don't think there is any formal name for the 256 indexed bitmap since I tried searching for information about it before but it was difficult. Windows just says "256 Color Bitmap" when you hit "save as" in paint.

    So, the original point I was bringing forward and the point of the thread is some quick pointers to functionality in Sven you may not see in other GoldSrc games/mods and let's say for example someone has a hat on player model that has it's own individual texture: Someone could very easily make it able to be customised by renaming the hat texture to "Remap1_000_255_255.bmp" and any number of other textures by replacing "Remap1" with "Remap2", "Remap3" etc. Also the other point was I'm lazy

  11. #11
    Regular player DNIO071's Avatar
    Join Date
    Mar 2016
    Location
    Argentina
    Posts
    68

    Re: Sven Co-op 5.0 Special Features for Modellers and Skinners

    I wasn't fully aware that you were doing a full technical research on it, which is pretty cool.

    To keep it short yes one could take an existing texture from a model to make it remappable, but don't rely on it working all the time as you're likely going to need to put extra time on arranging the colors of the palette.

    Another example with a tophat model from Garry's Mod
    Click image for larger version. 

Name:	unknown.jpg 
Views:	22 
Size:	784.3 KB 
ID:	18048
    Have a nice day, no matter what you went through it'll all be okay by tomorrow.

  12. #12
    Registered User
    Join Date
    Apr 2016
    Posts
    38

    Re: Sven Co-op 5.0 Special Features for Modellers and Skinners

    Quote Originally Posted by DNIO071 View Post
    To keep it short yes one could take an existing texture from a model to make it remappable, but don't rely on it working all the time as you're likely going to need to put extra time on arranging the colors of the palette.
    The index order wouldn't matter if you are selecting all values would it? All I assume the engine does is take each index and uses it as a shade of the colour it's applying. Something like, if you had an index with the values RGB(100,50,300) it would use something like RGB(0,0,300), for pure blue topcolor selection (in this example we are taking the palette and translating it to a pure blue palette), and another index which is slightly different like RGB(80,40,250), would be translated to RGB(0,0,250). Or for a colour that isn't predominately blue to begin with, it would just take the highest value of RGB (in theory), so, if one index was instead RGB(300,50,100), it would translate to the same thing as the first example: RGB(0,0,300). This is me just guessing how it works fundamentally but the results in practice are quite impressive, IMO, the engine just handles it all.

    Quote Originally Posted by DNIO071 View Post
    Another example with a tophat model from Garry's Mod
    Click image for larger version. 

Name:	unknown.jpg 
Views:	22 
Size:	784.3 KB 
ID:	18048
    Nice screenie, was that taken in Garry's mod? Seems to be a lot of aliasing on the model which makes me think it's source. Something I find remarkable in GoldSrc is that it has 0 aliasing when it comes to the models and what "gl_texturemode GL_LINEAR_MIPMAP_LINEAR" does for textures is amazing (probably wouldn't see those big pixels on the textures in the background with it on in Sven). I never used to worry about stuff like that but I couldn't help noticing the lack of aliasing in Sven/GoldSrc, how did they do that!? Every other game, including this emulator I'm playing, there's aliasing and then somehow playing Sven, nope, everything smooth as and my resolution is being fully utilised. I can't help imagining the map is de_nuke for some reason

  13. #13
    Regular player DNIO071's Avatar
    Join Date
    Mar 2016
    Location
    Argentina
    Posts
    68

    Re: Sven Co-op 5.0 Special Features for Modellers and Skinners

    That screenshot is from Sven Co-op, what I meant is that I ported that tophat model, which came with Garry's Mod.
    I guess to simplify the engine detects the ranges of colors from the palette that you specified, and just like an image editing software you control their hue, but brightness and saturation do not change at all.
    Have a nice day, no matter what you went through it'll all be okay by tomorrow.

  14. #14
    Registered User
    Join Date
    Apr 2016
    Posts
    38

    Re: Sven Co-op 5.0 Special Features for Modellers and Skinners

    Yeah sorry, that was me just being weird and going off topic. The lighting on the model looked nice so I thought it could be the Helmet player model in source. I think I found out why you have aliasing and no filtering on the textures, you must have this selected in video options:
    "Low video quality.
    Helps with slower video cards."

    I'm so sorry if you have to run it on such a setting! But actually it's not too bad and it has a sort of classic gaming feel to it, plus you probably don't get FPS dips like I do (lol!). I wonder what kind of anti-aliasing GoldSrc uses then, FXAA, 2X, 4X, 8X? Interesting how it's all internal. Anyway, way off topic, but thanks for the chat and feel free to reply and add more to the discussion/thread.

  15. #15
    REE3 The303's Avatar  
    Contributor
    Join Date
    Jul 2015
    Posts
    384

    Re: Sven Co-op 5.0 Special Features for Modellers and Skinners

    Quote Originally Posted by Thundercracker View Post
    So, the original point I was bringing forward and the point of the thread is some quick pointers to functionality in Sven you may not see in other GoldSrc games/mods and let's say for example someone has a hat on player model that has it's own individual texture: Someone could very easily make it able to be customised by renaming the hat texture to "Remap1_000_255_255.bmp" and any number of other textures by replacing "Remap1" with "Remap2", "Remap3" etc. Also the other point was I'm lazy
    Interestingly enough this extended form of remapping is available in Vanilla GoldSrc and from what ive been told it was an upgraded feature that debuted with TeamFortress Classic for team color changing. I guess I should update the infographic on "full range examples" for something to the effect of "Use these for easiest enabling of feature" or something. Im still working on some site review.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •