ZombieSoup is an action top-down shooter following the fate of a kid to shoot, loot and dodge tool his way to save a girl from the danger of zombies, monsters, robot and evil genius. You are Ricky, a college kid on backpack seeking his own adventures out in the country. On an ordinary night Ricky woke up on a long journey to a small town. Soon he discovered that the town has been infested by zombies and monsters. Rogue-like top-down shooter Weapons, both melee and ranged Human & Zombie form Secret paths, levels, loots & unlockables Over 50+ challenging levels Story Mode Survival Mode 80’s Aesthetic

  • View media
  • View media
  • View media
  • View media
  • View media
  • View media
Post article RSS Articles

ZombieSoup - Tutorial #01 (Unreal Engine)

Client Side Coding Tutorial

Introduction

As per in the developed game ZombieSoup, it is supposed to be a top down third-person view angle but due to design constraint, it has a twist is that the floor plane is not normal to the camera angle, which means it's not a 90' degree straight view like an usual 2D game does. The problem adds on that perspective view is used instead of orthographic that causes distortions in space that results in the distance like feeling. In ZombieSoup, the camera angle used has a 10' degree offset from the usual normal line from the floor plane. Diagram 1 below shows a sketch of the current scenario. For cursor world location, we used visibility hit result under the cursor which gives us the result of whatever the cursor is pointing in the world space.

Intended View


Problem Statement

On ideal situation, where the character's actor location has the same Z (height) level as the cursor's world location, using the old method to calculate the Z rotation of the player character will not be a problem. However, the problem comes in when there is a height difference. Since we only wants the Z rotation the old calculation will ignore the Z difference. Shown in Diagram 2, you can see what happened to the player's actor location when u transform its Z to the same height as the mouse Z value. As you can see from the spawned particle location based on the player's location and the cursor location, there is an error caused by the non-normal view as the Z height does not go along with the camera's view. However, if you draw a between the two explosion smoke and between player's location and the projectile hit location, we can see that this two lines are perpendicular to each other.

Error


Analysis

From here we can see that the error is caused by the distorted perspective view and the non-normal camera angle. To attempt to fix this, we need to transpose the player's location in relative to the camera viewport as in, the "correct" Z axis movement. Diagram 3 shows an example scenario of what we need to do.

Formula


Solution

Based on Diagram 3, to perform the transpose, we need to find O value. According to the trigonometry formula, we would require 2 variable which are the angle and the A value. Angle can be obtained from the Camera Manager of the controller and the A value can be calculated by the difference between the cursor Z value and the player's location Z value. After performing the calculation, the transpose can be applied to the player's location to achieve as shown in Diagram 4.

Fixed


With this calculation performed, we can dynamically calculate where the player should point to regerdless of the height difference that might be available in the game. The only down side of this approach is that every mouse movement required to go through a formula calculation which may only take a very small amount of processing power that even a calculator can perform in split seconds.

Old Blueprint view

Old Blueprint

New Blueprint view

New Blueprint

By : Alex Chew Hoo Wing (@Aeonsparx)

Comments
LunarShuriken
LunarShuriken

Very interesting read, thank you!

Reply Good karma Bad karma+1 vote
Post a comment
Sign in or join with:

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.

Follow Profile
Icon
ZombieSoup
Platforms
Windows, Mac, Linux
Contact
Send Message
Release date
Game watch
Follow
Share
Style
Theme
Anime
Players
Single & Co-op
Project
Indie
Twitter

Latest tweets from @zombiesoupgame

#levelupplayone #levelupkl #levelupmy #levelupspacebar be a hero and save your girl friend from hordes of zombies!… T.co

Jun 10 2020

We have arrived to Prague, Czech Republic for Game Developer Session. We are showcasing our game here in the indie… T.co

Nov 29 2019

Happy to announce for our 3rd place win for PC Indie Pitch in G-Star 2019 Busan, Korea. #indiegame T.co

Nov 18 2019

These boys really made my day. What a display of incredible skill and coordinations. Can’t believe someone found a… T.co

Nov 16 2019

Just when we are about to close, a hardcore Korean gamer just refuse to quit beating the game before the contractor… T.co

Nov 16 2019

We have just won 3rd place in The PC Indie Pitch in Busan G-Star 2019. #bigindiepitch T.co

Nov 15 2019

We are ready for G-Star indie booth U22. Stop by and play our #indiegame #GSTAR2019 T.co

Nov 13 2019

We are honoured to have our game @zombiesoupgame nominated for 3 awards in #LEVELUPKL 2019 South East Asia Best Tec… T.co

Nov 13 2019

Feeling stoked that our game @zombiesoupgame has been nominated in 3 categories for Level Up KL SEA awards. Best Te… T.co

Nov 8 2019

#screenshotsaturday Beginning of the Henry's bar. Ricky is helping a lady in despair to clear the zombies out of th… T.co

Oct 27 2019

Embed Buttons
Link to ZombieSoup by selecting a button and using the embed code provided more...
ZombieSoup
Statistics
Last Update
Watchers
3 members
Articles
1
You may also like
WarScrap
WarScrap Third Person Shooter
Valchion
Valchion Third Person Shooter
FMJ Games Presents Soldier Girl
FMJ Games Presents Soldier Girl Third Person Shooter
Resident Evil 2
Resident Evil 2 Third Person Shooter
Max Payne 2
Max Payne 2 Third Person Shooter
POSTAL III
POSTAL III Third Person Shooter