Actors in Unreal

Transform

Location, Rotation, and Scale

Location

X, Y, and Z

In Unreal Engine, location is always given as follows:

  • The location is stored in a Vector3, which is a class made of three floats named X, Y, and Z.
  • All units are in centimeters.
    • You do not have to use centimeters, but it is preferred that you do so that standard assets are the correct size.
  • The XY plane is the plane that the characters and objects stand on. 
    • This means that up is not the Y value, but Z.
    • If you are using 2D, the game will be on the XZ plane.

Location

World vs Relative

Let's assume we have a world in which UCR's Belltower is the center.

  • If we wanted to give the coordinates of WCH 135, we would have to calculate the distance in all 3 dimensions from the Belltower. This would be somewhere around the position (1000, 500, -5), all in meters.
  • But we can also give define the position of the room using relative, or local, coordinates.
    • We can pick a point in WCH that is well known, like Bytes, and give measurements from there.
    • From Bytes, WCH 135 is positioned at (10, 5, 0) meters.

Rotation

Rotators and Quaternions

  • A rotator (FRotator) holds the rotation of the object in degrees clockwise around the X, Y, and Z axes. 
  • The rotator class also has 3 public floats for these rotations (X, Y, and Z).
  • This rotator then gets converted into a quaternion, which is a rotation type that allows for fluid rotations
  • Quaternions (FQuat) are a 4 dimensional (W,X,Y,Z)
    • Unless you are a math major with a concentration in Applied Mathematics, avoid changing a quaternion's WXYZ values.

Rotation

World vs Relative

Just like position, rotations can be relative as well.

  • These rotations work similar to a planetary model. If we want to rotate the moon around the Earth, we first have to make the Earth rotate around the Sun, and then make the moon rotate around the Earth.
    • Both of these rotations would be relative to their parent (the Sun would be the parent of the Earth, and the Earth would be the parent to the Moon.

Scale

Scale works the same way as position and rotation, and again has values for the scale in the X, Y, and Z directions

 

Scale also works relatively (multiplicative). If an object's relative scale is (2, 1, 3), and it's parent's scale is (3, 4, 5), then the resulting scale is (6, 4, 15).

 

This can be incredibly helpful if you want to shrink or expand an entire object and it's children.

Movement Types

Lerp and the Motion Equations

How We Move

Movement in video games nearly always happens over time. When we want a player to walk forward, a unit to move to a target location, or a card to be played onto a board, we don't want them to reach their destination instantaneously. 

 

Instead, for every frame we move the object by a small amount until it reaches it's destination. We can achieve this by updating the object's position value stored in it's transform using SetWorldLocation, SetRelativeLocation, AddWorldOffset or AddRelativeLocation.

 

//(Event Tick & Delta Time)

Lerp (Linear IntERPolation)

Sounds fancy and complicated, but it's really simple.

  • Every Lerp has 3 values: Origin (A), Destination (B), and Alpha
    • The first two are simple enough, where the object comes from and where it stops at.
    • The second one is the objects progress, a value from      0 to 1 to tell us how close we are to the destination
      • A value of 0 means we are still at the start position,
      • A value of 1 means we have reached the destination,
      • A value of 0.5 means we are halfway there, 
      • .75 is 3/4ths the way to the destination, and so on.

Lerp: How

All three values of the lerp are often stored as private variables in the blueprint/class that is being moved.

  • Every frame we can increase the alpha value so it will be closer to 1.
    • If we want to have the object take X amount of seconds, we can divide the current amount of time by the total time it should take.
      • For instance, if we want the object to reach the destination in 5 seconds and 2 seconds have already passed since the object started moving, the alpha value would be 2/5 or 0.4.

Lerp: Outside of Movement

Lerp can also be used outside of movement. Color, rotation, and scale can also utilize the lerp function.

 

Lerp can also smooth a change in direction, or act as friction.

  • Instead of using time for our alpha value, we can set alpha to a constant smoothness value. 
    • Our Origin (A) would be our previous value, and our Destination (B) would be the value we want to move smoothly transition to.
    • Good values for smoothness are somewhere between .0625 and .25. Anything below will be a really slow transition, and above .25 will be really fast.

Lerp: When to Use

Besides transitions, there are plenty of places where a lerp is much more efficient and looks great in comparison to physics based movement.

 

Lerp works really well on UI elements and animations. If something takes a certain amount of time no matter how far from the destination you are, you'll want to use a lerp.

Motion Equations

Movement can also be Physics based, utilizing the Position, Velocity, and Acceleration model. This is often referred to as the Kinematic or Motion Equations.

 

By default, all Actors have a physics actor component attached. If you are using these physics calls make sure it is enabled.

 

We can modify these using AddLinearVelocity, SetLinearVelocity, AddImpulse, and AddForce.

We can modify location with the same functions mentioned previously.

Motion Model: How it Works

The physics engine automatically calculates the following equations before every frame:

 

  1. acceleration = sumOfForces / massOfActor + gravityConstant;
  2. location += velocity * deltaTime + 1/2 * accel * deltaTime^2;
  3. velocity += acceleration * deltaTime;

 

 

Motion Model: Ways to Use

Projectiles: Bullets, Arrows, Laser Beams

  • There are three values you will want to set, and then never touch the projectile after that:
    • Initial Position, Affected by Gravity (bool), and initial Speed.

Unpushable Objects

If you have an object that should not move unless the player gives input, or you say so, set the "isKinematic" value to true.

  • This will still allow you to move the object by using acceleration and velocity, and prevent the object from being pushed.
    • A pong paddle is an example of a Kinematic object.

Programs

//TODO: Add the flyers into the slides

Instead of the current images. They look prettier

Cyber Security Committee 

A committee for participating in cyber security competitions.

Bradly Evans will be leading the practices and the committee!

Join the facebook page: /groups/ucrcyber/

or email Bradley at: bevan006@ucr.edu

Joint committee with IEEE

Algorithm Practices

If you want help for your classes, interview questions, or just for fun :D

Led by Michelle Wang

Tuesdays 5:00 - 6:00 pm

WCH 202

Mock Interviews

If you want some practices with Technical Interviews

Set up an appointment with Faiz for a Mock Interview!

 

Sign up here:

Led by Faiz Mirza

By appointments

UE4 Career Pathway

 

Learn game development in Unreal Engine 4

  • Learn visual programming via Blueprints
  • Learn to create shaders and materials using Physically Based Rendering, the latest standard in 3D graphics
  • Create your very own game alone or with a team
  • Syllabus can be found here.

Led by Mark De Ruyter

Mondays 4:00 - 5:00pm WCH 135

NAO Robots

 

 

  • Work together in a group to program functionality into the robot.
  • The robot has a ton of sensors:
    • Touch sensitivity on hands, head & fingers
    • 2 microphones
    • infrared sensors (for kinect-like sensing)
  • Full actuators on nearly all limbs!

 

Joint program with IEEE

Led by Kash and Michael

Wednesdays 5:00 - 6:00pm WCH 202            

Hack Nights

Collaborate and work on projects including:

Android/IOS, Web, Games, OS, etc...

Friday 5-7pm in WCH 127

We have prizes!

Check out our trophy and become engraved in ACM history

Judging for last quarter's winner this Friday (Tomorrow!)

 

StarCraft Broodwar AI

Interested in designing AI? Learn through programming an AI for StarCraft!

  • Program multiple AI's for different strategies and have them compete

 Led by Kyle and Ben

Fridays 5:00 - 6:00pm WCH 135

ACM Mentorship Program

Mentors and mentees!

Check your emails and the Facebook page for more information!

How to Start a Project

Have you guys ever wanted to start an app, video game, or some other project but didn't know how to start?

 

Then this is for you!

Will be talking about how to break down projects into manageable chunks to make it easier to manage

Led by Ben Quach

Thursday Jan. 28th 4:00 - 5:00pm

WCH 202

Distinguished Guest Speaker

So You Think You Can Search? How People Search & Some REALLY Advanced Google Search Tips for Engineers

 

 

//TODO: More Info

Led by Berkeley Professor Daniel Russel

Monday February 8th 5-6pm in Bournes A265

T-shirt Design!

Winner gets the shirt for free!

DEADLINE: February 12th!

We have started our T-Shirt design competition! Submit your designs to acm.at.ucr@gmail.com along with your name.

 

Specifications:

  • Have "ACM at UCR" or "ACM@UCR" on the shirt
  • Use at most 2 colors. 

You can use the these assets here if you would like to.

ACM Clubroom 

Stop by WCH 226 and say hi!

 

We even have rent-able lockers to keep your things safe!

  • $20 if you need a lock, $15 if you provide your own
  • Must provide name, contact info, and lock combination
  • Rental good for entire quarter
  • ACM Fridge!
    • $0.50 per can of soda or bottle of water
    • donation based!

aka: The Leviathon

Become a Member of ACM

Pay $20 to Kash, giving him your ID and shirt size

We also have an online payment option via our website,

http://acm.cs.ucr.edu/membership.html

  • Discounted ticket prices
  • Priority workshop enrollment
  • Ability to participate in giveaways
  • Access to "member's only" hardware (Oculus Rift, Google Cardboards, Arduinos and more!)
  • Free t-shirt!

Graduation Stoles

//TODO: FILL THIS OUT TOO

Open Officer Meetings

Fridays 3:00 - 4:00pm

Want to be involved with ACM on an administrative level? Interested in becoming an officer for next year? 

 

Speak with or email an ACM officer to be their +1 at our officer meetings. Here we discuss how events are going, what we need to improve on, and what we need to do to get events ready for the future.

Elections!

Fourth General Meeting Feb. 18th 2016

 

We know it's early, but this quarter we are going to be having elections for next years' board.

 

For those of you who have enjoyed the events and programs that ACM has offered, consider joining the board to make next year even better!

T-Shirt Giveaway Question!

//TODO: Question goes here

Questions?

ICE BREAKER!

Made with Slides.com