Behind the scenes of the Customization Menu and 265

SamusDroidSamusDroid Colorado Join Date: 2013-05-13 Member: 185219Members, Forum Moderators, NS2 Developer, NS2 Playtester, Squad Five Gold, Subnautica Playtester, NS2 Community Developer, Pistachionauts
edited October 2014 in NS2 General Discussion
About 2 months ago I was asked to make my menu poses mod a reality. After first creation of the mod many months ago, I quickly realized that cinematics would not do, and I would need to do it in code. This sounds easy, but turned out to be one of the most daunting tasks I've done in Natural Selection 2. In premise, it sounds easy, a player standing on a level with lights, but due to near endless limitations, quickly turned into a complicated mess.

First I decided to start with GUI's so I could at least access the menu. Had a fully working GUI in only a few hours, going smoothly so far.
Next I started working on getting a model in front of your screen. After many crashes and experimenting, I figured out that this needed to be done on the Server.
In order to place a model in front of the player, it needs to first be precached. Now under common assumptions this just means "oh load it before it is needed" but actually it does a lot more. Precaching assigns a model index to the model, so that the server can sync the bones of the model and play animations. Unfortunately this can not be done in the menu before you connect to a server. This is just the start of the limitations.

The customization menu is all created in the View Model render scene, this allows models to be created in front of the player without walls or players going through the menu. We arrived at the conclusion that there needed to be an effect when switching models, this simple sounding task was one of the more complicated pieces of the menu. when the model is switched it changes the opacity of the model and uses the Tweener functions to do so. A cinematic level used as a background contains lights and props to make it look the same always. This was also another source of many limitations. The cinematic editor is not perfect, it is pretty good but it has many limitations. For whatever reason certain entities are not dynamic with the creation of the cinematic. In order to make the customization menu work, I needed to find a way to make a background. Of course it turns out that levels are static to where they were created, meaning they don't follow the creation of the cinematic. This wouldn't work, so I turned to using props. Thankfully, props are dynamic, then came the lights. Another limitation is that spotlights are static, meaning I could not use them, so I had to use point lights. This is all great except that shadows are not cast in the view model render scene, and that I could not have atmospherics. It also turns out that your FOV affects where the lights are in the level, but not props. After a long time experimenting that it took me to figure that out, it was already too late and the build was ready to be released. It would be dark for players with full FOV, and really ugly and bright for minimum FOV. I then went about finding a way to hide the GUIs, a very complex process that is not as ideal as I would like, but it works. Of course, I could not hide all the GUIs in the time I was given to create the menu by the time I got to this part. I also needed to find a way to make outside lights not cause inwards and not see highlighted players. Mendasp gave me a hackish but clever solution to move the players camera up really high, 10000 units high above the map, this worked great minus a few bugs which I worked out quickly.

Once finally getting the backend working, I then started polishing the menu up. I ended up finding a perfect sound effect when switching the menu, the sound used for Vortex. the customization menu is a lot more than people would first see, and one of the most challenging, and educational tasks I have needed to do. I am finally glad to get it out to the public, and with mostly positive feedback about it so far.

I then needed to make the skins. which was a very interesting and efficient way to change textures on models, using the new awesome skins that Rantology had made. I explained this more in the public post.

Exo and Rifle skins were also a very complicated, but in theory simple task. I decided texture atlasing like the shoulder patches could work. It ended up working very well without much work needed. However, getting them to actually work was another story. I began by copying what is currently done with Marine models, which worked pretty well but introduced quite a few bugs. One of the weirdest bugs I have encountered in NS2 was with first person view model textures. There were 2 bugs where one player on the server, at random, would be able to control everyone else's view model variant. After nearly 2 weeks of experimenting and testing, I ended up with a solution of verifying by Steam ID who made the request to change the skin, so only your request affected you.

2 weeks before the patch was released, we began having double playtests, EUPT and NAPT Monday - Thursday, constantly tweaking and trying to fix. Eventually I decided that I needed a faster way to update and test. thankfully Gibs was able to host a listen server I could connect to, and I created a mod that I could quickly update, and then shortly I fixed the problems that were caused by the many bugs that first started out with. The last 2 weeks before release were very exhausting, but worth it, as I now have a way to display variants in a complicated, but simple to use menu, and a way to have weapon variants, well worth the time and energy made to make them. Due to what I needed to have in order to have this function properly, I ended up also fixing some very very old bugs, like visors and decals not fading with a dead marine, a bug reported almost 500 days ago, and Fade and Onos view models being outlined.

Comments

  • RapGodRapGod Not entirely sure... Join Date: 2013-11-12 Member: 189322Members
    Early patch with bugs that forces samus to fix said bugs... he just says to the devs... ''YOU SHALL NOT PASS!"
  • IeptBarakatIeptBarakat The most difficult name to speak ingame. Join Date: 2009-07-10 Member: 68107Members, Constellation, NS2 Playtester, Squad Five Blue, NS2 Map Tester, Reinforced - Diamond, Reinforced - Shadow
    edited May 2014
    Thank you for your time and effort to make such a requested feature happen, even if you had to claw your way through the belly of the beast to do it.

    Now make the SamusDroid DLC so we can send some your way. :P
  • VetinariVetinari Join Date: 2013-07-23 Member: 186325Members, Squad Five Blue, Reinforced - Shadow, WC 2013 - Silver
    Once software reaches a certain level of complexity, it might look sleek and shiny on the front, but behind that it's held together by spit and duct tape :D

    Sounds like you did some awesome work there B-)
  • NarfwakNarfwak Join Date: 2002-11-02 Member: 5258Members, Super Administrators, Forum Admins, NS1 Playtester, Playtest Lead, Forum Moderators, Constellation, NS2 Playtester, Squad Five Blue, Reinforced - Supporter, Reinforced - Silver, Reinforced - Gold, Reinforced - Diamond, Reinforced - Shadow, Subnautica PT Lead, NS2 Community Developer
    edited May 2014
    Thanks for posting this Samus!
    SamusDroid wrote: »
    One of the weirdest bugs I have encountered in NS2 was with first person view model textures. There were 2 bugs where one player on the server, at random, would be able to control everyone else's view model variant. After nearly 2 weeks of experimenting and testing, I ended up with a solution of verifying by Steam ID who made the request to change the skin, so only your request affected you.
    Those were definitely some of the weirdest sessions of playtesting I've been a part of with some of the hardest times trying to figure out exact reproduction steps.

  • SteveRockSteveRock Join Date: 2012-10-01 Member: 161215Members, NS2 Developer, Subnautica Developer
    Yeeeup... :P

    Awesome work. This is the kinda thing that seems like it should be simple but turns out to be a huge pain. Hopefully for our future games, the architecture will be a lot more clear to prevent these. The view model FOV thing is probably an oversight that we just never noticed before, since most view model lights are quick muzzle flushes I guess.
  • SaltlickSaltlick Join Date: 2013-01-03 Member: 177347Members, Reinforced - Shadow
    Great post. I find this stuff really interesting. I hope it gives people some insight into the difficulty of software development and why things take longer than they expect.
  • current1ycurrent1y Join Date: 2003-12-08 Member: 24150Members, NS2 Playtester, NS2 Map Tester, Reinforced - Shadow, Subnautica Playtester
    edited May 2014
    Thanks for changing it so i can spin my model to the right but now I can't spin it to the left! omg the humanity.
  • _INTER__INTER_ Join Date: 2009-08-08 Member: 68392Members, NS2 Playtester, Reinforced - Shadow
    This makes sense now why the Costumization menu only shows up ingame. But i think it's still hard to find if you're a new player, it's been the same with "Vote".
    How about having those two menu points showing up in non-ingame menu aswell, but beeing greyed-out and / or at another position on the screen?
  • IeptBarakatIeptBarakat The most difficult name to speak ingame. Join Date: 2009-07-10 Member: 68107Members, Constellation, NS2 Playtester, Squad Five Blue, NS2 Map Tester, Reinforced - Diamond, Reinforced - Shadow
    a2Beq55.png

    So madness permitting whats the chances we can customize to this extent down the road? :P
  • SupaFredSupaFred Join Date: 2013-03-03 Member: 183652Members, NS2 Playtester, Squad Five Blue, NS2 Map Tester, Reinforced - Supporter, Reinforced - Silver, Reinforced - Shadow, WC 2013 - Silver
    I noticed that you can only view the skins you have bought/have access to. How about enabling everyone to see all skins? You could add a large "unavailable" or something and a short description on how to buy them. I think that might get the sales up a little bit if players can preview the skins available in-game.
  • VetinariVetinari Join Date: 2013-07-23 Member: 186325Members, Squad Five Blue, Reinforced - Shadow, WC 2013 - Silver
    SupaFred wrote: »
    I noticed that you can only view the skins you have bought/have access to. How about enabling everyone to see all skins? You could add a large "unavailable" or something and a short description on how to buy them. I think that might get the sales up a little bit if players can preview the skins available in-game.

    Could give a negative impression with the preorder skins, though.
  • SupaFredSupaFred Join Date: 2013-03-03 Member: 183652Members, NS2 Playtester, Squad Five Blue, NS2 Map Tester, Reinforced - Supporter, Reinforced - Silver, Reinforced - Shadow, WC 2013 - Silver
    Could give a negative impression with the preorder skins, though.

    How so?
  • VetinariVetinari Join Date: 2013-07-23 Member: 186325Members, Squad Five Blue, Reinforced - Shadow, WC 2013 - Silver
    SupaFred wrote: »
    Could give a negative impression with the preorder skins, though.

    How so?

    "Here's the awesome black armor. You can't get it, but we show it to you anyway so you know what you miss."
  • HoliHoli Sweden Join Date: 2014-01-28 Member: 193600Members
    Awesome work and thanks for trying to explain to people how much work you actually have to do to make stuff like this :)
  • SupaFredSupaFred Join Date: 2013-03-03 Member: 183652Members, NS2 Playtester, Squad Five Blue, NS2 Map Tester, Reinforced - Supporter, Reinforced - Silver, Reinforced - Shadow, WC 2013 - Silver
    "Here's the awesome black armor. You can't get it, but we show it to you anyway so you know what you miss."

    Ok, I see your point. How about excluding the black armor and show all of the other ones that can be bought?
  • VetinariVetinari Join Date: 2013-07-23 Member: 186325Members, Squad Five Blue, Reinforced - Shadow, WC 2013 - Silver
    SupaFred wrote: »
    "Here's the awesome black armor. You can't get it, but we show it to you anyway so you know what you miss."

    Ok, I see your point. How about excluding the black armor and show all of the other ones that can be bought?

    Sounds better, but is inconsistent and could raise questions if someone sees a black armor ingame for the first time.
  • DC_DarklingDC_Darkling Join Date: 2003-07-10 Member: 18068Members, Constellation, Squad Five Blue, Squad Five Silver
    I wonder something so I hope someone can enlighten me.

    We can have models in the main menu, as this has been done before. They can also do movement right? We even have/had a mod lying around which showed models like gorge, lerk and marine so we could see the skin we selected.

    Then what is the engine limitation which prevents this, or am I not understanding something fundamental?

    Not trying to nag or anything, I just do not understand.
  • GhoulofGSG9GhoulofGSG9 Join Date: 2013-03-31 Member: 184566Members, Super Administrators, Forum Admins, Forum Moderators, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, Reinforced - Supporter, WC 2013 - Supporter, Pistachionauts
    edited May 2014
    I wonder something so I hope someone can enlighten me.

    We can have models in the main menu, as this has been done before. They can also do movement right? We even have/had a mod lying around which showed models like gorge, lerk and marine so we could see the skin we selected.

    Then what is the engine limitation which prevents this, or am I not understanding something fundamental?

    Not trying to nag or anything, I just do not understand.

    The menu is a animation loop made with the cinematic editor.

    So ( as @SamusDroid‌ explained somewhere else before ) to make the costumization menu compatible with the main menu you would have to create such a animation loop for every existing skin variant.

    Which is a lot of work if you want to add easily new skins and models and may want to change the main menu background itself.
  • SamusDroidSamusDroid Colorado Join Date: 2013-05-13 Member: 185219Members, Forum Moderators, NS2 Developer, NS2 Playtester, Squad Five Gold, Subnautica Playtester, NS2 Community Developer, Pistachionauts
    I've already made it so you can click the model to rotate, rotate models both ways, and made the vortex sounds quieter.

    I wanted to do more in depth customization however it would require models to be charged in order to have a smaller texture for visors and lights. It's something in will be investigating though, as I can now edit the source models.
  • DC_DarklingDC_Darkling Join Date: 2003-07-10 Member: 18068Members, Constellation, Squad Five Blue, Squad Five Silver
    Aha, well I understand now. :)
Sign In or Register to comment.