Login | Register 

Urban Terror Blogs

Zenity's blog

Hits and Hops

posted Friday, 10 July 2015 by FS Zenity
Since my last post, I have been working on implementing spread and recoil. Here's what it looks like so far:

(Of course all assets in this video are either placeholders or work in progress)

I've tried to stay close to the current behaviour, without any major experiments. A couple things of note though:

- In Q3UT, increasing recoil will make your crosshair jump towards the left and right, so it never actually points at the position you are aiming at. While I do think this is a useful feature to "feel" the increasing inaccuracy of spraying, and you would not be able to hit anything by directly aiming at it anyway once it gets so bad, it doesn't feel really good to me. So I tried to replace the left right movement with a camera roll which still conveys the lack of accuracy, but does not actually move the crosshair from where you are aiming. This feels really good to me so far.

- I have also added the option to set a random seed for each weapon. This means that spray patterns are always identical and while this still won't allow you to perfectly control a spread like Counter Strike (which wouldn't be a good fit for the game IMO for various reasons), it will allow some sort of control and reward experience. By and large though, you are still much better off burst firing.

In the end of the video I hop around a bit to show the state of wall jumping and powersliding.


Also some people mentioned the issue of "hits" in general, so I thought I'd quickly share my thoughts on this. I believe there are generally three areas which can potentially lead to faults with hit detection. From least to most significant:

1) Random Spread

Sometimes you just have bad luck... Urban Terror has extremely accurate weapons, so as long as you tap or burst your shots, you will hit what you aim for. Spread escalates quickly though, so you can get the situation where you just barely miss your first couple of shots, and then your spread already becomes large enough to make you miss most of your shots. This can lead to the odd situation where you aim is almost perfect, yet you don't hit anything. Hit detection in Urban Terror can be extremely unforgiving due to the relatively small hit boxes coupled with a relatively fast movement speed.

We can counter this by making it more obvious when the accuracy goes down (especially for players who don't use an expanding crosshair).

2) The Hit Mesh

ARIES was way ahead of its time, and there's no wonder it had some growing pains. These days I believe it works very reliably, and that's quite remarkable considering the technology it's based on.

That said, UE4 makes life a lot easier for us in this regard. Instead of per-poly hit detection on a low poly model, we use the physical asset for hit detection, which uses simplified shapes and is of course very well tested. The physical asset follows the reference model perfectly, as you can see here:

3) Netcode

Finally and most importantly, network code is always fickle and things can easily go out of sync. This becomes even more true with small and accurate hit models. No matter how well designed the network code is, there is always a chance for inaccuracies caused by flakey network conditions or server performance issues.

Fortunately, there is an option which sidesteps all those headaches: Client side hit detection.

Now before you throw eggs in my face, hear me out. Client side hit detection has become more popular in modern games, for one simple reason: When the client is compromised, then all is lost already. Allowing a compromised client to mess with hit detection sounds scary, but the truth is that this kind of hack would be the easiest to discover, not to mention incredibly boring for the cheater. With every random hack featuring perfect aimbots and wallhacks, there is just no reason any more to be concerned about this. Of course servers still do basic verification of each hit and any obvious tampering would be very easy to spot. The bottom line is that when in doubt, the client is trusted that a bullet was actually a hit.

One commonly perceived downside is the effect of getting hit behind walls, but this is also an issue with server side lag compensation, and it pales in comparison to missing shots. It is also up to us how lenient we want to be with this, e.g. whether to reject hits if the target has moved behind a wall by the time the hit arrives at the server.

The giant advantage of client side hit detection is simply this:

Perfect hits. Always. Without exceptions.
comments: Feel free to discuss this on our forums

Sponsored link

Copyright © 1999-2021 Frozensand Games Limited  |  All rights reserved  |  Urban Terror™ and FrozenSand™ are trademarks of Frozensand Games Limited

Frozensand Games is a Limited company registered in England and Wales. Company Reg No: 10343942