SmartlyDressedGames / Unturned-Docs

Documentation for Unturned's modding features.
135 stars 49 forks source link

Unity Setup for Guns #294

Closed MoltonMontro closed 8 months ago

MoltonMontro commented 8 months ago

Unity setup info for items/guns! Meant to be a replacement for the older Steam guides, such as: https://steamcommunity.com/sharedfiles/filedetails/?id=470771503.

getting-started.rst

I've rewritten a lot of this, to provide more info on the Unity packages provided.

I think, eventually, it'll make sense to expand this doc further. E.g., to provide info on bundling and exporting – although that could be a new doc. Could also be helpful to note multiplatform export requirements, since that's relevant to the Unity install.

item-asset/introduction.rst and gun-asset.rst

These docs are now broken into upwards of three major sections: Unity Setup, File Setup, and Localization. Unsure about some stuff, like positioning in the doc, section names, subheadings, etc.

The new "Unity Setup" section is currently at the top, and contains info on creating custom items in Unity. To minimize repeating "default" steps, I've put info that should be true for most items in the Intro doc, and stuff that's mostly only applicable to guns in the GunAsset doc.

Images are included as visual aids, but they're more of an "overview" rather than a step-by-step walkthrough.

Questions, Thoughts, Etc.

SDGNelson commented 8 months ago

Looking good so far!

  1. I'd be hesitant about custom CSS because it makes it more difficult to maintain. (Perhaps in part my personal preference not doing much web dev type stuff in a while.) On the other hand, the properties would be difficult to read without line wrapping. Another option might be a "quick reference" table with links a brief description and link to the full description?
  2. Since they are ultimately both files, maybe something along the lines of "Unity Asset Bundle Contents" and "Game Data File"?
  3. I think you're right that setup in Unity is the most relevant for beginners, yet anyone who's familiar with it will be referring back to the properties. Maybe keeping the current order but with a quick table of contents at the top of each doc to skip to the other sections?
  4. Sure, and I think that's a good style.

Minor edit suggestions:

  1. As you mention in the article that modded guns can't use economy features, I think the "Additional Setup for Economy Items" section might as well be removed. (Though maybe I'm not thinking of a potential use case?)
  2. Personally when setting up the item animations, I just created a new prefab from the imported animations prefab and removed all of its children. I think this would be worth including as an easy option. The tag/layer also don't matter because the game only uses it to copy over the AnimationClip references.
  3. For the Item collider description: it can have multiple colliders including multiple types, but one box collider is usually good enough. Also I think worth mentioning that the 0.2 min dimension is because the larger the collider is the less likely it is to be able to fall through a thin surface in a single physics tick.
  4. The camera position doesn't matter by default as much as its orientation because of the automatic sizing/positioning, so maybe "don't worry too much about centering the item, just that the direction is what you want".
MoltonMontro commented 8 months ago

I'd be hesitant about custom CSS because it makes it more difficult to maintain. (Perhaps in part my personal preference not doing much web dev type stuff in a while.) On the other hand, the properties would be difficult to read without line wrapping. Another option might be a "quick reference" table with links a brief description and link to the full description?

For reference, it'd probably be:

/* Wrap table contents for large screens only. */
@media screen and (min-width: 769px) {
    .wy-table-responsive { overflow: visible; }
    .wy-table-responsive table td { white-space: normal; }
}

When the table PR is up, we can see how it looks without styling and go from there. Could be other stuff we want to change/redo first anyway.

Note: no changes present in the latest commit regarding these considerations.

Since they are ultimately both files, maybe something along the lines of "Unity Asset Bundle Contents" and "Game Data File"?

πŸ‘ Done – these look good to me.

Maybe keeping the current order but with a quick table of contents at the top of each doc to skip to the other sections?

Maybeβ€”although people can do this from the TOC sidebar already, to a certain depth. (Currently goes to Lv3 headings – unsure if we can go deeper.)

image

Note: no changes present in the latest commit regarding these considerations.

Sure, and I think that's a good style.

πŸ‘ Done – the README.md mentions cropping Unity images.

As you mention in the article that modded guns can't use economy features, I think the "Additional Setup for Economy Items" section might as well be removed. (Though maybe I'm not thinking of a potential use case?)

My thoughts were:

Note: no changes present in the latest commit regarding these considerations.

Personally when setting up the item animations, I just created a new prefab from the imported animations prefab and removed all of its children. I think this would be worth including as an easy option. The tag/layer also don't matter because the game only uses it to copy over the AnimationClip references.

πŸ‘ Always a balance between modders doing stuff from scratch, vs. only referencing vanilla. I've mentioned the paths to vanilla Prefabs and raw FBX anim files in the Intro to Items doc. Similar is still mentioned in the Getting Started doc, too.

For the Item collider description: it can have multiple colliders including multiple types, but one box collider is usually good enough. Also I think worth mentioning that the 0.2 min dimension is because the larger the collider is the less likely it is to be able to fall through a thin surface in a single physics tick.

πŸ‘ Done – revised per above.

The camera position doesn't matter by default as much as its orientation because of the automatic sizing/positioning, so maybe "don't worry too much about centering the item, just that the direction is what you want".

πŸ‘ I've reworded this. There's a handful of curated maps that disable the automatic measuring, but maybe more info regarding that can just be added to the game data file property itself.

SDGNelson commented 8 months ago

Looks great, thanks! Fair point that I think you're right some mods have used the Shared_Skin_Lookup_ID option.