Home Technical Talk

Setting up hit zones on a bullseye target in UDK

polycounter lvl 13
Offline / Send Message
The Mad Artist polycounter lvl 13
So how would one go about setting up hitzones on a target (like a bullseye for example) in UDK where you would designate a score based on exactly where you shot? I'm a newbie with UDK, but in other engines I've done this with setting up hit geometry, a seperate layer for each 'zone' of the target, and then a seperate script was written by someone else that designated score values to each zone in game. Can it be done by designating a different material for each zone? Any input or a point in the right direction would be very helpful. Thanks in advance!

Replies

  • keres
    Options
    Offline / Send Message
    keres polycounter lvl 12
    Just stack cylindrical or circular pieces of geometry on top of each other to create the zones. The other thing you could do is compare the hit location to the center of the bull's eye. If the bull's eye has a 128uu radius, then you hit the target if VSize(HitLocation - BullsEyeCenter) is less than 128uu.
  • The Mad Artist
    Options
    Offline / Send Message
    The Mad Artist polycounter lvl 13
    Thanks for the reply. The concern we had with doing the cylindrical approach was how decals would look, but we'll give it a try and see how it works. The other approach would work, (and this is my fault for not mentioning it) but eventually we'd be using targets more like this:
    http://www.letargets.com/estylez_ps.aspx?searchmode=category&searchcatcontext=~010000~010400~010403

    ..so the goal would be to find a method that works well for any type of target that has a scoring zone. Thanks for the tip!
  • PolyMonstar
    Options
    Offline / Send Message
    A jumpoff from the question above.

    Say you've already been using invisible/linked meshes as hit zones for a structure. But you want different decals to show up on the structure alone through firing an object in kismet or with a custom weapon. Is there a preferred set of tutorials out there that goes over managing physical materials for things like bullet holes and effects on a per material/perobject + per weapon basis?
  • Vailias
    Options
    Offline / Send Message
    Vailias polycounter lvl 18
    In unreal script hook the TakeDamage function of your target class object to a scoring routine. Have it pass along the hit location.

    Just be sure to make your target's center point/origin at the bullseye.

    In the code get the distance from the object's origin/position in worldspace to the hitpoint in worldspace. Feed the distance into some routine to add points to the player's score based on the distance from center. You could expose a variable for target size and code the scoreing routine to automatically calculate n number of zones based on the largest radius.

    This is assuming a round target.

    for other target shapes you could do some other math to find if the hit point is within a certain polygon centered, or otherwise related to a target point within the target object. Would be good to mark the target centers or corners with a bone or socket for easy reference.

    Talk with your coders. They should be able to implement this with minimal issue.
Sign In or Register to comment.