game development best practices

24
Game Development SCM Best Practices Sven Erik Knop Perforce Software

Upload: perforce

Post on 21-Jan-2018

218 views

Category:

Software


0 download

TRANSCRIPT

Page 1: Game Development Best Practices

Game Development

SCM Best Practices

Sven Erik KnopPerforce Software

Page 2: Game Development Best Practices

2© Perforce Software Inc. All Rights Reserved.

Overview

What makes game development so challenging?

Workflow Git in Game Development

Administration

Page 3: Game Development Best Practices

3© Perforce Software Inc. All Rights Reserved.

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

• Average AAA game:• 100s of 1000s of files

• 1TB+ code and assets at HEAD

• 50GB + changes a day

• 100+ team members

Challenges in Games Development

Page 4: Game Development Best Practices

4© Perforce Software Inc. All Rights Reserved.

Single of Source of Truth

Page 5: Game Development Best Practices

5© Perforce Software Inc. All Rights Reserved.

• Continuous integration• Builds take minutes

(incremental) to hours (full)

• Smoke tests?

• Full tests?

• How do you deal with large teams and many changes?

• How do you deal with large binary files?

Consequences

Page 6: Game Development Best Practices

6© Perforce Software Inc. All Rights Reserved.

• Images?

• 3D models?

• Sound files?

• Locking!

• Across branches?

3-way merge for binary assets?

Page 7: Game Development Best Practices

Codeline Organization

Page 8: Game Development Best Practices

8© Perforce Software Inc. All Rights Reserved.

• Why do we branch?• Different policies

• Decoupling from fast-changing code line

• Isolation of tasks

• Mainline model• All changes flow back to a single

trunk/mainline

• Development branches

• Milestone and release branches

Branching models

Page 9: Game Development Best Practices

9© Perforce Software Inc. All Rights Reserved.

Single Code Line

Head

Stable Head still stable?

Page 10: Game Development Best Practices

10© Perforce Software Inc. All Rights Reserved.

Development branches

Long-lived development branches can cause problems

Page 11: Game Development Best Practices

11© Perforce Software Inc. All Rights Reserved.

Task/Feature branches

Keeping feature branches short-lived avoids severe merge conflicts

Page 12: Game Development Best Practices

12© Perforce Software Inc. All Rights Reserved.

Milestone and release branches

Stabilize in separate branchMerge fixes, ignore hacks

Page 13: Game Development Best Practices

13© Perforce Software Inc. All Rights Reserved.

• Usually do not need all files

• Reduce space

• Speed up workspace syncs

• Perforce Helix methods for filtering:• Manual workspaces views

• Template workspace

• Virtual streams

• Alternative

• Split project into separate code lines

Views for filtering

codeline

ws1

ws2

Page 14: Game Development Best Practices

14© Perforce Software Inc. All Rights Reserved.

Component-based

Shared trunk

Separate trunks

Page 15: Game Development Best Practices

15© Perforce Software Inc. All Rights Reserved.

Helix Streams

Page 16: Game Development Best Practices

16© Perforce Software Inc. All Rights Reserved.

• Git repositories and Perforce Helix (Core) repositories in one place

• Perforce Helix 2017.1 introduces Helix4Git

Can I develop games using Git?

ArtistsDevelopers

Perforce Helix

Page 17: Game Development Best Practices

Administration

• Server sizing and setup

• Archiving and purging

• Replication

Page 18: Game Development Best Practices

18© Perforce Software Inc. All Rights Reserved.

• More RAM is always the right answer (Sven rule #2)

• Keep your database, logs,and journal local• Ideally on SSD

• Depots usually live onseparate storage• Faster Backups

• Shared replica storage

• Be aware of network bottlenecks

Server hardware

Page 19: Game Development Best Practices

19© Perforce Software Inc. All Rights Reserved.

• You can overwhelm storage of any size• Especially with generated files (artefacts)

• Perforce Helix has archiving features• Declare separate archiving depots (type “archive”) on cheap disks

• Use ‘p4 archive’ to move file content (history is preserved)

• Use ‘p4 restore’ to move archived files back in place

• Consider using +S filetype for generated files• Beware of limitations: avoid branching of +S files

Do you need every version of every file?

Page 20: Game Development Best Practices

20© Perforce Software Inc. All Rights Reserved.

Replication

master

failover proxy

forward

edge

Buildedge

shared drive

Main Site

Page 21: Game Development Best Practices

21© Perforce Software Inc. All Rights Reserved.

• Outsourcers typically need a subset of the whole project

• DVCS-style approach:• Use independent Helix server and

push and fetch to transfer changes

• Replica-style approach:• Use edge server, potentially in the

cloud in their region

• Control amount of stored files:

• db.replication=cache

• p4 cachepurge

Outsourcing

Page 22: Game Development Best Practices

22© Perforce Software Inc. All Rights Reserved.

• Perforce Helix is a great choice for your game developers• Artists and developers collaborate

using a Single Source of Truth

• There are many strategies to keep the size in check• Syncing files for users

• Replicas for build systemsand remote sites

• Archiving and purging

Conclusion

Page 23: Game Development Best Practices

Questions? Reach me on Twitter: @p4sven