Page 1 of 2

Grenade Throw Indicator

Posted: Fri Apr 26, 2019 8:15 am
by Hamedudk
Image
Hello.
In gamesdk, there are codes for the Throw Indicator, but how does it work?
Like the video below:
Show the direction for the grenade
https://youtu.be/xlMoRd0RJno?t=203

https://youtu.be/xO0X5TNsOCU?t=161

Re: Grenade Throw Indicator

Posted: Fri May 24, 2019 10:26 am
by Cry-Flare
Indeed you can activate the throw trajectory using the CVar:
i_grenade_showTrajectory 1

You may also need to disable real geometry in the trajectory debug with this CVar to be able to see it:
i_greande_trajectory_useGeometry 0

Essentially the game creates a dummy object of the same type (the grenade), it then manually calculates physics steps for this time given its physical parameters (start velocity/mass etc).
It does these steps in a loop until the entity stops moving or max steps is reached (set to 200 steps). As it does this, it records the information so it can draw a line for it's position.

The relevant code for stepping through physics for an object manually is here:
https://github.com/CRYTEK/CRYENGINE/blo ... .cpp#L3301

Re: Grenade Throw Indicator

Posted: Fri May 24, 2019 11:21 am
by Hamedudk
It was really helpful.
thanks a lot. :P

Re: Grenade Throw Indicator

Posted: Mon Jul 22, 2019 2:42 pm
by Hamedudk
Indeed you can activate the throw trajectory using the CVar:
i_grenade_showTrajectory 1

You may also need to disable real geometry in the trajectory debug with this CVar to be able to see it:
i_greande_trajectory_useGeometry 0

Essentially the game creates a dummy object of the same type (the grenade), it then manually calculates physics steps for this time given its physical parameters (start velocity/mass etc).
It does these steps in a loop until the entity stops moving or max steps is reached (set to 200 steps). As it does this, it records the information so it can draw a line for it's position.

The relevant code for stepping through physics for an object manually is here:
https://github.com/CRYTEK/CRYENGINE/blo ... .cpp#L3301
Hi.
Trajectory works well in crysis 2 sandbox.
But now it's not working on cryengine 5.5.2 !! Why?


Now, I've tested on cryengine 5.5.2.

Re: Grenade Throw Indicator

Posted: Tue Jul 23, 2019 8:37 am
by Cry-Flare
Hey there,

I do not see any problems with this on CRYENGINE 5.5.2.
Can you elaborate on what is not working for you?

Re: Grenade Throw Indicator

Posted: Tue Jul 23, 2019 12:06 pm
by Hamedudk
Hey there,

I do not see any problems with this on CRYENGINE 5.5.2.
Can you elaborate on what is not working for you?
I set the "trajectory" below.

Image
Like Crysis 3 right click! But something will not be displayed!
What method is displayed?
Image

Re: Grenade Throw Indicator

Posted: Wed Jul 24, 2019 1:15 pm
by Cry-Flare
Apologies, seems there was a typo on my original post.
These are the CVars (correctly spelled this time :P) that affect the grenade trajectory preview in GameSDK:

Code: Select all

i_grenade_showTrajectory i_grenade_trajectory_resolution i_grenade_trajectory_dashes i_grenade_trajectory_gaps i_grenade_trajectory_useGeometry
showTrajectory should be 1 and useGeometry should be 0. Then you should see the path preview when holding the grenade.

Re: Grenade Throw Indicator

Posted: Thu Jul 25, 2019 4:06 am
by mknmknmknjk
check out my trajectory code .
SpawnPointh.cpp
(3.26 KiB) Downloaded 33 times
SpawnPoint.cpp
(10.28 KiB) Downloaded 35 times

Re: Grenade Throw Indicator

Posted: Thu Jul 25, 2019 7:18 am
by Hamedudk
Apologies, seems there was a typo on my original post.
These are the CVars (correctly spelled this time :P) that affect the grenade trajectory preview in GameSDK:

Code: Select all

i_grenade_showTrajectory i_grenade_trajectory_resolution i_grenade_trajectory_dashes i_grenade_trajectory_gaps i_grenade_trajectory_useGeometry
showTrajectory should be 1 and useGeometry should be 0. Then you should see the path preview when holding the grenade.
Hi
thanks a lot. It was great.
Just a little distant, it's not clear!

Image

Trajectory has a bug!
When "Trajectory!" We move on a physics object, the physics begins to move !!!
Image
I'm impatiently waiting for Schematyc to make things easy! :roll: :arrow:

Re: Grenade Throw Indicator

Posted: Thu Jul 25, 2019 7:21 am
by Hamedudk
check out my trajectory code .SpawnPointh.cppSpawnPoint.cpp
Hello.
Thanks.
I do not know how to use this code.
What I find out is Schematyc. it's true ? :shock:
I hope
Help me out in the next "Schematyc"! :lol: