Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[request]Ballistic missile
2017-09-08, 06:15 PM
Post: #1
[request]Ballistic missile
So I was thinking of a missile that boosts to space at an angle to reduce drag, cut down on thrust, glide above the enemy and cut thrust completely to counter LAMS and swoop down like an APN bomb, I've tried existing scripts with minimal result, any help would be great
Find all posts by this user
Quote this message in a reply
2017-09-11, 01:08 AM
Post: #2
RE: [request]Ballistic missile
You'd need an APN module in any case because missiles with no APN don't or barely steer, so this would have to be a LUA script accounting for that.
Find all posts by this user
Quote this message in a reply
2017-09-11, 03:52 AM
Post: #3
RE: [request]Ballistic missile
Hi there.

The idea is simple. you have to cut each missile into 3 phases:
1 - Going up.
2 - Move in cruising speed to point above target.
3 - Go to target.

Before we think about points of path(Start,StopGoingUp,GoDown,Hit) we already have several problems to solve.
1 - Each missile has to have a phase counter to make sure they do each phase. This means that for each active missile you need Permanent variable with the phase counter. We can do this with an table where the index is the missileid(not the missile count, as each missile will change their count number if a lower missile gets destroyed)
2 - Target order, supplied by AI will change if AI decides another target is more important, and this can make our missile go back and forward changing targets, until it runs out of fuel. Even if you want this, you dont want your missile changing targets when it is on phase 3, diving to hit the target.
This means that you need another table, where each member links each active missile to a target id (independent of target priority)

Now that we got targets and missiles accounted for. You need to calculate the 3 points in the path:
1 - StopGoingUp Point:
Easy aproach = your ship location + cruse altitude
Medium aproach = your ship location + target altitude + X meters in direction of target
Hard aproach = your ship location + target altitude + if target distance > 4 X (X meters in direction of target ) if not ( target distance /4 )
2 - GoDown Point:
Easy aproach = target location + cruse altitude
Medium aproach = target location + target altitude + X meters in direction of your ship
Hard aproach = target location(calculated with velocity differential) + target altitude + if target distance > 4 X ( X meters in direction of your ship) if not ( your ship distance /4 )
3 - Hit point
Easy aproach = target location
Medium aproach = target location + (target speed * time to target)
hard aproach = Medium aproach with recalculated time to target (has time to target changes as we change the hitpoint)

Easy approach will overshoot the target and then turn back while heading down.
Medium approach will spend extra fuel if target is too close or if moving too fast
Hard version will be the less fuel and most accurate missile.

The Realy Realy hard approach is to do that with n degree derivatives and with harmonics buffering treatment of missile and targets and also dodging incoming projectiles. But, if you can do that, maybe you can apply to a job in the army's R&D.

Im on my wait to make a Hard approach version
Find all posts by this user
Quote this message in a reply
2017-09-11, 03:58 AM
Post: #4
RE: [request]Ballistic missile
(2017-09-11 03:52 AM)jcordeiro Wrote:  Hi there.

The idea is simple. you have to cut each missile into 3 phases:
1 - Going up.
2 - Move in cruising speed to point above target.
3 - Go to target.

Before we think about points of path(Start,StopGoingUp,GoDown,Hit) we already have several problems to solve.
1 - Each missile has to have a phase counter to make sure they do each phase. This means that for each active missile you need Permanent variable with the phase counter. We can do this with an table where the index is the missileid(not the missile count, as each missile will change their count number if a lower missile gets destroyed)
2 - Target order, supplied by AI will change if AI decides another target is more important, and this can make our missile go back and forward changing targets, until it runs out of fuel. Even if you want this, you dont want your missile changing targets when it is on phase 3, diving to hit the target.
This means that you need another table, where each member links each active missile to a target id (independent of target priority)

Now that we got targets and missiles accounted for. You need to calculate the 3 points in the path:
1 - StopGoingUp Point:
Easy aproach = your ship location + cruse altitude
Medium aproach = your ship location + target altitude + X meters in direction of target
Hard aproach = your ship location + target altitude + if target distance > 4 X (X meters in direction of target ) if not ( target distance /4 )
2 - GoDown Point:
Easy aproach = target location + cruse altitude
Medium aproach = target location + target altitude + X meters in direction of your ship
Hard aproach = target location(calculated with velocity differential) + target altitude + if target distance > 4 X ( X meters in direction of your ship) if not ( your ship distance /4 )
3 - Hit point
Easy aproach = target location
Medium aproach = target location + (target speed * time to target)
hard aproach = Medium aproach with recalculated time to target (has time to target changes as we change the hitpoint)

Easy approach will overshoot the target and then turn back while heading down.
Medium approach will spend extra fuel if target is too close or if moving too fast
Hard version will be the less fuel and most accurate missile.

The Realy Realy hard approach is to do that with n degree derivatives and with harmonics buffering treatment of missile and targets and also dodging incoming projectiles. But, if you can do that, maybe you can apply to a job in the army's R&D.

Im on my wait to make a Hard approach version

I think the diving phase would need an APN component, else the missile without thrust wouldn't reliably hit the target
Find all posts by this user
Quote this message in a reply
2017-09-11, 12:10 PM
Post: #5
RE: [request]Ballistic missile
(2017-09-11 03:58 AM)sundy123 Wrote:  I think the diving phase would need an APN component, else the missile without thrust wouldn't reliably hit the target

If you use:
I:SetLuaControlledMissileAimPoint(t,m,target.Position.x,target.Position.y,target​.Position.z)

This missiles will point to the target even if they are without fuel. I have seen this.
The real question is if they can turn just by aiming
Find all posts by this user
Quote this message in a reply
2017-09-11, 12:24 PM
Post: #6
RE: [request]Ballistic missile
(2017-09-11 12:10 PM)jcordeiro Wrote:  
(2017-09-11 03:58 AM)sundy123 Wrote:  I think the diving phase would need an APN component, else the missile without thrust wouldn't reliably hit the target

If you use:
I:SetLuaControlledMissileAimPoint(t,m,target.Position.x,target.Position.y,target​.Position.z)

This missiles will point to the target even if they are without fuel. I have seen this.
The real question is if they can turn just by aiming

The problem is that if they just aim to the target without thrust they won't hit, they need an APN-like function to glide towards the target.
Find all posts by this user
Quote this message in a reply
2017-09-11, 12:27 PM
Post: #7
RE: [request]Ballistic missile
Another problem is the lack of thrust control in LUA api.
so we have 3 options:
1 - Dont cut thrust and hit the target with full thrust.
2 - Go in circles above the target until the fuel runs out then aim at target
3 - Make/install some mod that adds full thrust to LUA missile API
Find all posts by this user
Quote this message in a reply
2017-09-11, 12:29 PM
Post: #8
RE: [request]Ballistic missile
(2017-09-11 12:24 PM)sundy123 Wrote:  The problem is that if they just aim to the target without thrust they won't hit, they need an APN-like function to glide towards the target.

But wont APN just do the same? Only aiming at the target?
Find all posts by this user
Quote this message in a reply
2017-09-11, 12:30 PM
Post: #9
RE: [request]Ballistic missile
(2017-09-11 12:27 PM)jcordeiro Wrote:  Another problem is the lack of thrust control in LUA api.
so we have 3 options:
1 - Dont cut thrust and hit the target with full thrust.
2 - Go in circles above the target until the fuel runs out then aim at target
3 - Make/install some mod that adds full thrust to LUA missile API

I have seen thrust control in lua, said lua script is on the lua frontpage now
Find all posts by this user
Quote this message in a reply
2017-09-11, 12:30 PM
Post: #10
RE: [request]Ballistic missile
(2017-09-11 12:29 PM)jcordeiro Wrote:  
(2017-09-11 12:24 PM)sundy123 Wrote:  The problem is that if they just aim to the target without thrust they won't hit, they need an APN-like function to glide towards the target.

But wont APN just do the same? Only aiming at the target?

No, the missile accelerates using fins and also predict the enemy's future movements
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)