| Author |
Ballistic missile mod works - theoretically HELP NEEDED |
XabbaRus
Joined: Feb 28, 2002 Posts: 2792 | Posted: 2002-07-16 17:52  
OK jsteed we have 600x600 nautical mile playing area so the furthest distance a missile can fly from top corner to diagonal opposte is roughly 800 nautical miles...so you don't have to worry about the max distance for the missile.
Anyway anything you come up with that makes it work better is great.
_________________
Project 971
 
|
Monophonic
Joined: Feb 28, 2002 Posts: 279 From: Espoo, Finland
| Posted: 2002-07-16 17:58  
Wasn't the playing area a square of 600nm sides? Then the maximal range needed is slightly less than 850nm, from a corner of the area to the opposite corner. It would be easy to live with even less.
Personally, I don't necessarily even need a capability of actually hitting anything. (Not yet anyway.) Most likely scenario for my mind would be one were the player is tasked with killing the boomer before it can fire it's missiles rather than being that boomer (althought it could be made interesting, too). A simple missile which would fly to the max altitude and then disappear would suffice for that, as the mission would already be lost.
But this is only my opinion, and toys are always nice, anyway. 
 
|
XabbaRus
Joined: Feb 28, 2002 Posts: 2792 | Posted: 2002-07-16 18:00  
That's one way but I think quite a few people want to see stuff go boom...and with a big mushroom on top
Oh I wasn't to far off with my 800 mile diagonal distance guess....
Impressed with myself.
_________________
Project 971
 
|
Monophonic
Joined: Feb 28, 2002 Posts: 279 From: Espoo, Finland
| Posted: 2002-07-16 18:07  
Pretty good estimate, and it must be even later there at your town, XabbaRus. Its roughly 1am east european summer time here.
 
|
jsteed
Joined: Apr 08, 2002 Posts: 253 | Posted: 2002-07-16 18:32  
XabbaRus,
Are you ok with the fact that the missile will fly much higher than it does in reality?
By the way, put a damage value of 5000 on the warhead and you only have to hit in the general vicinity. They really go BOOM!
Cheers, jsteed
 
|
XabbaRus
Joined: Feb 28, 2002 Posts: 2792 | Posted: 2002-07-16 18:46  
Nope, I'm not going to be looking am I :)
Yes there is a max damage number for objects aswell, somewhere around 30,000 units.
Didn't think it had that much affect on area of explosion just power against target.
_________________
Project 971
 
|
Thomasew
Joined: Feb 28, 2002 Posts: 1898 From: Bluewater Bay, South Africa
| Posted: 2002-07-16 18:57  
Hi Guys
Are you guys aware of the fact, that the AI handles targetting differently ... depending on whether the Land Target has been set for 'Auto-Detect', or not, in the Mission Editor.
When I had the AI launching TLAMs at Land Targets ... 2 problems cropped up.
1. If the Land Target has been set for 'Auto-Detect' in the Mission Editor ... the AI proceeds to Launch TLAMs at every Land Target in Range ... irrespective of whether the platform had been 'Assigned' an 'Attack' order, or not. Not conducive to good Mission design ... in that, all Platforms that are TLAM capable have to be kept at least 1400 miles away ... Not Possible.
2. The only way to stop the AI from doing this, was to 'uncheck' the 'Auto-Detect' box, which leads to another problem ... the AI doesn't target the same way ... which results in the TLAM flying over the Target. So, I had to re-write the Doctrine ... but then it doesn't work too well once the Target was auto-detected. Also, if the Target was partially damaged by a previous TLAM ... for some strange reason, any other TLAMs enroute just miss ... and no additional TLAMs are launched. It's almost as if the AI thinks the Target has been destroyed.
That's why I left it out of the DB for now ... it ain't practical at the moment. Have to re-think the TLAM issue ... and other Long-Range Missiles.
Unless someone comes up with some other solution ... I didn't think it was such a good idea for the AI to blow up everything in range. It would sorta leave you with nothing to do ... if your Mission involved some sort of involvement with a Land Objective ... or something.
Cheers
Tom
_________________
He Who Will Not Risk Cannot Win

[ This Message was edited by: Thomasew on 2002-07-16 19:02 ]
 
|
XabbaRus
Joined: Feb 28, 2002 Posts: 2792 | Posted: 2002-07-16 19:04  
OK So that's why in one of my missions the ships just start shooting everything....hmmmm.
Yep someone screwed up on that one in programming..
_________________
Project 971
 
|
jsteed
Joined: Apr 08, 2002 Posts: 253 | Posted: 2002-07-19 23:24  
Here is a ballistic missile doctrine that will blow things up properly. The problem you had Ferenci, was that the program changes the speed of an object over a period of 30 seconds. It doesn't matter how large a change is made, the 30 sec. is a universal law in SC. I have also written a tutorial about writing doctrines using this one as an example. If anyone is interested in getting a copy of it, just let me know.
Cheers, jsteed
; BallisticMissile Doctrine
var DestX
var DestY
var BoostComplete
var AscentComplete
var DescentComplete
var StartT
var t
var Range
var v0
var h
var v2
var r2
var a
var b
var c
var p1
var p2
var cos
var sin
var vy0
var vy
var vx
var ApexRng
var tmp
var theta
var sign
if Init then {
SetPitch 90
SetSpd MaxSpd
SetCrs ( XYbrg ( DestX - OwnX ) ( DestY - OwnY ) )
StartT = Time
BoostComplete = false
AscentComplete = false
DescentComplete = false
} else {
t = ( Time - StartT )
if ( BoostComplete == false ) then {
if ( ( OwnSpd + 5 ) >= MaxSpd ) then {
BoostComplete = true
Range = XYrng ( DestX - OwnX ) ( DestY - OwnY )
v0 = ( OwnSpd / 1.777 )
h = ( OwnAlt - 2000 )
v2 = ( v0 * v0 )
r2 = ( Range * Range )
tmp = ( 10.667 * r2 )
vy = ( v2 * h )
a = ( v2 * v2 * ( r2 + ( h * h ) ) )
b = ( -2 * v2 * Range * ( tmp - vy ) )
c = ( tmp * ( tmp - ( 2 * vy ) ) )
p1 = ( ( -1 * b ) / ( 2 * a ) )
p2 = ( sqrt ( ( b * b ) - ( 4 * a * c ) ) / ( 2 * a ) )
if ( ( p1 + p2 ) > 1.0 ) then {
p1 = ( p1 - p2 )
} else {
p1 = ( p1 + p2 )
} endif
tmp = ( p1 * p1 )
theta = ( ( 1.570796 - p1 + ( p1 * tmp / 6 ) + ( 3 * tmp * tmp * p1 / 40 ) ) / 2 )
SetPitch ( ( 180 * theta / 3.1415827 ) + 0.5 )
tmp = ( theta * theta )
cos = ( 1 - ( tmp / 2 ) + ( tmp * tmp / 24 ) )
sin = ( theta - ( tmp * theta / 6 ) + ( tmp * tmp * theta / 120 ) )
vy0 = ( v0 * sin )
vx = ( v0 * cos )
vy = ( vy0 - ( 10.667 * 30 ) )
tmp = ( 1.777 * XYrng ( vy ) ( vx ) )
SetSpd tmp
SetCrs ( XYbrg ( DestX - OwnX ) ( DestY - OwnY ) )
ApexRng = ( Range / 2 )
c = 0
StartT = Time
sign = 1
DEBUGOUT "Boost phase complete. Begin Ballistic phase"
DEBUGOUT "Bearing"
DEBUGVALUEOUT ( XYbrg ( DestX - OwnX ) ( DestY - OwnY ) )
DEBUGOUT "Range to target"
DEBUGVALUEOUT Range
DEBUGOUT "Altitude"
DEBUGVALUEOUT OwnAlt
} endif
} else {
Range = XYrng ( DestX - OwnX ) ( DestY - OwnY )
if ( Range <= ApexRng ) and ( AscentComplete == false ) then {
AscentComplete = true
StartT = Time
t = 0
vy0 = 0
sign = -1
c = 30
DEBUGOUT "Ballistic pahse complete. Begin Descent phase"
} endif
if ( DescentComplete == false ) then {
if ( c == 30 ) then {
vy = ( vy0 - ( sign * 10.667 * ( t + 30 ) ) )
if ( vy < 0 ) then {
vy = 0
} endif
SetSpd ( 1.777 * XYrng ( vy ) ( vx ) )
c = 0
} else {
v0 = ( OwnSpd / 1.777 )
vy = sqrt ( ( v0 * v0 ) - ( vx * vx ) )
theta = ( ( sign * XYbrg ( vy ) ( vx ) ) + ( sign * 0.5 ) )
SetPitch ( theta )
c = ( c + 1 )
} endif
} endif
} endif
if ( AscentComplete ) and ( Range < 25000 ) then {
theta = ( ( -1 * XYbrg ( OwnAlt - 2000 ) ( Range ) ) + ( sign * 0.5 ) )
SetPitch ( theta )
DescentComplete = true
} endif
if ( DescentComplete ) and ( ( OwnAlt - ( OwnSpd / 1.777 ) ) < 2000 ) then {
Detonate
DEBUGOUT "KABOOM!!"
DEBUGOUT "Range to target"
DEBUGVALUEOUT Range
DEBUGOUT "Altitude of detonation"
DEBUGVALUEOUT OwnAlt
} endif
} endif
 
|
ferenci
Joined: Apr 03, 2002 Posts: 283 From: Budapest, Hungary
| Posted: 2002-07-20 01:30  
Thanks jsteed I'll begin testing it immediately!
(btw could you send me that tutorial to my e-mail? Thanks)
ferenci
_________________ "There are only two kinds of warships: submarines and targets."

 
|
Madcowz
Joined: Feb 28, 2002 Posts: 574 From: Cambridge (UK)
| Posted: 2002-07-20 03:45  
Could you send the tutorial to me at Comsa so I can add it to SCX.
Thanks
MAd
_________________
Comsa
'When the hunter comes, the tiger runs with the deer'
 
|
jsteed
Joined: Apr 08, 2002 Posts: 253 | Posted: 2002-07-20 10:32  
ferenci & Madcowz,
Files have been sent. Let me know if the doctrine works as you thought it should.
Cheers, jsteed
 
|