Your SlideShare is downloading. ×
  • Like
Introduction to the Unreal Development Kit
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Now you can save presentations on your phone or tablet

Available for both IPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Introduction to the Unreal Development Kit

  • 303 views
Published

Introduction to the UDK from a programmer's perspective, featuring UnrealScript, navigation meshes, weapons system and networking.

Introduction to the UDK from a programmer's perspective, featuring UnrealScript, navigation meshes, weapons system and networking.

Published in Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
303
On SlideShare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
8
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Introduction to the Unreal Development Kit (UDK) Nick Prühs October 23, 2013
  • 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 2 / 58
  • 3. Features • complete editing environment • pure rendering power (Gemini) • state-of-the-art animation (Mantinee) • powerful scripting (Kismet) • real worlds physics • eye-popping lighting and shadows (Lightmass)
  • 4. Features (Cont.) • gorgeous cinematics (Mantinee) • terrain • built-in networking • real-time shaders • broad audio support • particle effects (Cascade)
  • 5. Features (Cont.) • artificial intelligence • distributed computing (Swarm) • descructible environments • Bink video codec • SpeedTree foliage editor • FaceFX facial animation • Scaleform 4.0 UI
  • 6. Platforms
  • 7. Platforms
  • 8. Platforms
  • 9. Integrated Partners
  • 10. Licensing • non-commercial use: • free! • commercial use: • USD 99 up-front • 0% royalty on first USD 50,000 in UDK related revenue • 25% royalty on UDK related revenue above USD 50,000
  • 11. Useful Stuff • UT Source Code • UDK Forums • Showcases • UDK Programming Home • UDK Gems • UnrealScript Language Reference
  • 12. Working With The UDK • UDK vs. Licensees • monthly releases • Feb 12: Recast • May 12: RealD 3D • Feb 13: Substance • Visual Studio 2010 & nFringe • UnrealEd & UnrealFrontend • Content Packages
  • 13. Unreal Engine Basics • Core • C++ • Rendering, Sound, GameLoop, Collision, Physics, Threading, Low Level Network • Virtual Machine • runs in core • executes UnrealScript
  • 14. Unreal Engine Basics (Cont.) • UnrealScript • similar to C++ and Java • high-level object-oriented language • pointerless environment with automatic garbage collection • simple single-inheritance class graph • strong compile-time type checking • safe client-side execution "sandbox"
  • 15. Class Hierarchy
  • 16. UnrealScript Features • instantiation • Actor.Spawn(class<Actor>) vs. new • timers • Actor.SetTimer(float, bool, name) • iterators • Actor.AllActors • Actor.DynamicActors • Actor.CollidingActors
  • 17. UnrealScript Features (Cont.) • states state Dead { ignores SeePlayer, HearNoise, KilledBy, NextWeapon, PrevWeapon; function bool IsDead() { return true; } // ... } Source: PlayerController.uc
  • 18. UnrealScript Features (Cont.) • exec functions .Bindings=(Name="MouseScrollDown",Command="GBA_NextWeapon") Source: DefaultInput.ini
  • 19. UnrealScript Features (Cont.) • exec functions .Bindings=(Name="MouseScrollDown",Command="GBA_NextWeapon") Source: DefaultInput.ini exec function NextWeapon() { if ( WorldInfo.Pauser!=None ) return; if ( Pawn.Weapon == None ) { SwitchToBestWeapon(); return; } if ( Pawn.InvManager != None ) Pawn.InvManager.NextWeapon(); } Source: PlayerController.uc
  • 20. UnrealScript Features (Cont.) • config files class HWPawn extends HWSelectable config(HostileWorldsUnitData) abstract; /** The value the damage of all attacks is reduces by before being applied. */ var config int Armor; /** The ground movement speed of this unit, in UU/s. */ var config int MovementSpeed; Source: HWPawn.uc
  • 21. UnrealScript Features (Cont.) • config files class HWPawn extends HWSelectable config(HostileWorldsUnitData) abstract; /** The value the damage of all attacks is reduces by before being applied. */ var config int Armor; /** The ground movement speed of this unit, in UU/s. */ var config int MovementSpeed; Source: HWPawn.uc [HostileWorlds.HWSM_Commander] Armor=0 MovementSpeed=160 Source: UDKHostileWorldsUnitData.ini
  • 22. UnrealScript Features (Cont.) • localization files class HWAbility extends Actor config(HostileWorldsAbilityData) abstract; /** The name of this ability. */ var localized string AbilityName; Source: HWAbility.uc
  • 23. UnrealScript Features (Cont.) • localization files class HWAbility extends Actor config(HostileWorldsAbilityData) abstract; /** The name of this ability. */ var localized string AbilityName; Source: HWAbility.uc [HWAb_Cloak] AbilityName=Cloak Source: HostileWorlds.int
  • 24. UnrealScript Features (Cont.) • meta data /** Enable or disable spawning. */ Var() bool bEnableSpawning; /** Set the rate at which AIs are spawned. */ Var() float RespawnsPerSecond<EditCondition=bEnableSpawning>; Source: http://udn.epicgames.com/Three/UnrealScriptMetadata.html
  • 25. Navigation Meshes • connected graph of convex polygons • at each node we know that an AI can get from any point in that node, to any other point in that node due to its convexity • thus the task of pathfinding through the graph simplifies into pathfinding along a connected graph of nodes • much more natural looking movement
  • 26. Navigation Meshes (Cont.) Source: http://udn.epicgames.com/Three/NavigationMeshReference.html
  • 27. Navigation Meshes (Cont.) Source: http://udn.epicgames.com/Three/NavigationMeshReference.html
  • 28. Navigation Meshes (Cont.) Source: http://udn.epicgames.com/Three/NavigationMeshReference.html
  • 29. Obstacle Meshes • represent obstacles in the world • allow low-fidelity raycasts (against this obstacle mesh only) when an AI needs to know whether it can walk from one point to another directly • allows us to skip doing a path search in wide open areas even if there are many polygons between the start and the goal
  • 30. Navigation Meshes DEMO
  • 31. Benefits of Navigation Meshes • can represent a large area with a single polygon • overall graph density goes down • memory footprint reduced • pathfinding time goes down • less time fixing up cross-level pathing information • better pathing behavior • automatic generation
  • 32. Benefits of Navigation Meshes (Cont.) • handling of dynamic objects Source: http://udn.epicgames.com/Three/NavigationMeshReference.html
  • 33. Benefits of Navigation Meshes (Cont.) • handling of dynamic objects Source: http://udn.epicgames.com/Three/NavigationMeshReference.html
  • 34. Weapons & Inventory /** Holds the list of link guns linked to this weapon */ var array<UTWeap_LinkGun> LinkedList; Source: UTWeap_LinkGun.uc // I made a funny Hahahahah :)
  • 35. Weapon Fire
  • 36. Weapon Fire (Cont.)
  • 37. Weapon Fire (Cont.)
  • 38. Weapon Fire (Cont.)
  • 39. Weapon Fire (Cont.)
  • 40. Weapon Fire (Cont.)
  • 41. Weapon Fire (Cont.)
  • 42. Weapon Fire (Cont.)
  • 43. Weapon Fire (Cont.)
  • 44. Weapon Fire (Cont.)
  • 45. Weapon Fire (Cont.)
  • 46. Weapon Fire (Cont.)
  • 47. Network “Unreal views the general problem of coordinating a reasonable approximation of a shared reality between the server and clients as a problem of replication. That is, a problem of determining a set of data and commands that flow between the client and server in order to achieve that approximate shared reality.“ - Tim Sweeney, Epic Games Inc.
  • 48. Network • generalized client-server model • authoritative server (dedicated, listen) • predicting and simulating clients • “hybrid” code • client and server execute same code on approximately the same data • minimizes traffic
  • 49. Network (Cont.) • generalized client-server model • decoupling of network and game logic facilitates extensibility • network code can coordinate any game which can be described by the language • network is controlled on language level through keywords & variables • low level network (serialization, reliable UDP) done by core
  • 50. Network - Basic Terminology • Actor • object that can move and interact with other actors • Level • object which contains a set of actors • Game State • the complete set of all actors that exist in a level • the current values of all actor variables
  • 51. Network – Update Loop 1. if (server) Send(Gamestate) to all clients 2. if (client) Send(RequestedMovement) to server Receive(Gamestate) from server Render(ApproximateWorldView) to screen 3. if (server || client) Tick(DeltaTime) to update Gamestate Update(Actors) Execute(Physics) Receive(GameEvents) Execute(ScriptCode)
  • 52. Actor Roles • describes how much control the machine (server or client) has over an actor • controls the actors function call permissions // Net variables. enum ENetRole { ROLE_None, ROLE_SimulatedProxy, ROLE_AutonomousProxy, ROLE_Authority, }; // // // // No role at all. Locally simulated proxy of this actor. Locally autonomous proxy of this actor. Authoritative control over the actor. var ENetRole RemoteRole, Role; Source: Actor.uc.
  • 53. Bandwidth Optimization: Actor Relevancy • eight prioritized rules: • • • • not relevant, if (RemoteRole == none) determined by the relevancy of its base, if any relevant if (bAlwaysRelevant) only potentially relevant to the client who owns that Actor if (bOnlyRelevantToOwner)
  • 54. Bandwidth Optimization: Actor Relevancy • eight prioritized rules: • relevant if (Owner==Player) • not relevant if • (bHidden) && • (!bBlockPlayers) && • (AmbientSound == none) • relevant if visible according to a line-of-sight check between the actor's Location and the player's Location • relevant, if was visible less than 2 to 10 seconds ago
  • 55. Bandwidth Optimization: Prioritization • Actor::NetPriority • regulates share of the bandwidth based on how important the Actor is to gameplay • always relative to all other Actors’ NetPriority
  • 56. Replication • Actor replication • only Location, Rotation valid on spawn • variable replication • • • • regulated by condition in Class Replication Statement server to client only always reliable subject to bandwidth optimization • repnotify keyword replication { // replicate if server if (Role == ROLE_Authority && (bNetInitial || bNetDirty)) Armor, Range, AttackDamage; } Source: HWPawn.uc.
  • 57. Where‘s Waldo? simulated event ReplicatedEvent(name VarName) { if (VarName == 'TeamIndex') { ChangeColor(TeamIndex); } } Source: HWSelectable.uc, before January 11, 2011.
  • 58. Where‘s Waldo? simulated event ReplicatedEvent(name VarName) { if (VarName == 'TeamIndex') { ChangeColor(TeamIndex); } else { super.ReplicatedEvent(VarName); } } Source: HWSelectable.uc.
  • 59. Gotcha! Never forget super calls when overloading engine class functions! 60 / 58
  • 60. Replication • function call replication • keywords: • server, client • reliable, unreliable • server -> client: only to client who owns that Actor • client -> server: only on owned Actor • immediately sent, disregarding bandwidth reliable server function ServerIssueAbilityOrder(HWAIController C, HWAbility Ability, HWSelectable Target) Source: HWPlayerController.uc.
  • 61. Go ahead, … … make something Unreal!
  • 62. References • Epic Games. UDK Unreal Developer’s Kit. http://www.unrealengine.com/udk/, October 2013. • Epic Games. UDN Technical Home. http://udn.epicgames.com/Three/TechnicalHome.html, October 2013. • Epic Games. UDN UnrealScript Language Reference. http://udn.epicgames.com/Three/UnrealScriptReference.html, October 2013. • Epic Games. UDN AI & Navigation. http://udn.epicgames.com/Three/ReplicationHome.html, October 2013. • Epic Games. UDN Networking & Replication. http://udn.epicgames.com/Three/ReplicationHome.html, October 2013. • Epic Games. Epic Games Community Forum. http://forums.epicgames.com/forums/366-UDK, October 2013. 63 / 58
  • 63. Thank you for your attention! Contact Mail dev@npruehs.de Blog http://www.npruehs.de Twitter @npruehs Github https://github.com/npruehs 64 / 58