SlideShare a Scribd company logo
1 of 28
Download to read offline
Unity scene file collaboration
Simpler than rocket surgery™
Noam Gat
19/4/2015
@noamgat
Hello!
Noam Gat
CTO @ Tacticsoft
Past - JoyTunes, Omek Interactive, OGRE
The scene file is the place that integrates the work
of all people working on a project
- Programmers add logic
- Artists add assets and control lighting
- Level designers build levels
- Game designers control balance
For a team member to be able to complete a loop
on their own, they often need to modify the scene
file
Why collaborate?
Whats the problem?
Two team members start working on the
scene at the same time, make different
changes and try to commit.
What is the resulting scene file? How do we
get there?
Previous Work
Some popular workarounds :
- Lock scenes when working on them
- Separate the scenes into several prefabs,
lock prefabs when working on them
Both methods work, but they come with their
problems (hard to scale, need to decide
prefab split, unable to use prefabs for what
they were meant to be)
Related Unity Milestones
Why were those workarounds created?
Unity 1.0 - Scenes are binary, can’t merge
Unity 3.0 - Textual version in Pro
Unity 3.5 - Textual version in Free
Unity 4.6.1 - Random IDs for documents
Unity 5 - UnityYAMLMerge
Tools required for collaboration
A. Version Control
B. Conflict merging tool
C. Understanding of scene file conflicts
Tools required for collaboration
A. Version Control
git, SourceTree
B. Conflict merging tool
P4Merge, UnityYAMLMerge
C. Understanding of scene file conflicts
Today =)
Simple test case
Base Change 1 Change 2
Simple?
Simple? :(
Unity scene files
In order to read, understand and solve
conflicts, we should first understand how
Unity stores scene files.
The files are based on the YAML format
YAML
--- !invoice
receipt: Oz-Ware Purchase Invoice
date: 2012-08-06
customer:
given: Dorothy
family: Gale
Document separator + identifier
(Multiple documents can exist in
one file)
Key value based storage
Indentation for hierarchy
Unity scene YAML
--- !u!1 &1280541007
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 4
m_Component:
- 4: {fileID: 1280541011}
- 33: {fileID: 1280541010}
- 65: {fileID: 1280541009}
- 23: {fileID: 1280541008}
m_Layer: 0
m_Name: Box1
Object type (1 = GameObject), ID
Links to component types +
document IDs (they are also linked
back to it via m_GameObject field)
Unity scene properties
- The file is just a flat list of Component /
GameObject documents
- Order of documents is irrelevant (!)
- Hierarchy is maintained by two sided
connections (parent points to children,
child points to parent).
--- !u!4 &1280541011
Transform:
m_GameObject: {fileID: 1280541007}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 2, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 1949811455}
m_Father: {fileID: 0}
m_RootOrder: 3
Understanding .unity conflicts
The common tool to solve conflicts is a “3
way merge” tool, where you see the Base
file, and two conflicting changesets made to
it.
Simple test case 3-way-merge
Simple test case 3-way-merge
Both changesets tried to insert new lines in
the same position in the file
BaseChange 1 Change 2
Simple test case 3-way-merge
In this case, the solution is simple :
Just put one of them after the other
Simple test case 3-way-merge
Success!
(But why is Box1 before Box2?)
Why does auto-merge fail?
It does not know what we know :
- That a “---” line with different IDs means
that they are two different objects. It
suspects that the lines are the same
change with slightly different values.
- That the order of the documents in the .
scene file is irrelevant. Who should be
before who in the text file?
Smart auto-merge
A suggestion for an algorithm to smartly
merge .scene files :
- Break down the scene file into separate
objects (based on the document
identifiers)
- Merge each document separately
- Dump back into .scene file
(Inside .gitconfig)
[merge]
tool = unityyamlmerge
[mergetool "unityyamlmerge"]
trustExitCode = false
cmd = ' <path to UnityYAMLMerge> ' merge -p "$BASE" "$REMOTE" "$LOCAL" "$MERGED"
UnityYAMLMerge
In Unity 5, a tool called “UnityYAMLMerge”
was introduced.
It can be integrated as a pre-merge step in
source control tools :
UnityYAMLMerge
(Demonstration on actual computer if
possible)
Related Unity Milestones
Why were those workarounds created?
Unity 1.0 - Scenes are binary, can’t merge
Unity 3.0 - Textual version in Pro
Unity 3.5 - Textual version in Free
Unity 4.6.1 - Random IDs for documents
Unity 5 - UnityYAMLMerge
Not 100% automatic
In some cases, conflicts are real:
- Different changes are made to same
components
- Child ordering is not always resolved in
the diff. Manual fixups may be necessary.
- One changeset deletes an object, the
other modifies it
These are real conflicts, and need to be
solved like code conflicts.
Summary
- Unity .scene conflicts are scary if not
understood
- Understanding the file format allows
technical conflicts to be easily resolved
(UnityYAMLMerge)
- Once they are solved, the real conflicts
are easier to read and manage
Thank You!
(We’re hiring! tech@tacticsoft.net )
@noamgat

More Related Content

What's hot

Unity introduction for programmers
Unity introduction for programmersUnity introduction for programmers
Unity introduction for programmersNoam Gat
 
Casual and Social Games with Unity
Casual and Social Games with UnityCasual and Social Games with Unity
Casual and Social Games with UnityTadej Gregorcic
 
School For Games 2015 - Unity Engine Basics
School For Games 2015 - Unity Engine BasicsSchool For Games 2015 - Unity Engine Basics
School For Games 2015 - Unity Engine BasicsNick Pruehs
 
Game Programming 02 - Component-Based Entity Systems
Game Programming 02 - Component-Based Entity SystemsGame Programming 02 - Component-Based Entity Systems
Game Programming 02 - Component-Based Entity SystemsNick Pruehs
 
Game Development with Unity
Game Development with UnityGame Development with Unity
Game Development with Unitydavidluzgouveia
 
Unity Introduction
Unity IntroductionUnity Introduction
Unity IntroductionJuwal Bose
 
Style & Design Principles 03 - Component-Based Entity Systems
Style & Design Principles 03 - Component-Based Entity SystemsStyle & Design Principles 03 - Component-Based Entity Systems
Style & Design Principles 03 - Component-Based Entity SystemsNick Pruehs
 
Game Project / Working with Unity
Game Project / Working with UnityGame Project / Working with Unity
Game Project / Working with UnityPetri Lankoski
 
Unity Programming
Unity Programming Unity Programming
Unity Programming Sperasoft
 
Hands On with the Unity 5 Game Engine! - Andy Touch - Codemotion Roma 2015
Hands On with the Unity 5 Game Engine! - Andy Touch - Codemotion Roma 2015Hands On with the Unity 5 Game Engine! - Andy Touch - Codemotion Roma 2015
Hands On with the Unity 5 Game Engine! - Andy Touch - Codemotion Roma 2015Codemotion
 
Academy PRO: Unity 3D. Environment
Academy PRO: Unity 3D. EnvironmentAcademy PRO: Unity 3D. Environment
Academy PRO: Unity 3D. EnvironmentBinary Studio
 
Game Models - A Different Approach
Game Models - A Different ApproachGame Models - A Different Approach
Game Models - A Different ApproachNick Pruehs
 
OGDC 2014: Component based entity system mobile game development
OGDC 2014: Component based entity system mobile game developmentOGDC 2014: Component based entity system mobile game development
OGDC 2014: Component based entity system mobile game developmentGameLandVN
 
Unity 3D game engine seminar
Unity 3D game engine  seminarUnity 3D game engine  seminar
Unity 3D game engine seminarNikhilThorat15
 
GameDev 2017 - Анатолій Ландишев "AAA architecture in Unity3D"
GameDev 2017 - Анатолій Ландишев "AAA architecture in Unity3D"GameDev 2017 - Анатолій Ландишев "AAA architecture in Unity3D"
GameDev 2017 - Анатолій Ландишев "AAA architecture in Unity3D"Lviv Startup Club
 
Game Engine Overview
Game Engine OverviewGame Engine Overview
Game Engine OverviewSharad Mitra
 
Introduction to Unity3D Game Engine
Introduction to Unity3D Game EngineIntroduction to Unity3D Game Engine
Introduction to Unity3D Game EngineMohsen Mirhoseini
 

What's hot (20)

Unity introduction for programmers
Unity introduction for programmersUnity introduction for programmers
Unity introduction for programmers
 
Casual and Social Games with Unity
Casual and Social Games with UnityCasual and Social Games with Unity
Casual and Social Games with Unity
 
School For Games 2015 - Unity Engine Basics
School For Games 2015 - Unity Engine BasicsSchool For Games 2015 - Unity Engine Basics
School For Games 2015 - Unity Engine Basics
 
Game Programming 02 - Component-Based Entity Systems
Game Programming 02 - Component-Based Entity SystemsGame Programming 02 - Component-Based Entity Systems
Game Programming 02 - Component-Based Entity Systems
 
Game Development with Unity
Game Development with UnityGame Development with Unity
Game Development with Unity
 
Unity Introduction
Unity IntroductionUnity Introduction
Unity Introduction
 
Unity 3D, A game engine
Unity 3D, A game engineUnity 3D, A game engine
Unity 3D, A game engine
 
unity basics
unity basicsunity basics
unity basics
 
Style & Design Principles 03 - Component-Based Entity Systems
Style & Design Principles 03 - Component-Based Entity SystemsStyle & Design Principles 03 - Component-Based Entity Systems
Style & Design Principles 03 - Component-Based Entity Systems
 
Game Project / Working with Unity
Game Project / Working with UnityGame Project / Working with Unity
Game Project / Working with Unity
 
Unity Programming
Unity Programming Unity Programming
Unity Programming
 
Hands On with the Unity 5 Game Engine! - Andy Touch - Codemotion Roma 2015
Hands On with the Unity 5 Game Engine! - Andy Touch - Codemotion Roma 2015Hands On with the Unity 5 Game Engine! - Andy Touch - Codemotion Roma 2015
Hands On with the Unity 5 Game Engine! - Andy Touch - Codemotion Roma 2015
 
Academy PRO: Unity 3D. Environment
Academy PRO: Unity 3D. EnvironmentAcademy PRO: Unity 3D. Environment
Academy PRO: Unity 3D. Environment
 
Game Models - A Different Approach
Game Models - A Different ApproachGame Models - A Different Approach
Game Models - A Different Approach
 
OGDC 2014: Component based entity system mobile game development
OGDC 2014: Component based entity system mobile game developmentOGDC 2014: Component based entity system mobile game development
OGDC 2014: Component based entity system mobile game development
 
Unity 3D game engine seminar
Unity 3D game engine  seminarUnity 3D game engine  seminar
Unity 3D game engine seminar
 
GameDev 2017 - Анатолій Ландишев "AAA architecture in Unity3D"
GameDev 2017 - Анатолій Ландишев "AAA architecture in Unity3D"GameDev 2017 - Анатолій Ландишев "AAA architecture in Unity3D"
GameDev 2017 - Анатолій Ландишев "AAA architecture in Unity3D"
 
Game Engine Overview
Game Engine OverviewGame Engine Overview
Game Engine Overview
 
Presentación Unity
Presentación UnityPresentación Unity
Presentación Unity
 
Introduction to Unity3D Game Engine
Introduction to Unity3D Game EngineIntroduction to Unity3D Game Engine
Introduction to Unity3D Game Engine
 

Similar to Unity scene file collaboration

Extending unity3D Editor
Extending unity3D  EditorExtending unity3D  Editor
Extending unity3D EditorMuhammad Ahmed
 
unity gaming programing basics for students ppt
unity gaming programing basics for students pptunity gaming programing basics for students ppt
unity gaming programing basics for students pptKathiriyaParthiv
 
create-netflix-clone-03-server_transcript.pdf
create-netflix-clone-03-server_transcript.pdfcreate-netflix-clone-03-server_transcript.pdf
create-netflix-clone-03-server_transcript.pdfShaiAlmog1
 
Cmd unity withc
Cmd unity withcCmd unity withc
Cmd unity withcumairnoora
 
Introduction to Game Programming: Using C# and Unity 3D - Chapter 3 (Preview)
Introduction to Game Programming: Using C# and Unity 3D - Chapter 3 (Preview)Introduction to Game Programming: Using C# and Unity 3D - Chapter 3 (Preview)
Introduction to Game Programming: Using C# and Unity 3D - Chapter 3 (Preview)noorcon
 
The Basics of Unity - The Game Engine
The Basics of Unity - The Game EngineThe Basics of Unity - The Game Engine
The Basics of Unity - The Game EngineOrisysIndia
 
Threading Successes 05 Smoke
Threading Successes 05   SmokeThreading Successes 05   Smoke
Threading Successes 05 Smokeguest40fc7cd
 
Unity 3D
Unity 3DUnity 3D
Unity 3Dgema123
 
File splitter and joiner
File splitter and joinerFile splitter and joiner
File splitter and joinerRajesh Roky
 
Developing Plug-Ins for NetBeans
Developing Plug-Ins for NetBeansDeveloping Plug-Ins for NetBeans
Developing Plug-Ins for NetBeanselliando dias
 
VM: Image analysis and fragmentation
VM: Image analysis and fragmentation VM: Image analysis and fragmentation
VM: Image analysis and fragmentation EOSC-hub project
 
Flex3 Deep Dive Final
Flex3 Deep Dive FinalFlex3 Deep Dive Final
Flex3 Deep Dive FinalRJ Owen
 
841- Advanced Computer ForensicsUnix Forensics LabDue Date.docx
841- Advanced Computer ForensicsUnix Forensics LabDue Date.docx841- Advanced Computer ForensicsUnix Forensics LabDue Date.docx
841- Advanced Computer ForensicsUnix Forensics LabDue Date.docxevonnehoggarth79783
 
A-Frame: building virtual reality experiences for the web
A-Frame: building virtual reality experiences for the webA-Frame: building virtual reality experiences for the web
A-Frame: building virtual reality experiences for the webErik Minarini
 
Introduction to html5 game programming with impact js
Introduction to html5 game programming with impact jsIntroduction to html5 game programming with impact js
Introduction to html5 game programming with impact jsLuca Galli
 
PowerShell - Be A Cool Blue Kid
PowerShell - Be A Cool Blue KidPowerShell - Be A Cool Blue Kid
PowerShell - Be A Cool Blue KidMatthew Johnson
 
Thug: a new low-interaction honeyclient
Thug: a new low-interaction honeyclientThug: a new low-interaction honeyclient
Thug: a new low-interaction honeyclientAngelo Dell'Aera
 

Similar to Unity scene file collaboration (20)

Extending unity3D Editor
Extending unity3D  EditorExtending unity3D  Editor
Extending unity3D Editor
 
unity gaming programing basics for students ppt
unity gaming programing basics for students pptunity gaming programing basics for students ppt
unity gaming programing basics for students ppt
 
create-netflix-clone-03-server_transcript.pdf
create-netflix-clone-03-server_transcript.pdfcreate-netflix-clone-03-server_transcript.pdf
create-netflix-clone-03-server_transcript.pdf
 
Cmd unity withc
Cmd unity withcCmd unity withc
Cmd unity withc
 
Introduction to Game Programming: Using C# and Unity 3D - Chapter 3 (Preview)
Introduction to Game Programming: Using C# and Unity 3D - Chapter 3 (Preview)Introduction to Game Programming: Using C# and Unity 3D - Chapter 3 (Preview)
Introduction to Game Programming: Using C# and Unity 3D - Chapter 3 (Preview)
 
The Basics of Unity - The Game Engine
The Basics of Unity - The Game EngineThe Basics of Unity - The Game Engine
The Basics of Unity - The Game Engine
 
D2 k word_format
D2 k word_formatD2 k word_format
D2 k word_format
 
Threading Successes 05 Smoke
Threading Successes 05   SmokeThreading Successes 05   Smoke
Threading Successes 05 Smoke
 
Unity 3D
Unity 3DUnity 3D
Unity 3D
 
File splitter and joiner
File splitter and joinerFile splitter and joiner
File splitter and joiner
 
Developing Plug-Ins for NetBeans
Developing Plug-Ins for NetBeansDeveloping Plug-Ins for NetBeans
Developing Plug-Ins for NetBeans
 
VM: Image analysis and fragmentation
VM: Image analysis and fragmentation VM: Image analysis and fragmentation
VM: Image analysis and fragmentation
 
Flex3 Deep Dive Final
Flex3 Deep Dive FinalFlex3 Deep Dive Final
Flex3 Deep Dive Final
 
841- Advanced Computer ForensicsUnix Forensics LabDue Date.docx
841- Advanced Computer ForensicsUnix Forensics LabDue Date.docx841- Advanced Computer ForensicsUnix Forensics LabDue Date.docx
841- Advanced Computer ForensicsUnix Forensics LabDue Date.docx
 
Game Studio
Game StudioGame Studio
Game Studio
 
A-Frame: building virtual reality experiences for the web
A-Frame: building virtual reality experiences for the webA-Frame: building virtual reality experiences for the web
A-Frame: building virtual reality experiences for the web
 
Introduction to html5 game programming with impact js
Introduction to html5 game programming with impact jsIntroduction to html5 game programming with impact js
Introduction to html5 game programming with impact js
 
PowerShell - Be A Cool Blue Kid
PowerShell - Be A Cool Blue KidPowerShell - Be A Cool Blue Kid
PowerShell - Be A Cool Blue Kid
 
Thug: a new low-interaction honeyclient
Thug: a new low-interaction honeyclientThug: a new low-interaction honeyclient
Thug: a new low-interaction honeyclient
 
Pcom xpcom
Pcom xpcomPcom xpcom
Pcom xpcom
 

Recently uploaded

APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxk795866
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxbritheesh05
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .Satyam Kumar
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and usesDevarapalliHaritha
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxPoojaBan
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLDeelipZope
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfme23b1001
 

Recently uploaded (20)

APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptx
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptx
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and uses
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptx
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCL
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdf
 

Unity scene file collaboration

  • 1. Unity scene file collaboration Simpler than rocket surgery™ Noam Gat 19/4/2015 @noamgat
  • 2. Hello! Noam Gat CTO @ Tacticsoft Past - JoyTunes, Omek Interactive, OGRE
  • 3. The scene file is the place that integrates the work of all people working on a project - Programmers add logic - Artists add assets and control lighting - Level designers build levels - Game designers control balance For a team member to be able to complete a loop on their own, they often need to modify the scene file Why collaborate?
  • 4. Whats the problem? Two team members start working on the scene at the same time, make different changes and try to commit. What is the resulting scene file? How do we get there?
  • 5. Previous Work Some popular workarounds : - Lock scenes when working on them - Separate the scenes into several prefabs, lock prefabs when working on them Both methods work, but they come with their problems (hard to scale, need to decide prefab split, unable to use prefabs for what they were meant to be)
  • 6. Related Unity Milestones Why were those workarounds created? Unity 1.0 - Scenes are binary, can’t merge Unity 3.0 - Textual version in Pro Unity 3.5 - Textual version in Free Unity 4.6.1 - Random IDs for documents Unity 5 - UnityYAMLMerge
  • 7. Tools required for collaboration A. Version Control B. Conflict merging tool C. Understanding of scene file conflicts
  • 8. Tools required for collaboration A. Version Control git, SourceTree B. Conflict merging tool P4Merge, UnityYAMLMerge C. Understanding of scene file conflicts Today =)
  • 9. Simple test case Base Change 1 Change 2
  • 12. Unity scene files In order to read, understand and solve conflicts, we should first understand how Unity stores scene files. The files are based on the YAML format
  • 13. YAML --- !invoice receipt: Oz-Ware Purchase Invoice date: 2012-08-06 customer: given: Dorothy family: Gale Document separator + identifier (Multiple documents can exist in one file) Key value based storage Indentation for hierarchy
  • 14. Unity scene YAML --- !u!1 &1280541007 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} serializedVersion: 4 m_Component: - 4: {fileID: 1280541011} - 33: {fileID: 1280541010} - 65: {fileID: 1280541009} - 23: {fileID: 1280541008} m_Layer: 0 m_Name: Box1 Object type (1 = GameObject), ID Links to component types + document IDs (they are also linked back to it via m_GameObject field)
  • 15. Unity scene properties - The file is just a flat list of Component / GameObject documents - Order of documents is irrelevant (!) - Hierarchy is maintained by two sided connections (parent points to children, child points to parent). --- !u!4 &1280541011 Transform: m_GameObject: {fileID: 1280541007} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 2, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 1949811455} m_Father: {fileID: 0} m_RootOrder: 3
  • 16. Understanding .unity conflicts The common tool to solve conflicts is a “3 way merge” tool, where you see the Base file, and two conflicting changesets made to it.
  • 17. Simple test case 3-way-merge
  • 18. Simple test case 3-way-merge Both changesets tried to insert new lines in the same position in the file BaseChange 1 Change 2
  • 19. Simple test case 3-way-merge In this case, the solution is simple : Just put one of them after the other
  • 20. Simple test case 3-way-merge Success! (But why is Box1 before Box2?)
  • 21. Why does auto-merge fail? It does not know what we know : - That a “---” line with different IDs means that they are two different objects. It suspects that the lines are the same change with slightly different values. - That the order of the documents in the . scene file is irrelevant. Who should be before who in the text file?
  • 22. Smart auto-merge A suggestion for an algorithm to smartly merge .scene files : - Break down the scene file into separate objects (based on the document identifiers) - Merge each document separately - Dump back into .scene file
  • 23. (Inside .gitconfig) [merge] tool = unityyamlmerge [mergetool "unityyamlmerge"] trustExitCode = false cmd = ' <path to UnityYAMLMerge> ' merge -p "$BASE" "$REMOTE" "$LOCAL" "$MERGED" UnityYAMLMerge In Unity 5, a tool called “UnityYAMLMerge” was introduced. It can be integrated as a pre-merge step in source control tools :
  • 25. Related Unity Milestones Why were those workarounds created? Unity 1.0 - Scenes are binary, can’t merge Unity 3.0 - Textual version in Pro Unity 3.5 - Textual version in Free Unity 4.6.1 - Random IDs for documents Unity 5 - UnityYAMLMerge
  • 26. Not 100% automatic In some cases, conflicts are real: - Different changes are made to same components - Child ordering is not always resolved in the diff. Manual fixups may be necessary. - One changeset deletes an object, the other modifies it These are real conflicts, and need to be solved like code conflicts.
  • 27. Summary - Unity .scene conflicts are scary if not understood - Understanding the file format allows technical conflicts to be easily resolved (UnityYAMLMerge) - Once they are solved, the real conflicts are easier to read and manage
  • 28. Thank You! (We’re hiring! tech@tacticsoft.net ) @noamgat