Gamestudio Links
Zorro Links
Newest Posts
blogherenowcenter
by 3s05bmmc. 06/05/24 06:08
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (VoroneTZ, AndrewAMD), 779 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19057 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
precise_shot.wdl - new version #111355
02/07/07 20:52
02/07/07 20:52
Joined: Jul 2002
Posts: 2,002
Europe
ShoreVietam Offline OP
Expert
ShoreVietam  Offline OP
Expert

Joined: Jul 2002
Posts: 2,002
Europe
Little script for Ego-Shooters to have more precise shots on animated models than with c_trace.

Right from the beginning, disadvantages:
1. You have to check every vulnerable entity since you have to pass an entity pointer.
2. You have to know the amount of bones of each model (should not be the problem with humans(-like) models only).


Demo program: trace.exe - Selfextracting WinRAR archive (~1.39 MB)
precise_shot.wdl ~ file









Last edited by ShoreVietam; 02/08/07 18:36.

My project Schlacht um Kyoto - Das Samurai Browsergame! (sorry, german only)
Re: precise_shot.wdl [Re: ShoreVietam] #111356
02/08/07 11:18
02/08/07 11:18
Joined: Jun 2006
Posts: 2,640
Earth
Germanunkol Offline
Expert
Germanunkol  Offline
Expert

Joined: Jun 2006
Posts: 2,640
Earth
Thanks a lot, Shorevietam!
This is great...

One thing I noticed: Is the white flickering light the place it'll hit? Or does it just show if it will hit?
In either case, if I put the crosshair right between two joints, like the knee and the foot, there's no flickering light. Does that mean I wouldn't hit if I'd shoot there?
Sorry if I missed something...

Thanks for contributing this!

Micha


~"I never let school interfere with my education"~
-Mark Twain
Re: precise_shot.wdl [Re: Germanunkol] #111357
02/08/07 16:44
02/08/07 16:44
Joined: Jul 2002
Posts: 2,002
Europe
ShoreVietam Offline OP
Expert
ShoreVietam  Offline OP
Expert

Joined: Jul 2002
Posts: 2,002
Europe
The light is created every 2 Ticks when the player was hit (I "trace" every 2 Ticks).

The light is created on the TARGET vector which is set by my "trace" function.

As you noticed, it is -not- right where your crosshiar is, but where the -hit bone- is, directed towards the shot origin.

However, you still have to crosscheck if there was a wall between the model and the shot origin.
But as this may differ quite strong from game to game I left it out.


Maybe Trace towards the shot direction with only scanning level geometry, store the result (distance) and then check if it is smaller than vec_dist(shot_origin, TARGET.X);

I could make the return value of the funtion as the distance from the shot origin to the hit position and still NULL when nothing was hit if it helps?


My project Schlacht um Kyoto - Das Samurai Browsergame! (sorry, german only)
Re: precise_shot.wdl [Re: ShoreVietam] #111358
02/08/07 17:36
02/08/07 17:36
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline
Serious User
DLively  Offline
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
I dont get it... what is it? :S


A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: precise_shot.wdl [Re: DLively] #111359
02/08/07 18:30
02/08/07 18:30
Joined: Jun 2006
Posts: 2,640
Earth
Germanunkol Offline
Expert
Germanunkol  Offline
Expert

Joined: Jun 2006
Posts: 2,640
Earth
If you animate a character, aparrently c_trace always looks at his first frame only. So if in the first frame there's a leg at a certain place, but now he's walking, and the leg's somewhere else, it would still hit the player, unless you do some updating ever frame. (am I right?... or did I misunderstand something?)
This system is a new way of tracing so that the player's hit in the right way even when he's not in his first frame, but playing an animation.


~"I never let school interfere with my education"~
-Mark Twain
precise_shot.wdl - new version [Re: DLively] #111360
02/08/07 18:35
02/08/07 18:35
Joined: Jul 2002
Posts: 2,002
Europe
ShoreVietam Offline OP
Expert
ShoreVietam  Offline OP
Expert

Joined: Jul 2002
Posts: 2,002
Europe
Exactly Germanunkol!
This is a function that "traces" each Bone of a model to enable precise hits for ego shooters.

This maybe is the final version; improvements:

- Better calculation of the TARGET - vector
- returns distance to shot-origin
- returns hit-bone-number (to detect headshots ect.)
- shot-direction does not have to be a normal vector (length doesn't matter any more)

- example how to use it in combination with trace to detect walls that are in the way.

New demo program including "precise_shot.wdl": trace.exe - Selfextracting WinRAR archive (~1.43 MB)










My project Schlacht um Kyoto - Das Samurai Browsergame! (sorry, german only)
Re: precise_shot.wdl - new version [Re: ShoreVietam] #111361
02/09/07 09:13
02/09/07 09:13
Joined: Oct 2004
Posts: 1,655
T
testDummy Offline
Serious User
testDummy  Offline
Serious User
T

Joined: Oct 2004
Posts: 1,655
::applauds this contribution::
Nice application of vector math.
It seems, ShoreVietam has a 'five star attitude'.

Re: precise_shot.wdl - new version [Re: testDummy] #111362
02/09/07 20:02
02/09/07 20:02
Joined: Jul 2002
Posts: 2,002
Europe
ShoreVietam Offline OP
Expert
ShoreVietam  Offline OP
Expert

Joined: Jul 2002
Posts: 2,002
Europe
Thanks a lot testDummy!

This is the theory I used:



I think I sucessfully build it into my wester shooter, tomorrow I'll test it excessly with a friend and upload it when everything works as it seems to work.


My project Schlacht um Kyoto - Das Samurai Browsergame! (sorry, german only)

Moderated by  adoado, checkbutton, mk_1, Perro 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1