Important UDK Classes How they fit together Copyright © 2015 – Curt Hill.

Slides:



Advertisements
Similar presentations
Chapter 11 Introduction to Programming in C
Advertisements

Objects and Classes First Programming Concepts. 14/10/2004Lecture 1a: Introduction 2 Fundamental Concepts object class method parameter data type.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved L05 (Chapter 16) Applets.
Wizard Game: Class-Level Variables in Alice By Jenna Hayes Under the direction of Professor Susan Rodger Duke University, July
Alternate Version of STARTING OUT WITH C++ 4 th Edition Chapter 1 Introduction to Computers and Programming.
Game Design Creating a game called PING Phase 3: Steps for building basic game.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley This week: Whew!!! The last homework was tough! The homework for this week.
Methods Chapter 6. 2 Program Modules in Java What we call "functions" in C++ are called "methods" in Java Purpose Reuse code Modularize the program This.
Sega 500 Making a Flamethrower Jeff “Ezeikeil” Giles
Copyright © 2015 Curt Hill Building a Simple Level Adding Some Standard Actors.
Color and Appearance Presented by the Three Engineers (and friend)
Copyright © 2015 – Curt Hill Minecraft Blocks Properties and Methods.
Sega 500 Close Combat weapons Jeff “Ezeikeil” Giles
Copyright © Curt Hill Sounds, Resource Packs, JSON What more would you want?
Copyright © Curt Hill Java Looking at our first console application in Eclipse.
Method Overriding Remember inheritance: when a child class inherits methods, variables, etc from a parent class. Example: public class Dictionary extends.
Copyright © 2015 Curt Hill Models and Textures Making your entity interesting.
Copyright © 2015 Curt Hill Typing Your Commands Console, Command Line and Movies.
Chapter 4 -2 part Writing Classes 5 TH EDITION Lewis & Loftus java Software Solutions Foundations of Program Design © 2007 Pearson Addison-Wesley. All.
Chapter 4 Introduction to Classes, Objects, Methods and strings
Games Development Game Architecture: Entities CO2301 Games Development 1 Week 22.
Copyright Curt Hill Variables What are they? Why do we need them?
Copyright © Curt Hill More Components Varying the input of Dev-C++ Windows Programs.
Sega 500 Creating a New Game Jeff “Ezeikeil” Giles
Particle Systems Using and Creating Copyright © 2015 Curt Hill.
Copyright © 2015 Curt Hill Java for Minecraft Those things you should know.
Copyright © – Curt Hill Types What they do.
Visual Basic for Application - Microsoft Access 2003 Programming applications using Objects.
Copyright Curt Hill The C/C++ switch Statement A multi-path decision statement.
M1G Introduction to Programming 2 5. Completing the program.
Copyright 2003 Scott/Jones Publishing Standard Version of Starting Out with C++, 4th Edition Chapter 1 Introduction to Computers and Programming.
Copyright Curt Hill Arrays in C/C++ What? Why? How?
Copyright © Curt Hill Formatting Reals Outputs other than normal.
Week101 APCS-AB: Java Miscellaneous Topics: Snippets we missed in Chapters 1-6 of book November 11, 2005.
Copyright © Curt Hill Applets A different type of program.
Parser Generation Using SLK and Flex++ Copyright © 2015 Curt Hill.
Speed Tree Let’s Make a Forest Copyright © 2015 – Curt Hill.
Copyright © 2015 Curt Hill UDK Animation with Kismet and Matinee Visual Scripting.
Sega 500 Combo Mutator Jeff “Ezeikeil” Giles
Copyright © 2015 Curt Hill Building a Simple Level No UnrealScript but several editors.
Copyright © 2009 – Curt Hill Standard Template Library An Introduction.
Scanner Generation Using SLK and Flex++ Followed by a Demo Copyright © 2015 Curt Hill.
Classes, Interfaces and Packages
Network Replication Possibly the ugliest thing to learn this semester Many different states Simulated Functions Is it an Event or function? Roles.
Methods Chapter 6. 2 Program Modules in Java What we call "functions" in C++ are called "___________________" in Java Purpose –Reuse code –Modularize.
UnrealScript An Introduction Copyright © 2015 Curt Hill.
Copyright © Curt Hill Meshes A Little More to Know.
Lecturer: Nguyen Thi Hien Software Engineering Department Home page: hienngong.wordpress.com Chapter 2: Language C++
Copyright © – Curt Hill Building Windows Applications in wxDev-C++
Copyright © 2014 Curt Hill Algorithms From the Mathematical Perspective.
Copyright © Curt Hill Simple I/O Input and Output using the System and Scanner Objects.
Copyright © Curt Hill Common Dialogs Easily Obtaining File Names in DevC++ Windows Programs.
Batch Files More flow of control Copyright © by Curt Hill.
Building a Simple Level Adding Lighting Copyright © 2015 Curt Hill.
A Review or Brief Introduction
Methods Chapter 6.
Console and GUI Programs
Using SLK and Flex++ Followed by a Demo
Section 11.1 Class Variables and Methods
Organizing common actions
Predefined Dialog Boxes
Concepts From Alice Switching to Java Copyright © Curt Hill.
Editable Attributes (1)
Arrays in Java What, why and how Copyright Curt Hill.
The Java switch Statement
Outline Anatomy of a Class Encapsulation Anatomy of a Method
Classes, Objects and Methods
Java Looking at our first console application in Eclipse
SPL – PS1 Introduction to C++.
Presentation transcript:

Important UDK Classes How they fit together Copyright © 2015 – Curt Hill

Introduction We have created a level We have seen an introduction to UnrealScript We should have also set several.ini files We should have also created several UnrealScript classes descended from: –GameInfo –Pawn –Controller

Classes There are several classes that are vital to your play These include: –WorldInfo –GameInfo –Actor –Pawn –Controller –Camera Understanding how these interrelate is crucial Copyright © 2015 – Curt Hill

WorldInfo This is the master class for the engine –We will use this to find out or change the world in our programs Source is in: …\Development\Src\Engine\Classes It has instance variables that control: –Lighting, physics, sounds among others Copyright © 2015 – Curt Hill

Functions GetWorldInfo will return a WorldInfo object Several iterators: –AllControllers –AllPawns Several events –PostBeginPlay –PreBeginPlay It is unlikely but possible we will make a descendant of WorldInfo Copyright © 2015 – Curt Hill

WorldInfo and GameInfo One of the most important objects of WorldInfo is GameInfo The instance variable of type GameInfo is named Game –Since UnrealScript is polymorphic it may be any descendant of GameInfo This is actually set in the Editor –Among other possible places Copyright © 2015 – Curt Hill

Menu The descendent of GameInfo that is actually part of the WorldInfo is set from the editor –Use the View and World menu This is connected to an individual level The Game Type is the set of values which are known descendants –A drop down It is also dependent on the ancestry of the GameInfo item you choose Copyright © 2015 – Curt Hill

View/World Copyright © 2015 – Curt Hill

GameInfo Determines the rules and characteristics of this game This will determine several things in the game –Presence or absence of the pawn –First or third person camera –Heads Up Display Next are four displays with different GameInfos Copyright © 2015 – Curt Hill

GameInfo Copyright © 2015 – Curt Hill

CloudGame Copyright © 2015 – Curt Hill

UTTeamGame Copyright © 2015 – Curt Hill

UTDeathMatch Copyright © 2015 – Curt Hill

GameInfo Descendents There are many, some of which also have descendants –PlayerCollectorGame –MobileMenuGame –FrameWorkGame SimpleGame –UDKGame UTGame UTDeathMatch The one you choose to derive has an effect on your game We will make our own as well Copyright © 2015 – Curt Hill

More on GameInfo There will only be one GameInfo (or descendant) instance Chosen before the level starts and persists for the rest of gameplay for that level –If the level is terminated and a new level entered a different GameInfo is used This class does delegate some of its duties to other classes Copyright © 2015 – Curt Hill

Continuing GameInfo also selects the player classes It specifies the default pawn, camera and controller class In this and other ways it is the central class for determining what game play will be like Copyright © 2015 – Curt Hill

Actors Recall that an actor is anything with a representation in the level This includes –Static meshes –Lights –Sounds –Pawns Copyright © 2015 – Curt Hill

Actor Events Destroyed() Falling () RanInto (Actor Other) –Actor ran into another actor TakeDamage and Tick will be considered later Copyright © 2015 – Curt Hill

More Events Bump (Actor Other, PrimitiveComponent OtherComp, Object.Vector HitNormal) –Somebody bumped me HitWall ( Object.Vector HitNormal, Actor Wall, PrimitiveComponent WallComp) Copyright © 2015 – Curt Hill

TakeDamage When a pawn or actor is damaged this event is called It may be used to modify the damage –Such as when armor is present It may also be called to inflict damage Copyright © 2015 – Curt Hill

TakeDamage Signature: event TakeDamage ( int Damage, Controller InstigatedBy, Object.Vector HitLocation, Object.Vector Momentum, class DamageType, optional Actor.TraceHitInfo HitInfo, optional Actor DamageCauser) Copyright © 2015 – Curt Hill

Tick(float delta) An event in any actor Parameter is time since last call Called so many times per second Allows animation and AI Usually want this to be quick if the actor is not active –Like: if(somebool) return Copyright © 2015 – Curt Hill

Actor Methods Destroy() –Makes it die Move (Vector) –Moves in this direction –Usually invoked in Tick so motion may be dependent on timing TakeRadiusDamage –Wrapper for TakeDamage Copyright © 2015 – Curt Hill

The Player Any player uses a set of several classes to function These are: –Controller –Pawn –Camera We now consider these Copyright © 2015 – Curt Hill

Pawn Controls the presence of the player in the level A player does not need a pawn, but if they lack one they can move around but not be seen Pawn is a derivation of Actor URL: K%29 Copyright © 2015 – Curt Hill

Pawn Properties Float Alertness in the range -1 to 1 bool bLOSHearing bool bMuffledHearing bool bCanCrouch Controller SkeletalMeshComponent Mesh Weapon Copyright © 2015 – Curt Hill

Pawn Events BreathTimer() OutsideWorldBounds() –Max is uu PostBeginPlay() PreBeginPlay() SetWalking(bool iswalking) Copyright © 2015 – Curt Hill

Controller The interface between the person and the pawn class Interprets the keyboard commands and passes on to the pawn Say method takes a string and displays it to the pawn Copyright © 2015 – Curt Hill

Controller Events HearNoise IsInCombat Destroyed SeeMonstrer(Pawn) SeePlayer(Pawn) We will look at some of these in the animation presentation Copyright © 2015 – Curt Hill

Camera Generates the display that the player sees A first person display has the camera aligned with the player’s location and orientation In third person it usually follows the person around For dramatic effect it may leave the player and follow the action somewhere else Copyright © 2015 – Curt Hill

Startup When the game starts WorldInfo is initialized The first piece of code that you might get to see is the GameInfo init() method There are also the Post and Pre Begins of the various actors Copyright © 2015 – Curt Hill

Logging The debugging process is somewhat hard One of the tricks we use is logging Every time the editor (which is an extension of the game) starts it keeps a log It closes that log when done This log is UDKGame\Logs and is Launch.log In this we may write messages Copyright © 2015 – Curt Hill

Log Macro The command is a macro Part of the preprocessor The simplest form is just to take a string –Make the string say all that you need Example: `log(“*** Damage ”$DamageAmount); Copyright © 2015 – Curt Hill

Finally We have the fundamentals for putting actors into motion and making them active agents We now need an example to see it all come together Copyright © 2015 – Curt Hill