Unity

https://www.youtube.com/watch?v=ogz-3r0EHKM&ab_channel=JelleVermandere

General

  • To download packages in Window » Package Manager, check that "show preview packages" is selected
  • Always make changes in Scene with the gameplay stopped, never in Game with it active, or they will be lost
  • Saving Scene makes it appear in the assets. Double clicking loads respective scene.
  • Add Scenes to BuildSettings: File » Build Settings » Add Open Scenes to add all we have » Select them
  • Everything that is common in multiple scenes should be a prefab, so that changing one has repercussions in all uses. Ex: Camera, Player, GameManager... That, before duplicating the scene or creating new ones
  • Shortcuts Q, W, R, T: to Grab, Rotate, Scale and All at the same time
  • To view from top or sides, we can click on the axis. For a isometric view, we can click on the cube at the center. 
  • To add object to scene, go to Hierarchy » right click and add object we want
  • To focus view on object, select object in Hierarchy » hit F
  • To center object in scene, go to Transform panel at the right » right click word» select Reset
  • To assign materials to objects: Assets » right click + Create + Material » change Inspector properties » drag it to object we want to tint
  • Ensure that objects have a Box Collider checked in the Inspector unless we want things to go through. Also, there are types of colliders more appropriate for other objects, ex: a Sphere object should have a Sphere Collider (just search "sphere" in Add Component), to make sure you switch to the more appropriate component. 
  • Ensure that objects have a Mesh Renderer checked in the Inspector unless we want them invisible
  • Add physics to object: select object in Hierarchy » Inspector » Add Component » Physics » Ex: Rigidbody (btw, bigger objects probably should have higher Mass)
  • Add Tags: Inspector » selected Untagged under object name » Add Tag » create tag » change tag of our object with the one we created
  • When we change something in a prefab object, under assets, and want it to be applied to other objects created from the same prefab, we have to hit Apply.
  • To select objects but not the platform/ground/wtv from the top or smt, we can disable selection by: selecting Ground » Add Layer (under name in Inspector) » create smt like Environment » assign layer we created as the ground layer » go to the Layers toggle (on top of Inspector) » click to lock the layer we created
  • Make objects snap to grid (usually from top or side view): Edit » Snap Settings » move objects while holding Ctrl will make it snap according to the number of units we specified in the settings

Scripts - and some utilities with them
  • To add script to object: Select Object » Inspector » Add Component » New Script » name it and keep C# » Create and Add » double click it to open in editor. We can add script to object by dragging it from the assets to the top of the object
  • Debug: In the Start Function of the scripts, use Debug.Log("msg"); » Check what appears in console when running game
  • Reference components in scripts and change properties: public/private ComponentName varName » varName will appear listed in the script component, and we can drag a component (of the right type) to its slot to finish the reference » To change a property, we write varName.property = value;
    • Ex: public Rigidbody rb; » drag respective component to script slot in inspector; » rb.useGravity = false; (in the component, the property was named Use Gravity) 
    • or rb.AddForce(); By the way, with Force it may be better to restrict rotation constraints in the Rigidbody component. Or we can add a created PhysicsMaterial to our ground and set the frictions to 0 to avoid rotation when collision occurs and ensure slipping. 
  • Update function in scripts runs once per frame - meaning it gives differents results depending on how many frames each computer runs on. Some things, like the force, can be multiplied by Time.deltaTime. We should also change name to FixedUpdate.
  • Obtain user input (usually inside if statements or such): 
    • in the script, write Input.GetKey("d"); 
    • D is for positive x force and A is for negative.
    • Instead of just adding a force with x,y,z, we shouls make it respond better to input by adding a fourth parameter, ForceMode.VelocityChange. That required higher force values (to the sides) and feels better with Drag(in RigidBody) as 1, not 0.
  • Make Camera follow player:
    • One way: in Hierarchy, drag Camera to inside/under Player object to create parenting and inherit movement script. That's a problem when player rotates tho, because it would rotate as well and that might not be the desired effect.
    • Other way: Add to camera a script FollowPlayer, with a var Transform player that references player and in the update, write transform.position = player.position + offset; (transform.position is the position of the camera, not the player, because transform not capitalized refers to script's object)(offset is a Vector3 var whose values we set in the Inspector, so that camera is not inside player)(dont forget to reference the Player)
  • Actions when collision occurs:
    • create script » create function void OnCollisionEnter(Collision collisionInfo) » use the collisionInfo.collider.name or collisionInfo.collider.tag to know what we accessed and add an action
    • It's better practice to detect objects by tags. To add Tags, see General
    • When we lose, we probably want to disable player movement. So we create a variable to store that component, PlayerMovement movement and then set movement.enable = false;
    • To make the collision be better detected, which is important if we want accurate scores, we should go to RigidBody » Collision Detection » change Discrete to Continuous. That for both the obstacle and the player or wtv collides
  • Make UI change dynamically:
    • import: using UnityEngine.UI;
    • create var to change the Text: public Text text;
    • update var: scoreText.text = "..." (we could change other things as well)
  • GameManager to manage the game states - the player, who can die, doesn't have that responsibility: 
    • It should also be a prefab. Along with the player and everything that is common between scenes
    • create EmptyObject and rename it (+ reset transform) » create script GameManager responsible for managing the states of the game
    • add a EndGame() method to the script
    • add a bool gameHasEnded = false; at the start, and set it to true inside method EndGame() inside a if (gameHasEnded == false). The if prevents game from "ending multiple times". 
    • add a Restart() method » import using UnityEngine.SceneManagement » inside method, write SceneManager.LoadScene(SceneManager.GetActiveScene().name OR .buildIndex); » call method inside the if from EndGame(), as Invoke("Restart", delayVar); (it's not called as Restart() because we want delay, and delay is a var to be adjusted in Inspector)
    • add a LevelWon() method » create a var GameObject winnersUi, that is initially disabled besides the name,  and reference it » inside method, call winnersUi.setActive(true)
    • Time to call method to end: To reference GameManager, we could create a reference usually inside the player, but it would be reset if player died. Instead, we should search for it: FindObjectOfType<GameManager>().ourFunctionFromThatScript();
    • To call LevelWon(), do it normally inside the OnTriggerEnter() created next
  • Create a Trigger area, to end the game or start a cutscene or wtv: Create an object that covers the area » disable rendering to make it invisible » for dev to know the object is there, select a color icon besides the name in the Inspector » check Is Trigger in the Box Collider » add a script with a function OnTriggerEnter() » reference the GameManager normally » call wtv we want inside from the GameManager
  • For Buttons, scripts are added in OnClick() events » then we reference object that has script » and select the method

UI
  • Go to Hierarchy » Create » UI » Text
  • To see it: change view to 2D » select objects in Hierarchy » hit F
  • move text to inside the canvas » center it and customize it
  • avoid trimming if text reaches boundaries: select Text object » Horizontal Overflow » Overflow
  • make canvas resize with screen size: select Canvas object » Canvas Scaler » UI Scale Mode » Scale with Screen Size
  • unfocused or unsharpened?: Canvas » check Pixel Perfect
  • download a new font (ex: Roboto): download zip from google fonts » extract » move it to a folder in the assets » select Text » change font for one we imported
  • background that fits the screen: create a Panel inside the Canvas » change Source Image to None if we want a solid color » add Text inside
  • add Animation: see animations
  • See how to make it change dynamically in Scripts


Terrain

  • How to create:
    • On Scene, we can Create 3D Object » Terrain. 
    • Alternatively, we can go to Window » Terrain » Terrain Toolbox » Create, which allows us to create terrains with specific settings and is better to work with several terrains at once. We can place it next to other windows. 
    • We can also create a base from a heightmap.raw image, that we import to our assets » Terrain Toolbox » check Import Heightmap » select image and maybe change the resolution and dimensions » ensure it doesn't have the same Group ID as other terrains » Create. 
  • We will have a Terrain Folder with a terrain inside, in the assets
  • Disable fog at the top to see things better, we can enable it later. Also go to lighting window  and TURN OFF AUTO generated lighting!!!!!! (or reloading scenes will look weird)
  • Go to Window » Package Manager » Make sure "All Packages" and "Show preview Packages" are checked » search and download Terrain Tools
  • Go to Asset Store » search, download and import Terrain Sample Assets » We will see everything under Samples folder assets. Optional but useful and recommended assets:
    • Outdoor Ground Textures
    • Flooded Grounds
    • For trees: Conifers
    • Grass Flowers Pack Free
    • Stylized Nature Pack (used for "The First Tree")
    • Fantasy Skybox
  • Some people, before starting painting terrain, go to Inspector » Terrain Settings (last icon) and make it bigger, downsizing when they are finished. Don't forget to use the Terrain Toolbox do to it in multiple terrains. In the Terrain Settings, we can also hide things like trees if we need by uncheking "Draw" in the details section. 
  • It's useful to place a character or a cube for size reference. 
  • To start painting, go to Inspector » Select painting brush icon » Then select our paint mode (like "Raise or lower terrain") and paint. Suggestions: Noise, scaled to something bigger like 20x20, looks really cool. Shortcuts: 
    • Ctrl is used to invert (either reverse the effect of the brush or delete)
    • S scales brush. 
    • A changes strength of the brush
  • To create neighbour terrains, in the first icon of the inspector, we can click on what neighbor terrains we want. Make sure they have the same Group ID, otherwise we can sculpt multiple terrains at the same time. They also need the same resolution. 
  • To paint, as in actual colors, we go back to Inspector » Paint mode » Create/Add Layer. To Create » Select texture, like dirt » rename the asset. It is a good idea to import the normal and mask map for that layer, which usually are textures in from of the one we chose. Increasing tile size looks better. To Add » import one from the sample assets, like moss. 
  • To add trees, to to the Tree icon » Add Tree » Chose prefab from assets » change brush settings to affect area or add more trees per stroke or wtv. To remove a specific tree, use Ctrl and a small brush size and delete, making sure the corresponding prefab in the list of trees is selected or nothing will happen. 
  • For grass, it's the same as with the trees. Don't forget we can edit the chosen prefab like the colors and height. We can chose prefabs for texture grass or detail mesh grass. To add detail Mesh, we can use some from the asset store like Flooded Grounds. It works the same way as with prefabs, but it's more detailed and less optimized. 



Post Effects and Post Processing
  • Object properties, materials, shaders...:
    • Obvs organize the assets 
    • To create, go to Assets (top) » Create » Material. Change properties, can be a texture
    • Popular shaders (picked on the top of the sidebar for material): Standard, Legacy Diffuse(evenly distributed), Legacy Specular.
    • Popular shaders imported: Skybox (recommended from the start), Joepie (stylized, wobble), MirrorReflection(load heavy), Screenspace (cute stylized patterns)
    • Recs:
      • How to treat mmd characters: see blender post
      • Fog https://www.youtube.com/watch?v=1ZsKBZnbAB8
      • water https://www.youtube.com/watch?v=mWg4CE6ybKE
  • Lights:
    • Inspector » Main Camera » Layer UI to Post Processing
    • Chose Directional Lights in the Scene and edit it » Maybe decrease intensity
    • Go to the Lighting Window (Window » Rendering » Lighting) » Environment (top) » replace the Skybox material for Sky or smt, maybe even Solid Color » Scene (top) » check the new settings » uncheck Baked Global Illumination » Generate » Shader of Sky with less exposure » check Fog
    • Lighting Window (Window » Rendering » Lighting) » Environment (top) » Environment Reflections» change to Custom » set cubemap to a white image marked in the inspector as  Cube  in the texture shape https://www.youtube.com/watch?v=XatLA5SGgAs
  • Main Camera object 
    • check Post-Processing Volume box!!! » thinker with Ambient Occlusion vars 
    • in Light area, change Flare to Sun 
    • in the camera Inspector » Rendering Path to Forward
    • in the Color Grading of the Inspector » Mode to ACES
    • in the Bloom area of Inspector » check and change vars, in particular Threshold » maybe that will require to play with the Shader of the Sky in the light Environment and keep changing the Color Grading
    • Add Effect » Vignette
    • Add Effect » Chromatic Ab

Animations
  • Window » Animation (not Animator! it allows to transition and play animations, not create them)
  • Create Animation and save it inside folder
  • In the assets, select animation itself (what shows first) » disable Loop Time for it to just play once
  • In Record Mode, gameplay icons are red and recording is shown with red circle
  • Add key frames for what we want - they are the icons with a losango
  • We can add Animation Events to later trigger other actions - we just select the timeframe and click the icon besides the keyframe
    • We could add a function to it. We can also create a script belonging to what we are animating, with a function inside, and add that function to the event. 

Blender + CC

Sims 4 Studio common start

  • Studio » CAS ou wtv » Create 3D mesh » Choose + Next + Save » Texture» Export. Same for a mesh. Or meshes.
  • Don't forget that the mesh opened comes in three layers, two are visible with an hat and the other isn't

Shortcuts

  • Rotate» Press mouse wheel and rotate mouse
  • Zoom in/out » Mouse wheel
  • Select Mesh » Right click / Respective layer
  • Select Mesh Part in edit mode » B + Left click or L + drag
  • Inverse Selection » Ctrl + I
  • Select All Mesh » A
  • Select Vertices? or mesh components » Tab
  • Select Vertices + L for related vertixes + P » separation menu
  • Delete Selected » Delete shortcut
  • Select S4Studio mesh into scenes » Shift + Left Click
  • Merge layers » Ctrl + J or Join under the Edit left window
  • Move Object » G
  • Add mesh » Shift A
  • Select all» A, em object mode
  • Unselect all » AA, object mode
  • Rotate » R or Transform window
  • Scale » S or Transform window
  • Duplicate » Shift + D
  • Show both sides visible » in the bottom bar, there is a cube icon that allows you to check or uncheck that option
  • See top, left, right, bottom... » Hover the model and click the number 

Sculpt Mode
Brush increase size 


Mirror objects


Import model and dance
  • Download CAT and Powpurri
  • For powpurri, only want inside filer
  • Import them under Edit » preferences » addons » install. Click zip
  • Download MMD: pmx model and vmd movements
  • Open powpurri addon » import model » build » convert materials for cycles » edge preview to look more 2d » select armature » import movement
  • Open misc addon » select shadeless » that way it works on solid mode » maybe uncheck toon texture
  • Scene properties in lateral menu » units scale to 0.02 » rigid body » maybe reduce substeps » bake » it's fixed, just play dance
  • to change expression, go to shape keys: select scene on sidebar, then click model, and its in the triangle on side properties saying object data properties
  • Export normally as FBX, armature and mesh, use Shift for multiple select. Keep checked Bake animation and, within, Key all bones, NLA Strips, All actions and Force keying.
  • To import unity, just drag the FBX into the assets. Recommended shader: Unity chan, URP (the one from sunny side). Process: import > shade > assign humanoid rig and check optimize game objects https://www.youtube.com/watch?v=pbaOGZzth6g > apply changes to avatar. See Unity tutorials for that.
  • Rig can stay invisible just to see dance, but if we want proper collision, we have to fix it:
https://www.youtube.com/watch?v=7EJRlWitYmo
Addons » mesh » extra objects » create mesh vertex » extrude vertex with e and z » ctr a to select all » p to separate by loose parts » tool modifiers » add skin modifier + subdivision surface + mirror » check x axis and bisect » 

dystop marcado a nao ser pa dar remesh
n exagerar valor de remesh
ctrl inverte pincel, shift e smooth, f e shift f pa tamanho e força pincel


Do "paper hair"
  • Have the texture, a png img of a ponytail or something that would make sense having the same shape all around
  • Download template and scale texture to the section of hair, make sure it's not outside boundaries, but can be smaller. Can also add a scalp, from sims4 textures or other creators with permission. Save png without template visible. That's a texture.
  • Import texture in a model from the studio, don't worry with appearance
  • Export mesh and open in blender
  • Add Plane Mesh (shift + A), and rotate it to be parallel with the characters back, and scale to fit the width of the hair, and place it close to the back and scalp
  • Go to Object Mode
  • Go to the Texture icon/window on the right» New » Clouds » Image or Movie » down to Open » open your texture » down to Generated and change it to UV (it disappears)
  • Click on the paper icon under the window to paint a texture and select your texture » To make backside visible, go to Tools icon besides the texture and material window » Modifier » Solidify » Ticken to 0.0010
  • Back to texture on the left, resize outer window to include only our texture without the scalp, that will be projected on the plane
  • In Material window at the right, check transparency » Alpha to 0 (disappears)
  • Texture window » Check Alpha to on (appears)
  • Clone plane and rotate it all around (like two Xs of planes if visible from the top)
  • Position strand where you want it and as many times as you want it» Merge all of your custom layers
  • Go to Weight Paint Mode » Transfer Weight at the left
  • For each of the studio layers, press Tab to highlight » X + Delete Vertices
  • Triplicate your own mesh » Merge each of your meshes with each of studio meshes, make sure you merge under the studio meshes and not your own
  • For each final studio layer, go to Tools on the right » Modifier » Solidify » scale down to 0.0010
  • File » Save » Import in Studio for each Level of Detail » (optional) in texture, make shadow blank or import your own
  • Tools » Modding » Glass shader » Save with any name as a package file » Import package in your Mods folder
Other types of hair
  • Open mesh and such
  • Edit mode » Limit selection to Visible » A to deselect verticles
  • B + Left, drag to select area of verticles OR L + drag to select area, delete those we don't want to keep hair part we want to merge » Change it (check how it looks by clicking on the Rig layer) » (optional) Sculpt » Save it when happy
  • Back to the Studio » Cas » Create 3D Mesh » Get the hairstyle that is a scalp shaved only, and repeat steps to open in blender
  • On blender, File » Append » Select the hair you made previously to merge with the new mesh » Select Object » s4studio_mesh1 » Append from library » Sculpt or Edit to better blend » Merge under mesh_1 when happy » Save
  • To create the Scalp texture, open image editor » Open the texture of the scalp and the texture of the first mesh that we merged » Delete the part of the scalp of the first mesh texture » Resize textures to 2048 x 4096 for HQ mod » Copy scalp texture and merge it into the first mesh texture  » Fix colors, maybe make both black » Save final texture » Import texture in Studio
  • Add a swatch » Modify categories » Save package file » Import in Mods folder

Web

Elder Scrolls timeline