Is Trunk-based Development Easy in Game Development?

18
Is Trunk-based Development Easy in Game Development? Sven Erik Knop Perforce Software

Transcript of Is Trunk-based Development Easy in Game Development?

Page 1: Is Trunk-based Development Easy in Game Development?

Is Trunk-based Development Easy in Game Development?

Sven Erik KnopPerforce Software

Page 2: Is Trunk-based Development Easy in Game Development?

Challenges in Games Development

• Why is Games Development so hard?– Besides the obvious I mean …

• Average AAA game:– 100 of thousands of files– 1 TB+ source code and assets at HEAD– 50GB + changes a day– 100+ Team size

Page 3: Is Trunk-based Development Easy in Game Development?

Consequences

• Continuous integration– Builds take minutes (incremental) to hours (full)– Smoke tests?– Full tests?

• Who broke the build?• HEAD is not stable!

Page 4: Is Trunk-based Development Easy in Game Development?

Coding practices compared

• Different ways to organise your sources• There is no single best way– Team size– Target platform: Mobile/Console/PC/4K/…– Rate of change– Iteration frequency

Page 5: Is Trunk-based Development Easy in Game Development?

Single Code Line

Head

Stable Head still stable?

Page 6: Is Trunk-based Development Easy in Game Development?

Development branches

Long-lived development branches can cause problems

Page 7: Is Trunk-based Development Easy in Game Development?

Task/Feature branches

Keeping feature branches short-lived avoids severe merge conflicts

Page 8: Is Trunk-based Development Easy in Game Development?

Vignette: mergeable objects

• 3-way merge for text documents

Page 9: Is Trunk-based Development Easy in Game Development?

3-way merge for binary assets?

• Images?• 3D models?• Sound files?

• Locking!• Across branches?

Page 10: Is Trunk-based Development Easy in Game Development?

Component-basedShared trunk

Separate trunk

Page 11: Is Trunk-based Development Easy in Game Development?

Trunk-based Development

Trunk

Release

Extended testing for releaseRequires tooling!

Stable

Page 12: Is Trunk-based Development Easy in Game Development?

Milestone branches

Stabilise in separate branchMerge fixes, ignore hacks

Page 13: Is Trunk-based Development Easy in Game Development?

Summary

• Stability versus Agility• Trunk-based development can offer both– If supported with the right tools

• Careful with branching of binary assets– Consider componentisation instead

Page 14: Is Trunk-based Development Easy in Game Development?

Perforce• Perforce helps delivery teams build complex products collaboratively,

securely and efficiently.• Commonly used for…

– Software– Games– Electronics– Animations– Chipsets – Medical Devices– Internet of Things

Page 15: Is Trunk-based Development Easy in Game Development?

Who uses Perforce?

13,000 20,000 users

9,500 users500+ terabytes

5,000+ userscoders & designers

10,000,000 Perforce xact/day

Everything! 11,000+ users

Chips Games & Animation Cloud/SW Electronics Systems Automotive

Page 16: Is Trunk-based Development Easy in Game Development?

Perforce Helix

Contributors

Consumers

Flexible Workflows Version control, code reviews, simple file sharing

Fast and ScalableFrom 10 to 10,000+ on a each trunk

Every FileEfficiently handles large, often binary, data

EverywhereSupports geographically distributed teams

Secure Granular permissions, theft risk monitoring

Open and ExtensibleAPIs and integration hooks for customization

Page 17: Is Trunk-based Development Easy in Game Development?

StreamsParent-child relationship between streamsDevelopment and release stream typesVirtual streams for easy componentisation

Page 18: Is Trunk-based Development Easy in Game Development?

Conclusion

• Trunk-based development is a good thing• Requires the right tools• Recommendation– Componentisation– Protected release streams– Keep everything in one repository