• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0

Targetting Cues

3 posts in this topic

So my game's a third person space shooter. This causes a wierd problem with targeting as the player ship may not be pointing at the center of the screen at all times, which means crosshairs function kind of strangely and basically make it difficult to determine where exactly you're shooting (see attached screenshot for an earlier incarnation of this game that used a crosshair).

So instead I came up with a new system where there is no crosshair (see second screenshot), but each enemy ship has a targeting pattern that changes colors from red to green if they're in your sights. This targeting is fairly sophisticated in that it's not necessarily green if you're pointing directly at the enemy, but actually factors in the amount that you need to lead your shots to hit the enemy if they maintain their current velocity. However, when I set a few friends in front of this version and they seemed confused as to what the coloring meant. Once I explained it they seemed to get a little better at managing it.

While I could easily explain it away in some kind of tutorial part at the beginning of the game I wanted to get an opinion from the community about third person targetting and whether it's even desirable or if I should just do away with all targeting aids and err to the side of realism.

Since some weapons are fairly inaccurate or have tracking features, this complicates the situation even further.

Share this post

Link to post
Share on other sites
It seems like you've pretty much solved the math for this and you're more or less curious about the design. What I've used in the past is 2 cross hairs along with auto aim. The first cross hair represents where the player is aiming, the second represents where an enemy closest to that crosshair is, and when the player moves the cross hair close enough the first one jumps onto the second to show a lock on, and all rounds fired go towards where the player's cross hair is. This started out as a solution for the z point of where the player was aiming in our 3rd person shooter and eventually became an aim assist that the player could use. It took some of the challenge of shooting out of the game, but it meant that the challenge of the game was getting into cover, and then selectively taking out the targets by the danger priority each target presented. Quite impressive that you've solved the mathematics of this given you have player velocity and direction and enemy velocity and direction to account for. For accuracy we scaled the cross hairs to represent the accuracy of the selected weapon and for some weapons that accuracy decreased as they fired so thee player would end up firing short bursts to keep the shots focused in the reticule. We also used different textures for the cross hairs of different weapons. Another thing to keep in mind with a third person shooter is, that you need to solve that z-axis based on what target you think the player is aiming at for the shots from the player's avatar to hit the target instead of go around it. Which is important when the player needs to fire deflection shots (aiming ahead of the enemy) to score a hit. It's not an issue in first person shooters however. We had a bit in the game where the player fired a turret in first person against fast moving flying enemies, it didn't have a lock on, but it was a bit of a pain to get the deflection shots working intuitively since we needed to use the projected Z position of the target the player was aiming at to solve the z in the equation of what direction the bullet should go.

Share this post

Link to post
Share on other sites
About 10% of men are red-green colorblind to some degree, so those colors are pretty much the worst possible ones to indicate correct aim.
Change of color in general is slower and harder to see than a change in sight geometry. I'd suggest you make the sight change shape, add a box around it or something as the indicator.

Share this post

Link to post
Share on other sites
Stroppy - good call... Yellow/red or blue/red seem to be good choices from that standpoint.

Interesting post Kyall. Please post a screenshot if you have one, kind of curious how you handle the auto-adjustment of the Z-axis. When targeting enemies at different distances would the targeting "pop" around adjusting for different projection lengths?

The mathematics were a little fun. It's just a pretty simple system of vector equations to derive the formula you need, but solving it requires a few tricks. I already use the same formula so that the enemies can lead their shots too (otherwise they're hopelessly inaccurate).

Basically you start with:
finalPosition = initialPosition + velocity * time

What you want is to solve for any point at which a fired bullet will cross into the enemy's radius.

||(bulletInitial + bulletVelocity * time) - (enemyInitial + enemyVelocity * time)|| = enemyRadius

I'll let you figure out the rest of the proof for yourself, but basically you break each vector into it's component parts and solve for time with the quadratic formula. There should either be two real solutions or two complex solutions for time when you solve it. If there are two complex solutions it means the bullet will miss, if the solutions are real the bullet will hit.

The equation of course becomes trickier when you need to account for non-linear bullets like rockets (these have an accelleration component in my game).

Decided to post the code of the "IsTargeted" function so those who don't have the mathematics skills can use it, enjoy!

private static bool IsTargeted(Weaponry.Weapon weapon, PhysicsObject target, Player p)
var shootPosition = weapon.GetShootPosition();
var shootSpeed = weapon.GetShootVelocity().Length();

// Quadratic formula to calculate time for leading the shot
Vector3 shootVelocity = shootSpeed * p.Look;
var speedSquared = Square(shootSpeed);
var velocityDelta = shootVelocity - target.Velocity;
var positionDelta = shootPosition - target.Position;
var a = Square(velocityDelta.X) + Square(velocityDelta.Y) + Square(velocityDelta.Z);
var b = 2f * (shootPosition.X * shootVelocity.X - shootPosition.X * target.Velocity.X - target.Position.X * shootVelocity.X + target.Position.X * target.Velocity.X
+ shootPosition.Y * shootVelocity.Y - shootPosition.Y * target.Velocity.Y - target.Position.Y * shootVelocity.Y + target.Position.Y * target.Velocity.Y
+ shootPosition.Z * shootVelocity.Z - shootPosition.Z * target.Velocity.Z - target.Position.Z * shootVelocity.Z + target.Position.Z * target.Velocity.Z);
var c = Square(positionDelta.X) + Square(positionDelta.Y) + Square(positionDelta.Z) - Square(target.Radius) - Square(weapon.BulletRadius);

// Evaluate the quadratic formula, with a little modification
var inner = Square(b) - 4 * a * c;
var latterPart = (float)Math.Sqrt(inner);
return inner >= 0 && ((-b + latterPart) / a > 0 || (-b - latterPart) / a > 0);
[/CODE] Edited by jsuffolk

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
Followers 0

  • Similar Content

    • By KaiZerg
      Dear Colleagues,
      Can you please advise on the issue below:
      I have got several Folders(paper), to keep cheat sheets, practical guides, Lists of sequences ect.
      What is the best way to separate Folders?
      -Unity all
      -Unreal Engine all
      -Game art
      -Game Design
      -Game Engine
      -Game Programming
    • By suerozcelik
      Hi everyone, My name is Arda Süer, i’m a game developer and producer of Pocket Universe : Create Your Community. Pocket Universe is on pre-order and soon the early access to Steam. I need your help and I want to introduce you to my game. Please read the game story and website content etc. If you have any suggestions tell us and we can develop. Example:"Story is good but you need more faction","You need add bla,bla to the game". Anyway I will put links here to help you to understand Pocket Universe. Story : http://www.pocketuniversegame.com/?page_id=7 Features : http://www.pocketuniversegame.com/?page_id=180 Factions : http://www.pocketuniversegame.com/?page_id=54 Press Release : http://www.pocketuniversegame.com/?page_id=237 If you want to help more, please buy my game Kinguin : https://www.kinguin.net/category/38680/pocket-universe-create-your-community-pre-order-steam-cd-key/ G2A : https://www.g2a.com/pocket-universe-create-your-community-steam-key-global-i10000070716001 Press Relase.rtf
    • By NA-45
      I'm currently working on Metroidvania style game that I was inspired to start by Hollow Knight and Beksiński's art.

       It's built in Unity using C# and has quite a bit done already.  I'm handling the programming myself and have a working model (besides combat which is a WIP) that can be expanded greatly depending on where we decide to take the project.  You can see the current test area here: https://streamable.com/mp5o8  Since I'm not artistically gifted, its all rectangles but can easily be skinned once we've desired on designs.
      I have professional experience using Unity and C# working on both a released game and a prototype as well as having extensive Java knowledge.  I also dabble in Python with a little bit of C++.
      I have worked on and completed many projects before, the most recent being a 2D stick fighting game written ground up in Java Swing (don't ask why): https://www.youtube.com/watch?v=V4Bkoyp_f0o
      I'm looking for a 2D artist (potentially more than one) to create concept and game art and a designer/writer who can help flesh out the story as well as map out and create challenging and eye catching areas.  I can handle most if not all of the programming side of things though if there is anyone who is extremely passionate about this sort of thing, I'd consider splitting the load.
      The end goal is a completed game that can be sold however profit isn't really a concern to me as it's mostly a labor of love from my part.  Any profits would be split between team members however that's pretty far off so don't make that a reason to join.
      The story I have in mind is something like this:
      A man wakes up in a chasm that stretches seemingly endlessly in both directions lined with enormous statues.

       He discovers a temple with text above a closed gate that tells of the failed kingdom that lies below.  After finding a way around this, he drops down into the subterranean kingdom.  Adventuring through the labrynth below, he comes across different cities in which the residents succumbed to different sins such as Greed, Wrath, etc.  Each city tells a story of how its fixation on something lead to their demise leading up to a fight with the personification of their mistake.
      An very rough idea for Waterways, a potential area:
       - To enter you must be wearing a pair of glasses that you find somewhere earlier in the ruins.  There are similar glasses found in every home.  Everything appears incredibly beautiful however something seems wrong.  After triggering some event, the glasses break and it's revealed that the glasses are made of some sort of stone that makes everything appear differently.  The city is in ruins and absolutely disgusting as everything was neglected.  
       - The only thing that remains intact is in the center of the city, an incredible statue of a goddess holding up a large sphere of the same material that was used for the glass.  You slowly learn the story behind the statue: the goddess came from the sea that the city lies on and brought prosperity to them.  
       - After opening up the the temple of the goddess that lies right on the edge of the waters, a giant sheet of the glass covers an opening in the back of the temple that reveals the goddess behind it.  You shatter the glass and it becomes apparent that the goddess is actually a disgusting creature half beached and mostly immobile that appears to secrete the material that makes up the glass. Fight ensues.
      The combat is pretty up in the air and part of the reason I need a designer to bounce ideas off of but I think it will be something like this:
       - 4 orbs equipped at a time
       - 2 orbs selected at a time
       - Pressing the cast button will cast a spell determined by the 2 orbs that are selected
       - Spells cost mana however you can use spells with 0 mana and it will cost health instead
       - These spells in addition to being useful for combat, are the Metroidvania "gating" metchanic.  For instance, one of the conceptualized spells is a water orb + water orb to create a ice pillar that can be either used to block projectiles/enemy paths or to jump on to reach high areas
      If you're interested or have any questions, contact me through discord.  My id is NA-45#3692. 
    • By Qwertyman
      My game (built on the Unity platform, making use of EZ GUI) requires players to log into Facebook. However, when the player is using a language other than English on Facebook, I'm unable to display the localized Username (which is the same as the FB Username) within the game. Any ideas on how this can be tackled?
      PS: Detecting the OS language doesn't really help here because, for all you know, the player might be using one language for the OS, but another one for their Facebook, so.... 
    • By NajeNDa
      Hi there,
      I am a game programmer (C#/C++) who is looking for a project to join. I am computer science engineer plus Master Degree in Game Development, currently working in one the most renown mobile games company (2 years academic experience, 1 year working experience).
      I have developed several prototypes or even games almost ready to release, but I always lack of artists, so I am looking for a project already set up or few artist to begin working in something.
      My preferences are:
      Unity or Unreal Engine 4 based project (UE4 prefered) PC/Console game prefered but mobile is acceptable Not interested in VR Serious team with almost all the roles filled or pretending to be filled 3D project prefered over Sprites Guaranteed 7 work hours per week, Crunch 20 work hours per week  European team (if timezone is not a problem for you, so it is not for me) I am not looking for any kind of money income from games neither the team, I want to do this as a hobby and a way to improve my skills.
  • Popular Now