When developing games, each and every one of us should strive for perfection. At my desk, I have put up a sign saying “What would Blizzard do?” This talk is about motivation, excitement and learning how to dissect other games in order to learn from each other.
Developing applications and games in Unity engine - Matej Jariabka, Rudolf Ka...gamifi.cc
gamifi.cc team - Rudolf & Matej presented on local tech/mobile/games conference experience with Unity & game development in general.
We also list some other tools that might help you. First part covers business tips & reasons to use Unity.
Chapter 03 of the lecture Style & Design Principles taught at SAE Institute Hamburg.
Drawbacks of inheritance-based game models and introduction to aggregation-based game models.
The design and rules of games constantly change during development, invalidating your carefully engineered software from day to day. Entity systems are a great approach for getting rid of the many drawbacks of inheritance-based game models like the “diamond of death”, moving on to a much more flexible aggregation-based model which has been popular since Gas Powered Games’ Dungeon Siege.
Game Programming 07 - Procedural Content GenerationNick Pruehs
Chapter 7 of the lecture Game Programming taught at HAW Hamburg.
Introduction to procedural content generation and its implication for the game design.
When developing games, each and every one of us should strive for perfection. At my desk, I have put up a sign saying “What would Blizzard do?” This talk is about motivation, excitement and learning how to dissect other games in order to learn from each other.
Developing applications and games in Unity engine - Matej Jariabka, Rudolf Ka...gamifi.cc
gamifi.cc team - Rudolf & Matej presented on local tech/mobile/games conference experience with Unity & game development in general.
We also list some other tools that might help you. First part covers business tips & reasons to use Unity.
Chapter 03 of the lecture Style & Design Principles taught at SAE Institute Hamburg.
Drawbacks of inheritance-based game models and introduction to aggregation-based game models.
The design and rules of games constantly change during development, invalidating your carefully engineered software from day to day. Entity systems are a great approach for getting rid of the many drawbacks of inheritance-based game models like the “diamond of death”, moving on to a much more flexible aggregation-based model which has been popular since Gas Powered Games’ Dungeon Siege.
Game Programming 07 - Procedural Content GenerationNick Pruehs
Chapter 7 of the lecture Game Programming taught at HAW Hamburg.
Introduction to procedural content generation and its implication for the game design.
Entity-Component-System (ECS) is a distributed and compositional architectural design pattern that is mostly used in game development. Elixir is a dynamic, functional language built on top of the Erlang VM designed for building scalable and maintainable applications. In this talk, discover how we can use both ECS and Elixir in a novel approach to structure our programs beyond the traditional OO/inheritance paradigm.
An introductory presentation about the Unity game engine given at GarageGeeks HQ in 2012, meant to bring programmers who have no game development experience up to speed with Unity
Unreal Engine Basics 01 - Game FrameworkNick Pruehs
First chapter of the lecture Unreal Engine Basics taught at SAE Institute Hamburg.
- Getting familiar with Unreal Engine as a technology, framework and toolset
- Learning the basics about writing Unreal Engine C++ code
Choosing A Game Engine - More Than Frames Per SecondNoam Gat
Suggesting a few questions that teams should ask themselves when facing the question of choosing a game engine.
Talk given at the GameIS 2014 conference
Why does co-editing Unity scene files always cause conflicts? How do we solve this? We take an in-depth look into the file format and toolchain to find a solution.
Introduction to Unity game engine and platform.
Authors:
* Vaclav Vancura (@vancura)
* Michal Hotovec (@mhotovec)
Presented on 1st Indie Games Czech meetup in Prague on October 18, 2011.
More info on the meetup on @indiegamescz.
Game Programming 04 - Style & Design PrinciplesNick Pruehs
Chapter 4 of the lecture Game Programming taught at HAW Hamburg.
Introduction to naming conventions, type and member design, exception design and common .NET interfaces.
Entity-Component-System (ECS) is a distributed and compositional architectural design pattern that is mostly used in game development. Elixir is a dynamic, functional language built on top of the Erlang VM designed for building scalable and maintainable applications. In this talk, discover how we can use both ECS and Elixir in a novel approach to structure our programs beyond the traditional OO/inheritance paradigm.
An introductory presentation about the Unity game engine given at GarageGeeks HQ in 2012, meant to bring programmers who have no game development experience up to speed with Unity
Unreal Engine Basics 01 - Game FrameworkNick Pruehs
First chapter of the lecture Unreal Engine Basics taught at SAE Institute Hamburg.
- Getting familiar with Unreal Engine as a technology, framework and toolset
- Learning the basics about writing Unreal Engine C++ code
Choosing A Game Engine - More Than Frames Per SecondNoam Gat
Suggesting a few questions that teams should ask themselves when facing the question of choosing a game engine.
Talk given at the GameIS 2014 conference
Why does co-editing Unity scene files always cause conflicts? How do we solve this? We take an in-depth look into the file format and toolchain to find a solution.
Introduction to Unity game engine and platform.
Authors:
* Vaclav Vancura (@vancura)
* Michal Hotovec (@mhotovec)
Presented on 1st Indie Games Czech meetup in Prague on October 18, 2011.
More info on the meetup on @indiegamescz.
Game Programming 04 - Style & Design PrinciplesNick Pruehs
Chapter 4 of the lecture Game Programming taught at HAW Hamburg.
Introduction to naming conventions, type and member design, exception design and common .NET interfaces.
Chapter 9 of the lecture Game Programming taught at HAW Hamburg.
Introduction to AI in games, existing approaches to AI architecture, behaviour trees and AI authoring tools.
Chapter 11 of the lecture Game Programming taught at HAW Hamburg.
Introduction to kinematics and dynamics, numerical integration, rigid bodies, collision detection and resolving.
Game Programming 05 - Development ToolsNick Pruehs
Chapter 5 of the lecture Game Programming taught at HAW Hamburg.
Introduction to continuous integration, API documentation generation, analytics, static code analysis and crash dump analysis.
Game Programming 06 - Automated TestingNick Pruehs
Chapter 6 of the lecture Game Programming taught at HAW Hamburg.
Introduction to unit testing, integration testing, mocking and test-driven development in games.
Entity System Architecture with Unity - Unite Europe 2015Simon Schmid
Entity System Architecture with Unity - Unite Europe 2015
Entitas - open source Entity Component System for C# and Unity: https://github.com/sschmid/Entitas-CSharp
Designing an actor model game architecture with PonyNick Pruehs
Introduction to Pony, actor model, reference capabilities and making concurrent DirectX games with Pony.
Presented at MVP Fusion #3.
http://mvpfusion.azurewebsites.net/
ECS architecture with Unity by example - Unite Europe 2016Simon Schmid
Simon Schmid (Wooga) and Maxim Zaks explain how the introduction of strict ECS architecture in Unity helped them to achieve easy to test, robust and scalable game logic. It also helped them to extract this logic and run it on a server. At Unite Europe 2015 they introduced their Open Source project Entitas-CSharp (https://github.com/sschmid/Entitas-CSharp), which helped them achieve all the benefits they listed before. This year they present an example which explains how ECS and Unity can co-exist and empower developers to have a clean, scalable and testable architecture. They cover the following topics: User Input, Integration with Unity Collision System, Reactive UI, Re-Playable games
Clean, fast and simple with Entitas and Unity - Unite Melbourne 2016Simon Schmid
Using a strict Entity Component System (ECS) architecture in Unity helped me to achieve easy to test, robust and scalable game logic. I want to show you how you can benefit from using Entitas in you game. Entitas is an open source ECS library which proofs how ECS and Unity can co-exist and empower developers to have a simple, flexible and clean architecture.
Software construction is an exercise in managing complexity, more so with the spiralling complexity required by modern games. Automated Testing is an industry proven methodology to deliver more reliable complex software, with a fighting chance to do it on time and on budget. And having fun doing so. Crytek is spearheading this idea in the game industry with its flagship title, and now sharing the experience with you: best practices, potential pitfalls, To-Do’s and No-No’s will be shown with real examples of unit testing game code using its proprietary testing framework and tools. Functional Testing and acceptance testing will also be touched on as a viable way of describing and checking game design requirements. And take automated testing to the next level.
Lightweight Multiplayer HTML5 Games with PubNubPubNub
Can a web browser be used as a platform for serious gaming? Here at PubNub, we intended to find out, and decided to experiment with an HTML5 game engine.
A split screen-viable UI event system - Unite Copenhagen 2019Unity Technologies
Learn about the implementation of a 2-player split-screen user interface (UI) in Battle Planet Judgement Day. In Unity, the Event System allows only one element to be currently selected, which can be a problem when designing split screen UI. In this session, you'll discover how this issue was addressed in Battle Planet Judgement Day, the ups and downs of the implementation, insights on pitfalls to avoid and best practices learned during the time of development. We hope this will help you learn how to implement your own solution.
Speaker: Kevin Hagen - Threaks
Session available here: https://youtu.be/aR5UXatawmE
Sixth chapter of the lecture Unreal Engine Basics taught at SAE Institute Hamburg.
- Understanding how to drive final character animation poses through animation blueprints and blend spaces
- Learning how to configure, combine and play sound assets
- Understanding the modular nature of particle effects in Unreal Engine
Unreal Engine Basics 05 - User InterfaceNick Pruehs
Fifth chapter of the lecture Unreal Engine Basics taught at SAE Institute Hamburg.
- Understanding the difference between Unreal’s UI frameworks Slate and UMG
- Learning how to create basic and complex user interfaces in UMG
- Learning how to build a simple main menu
Forth chapter of the lecture Unreal Engine Basics taught at SAE Institute Hamburg.
- Getting familiar with behavior trees in general
- Learning how to set up and use behavior trees in Unreal Engine
- Learning about the very basics of the Unreal Engine navigation system
Third chapter of the lecture Unreal Engine Basics taught at SAE Institute Hamburg.
- Learning how to expose class fields and functions to blueprints
- Writing basic Unreal gameplay code, such as spawning actors, accessing components and listening for events
- Getting familiar with gameplay concepts in the context of Unreal, such as damage and collision
Second chapter of the lecture Unreal Engine Basics taught at SAE Institute Hamburg.
- Getting familiar with the Unreal Level Editor
- Learning how to bind and handle player keyboard and mouse input
- Understanding character movement properties and functions
Tool Development 10 - MVVM, Tool ChainsNick Pruehs
Chapter 10 of the lecture Tool Development taught at SAE Institute Hamburg.
Introduction to the MVVM pattern and advanced data binding concepts such as data conversion and data validation.
Connector Corner: Automate dynamic content and events by pushing a buttonDianaGray10
Here is something new! In our next Connector Corner webinar, we will demonstrate how you can use a single workflow to:
Create a campaign using Mailchimp with merge tags/fields
Send an interactive Slack channel message (using buttons)
Have the message received by managers and peers along with a test email for review
But there’s more:
In a second workflow supporting the same use case, you’ll see:
Your campaign sent to target colleagues for approval
If the “Approve” button is clicked, a Jira/Zendesk ticket is created for the marketing design team
But—if the “Reject” button is pushed, colleagues will be alerted via Slack message
Join us to learn more about this new, human-in-the-loop capability, brought to you by Integration Service connectors.
And...
Speakers:
Akshay Agnihotri, Product Manager
Charlie Greenberg, Host
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Tobias Schneck
As AI technology is pushing into IT I was wondering myself, as an “infrastructure container kubernetes guy”, how get this fancy AI technology get managed from an infrastructure operational view? Is it possible to apply our lovely cloud native principals as well? What benefit’s both technologies could bring to each other?
Let me take this questions and provide you a short journey through existing deployment models and use cases for AI software. On practical examples, we discuss what cloud/on-premise strategy we may need for applying it to our own infrastructure to get it to work from an enterprise perspective. I want to give an overview about infrastructure requirements and technologies, what could be beneficial or limiting your AI use cases in an enterprise environment. An interactive Demo will give you some insides, what approaches I got already working for real.
UiPath Test Automation using UiPath Test Suite series, part 3DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 3. In this session, we will cover desktop automation along with UI automation.
Topics covered:
UI automation Introduction,
UI automation Sample
Desktop automation flow
Pradeep Chinnala, Senior Consultant Automation Developer @WonderBotz and UiPath MVP
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Jeffrey Haguewood
Sidekick Solutions uses Bonterra Impact Management (fka Social Solutions Apricot) and automation solutions to integrate data for business workflows.
We believe integration and automation are essential to user experience and the promise of efficient work through technology. Automation is the critical ingredient to realizing that full vision. We develop integration products and services for Bonterra Case Management software to support the deployment of automations for a variety of use cases.
This video focuses on the notifications, alerts, and approval requests using Slack for Bonterra Impact Management. The solutions covered in this webinar can also be deployed for Microsoft Teams.
Interested in deploying notification automations for Bonterra Impact Management? Contact us at sales@sidekicksolutionsllc.com to discuss next steps.
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
Are you looking to streamline your workflows and boost your projects’ efficiency? Do you find yourself searching for ways to add flexibility and control over your FME workflows? If so, you’re in the right place.
Join us for an insightful dive into the world of FME parameters, a critical element in optimizing workflow efficiency. This webinar marks the beginning of our three-part “Essentials of Automation” series. This first webinar is designed to equip you with the knowledge and skills to utilize parameters effectively: enhancing the flexibility, maintainability, and user control of your FME projects.
Here’s what you’ll gain:
- Essentials of FME Parameters: Understand the pivotal role of parameters, including Reader/Writer, Transformer, User, and FME Flow categories. Discover how they are the key to unlocking automation and optimization within your workflows.
- Practical Applications in FME Form: Delve into key user parameter types including choice, connections, and file URLs. Allow users to control how a workflow runs, making your workflows more reusable. Learn to import values and deliver the best user experience for your workflows while enhancing accuracy.
- Optimization Strategies in FME Flow: Explore the creation and strategic deployment of parameters in FME Flow, including the use of deployment and geometry parameters, to maximize workflow efficiency.
- Pro Tips for Success: Gain insights on parameterizing connections and leveraging new features like Conditional Visibility for clarity and simplicity.
We’ll wrap up with a glimpse into future webinars, followed by a Q&A session to address your specific questions surrounding this topic.
Don’t miss this opportunity to elevate your FME expertise and drive your projects to new heights of efficiency.
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
Accelerate your Kubernetes clusters with Varnish CachingThijs Feryn
A presentation about the usage and availability of Varnish on Kubernetes. This talk explores the capabilities of Varnish caching and shows how to use the Varnish Helm chart to deploy it to Kubernetes.
This presentation was delivered at K8SUG Singapore. See https://feryn.eu/presentations/accelerate-your-kubernetes-clusters-with-varnish-caching-k8sug-singapore-28-2024 for more details.
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Ramesh Iyer
In today's fast-changing business world, Companies that adapt and embrace new ideas often need help to keep up with the competition. However, fostering a culture of innovation takes much work. It takes vision, leadership and willingness to take risks in the right proportion. Sachin Dev Duggal, co-founder of Builder.ai, has perfected the art of this balance, creating a company culture where creativity and growth are nurtured at each stage.
Generating a custom Ruby SDK for your web service or Rails API using Smithyg2nightmarescribd
Have you ever wanted a Ruby client API to communicate with your web service? Smithy is a protocol-agnostic language for defining services and SDKs. Smithy Ruby is an implementation of Smithy that generates a Ruby SDK using a Smithy model. In this talk, we will explore Smithy and Smithy Ruby to learn how to generate custom feature-rich SDKs that can communicate with any web service, such as a Rails JSON API.
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
Keynote at DIGIT West Expo, Glasgow on 29 May 2024.
Cheryl Hung, ochery.com
Sr Director, Infrastructure Ecosystem, Arm.
The key trends across hardware, cloud and open-source; exploring how these areas are likely to mature and develop over the short and long-term, and then considering how organisations can position themselves to adapt and thrive.
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
2. About Me
“Best Bachelor“ Computer Science
Kiel University, 2009
Master Games
Hamburg University of Applied Sciences, 2011
Lead Programmer
Daedalic Entertainment, 2011-2012
Co-Founder
slash games, 2013
Microsoft MVP
2015
2 / 12
3. First Things First
• At npruehs.de/teaching you‘ll find all slides
• Ask your questions – any time!
• Contact me any time at dev@npruehs.de!
3 / 12
4. Objectives
• To understand the fundamentals of game lifecycles
• To learn how to build a small game with Unity3D
• To get an idea of how to learn from others
4 / 60
17. Game Loop
Update
Draw
17
Init Shutdown
During initialization, the game sets up everything to run properly, such
as preparing the graphics device, loading all assets, or opening a log file.
21. Our First Script!
Now that we’ve got our little space ship ready, it’s
time to add some action!
We want to do two things now:
1. Check if the player pressed a button.
2. Move the space ship if he or she did.
21 / 12
22. Our First Script!
22 / 12
In Unity, we can
attach scripts to
game objects.
Each script will
describe the behavior
of that particular
game object.
23. Our First Script!
C#
23
// Use the magic code Unity provides for us.
using UnityEngine;
using System.Collections;
// Name of the script.
public class KeyboardMovement : MonoBehaviour
{
// Use this for initialization.
void Start ()
{
// Nothing to do here, yay!
}
// Update is called once per frame.
void Update ()
{
// Check if player pressed any button.
if (Input.GetKey(KeyCode.W))
{
// Add "forward" vector to current position.
this.transform.localPosition += Vector3.forward;
}
}
}
24. Our First Script!
// Use the magic code Unity provides for us.
using UnityEngine;
using System.Collections;
Whew, that’s a lot of
stuff. Let’s take a detailed
look at that!
First, game engines like
Unity and frameworks
like .NET save us from
writing the same code
over and over again (e.g.
vector math, lists).
24 / 12
25. Our First Script!
// Name of the script.
public class KeyboardMovement:MonoBehaviour
{
…
}
Clearly, Unity needs to
know the name of our
script.
The other stuff (public,
class, MonoBehaviour,
that strange colon, …)
won’t be covered here.
Go to a dedicated
computer science class
for that ;)
25 / 12
26. Our First Script!
// Use this for initialization.
void Start ()
{
// Nothing to do here, yay!
}
26 / 12
Remember the
initialization we
sometimes need to do
before entering the game
loop?
Unity allows us to that
right here, right now!
27. Our First Script!
// Use this for initialization.
void Start ()
{
// Nothing to do here, yay!
}
Remember the
initialization we
sometimes need to do
before entering the game
loop?
Unity allows us to that
right here, right now!
(Thanks, Unity!)
27 / 12
28. Our First Script!
// Check if player pressed any button.
if (Input.GetKey(KeyCode.W))
{
…
}
Unity even intercepts
keyboard input for us.
All we need to do is
ask ;)
28 / 12
29. Our First Script!
// Add "forward" vector to current position.
this.transform.localPosition += Vector3.forward;
Unity stores
information relevant
for drawing the scene
with our camera in a
transform.
This includes the
position of an object,
its rotation, and its
scale.
29 / 12
30. Vector Math
Think of vectors as sets of coordinates in our
coordinate system:
𝑣 =
𝑥
𝑦
𝑧
30 / 12
31. Vector Math
Just as numbers, you can add vectors, resulting in a
new set of numbers:
𝑣1 + 𝑣2 =
𝑥1
𝑦1
𝑧1
+
𝑥2
𝑦2
𝑧2
=
𝑥1 + 𝑥2
𝑦1 + 𝑦2
𝑧1 + 𝑧2
31 / 12
32. Vector Math
Just as numbers, you can add vectors, resulting in a
new set of numbers:
𝑣1 + 𝑣2 =
1
2
3
+
4
5
6
=
5
7
9
32 / 12
33. Our First Script!
// Add "forward" vector to current position.
this.transform.localPosition += Vector3.forward;
We can access the
transform of the game
object the script is
attached to using the
this keyword.
Then, we can modify
its position by using
the += operator.
33 / 12
34. Our First Script!
Whew, that was fast!
Maybe we should improve our code here a bit.
1. Our spaceship should have its own speed value.
This will also allow us to have different ships with
different speed!
2. We should take the frame time of our game into
account. Otherwise, our spaceship would be
faster if our PC is faster – unfair!
34 / 12
35. Our First Script!
C#
35
// Use the magic code Unity provides for us.
using UnityEngine;
using System.Collections;
// Name of the script.
public class KeyboardMovement : MonoBehaviour
{
// Speed of this game object.
public float Speed;
// Use this for initialization.
void Start ()
{
// Nothing to do here, yay!
}
// Update is called once per frame.
void Update ()
{
// Check if player pressed any button.
if (Input.GetKey(KeyCode.W))
{
// Add "forward" vector to current position.
this.transform.localPosition += Vector3.forward * this.Speed * Time.deltaTime;
}
}
}
36. Our First Script!
// Speed of this game object.
public float Speed;
Here, speed is a
variable (like x in your
math class).
public means,
everybody can change
the speed value.
float means, speed
may be a fraction (like
1.4)
36 / 12
37. Our First Script!
37 / 12
Unity exposes public
variables in the
inspector we were
talking about earlier.
Change the speed
value and see what
happens!
38. A Nice Space Background
Lets pick up a nice space
image from the official
NASA website:
http://apod.nasa.gov/ap
od/ap120828.html
38
39. A Nice Space Background
Now, let’s change the
texture import settings of
our background:
Set Wrap Mode to Clamp.
39
40. A Nice Space Background
Next, we need to create a
material for the skybox to
use with our camera.
• Set the shader to
Skybox/6 Sided.
• Assign the texture to all
six slots.
40
41. A Nice Space Background
Finally, we can change
the scene lighting
settings to use our
brand-new skybox!
41
42. Let’s make a side-scroller!
Just change the
position and rotation
of your camera –
easy!
42 / 12
43. Let’s make a side-scroller!
You can also reduce
the field of view to
ensure the skybox
looks nice.
43 / 12
44. Adjusted Movement
C#
44
// Update is called once per frame.
void Update ()
{
// Check if player pressed any button.
if (Input.GetKey(KeyCode.W))
{
// Add “up" vector to current position.
this.transform.localPosition += Vector3.up * this.Speed * Time.deltaTime;
}
if (Input.GetKey(KeyCode.S))
{
// Add “down" vector to current position.
this.transform.localPosition += Vector3.down * this.Speed * Time.deltaTime;
}
if (Input.GetKey(KeyCode.A))
{
// Add “back" vector to current position.
this.transform.localPosition += Vector3.back * this.Speed * Time.deltaTime;
}
if (Input.GetKey(KeyCode.D))
{
// Add "forward" vector to current position.
this.transform.localPosition += Vector3.forward * this.Speed * Time.deltaTime;
}
}
45. Now for some real action!
We want our spaceship to fire its weapons!
For this, we need to:
1. Add a projectile to our project.
2. Create a projectile whenever the player presses a
button.
45 / 12
46. Unity Prefabs
46 / 12
Unity allows us to
create prefabs of our
game objects.
Think of prefabs as
“Schablonen” for new
game objects.
47. Our Second Script!
C#
47
// Use the magic code Unity provides for us.
using UnityEngine;
using System.Collections;
// Name of the script.
public class KeyboardFire : MonoBehaviour
{
// Prefab to use as projectile.
public GameObject ProjectilePrefab;
// Use this for initialization
void Start ()
{
// Still nothing to do, yay!
}
// Update is called once per frame
void Update ()
{
// Check if player pressed the SPACE button.
if (Input.GetKey(KeyCode.Space))
{
// Fire projectile!
Instantiate(this.ProjectilePrefab, this.transform.position, this.transform.rotation);
}
}
}
48. Boring projectiles are boring
C#
48
// Use the magic code Unity provides for us.
using UnityEngine;
using System.Collections;
// Name of the script.
public class AutomaticMovement : MonoBehaviour
{
// Speed of this game object.
public float Speed;
// Update is called once per frame
void Update ()
{
// Fly "forward" automatically.
this.transform.localPosition += Vector3.forward * this.Speed * Time.deltaTime;
}
}
49. Hint
Splitting up your code across
multiple components is always a
better idea than writing huge,
monolithic code files!
49 / 61
50. Game Objects
• objects in your game world can (or cannot)…
• be visible
• move around
• attack
• explode
• be targeted
• become selected
• follow a path
• common across all genres
50 / 57
52. There are probably hundreds of ways…
Then one day your designer says that they want a
new type of “alien” asteroid that acts just like a heat
seeking missile, except it’s still an asteroid.”
- Scott Bilas
52 / 57
54. Camera Movement
54 / 12
Right now, we can easily
leave the screen, if we want
to.
Let’s change that:
1. Reparent the camera
to our player ship.
2. Add the automatic
movement script to the
player ship.
55. Unity Hierarchy
55 / 12
If a game object in
Unity is a child of
another, its transform
is relative to the one
of its parent:
• Position
• Rotation
• Scale
56. Adding Enemies
Time to add our first enemies!
We need to …
1. Create a prefab for our enemy space ship.
2. Rotate enemies correctly.
3. Modify their movement.
56 / 12
57. Automated Movement
With Direction
C#
57
// Use the magic code Unity provides for us.
using UnityEngine;
using System.Collections;
// Name of the script.
public class AutomaticMovement : MonoBehaviour
{
// Velocity of this game object.
public Vector3 Velocity;
// Update is called once per frame
void Update ()
{
// Fly "forward" automatically.
this.transform.localPosition += this.Velocity * Time.deltaTime;
}
}
59. Taking Damage
Next, we want to keep track of the health value of
each ship. After all, we want to destroy our enemies,
don’t we?
We need to:
1. Write a script keeping track of spaceship health.
2. Check for collisions of projectiles with ships.
3. Reduce health when projectiles hit ships.
59 / 12
60. Spaceship Health
C#
60
// Use the magic code Unity provides for us.
using UnityEngine;
using System.Collections;
// Name of the script.
public class Health : MonoBehaviour
{
// Health of this game object.
public float CurrentHealth;
// Update is called once per frame
void Update ()
{
// Destroy when dead.
if (this.CurrentHealth <= 0)
{
Destroy (this.gameObject);
}
}
}
61. Hint
The if operator in C# allows us to
add conditions to our code.
It’s always a good idea not to
compare numbers for exact values
(<= instead of ==)
61 / 12
62. Handling Collisions
As you can imagine,
finding out whether
two objects collide can
include some terrible
math.
In Unity, colliders can
be used to approximate
the extents of a game
object for easier
collision detection.
62 / 12
64. Handling Collisions
If your collider moves
(just like our ships and
projectiles), we need to
add a rigidbody as well.
Make sure to disable
“Use Gravity”, or Unity
will make our
spaceships fall down.
64 / 12
65. Handling Collisions
Whenever two
objects collide, Unity
won’t allow them to
intersect each other.
Check “Is Trigger” to
allow these objects to
intersect!
65 / 12
66. Handling Collisions
C#
66
// Use the magic code Unity provides for us.
using UnityEngine;
using System.Collections;
// Name of the script.
public class DamageOnCollision : MonoBehaviour
{
// Damage this game object deals on collision.
public float Damage;
// OnCollisionEnter is called whenever we collide with somebody else.
void OnTriggerEnter(Collider other)
{
// Get the health component of the other object.
Health health = other.gameObject.GetComponent<Health> ();
if (health != null)
{
// Reduce health.
health.CurrentHealth -= this.Damage;
// Destroy this game object.
Destroy (this.gameObject);
}
}
}
67. Finishing Touches
67 / 12
Now, your job as
programmer is done
– time for the
designer in you!
Add enemies to the
level any play, play,
play!
68. Building The Game
68 / 12
Finally, we can build our
game, to show everyone
and share the fun
69. Where To Go From Here
As with every software
project, there’s always more
to do…
• Enemy Fire
• Enemy AI
• Menus
• Explosions
• Score
• Cheats
• More Enemies
• More Levels
69
94. There might even be cookies.
94 / 60
Source: UTWeap_LinkGun.uc (August UDK 2010)
/** Holds the list of link guns linked to this weapon */
var array<UTWeap_LinkGun> LinkedList; // I made a funny Hahahahah :)
95. Thank you for your attention!
Contact
Mail
dev@npruehs.de
Blog
http://www.npruehs.de
Twitter
@npruehs
Github
https://github.com/npruehs
95 / 60