How does aiming work in UT99?

Discussions about Coding and Scripting
Post Reply
maximdymok
Experienced
Posts: 84
Joined: Mon May 30, 2011 5:28 am

How does aiming work in UT99?

Post by maximdymok »

Hey guys! Not sure if this is in the right section.. please move the thread if it's not. So long story short - there's a few guys who are making a big patch for an old indie game I like to play. One of the bugs in that game we want to fix is related to how aiming works.. I don't think you need to know all the details, but here are the basics. So in UT as far as I know most servers run at a tickrate of 20 ticks/s - same thing with our game in question here. However, in this game, by default, your aim feels "smooth" - there is actually a 50ms delay between the time you move your mouse and the time the crosshair on the screen moves. There is an option in the menu to turn on Sharp Turning - and just like it sounds, it makes your aim feel "sharp" - in fact, it reduces that 50ms latency to about 17ms. How does it do that? Well, if you do some math - 20 ticks a second calculates to about 50ms delay between each tick. 60 frames a second, on the other hand, calculates to ~17ms delay between frames. All this option does is it updates your crosshair's position every frame, instead of every tick. Well, OK, you might say - so what? We want this option to make your aim feel sharp, just like it is in UT and Quake. It does that. BUT, does it do it well? The answer, sadly, is no. Somehow, with this option enabled, your weapons miss all the time. In fact, it feels like the crosshair you see is just an overlay for another hidden one - the one that runs on ticks. Your view might move sharply, but in reality the aim position that the game sends to the server is up to 33ms behind of that which you see. [R..R-Right? Not sure, I ain't good at math] What this means is that when you aim at the enemy and press fire after moving your mouse quickly to, well, put your crosshair over them - you see your bullets land right next to the enemy, where your crosshair was some time ago. TL;DR - it makes you miss, even though on your screen the crosshair was right over the enemy when you pressed fire. As you might imagine, this doesn't make for a very professional game - if you use "smooth" aiming - it's hard to aim, especially with weapons like Minigun, and if you use Sharp Turning, it's better - but you don't always hit when you should. So my question is.. How does UT do this? I mean, the aim is sharp, the tickrate is the same, the weapons don't miss.. Anyone care to explain in "noob" terms how UT works around this issue? Thanks in advance, and excuse the run-on sentences and poor grammar :oops:
UT99.org

Re: How does aiming work in UT99?

Post by UT99.org »

medor wrote:makes you want to play or talk?

For play there a config http://unrealtournament.99.free.fr/utfi ... Config.rar
For server no one ave the same tickrat ; separat weapond-tickrat ;zp ;no-zp ;netspped mini max. So :roll:
maximdymok
Experienced
Posts: 84
Joined: Mon May 30, 2011 5:28 am

Re: How does aiming work in UT99?

Post by maximdymok »

medor wrote:makes you want to play or talk?

For play there a config http://unrealtournament.99.free.fr/utfi ... Config.rar
For server no one ave the same tickrat ; separat weapond-tickrat ;zp ;no-zp ;netspped mini max. So :roll:
I.. don't think you really understand what I meant? I'm not trying to change the tickrate on a server in UT..
User avatar
EvilGrins
Godlike
Posts: 9762
Joined: Thu Jun 30, 2011 8:12 pm
Personal rank: God of Fudge
Location: Palo Alto, CA
Contact:

Re: How does aiming work in UT99?

Post by EvilGrins »

I aim in UT like I do when I play pool: Aim, fire, pray I hit something.

Usually works pretty good.
http://unreal-games.livejournal.com/
Image
medor wrote:Replace Skaarj with EvilGrins :mrgreen:
Smilies · viewtopic.php?f=8&t=13758
JackGriffin
Godlike
Posts: 3774
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

Re: How does aiming work in UT99?

Post by JackGriffin »

One of the hidden secrets of FPS gaming is the amount of aiming assistance that is built into the native code. This isn't aimbots, it's more like gentle nudges from the engine to get you on target. Here's a copy/paste from the crysis boards on the subject of aim assist:
I had mentioned a few weeks ago that aim assist included in FPS games isn't auto aim like you see in games like Red Dead Redemption or Streets of LA. I came across the article I read that better explains mechanics of FPS games. Remember that ALL FP shooters utilize different mechanics to make gameplay more rewarding and to feel more natural. Analog controls just aren't made for that type of control.

----------------------------------------------------------------------------------------------------------------------------------------
SNAPPING
Early first-person shooters on console struggled to make aiming feel intuitive and rewarding, since it was impossible to match the accuracy and speed of the PC's mouse interface. Snapping (also sometimes called auto aim) was the earliest solution to cnosole control problems. Titles like Rare's GoldenEye 007 aided players by reorienting their gun barrels toward enemies whenever a player's crosshairs were in proximity of their target. It wasn't a flawless system, but it helped make shooters more accessible for console owners.

ACCELERATION
Many modern FPS also have highly tuned acceleration curves for reticle movement. When a player pegs their aiming stick in one direction his or her reticle will start moving slowly in that direction before picking up speed. This is noteworthy because it makes aiming at nearby targets easier without significantly sacrificing a player's ability to make quick turns.

FRICTION
Bungie introduced friction in the first Halo, and nearly every shooter uses it today. A simple way to describe friction is that it slows a player's turn rate as soon as their reticle passes over an enemy, but that's not the whole story. "What we really do is slow your top speed, and then dramatically decrease the rate at which the crosshair will slow down when you let go of the stick," explains Griesemer.

MAGNETISM
Some games stop with friction, but Halo adds another system to the mix. Once a player has locked onto a target, and that target begins to move, magnetism helps players stay trained on that target.

Whether we want to admit it or not, we need the help. Console controllers aren't designed to move a crosshair across the screen with the kind of fidelity FPSes require. Aiming system are practically required from any FPS that wants to stay competitive.

These mechanics and the way they're implemented are a large part of how good a console shooter 'feels' to play. I'm grateful that they exist because without assists console FPS would be rather unpleasant to play.
Ferali and I have discussed this at length and he thinks that this sort of thing is confined to consoles while I think it's also prevalent in many (if not most) PC games as well, buried in the net code so that games just 'feel' better.

So, that's a lot of explanation about stuff but let me tie it all up. UT has no sort of aiming assist (when turned off) so shots hit the pixel you were pointing at when the trigger press was processed. This is going to make UT feel tight and solid compared to the gun action of a bunch of other FPS games, who (I think) use compensation and assist to process hits, especially long sweeping shots that cover a high arc across the POV. This may be why you can't get an answer from trying to compute/compare the time jumps involved. There may be more going on in your other game that you can't see.
So long, and thanks for all the fish
User avatar
Feralidragon
Godlike
Posts: 5493
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: How does aiming work in UT99?

Post by Feralidragon »

@Jack: Probably I didn't explain myself well back then: every FPS game originally done for PC does not have aim-assist, however FPS games done for consoles first and then ported over to PC may still retain that option (for example: BulletStorm has aim assist on PC).
However, CoD does not have aim assist in the PC version iirc. For instance, I am sure a certain UEngine3 based game (Blacklight Retribution) does not have either (and it's a 1 year old game, fairly new), specially since I am quite an avid sniper there, and you cannot imagine my "FUuuuuuu" when I miss the head for barely a pixel both on long and close range shots.
What almost every FPS game has nowadays is lag compensation, which is entirely a different matter and it only compensates ping (TF2 does the same thing for instance and Valve even explains the concept in one of their wiki pages).

@OP: Well, I can excuse the grammar, but not the lack of paragraphs and organized text, so please next time help us helping you by making it more organized and easy to read, otherwise next time people may just get annoyed and not provide any help at all.
Either ways, weapons in UT are tickrate dependent, meaning that if you have a 60fps client and a 20fps server, and your weapon makes 3 shots within 50ms, only one of them will count (hence missing them), and all the other shots will be disregarded because only one of the inputs will be considered by the server since it only receives one bulk of unique replicated data for each tick (since the same data may arrive the destination twice or more). One of the most notable weapons where this can be verified is the minigun, and any high firerate mod (like zark).
Generally what admins do to get around this is to increase the server tickrate to up to 40 or even 60fps in some cases to better match most clients.
There are ways around this though to make these shots tick independent, by calling different replicated functions, or store how long the user is firing the weapon or how many shots he made in the client, and replicate those inputs to the server and then process each one separately within the same server tick, basically, creating your own weapon class and implement this in it.
In case you go this road be careful, as you must validate all the received inputs to avoid hacking and exploiting of the system, since if you don't validate them, one can actually hack the functionality and send 3 or more shots to the server when the weapon shouldn't be that fast (imagine someone firing a sniper like a minigun....).
maximdymok
Experienced
Posts: 84
Joined: Mon May 30, 2011 5:28 am

Re: How does aiming work in UT99?

Post by maximdymok »

Hm, thanks for the reply. That is indeed a good way of doing it for the minigun, however I do not see why in UT a weapon like Rocket Launcher, which fires just one rocket flies right where you aim it.. while in our game the rocket would still fly to where your crosshair was a second ago. Can you not process 2 different things, like crosshair position and fire event at the same time in one tick? I'm sure you can.. So then, if you press fire with a rocket launcher, and it waits for the next tick which is when it both updates the crosshair position AND fires, why is the aim off? Sorry I suck at explaining so much, but I really don't understand why that bug is even there.[quote][/quote]
User avatar
papercoffee
Godlike
Posts: 10451
Joined: Wed Jul 15, 2009 11:36 am
Personal rank: coffee addicted !!!
Location: Cologne, the city with the big cathedral.
Contact:

Re: How does aiming work in UT99?

Post by papercoffee »

What game is it you talk about...?
maximdymok
Experienced
Posts: 84
Joined: Mon May 30, 2011 5:28 am

Re: How does aiming work in UT99?

Post by maximdymok »

papercoffee wrote:What game is it you talk about...?
Serious Sam :P
---------Edit---------
Feralidragon wrote:-text-
Indeed, the moving crosshair is quite annoying. There is an option to force it to stay still, which I use, but then it is not as accurate. This affects only first person view - in 3rd it's even worse, your whole view moves depending on how far away an object in front of you is. However this is bearable, with the crosshair static there is only an inaccuracy when you go right up against a wall and shoot, otherwise it's pretty accurate. This isn't actually the bug I'm talking about, though. I wish I could make a video of it, but with my PC it would just be a slideshow. Let's say you stand still and so does your enemy, and you aim at them and shoot. You will hit. Now turn around 180 and shoot them while still moving your mouse. Sometimes you'll hit, and sometimes you'll miss, even if you pressed fire at the perfect time when the crosshair was right over the enemy. If you had Sharp Turning disabled when you were doing that 180, however, you'd hit (assuming you pressed fire at the same time), but it would be way harder to aim because of the 50ms latency between your mouse being moved and the crosshair on the screen moving. That is a really anoying thing, especially with sniper rifle.. A good way you can see the bug for yourself if you still have the original Serious Sam is to enable Sharp Turning in first person view, and shoot the minigun close to you while turning around. You will notice the bullets hit to the left of your crosshair if you turn to the right. So yeah.. P.S. I hope you saw the edit, I'm scared Papercoffee will ban me for double posting.
Last edited by maximdymok on Tue Nov 27, 2012 2:44 pm, edited 1 time in total.
User avatar
Feralidragon
Godlike
Posts: 5493
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: How does aiming work in UT99?

Post by Feralidragon »

Well, in UT weapons have a "fire offset", which means, that they always fire a bit off relative where your crosshair is.
In UT, Epic made the crosshair being rendered slightly off center to match your weapon handedness, so if you''re using a right handed weapon, the crosshair is rendered a bit slightly to the right, in an attempt to be more accurate from where the projectile or hitscan shot will actually hit.

In the case of a shockrifle or a sniper, this offset is very close to where your crosshair is, so shots are accurate, however for rockets and ripper razors the difference is bigger so in long shots the lack of crosshair proper alignment shows off clearly.

For instance, in my case (NW3 mod), my weapons firing offset are extremely minimal (pretty much nonexistent in most of the weapons) so they are much more accurate exactly to avoid that problem (not sure if anyone noticed this while playing though).
In case of Serious Sam, afaik it keeps adjusting the crosshair position to where your shot will actually go, since it also has this offset.
In UT though this can be done as well with a custom weapon class, all you have to do is to render the crosshair yourself and make a trace for each tick from where exactly the weapon will fire and where exactly it should hit, however I must say that personally I don't like Serious Sam approach, since the last thing a FPS gamer wants is a moving crosshair, even in games where you have ADS and spread, many gamers who actually rely on accuracy (like me and many others) rather than spam or spray and pray set the crosshair to be static instead of growing or shrinking depending on the accuracy.
Post Reply