TOOL DEVELOPMENT
INTRODUCTION
2023 – 2024 Digital Arts & Entertainment
WHAT IS TOOL
DEVELOPMENT
Creation of tools that assist in the production
process of a game. Usually Automating repetitive or
manual tasks.
?
• Required the developer to understand the
production processes.
Pipeline Automation
• Asset Management / Processing
• Automatic rigging
• Dialogue builder
Build Automation
• Automated Testing
• Pushing to the right audience
…
Very specific per organization / Project
WHAT FRAMEWORKS /
LANGUAGES?
Ease of use > Performance
• Frameworks that are visual
?
• Quick to add / modify functionality
Examples:
• WPF C# + XAML
• Blazor C# + HTML
• QT C++ or Python
• Electron HTML + JS
• ...
SEMESTER
OVERVIEW
PART C# PART C++
5+1 Weeks 5+1 Weeks
50% of the Module 50% of the Module
Graded Assignment Graded Assignment
Switch mid semester
GRADES
Permanent evaluation during semester (20%)
• Project PART C++ (10%)
• Project PART C# (10%)
Best preparation for the exam!!
Final exam during exam period (80%)
• 2h PART C++ (40%)
• 2h PART C# (40%)
TOOL DEVELOPMENT WITH C#
C# Introduction
2023 – 2024 Digital Arts & Entertainment
C# INTRODUCTION
WORKING WITH
GIT
Version Control: Git
What is version control?
- Tracking and managing changes
- Online “backups”
- Collaboration
How?
- Online repository (Remote)
- Local copy (Clone)
- Changes are bundled in a Commit
- Push from Local to Remote
- Pull from Remote to Local
Git Terminology
Repository Push Merge
A storage system that contains all the Sending one or multiple commits to the Applying changes onto a local repository.
files and resources for a project, along remote repository. Conflicts are resolved during this phase.
with the complete history of the changes
made over time.
Clone Pull Branch
A full copy of the remote repository, Combination of Fetch and Merge. A version of the repository that diverges
stored on a local system. Development Downloads the latest changes from the from the main project. Allows multiple
will always happen on a clone. remote repository and applies them developers to work on different features
locally. without interference.
Commit Fetch
Snapshot of the changes made to one or Get the latest changes. Only affects the
more files at a certain time. Contains a history, not the actual files.
commit message provided by the user.
Possible changes are Add, Rename, Modify
and Delete.
Git Workflows: Basic Workflow
Also called the Centralized Workflow.
Everyone works on the same (‘main’) branch
Pull at the start of work, Commit then Push when ready with a
task.
Basic Workflow Example: Handling conflicts
Remote
• Initial state • Person A pulls and starts working. Makes several local commits.
• Commit A01 • Person B pulls and starts working. Makes several local commits.
• Commit A02 • Person A pushes commits to Remote.
• Commit B01
• Person B pushes commits to Remote -> Remote returns error
• Commit B02 “Unable to push because there are commits on the remote that are not
Pull Pull present on your local branch.”
• Commit
<Merge…
Push Push • Person B Pulls remote to have the latest version.
• (Optional) Person B resolves conflicts locally
• Person B merges -> creates a new commit.
• Person B Pushes commits to Remote
Person A Person B
• Commit A01 • Commit B01
• Commit A02 • Commit B02
• Commit A01
• Commit A02
• Commit <Merge branch ‘main’ of …
>
Git Workflows: Feature Branch Workflow (not for this course)
Main
e st
u
Req
ll
Feature Pu
All Features are developed in dedicated branches
Work inside a specific Feature branch follows the basic workflow
Features are pushed to Remote regularly
When a feature is Finished, A Pull Request is created to Merge into
‘main’
(also called a Merge Request)
Working with GIT
Good Commits
• Regular, after every block of work
• Clear messages
• Planning! Planning your work
beforehand and not aimlessly changing
things results in clear commits!
• Discard changes that were not
intended!
Push your commits!
Make it a good habit to immediately push
your commits -> Online backups!
C# Introduction
C# and .NET
Brief history
of .NET .NET FRAMEWORK 1.0
Developed by Microsoft
.NET Framework .NET FRAMEWORK 2.0
• Windows Desktop Development
.NET FRAMEWORK 3.0 .NET CORE 1.0
• Versions 1.0 (2002) to 4.5
Downside: Windows only .NET FRAMEWORK 4.0 .NET CORE 2.0
.NET Core .NET FRAMEWORK 4.5 .NET CORE 3.0
• Lightweight, open-source, Cross platform
• Mainly for server-side code (Web API’s,…) November 2020 .NET 5.0
• Versions 1.0 to 3.0 November 2021 .NET 6.0
.NET
November 2022 .NET 7.0
• Unified between .NET Framework
and .NET Core November 2023 .NET 8.0
• Starting .NET 5.0
What is .NET?
Application platform that is cross platform
(Android, MacOS, iOS, Linux & Windows)
Common Language Runtime (CLR)
• Runtime environment
• Manages execution & lifecycle of .NET app
• Memory management (e.g., Garbage
Collector)
• Exception handling
C# code gets compiled to Intermediate
Language (IL)
• Code that is interpreted by the CLR
• Compiled AT RUNTIME by the JIT compiler
(Just-In-Time) to machine code
Also supports other languages such as F# and
VB.NET
Easy to include Libraries using NuGet
packages
TOOL DEVELOPMENT WITH C#
AND .NET
“The creation of tools that will C# Intro
assist in the production
process of games, using C#
and the .NET Framework.” WPF & XAML
C# Continued
Consume
Webservices
MVVM
C# Introduction
vs
vs
At first glance
• High Level language • Low Level Language
• Closer to human language • Closer to machine code
• Easier to read/write • Harder to read/write
vs
Development speed Performance
• Easer to read/write • Closer to machine code
• Higher accessibility • More control over memory usage
• Cross-platform • Faster execution
• Automatic Memory Management • Danger of memory leaks
• Less efficient
vs
Conclusion: The right tool for the right job
• Each language has its strengths and weaknesses.
• Why C# is a good choice for Tool Development:
• Fast development cycle
• Easy to implement libraries
• Performance is not the top priority
C# INTRODUCTION
C# Project
Structure
HANDS-ON
C# Console
application
PROJECT CREATION
Visual Studio >> File >> New >>
Project…
• Different C# Project Types
• WPF Application (UI Project)
• Console Application (Console)
• Class Library (Library/DLL)
• …
Select Console App
PROJECT
CONFIGURATION
Do not use a synchronized
folder!
(no OneDrive, Google drive,...)
• Syncing sometimes freezes
files
• Conflicts when sharing code
Solution:
PROJECT
CONFIGURATION
• Select .NET Version
• Check “Do not use top-level
statements” ON
• Checked off:
SOLUTION EXPLORER
• Solution
• Project
• Dependencies
• Code Files
PROJECT PROPERTIES
• Application
• Output type (console Application,
DLL,…)
• .NET Version
• Target OS
• …
• Package information
= all information that will be stored
into the application / package on Build.
• Package ID
• Title
• Description
• Version
• Copyright
• …
DEPENDENCIES
= Referenced Projects / Libraries
• Default Dependencies (included
with .NET version)
• Add references (right-click)
• Project Reference
• DLL
• NuGet Packages
LIBRARIES
• Managed DLL
‘Reusable’ objects and functionality
packed into an assembly (= library)
• .NET Framework = Huge set of
libraries
• System.Xml > XML functionality
• System.Net > Networking
functionality
• …
• Third Party Libraries
(Don’t try to write everything yourself)
• SharpDX (DirectX Wrapper)
• Json.NET (Managed Json Parser)
• …
• Create your own
• Class Library Project
WORKING WITH
REFERENCES
Add the reference to the
Dependencies
Access in code with the using
keyword, followed by the namespace
at the top of the file.
using <namespace>;
This is necessary for every code file
that needs to reference a namespace.
NAMESPACES
Organize types in logically related
groups
Nested namespaces (hierarchy)
Recognized by the ‘using’ directive
using System;
• Gives you access to the exposed
objects
of the System library
namespace HelloWorld
• Namespace identifier for your own
objects
(ex. When writing your own library)
WHAT IS IN A
LIBRARY?
Object Browser
• View>>Object Browser
• Select the Library
.NET Documentation
• Select an object in your project
• Press F1
FLASH QUIZ
Which namespace is not part of the .NET 8
Library?
A. System.Reflection
B. System.Threading
C. System.Net
D. System.Error
E. System.Drawing
CODE FILES (.cs files)
• No header files.
• Default Program.cs file with a
static Main() method as entry
point.
EXERCISE
• Write multiple lines to the console.
• Read a line from the console.
Look in the documentation, or in the Object Browser to see which
methods can help you with this.