Page 7 of 12

Re: [u1] Unreal: Return to Na Pali Episode 2: Na Pali War

Posted: 27 Aug 2011, 10:57
by Dozey
integration wrote:In the case, that the AA Gun fires straight flying projectiles (and is no instant hit weapon), I want you to know, that it is possible to calculate where to shoot to hit the Aircraft, if the AirCraft is not changing its speed nor its moving direction. Of course you would have to rewrite the AdjustAim function.

Code: Select all

In the following for vectors x I use the notation x² = x dot x
let y (vector) be the target's speed
let z (vector) be the vector from shooter to target
let v (float) be the projectile's speed
let t (float) be the unknown time until the impact
let x (vector) be the unknown normed (x²=1) shooting direction
Then we have: t*v*x = t*y + z
Thus the square of the length of both sides must be the same
(t*v*x) dot (t*v*x) = (t*y + z) dot (t*y + z)
t²*v² = t²*y² + 2*t*(y dot z) + z²
t²*(v²-y²) - 2*t*(y dot z) = z²
This is a quadratic equation in t
With a = v² - y², b = y dot z, c = z² we have
a*t² - 2*b*t = c or rearranged
a*(t - b/a)² - b²/a = c
(t- b/a)² = (c*a + b²)/a² , now take the root
t - b/a = +/- sqrt(c*a + b²)/a
t = [b +/- sqrt(c*a + b²)]/a
So if d := b*b + c*a > 0 we get the 2 solutions
t = ( b + sqrt(d) )/a and t = ( b - sqrt(d) )/a
Use the one with t > 0 and t as small as possible
In the case a > 0 (projectile faster than target)
it should be t = ( b + sqrt(d) )/a
The unknown shooting direction x is Normal(t*y + z)


Interesting. Altrough I don't wanna to changing original actor/object scripts, so projectiles from AA will be instant hit (like in rifle,minigun,CAR). But this code looks interesting. Would you wanna explain a little about it on PM??

Re: [u1] Unreal: Return to Na Pali Episode 2: Na Pali War

Posted: 27 Aug 2011, 11:57
by integration
Don't mind it, if the projectiles are supposed to be instant hit.

I don't know what to explain about it. It's not real code, it is an explaination itself (under the assumption the target is continuing its movement).
Imagine a triangle with the 3 corners:
1. the projectile's spawning location
2. the target's location at the moment, the projectile is spawned.
3. the point, where the projectile is supposed to hit the target (t seconds after the projectile is fired)
The vectors of the sides of this triangle are t*v*x (corners 1 and 3) , z (corners 1 and 2) and t*y (corners 2 and 3). Note, that t and x are the unknowns. The rest is simple vector analysis and how to solve a quadratic equation.

Re: [u1] Unreal: Return to Na Pali Episode 2: Na Pali War

Posted: 27 Aug 2011, 12:27
by Dozey
integration wrote:Don't mind it, if the projectiles are supposed to be instant hit.

I don't know what to explain about it. It's not real code, it is an explaination itself (under the assumption the target is continuing its movement).
Imagine a triangle with the 3 corners:
1. the projectile's spawning location
2. the target's location at the moment, the projectile is spawned.
3. the point, where the projectile is supposed to hit the target (t seconds after the projectile is fired)
The vectors of the sides of this triangle are t*v*x (corners 1 and 3) , z (corners 1 and 2) and t*y (corners 2 and 3). Note, that t and x are the unknowns. The rest is simple vector analysis and how to solve a quadratic equation.


So it will lock itself and seek the target all time??

Re: [u1] Unreal: Return to Na Pali Episode 2: Na Pali War

Posted: 27 Aug 2011, 13:43
by integration
No, I mean't where the pawn/weapon should aim at - assuming the target is keeping its velocity. But now I know, that you don't need it, so let me end this Off Topic posts with a small video and code example:

https://www.youtube.com/watch?v=iOwPDl9zPWM

Code: Select all

class MyGasbag expands Gasbag;

// solves t*v*x = t*y + z where t is a float x is a normed vector
function rotator ContinueSpeedAim(vector y, vector z, float v, out optional float t)
{
   local float a,b,c,d;

   a = v*v - y dot y;
   b = y dot z;
   c = z dot z;
   d = b*b + c*a;
   t = ( b + sqrt(d) )/a;
   return rotator(t*y + z);
}

function rotator AdjustAim(float projSpeed, vector projStart, int aimerror, bool leadTarget, bool warnTarget)
{
   local PlayerPawn PP;

   if ( Target == None )
      if ( enemy!=none && !enemy.bDeleteme && enemy!=self )
         Target = Enemy;
   PP = Playerpawn(target);
   if ( PP != None && projSpeed > PP.groundspeed )
      return ContinueSpeedAim( PP.velocity, PP.location - projStart, projSpeed ); // <---
   else
      return Super.AdjustAim(projSpeed, projStart, aimerror, leadTarget, warnTarget);
}

Re: [u1] Unreal: Return to Na Pali Episode 2: Na Pali War

Posted: 27 Aug 2011, 13:50
by Dozey
Now I understand - it check propability position of target ;)
And yeap I use it if you give permission :)

Anyway - I wasn't lazy and I made 2 video presenting 2 air units (beta):
Boeing flyby (with full crew)

http://youtube.com/watch?v=zIFNf4bG_sw

And Tyransoaurus short flyby:

http://youtube.com/watch?v=7WyVxBB5-NQ

Re: [u1] Unreal: Return to Na Pali Episode 2: Na Pali War

Posted: 27 Aug 2011, 15:50
by integration
Interesting, but weird sound (because of the recording?). So that Boeing can drop bombs? Can you change the shooting directions or why did you sometimes switch to the gun turrets? And the Skaarj Aircraft can shoot at its back?

I would like to know how you controlled the moving and shooting direction. Did you pilot the flying direction and speed with the arrow keys (indepedent of the camera rotation)? And can you shoot in the direction of the camera?

The devil is in the detail. I think Qtit can tell you a thing or two about it. Different Aircrafts, different physics (steering, maximal rotation rate, acceleration) and what happens when you touch the ground and how do you notice how hard a collision was etc.
Dozey wrote:Now I understand - it check propability position of target ;)
And yeap I use it if you give permission :)

Of course you can use it. Everything what I post can be used without asking for permission. I cannot claim copyright for six short lines of code. :)

But here the devil also lies in the detail. Worse estimation of your velocity in lower difficulties, adding aim error etc. I don't want to do that.

Re: [u1] Unreal: Return to Na Pali Episode 2: Na Pali War

Posted: 27 Aug 2011, 16:01
by Dozey
integration wrote:Interesting, but weird sound (because of the recording?). So that Boeing can drop bombs? Can you change the shooting directions or why did you sometimes switch to the gun turrets? And the Skaarj Aircraft can shoot at its back?

I would like to know how you controlled the moving and shooting direction. Did you pilot the flying direction and speed with the arrow keys (indepedent of the camera rotation)? And can you shoot in the direction of the camera?

The devil is in the detail. I think Qtit can tell you a thing or two about it. Different Aircrafts, different physics (steering, maximal rotation rate, acceleration) and what happens when you touch the ground and how do you notice how hard a collision was etc.
Dozey wrote:Now I understand - it check propability position of target ;)
And yeap I use it if you give permission :)

Of course you can use it. Everything what I post can be used without asking for permission. I cannot claim copyright for six short lines of code. :)

But here the devil also lies in the detail. Worse estimation of your velocity in lower difficulties, adding aim error etc. I don't want to do that.


Yeap weird sounds cause It lose a quality horrible. Speed is with arrow keys, and yes I can shot where I've got direction of camera. Yeah the physics of it isn't very nice. Collision of it is a really crapp but I can't do anything without knowledge of deeper Unreal coding language. I think .:.: used also C++ to make this, cause he is the only one who make ANY working vehicles to Unreal. But as I sayed - good resolution would be waiting for he's physX Unreal core vehicle class. Then it will be different story with collision and physics...


EDIT: I am switching to turrets to show that it has got them ;]

EDIT2: Direction of bombs can't be changed - it need to refix in projectile code.

Sorry for not answering all questions in first time.

Re: [u1] Unreal: Return to Na Pali Episode 2: Na Pali War

Posted: 09 Sep 2011, 20:54
by Dozey
Hi there.

We're looking for a mapper. If someone is interested, please contact with me.

Re: [u1] Unreal: Return to Na Pali Episode 2: Na Pali War

Posted: 22 Sep 2011, 05:55
by AndryxaXP
that is new in this project? in the development stage at which you are now the map? :P

Re: [u1] Unreal: Return to Na Pali Episode 2: Na Pali War

Posted: 22 Sep 2011, 12:48
by Dozey
I don't understand the question - you mean about that this project is in upcoming maps pages and projects in production?? Or that we need a mapper??
Yeap the case of mapper is replacement the Blu3Hazz - he haven't answered yet how many progress of his map is done.

Re: [u1] Unreal: Return to Na Pali Episode 2: Na Pali War

Posted: 22 Sep 2011, 19:31
by AndryxaXP
Excuse me for a ridiculous question. I just wanted to learn the features of gameplay :o

Re: [u1] Unreal: Return to Na Pali Episode 2: Na Pali War

Posted: 22 Sep 2011, 22:09
by Dozey
AndryxaXP wrote:Excuse me for a ridiculous question. I just wanted to learn the features of gameplay :o


It's quite simple - different missions to pass by you as UMS officer with new stuffs. Fight the versus skaarj units in middle of hell, or change the course of war by fighting outfront on the back of enemy forces :)
What you'll have to do:
- for your disposition you'll gain new weapons of UMS armoury or use standard game weapons
- fight enemy with ranks of UMS; definition of alone play - it's past
- the most difficult and most important and the most effective: NEW USABLE VEHICLES: based on .:.: Unreal Nvidia PhysX - ground, hover, air, water...
- new enemies, friendly creatures, mercenaries
Real hell on the futuristic battlefield ;)

Re: [u1] Unreal: Return to Na Pali Episode 2: Na Pali War

Posted: 22 Sep 2011, 22:45
by Z-enzyme
Well, I remember that there was a time when I created a flyable version of Halo's Pelican for UT. It had nice flying behavior. I can dig it up for you. Also, I tried to make a transport with Dots' PhysX but it actually failed a lot. Still, the ship itself is kinda flyable XD

Re: [u1] Unreal: Return to Na Pali Episode 2: Na Pali War

Posted: 23 Sep 2011, 11:46
by Dozey
Qtit wrote:Well, I remember that there was a time when I created a flyable version of Halo's Pelican for UT. It had nice flying behavior. I can dig it up for you. Also, I tried to make a transport with Dots' PhysX but it actually failed a lot. Still, the ship itself is kinda flyable XD


I would like to see it ;)
Could you send it via my mail??
jcoop*wp.pl

Re: [u1] Unreal: Return to Na Pali Episode 2: Na Pali War

Posted: 23 Sep 2011, 14:05
by makemeunreal
Have you got a video? I want check the Pelican (: