The Ur-Quan Masters Home Page Welcome, Guest. Please login or register.
Did you miss your activation email?
July 13, 2024, 11:42:07 am
Home Help Search Login Register
News: Celebrating 30 years of Star Control 2 - The Ur-Quan Masters

+  The Ur-Quan Masters Discussion Forum
|-+  The Ur-Quan Masters Re-Release
| |-+  General UQM Discussion (Moderator: Death 999)
| | |-+  Ur-Quan Dreadnought to be re-named "Banana Boat"
« previous next »
Pages: 1 ... 4 5 [6] 7 8 Print
Author Topic: Ur-Quan Dreadnought to be re-named "Banana Boat"  (Read 37649 times)
Elvish Pillager
Enlightened
*****
Offline Offline

Posts: 625



View Profile
Re: Ur-Quan Dreadnought to be re-named "Banana Boat"
« Reply #75 on: May 07, 2008, 07:02:53 pm »

I think the odd edge-case disadvantage would be massively outweighed by the advantage.
The advantage only takes place in a few unusual cases as well. It's good if the enemy is stationary, but if the enemy is moving at all perpendicularly to the direction of the shot, it's going to over-correct as often as not.

I suppose the tracking system could be made smarter.
Logged

My team of four Androsynth and three Chmmr is the most unfair team ever!
My mod
Niles
Zebranky food
*
Offline Offline

Posts: 5



View Profile
Re: Ur-Quan Dreadnought to be re-named "Banana Boat"
« Reply #76 on: May 07, 2008, 10:47:03 pm »

Yeah, it should take the velocity+direction of the target into account rather than just the position. For a game set in a sci-fi future setting, the homing computers are remarkably stupid...

The game will take a bit more computing power, but that shouldn't be a problem these days.

Basically, at each "homing course change" the projectile should pick a direction that brings it into contact with the target within the projectile's remaining lifetime, taking the target's position, velocity and direction into account. The course that gets to the target the fastest should be taken.
If it is not possible for the projectile to reach its target during its lifetime at the time of being fired, it should just keep going forward (to allow defensive straight shots at long-range attacks). If inability to reach the target happens after being fired, the projectile should still head as close as possible.
Logged
Death 999
Global Moderator
Enlightened
*****
Offline Offline

Gender: Male
Posts: 3873


We did. You did. Yes we can. No.


View Profile
Re: Ur-Quan Dreadnought to be re-named "Banana Boat"
« Reply #77 on: May 08, 2008, 04:20:02 pm »

The advantage only takes place in a few unusual cases as well. It's good if the enemy is stationary, but if the enemy is moving at all perpendicularly to the direction of the shot, it's going to over-correct as often as not.

If you're in a position to get this thing to aim the wrong direction, it means you had to pass directly in front of it while it was in flight. This is generally considered a bad idea in respect to fusion blasts. They do not take their time closing in like limpets and plasmoids do.
« Last Edit: May 08, 2008, 05:48:35 pm by Death 999 » Logged
Elvish Pillager
Enlightened
*****
Offline Offline

Posts: 625



View Profile
Re: Ur-Quan Dreadnought to be re-named "Banana Boat"
« Reply #78 on: May 08, 2008, 09:09:57 pm »

If you're in a position to get hit by this thing when you wouldn't otherwise, you were sitting pretty stationary right next to its normal trajectory. This "is generally considered" a bad idea with respect to fusion blasts. By the way, do you know how much I hate the phrase "is considered" and its derivatives? It cleanly avoids taking or giving any responsibility for the consideration.

Also, although they're not as slow as plasmoids and limpets (speed 8 and 6.25 respectively) they're not fast like Spathi or Supox shots.

Niles - yeah; in fact, the Orz marines already use smarter homing - not as ideal as your description, but pretty reliable - although they're kind of half-hearted about it (they aim about midway between directly at the enemy and where they ought to.)
Logged

My team of four Androsynth and three Chmmr is the most unfair team ever!
My mod
Death 999
Global Moderator
Enlightened
*****
Offline Offline

Gender: Male
Posts: 3873


We did. You did. Yes we can. No.


View Profile
Re: Ur-Quan Dreadnought to be re-named "Banana Boat"
« Reply #79 on: May 08, 2008, 11:07:24 pm »

If you're in a position to get hit by this thing when you wouldn't otherwise, you were sitting pretty stationary right next to its normal trajectory.

Any ship that doesn't cross the unguided trajectory is going to have been missed; while any ship that ends up near that line is at risk from a guided shot.

Secondly, a lot of velocity doesn't do any good if it's in the radial direction, so a fast-moving ship could easily qualify as 'stationary' for these purposes.

How much lateral range are we talking, here? Well, if at the end it has a ten degree homing angle, then it will achieve a lateral offset of 8.7% of its forward range (sin(10 degrees)/2 = 0.087). This is hardly 'right next to', as the range is quite substantial. If it's not enough, we can increase the turn rate appropriately.

I don't get your point about Spathi or Supox shots. If you think the fusion blast is slow, say so. If you think you can run rings around it and confuse it, say so. If you think diving in front of a homing plasma blast is not dangerous, say so.

I'm presently working on implementing this so we can check how useful it is, practically.

Presently, my difficulty is storing the lateral velocity state. MISSILE_BLOCK is the data entry for these missiles, and it doesn't have a 'miscellaneous' entry or an 'other velocity' entry. I remember someone said something somewhere (very useful, I know!) about including some degree of shot relativity for some ship (perhaps hypothetically?). If they found a solution for that, it should be easily adapted to this.

Another solution would be to simply make MISSILE_BLOCK bigger, and have every other missile in the game carry around some state it doesn't need.
Logged
Elvish Pillager
Enlightened
*****
Offline Offline

Posts: 625



View Profile
Re: Ur-Quan Dreadnought to be re-named "Banana Boat"
« Reply #80 on: May 08, 2008, 11:12:39 pm »

How much lateral range are we talking, here? Well, if at the end it has a ten degree homing angle, then it will achieve a lateral offset of 8.7% of its forward range (sin(10 degrees)/2 = 0.087). This is hardly 'right next to', as the range is quite substantial. If it's not enough, we can increase the turn rate appropriately.
Considering that it turns over the course of its flight, that'd be about half what you say - about 4.4% of its range, which is 17.6 display units - less than the width of an Ur-Quan...

I don't get your point about Spathi or Supox shots. If you think the fusion blast is slow, say so. If you think you can run rings around it and confuse it, say so. If you think diving in front of a homing plasma blast is not dangerous, say so.
It's slow ; you can't run rings around it ; diving into its path carelessly is dangerous but crossing its path while in flight is possible to do while paying attention, without risk.

Presently, my difficulty is storing the lateral velocity state. MISSILE_BLOCK is the data entry for these missiles
no ; MISSILE_BLOCK is just for creating a new missile.
Logged

My team of four Androsynth and three Chmmr is the most unfair team ever!
My mod
Resh Aleph
*Smell* controller
****
Offline Offline

Gender: Male
Posts: 319


Rottem Tomatoes


View Profile
Re: Ur-Quan Dreadnought to be re-named "Banana Boat"
« Reply #81 on: May 09, 2008, 11:56:49 am »

I'm presently working on implementing this so we can check how useful it is, practically.

This is the most sensible thing I've read all page long.
Logged

Marines on Maulers and limpets on Earthlings  /  Bright Podship plasma and warm Kohr-Ah death rings  /
Shofixti Scouts doing gravity whips  /  These are a few of my favorite ships!
       © meep-eep
Death 999
Global Moderator
Enlightened
*****
Offline Offline

Gender: Male
Posts: 3873


We did. You did. Yes we can. No.


View Profile
Re: Ur-Quan Dreadnought to be re-named "Banana Boat"
« Reply #82 on: May 09, 2008, 04:35:50 pm »

Here's a diff file that describes the changes to the code. I have verified that this correctly compiles to an object file. However, I do not have all the needed libraries, so I can't build the full game myself.

Problems may arise if the velocity values are low enough that dividing by 114 results in large rounding errors. If so, we can do larger turns less frequently than every frame.

Code:
109a110,161
> #define FUSION_TURN_FRAC 114
> #define FUSION_TURN_TRIGGER_FACTOR (FUSION_TURN_FRAC / 2)
> static void fusion_preprocess ( PELEMENT ElementPtr)
> {
>   ELEMENTPTR eptr;
>   SIZE delta_x, delta_y, vx, vy, re, im;
>   if (ElementPtr->hTarget)
>     {
>       LockElement (ElementPtr->hTarget, &eptr);
>       delta_x = eptr->current.location.x
>       - ElementPtr->current.location.x;
>       delta_y = eptr->current.location.y
>       - ElementPtr->current.location.y;
>       UnlockElement (ElementPtr->hTarget);
>       delta_x = WRAP_DELTA_X (delta_x);
>       delta_y = WRAP_DELTA_Y (delta_y);
>       /*
>        If we want to make it lead the target, then we'll need to add
>        (target's velocity) * (time to pass) to these deltas.
>        */
>       
>       GetCurrentVelocityComponents(&(ElementPtr->velocity), &vx, &vy);
>       /*
>        Next I figure out which way to turn.
>        The logic here is analogous to imaginary number multiplication.
>        I multiply the delta (x + iy) by the complex conjugate of the velocity (x - iy).
>        (instead of dividing delta by velocity, which would take a division -- we only need direction, not magnitude)
>        The result is a course correction vector.
>       */
>       im = vx * delta_y  -  vy * delta_x;
>       re = vx * delta_x  +  vy * delta_y;
>       
>       // If tan of our course correction < FUSION_TURN_TRIGGER FACTOR, it's close enough that correcting would overshoot.
>       if ( re < 0 || im * FUSION_TURN_TRIGGER_FACTOR >  re )  // need to turn
>       {
>         if (im > 0) // The course correction is above the real axis, so I need to turn left.
>         { // add a small orthogonal component. Failure to take away from forward component only adds 0.0008% to speed.
>           im = vx - vy/FUSION_TURN_FRAC;
>           vy = vy + vx/FUSION_TURN_FRAC;
>           vx = im;
>         }
>         else  // The course correction is below the real axis, so I need to turn right.
>         {
>           im = vx + vy/FUSION_TURN_FRAC;
>           vy = vy - vx/FUSION_TURN_FRAC;
>           vx = im;
>         }
>         SetVelocityComponents(&(ElementPtr->velocity), vx, vy);
>       }
>     } // end if there's an enemy ship
> } // end fusion_preprocess(...)
>
132c184
< MissileBlock.preprocess_func = NULL_PTR;
---
> MissileBlock.preprocess_func = &fusion_preprocess;
« Last Edit: May 09, 2008, 04:39:05 pm by Death 999 » Logged
0xDEC0DE
*Many bubbles*
***
Offline Offline

Posts: 175



View Profile WWW
Re: Ur-Quan Dreadnought to be re-named "Banana Boat"
« Reply #83 on: May 20, 2008, 07:16:17 pm »

Normal diffs make baby jesus cry.  Unified diffs are better for moving targets like this one, as they preserve a bit of context, and can account for "code drift".  But even then, up-to-date SVN is different than 0.6.2 (e.g., ELEMENTPTR was deprecated/removed)

If that weren't bad enough, this patch doesn't do anything. 
ElementPtr->hTarget is always NULL in this context, turning the whole function into a big, complicated no-op.  You'll need to walk the element list, looking for the opposing ship, or just use TrackShip() in src/sc2code/weapon.c to do it for you.

Here's a patch against "current" SVN (r2983) that's effectively a drop-in of the Cruiser's homing projectile, but with the homing aspect severely dialed-down to the point that it is a very weakly-tracking missile:

Code:
Index: src/sc2code/ships/urquan/urquan.c
===================================================================
--- src/sc2code/ships/urquan/urquan.c   (revision 2983)
+++ src/sc2code/ships/urquan/urquan.c   (working copy)
@@ -111,6 +111,42 @@
    0,
 };

+#define TRACK_WAIT 12
+
+static void
+fusion_preprocess (ELEMENT *ElementPtr)
+{
+   COUNT facing;
+
+   facing = GetFrameIndex (ElementPtr->next.image.frame);
+   if (ElementPtr->turn_wait > 0)
+       --ElementPtr->turn_wait;
+   else
+   {
+       if (TrackShip (ElementPtr, &facing) > 0)
+       {
+           ElementPtr->next.image.frame =
+                   SetAbsFrameIndex (ElementPtr->next.image.frame,
+                   facing);
+           ElementPtr->state_flags |= CHANGING;
+       }
+
+       ElementPtr->turn_wait = TRACK_WAIT;
+   }
+
+   {
+       SIZE speed;
+
+#define THRUST_SCALE DISPLAY_TO_WORLD (1)
+       if ((speed = MISSILE_SPEED +
+               ((MISSILE_LIFE - ElementPtr->life_span) *
+               THRUST_SCALE)) > MISSILE_SPEED)
+           speed = MISSILE_SPEED;
+       SetVelocityVector (&ElementPtr->velocity,
+               speed, facing);
+   }
+}
+
 static COUNT
 initialize_fusion (ELEMENT *ShipPtr, HELEMENT FusionArray[])
 {
@@ -133,7 +169,7 @@
    MissileBlock.hit_points = MISSILE_HITS;
    MissileBlock.damage = MISSILE_DAMAGE;
    MissileBlock.life = MISSILE_LIFE;
-   MissileBlock.preprocess_func = NULL;
+   MissileBlock.preprocess_func = &fusion_preprocess;
    MissileBlock.blast_offs = MISSILE_OFFSET;
    FusionArray[0] = initialize_missile (&MissileBlock);


Now you can actually try it instead of postulating endlessly about its effectiveness.  Enjoy.
« Last Edit: May 20, 2008, 09:51:33 pm by 0xDEC0DE » Logged

"I’m not a robot like you. I don’t like having disks crammed into me… unless they’re Oreos, and then only in the mouth."  --Fry
Death 999
Global Moderator
Enlightened
*****
Offline Offline

Gender: Male
Posts: 3873


We did. You did. Yes we can. No.


View Profile
Re: Ur-Quan Dreadnought to be re-named "Banana Boat"
« Reply #84 on: May 20, 2008, 09:52:58 pm »

Having finally gotten it compiled properly, I noticed what Nic noticed and came up with the same fix.

I mean, the same one he had before he totally replaced it with something that basically functions, but acts way too much lie the cruiser's missile.

Which is better than what I had up there, which kind of wiggles around and then swerves off in a random direction.
« Last Edit: May 20, 2008, 10:06:41 pm by Death 999 » Logged
Death 999
Global Moderator
Enlightened
*****
Offline Offline

Gender: Male
Posts: 3873


We did. You did. Yes we can. No.


View Profile
Re: Ur-Quan Dreadnought to be re-named "Banana Boat"
« Reply #85 on: May 22, 2008, 05:39:40 pm »

I didn't notice this, but I wanted to say:

How much lateral range are we talking, here? Well, if at the end it has a ten degree homing angle, then it will achieve a lateral offset of 8.7% of its forward range (sin(10 degrees)/2 = 0.087). This is hardly 'right next to', as the range is quite substantial. If it's not enough, we can increase the turn rate appropriately.
Considering that it turns over the course of its flight, that'd be about half what you say - about 4.4% of its range, which is 17.6 display units - less than the width of an Ur-Quan...

No, I already put in the half -- see that /2 in there? I know math. Plus, that was a first guess - as I said,
Quote from: Death 999
If it's not enough, we can increase the turn rate appropriately.

I think I'll take another stab at this soon.


We could alternately bring the speed to the fusion blast up to that of the faster weapons such as Orz shots (from 20 to 30). Or both.
Logged
tartarus
Zebranky food
*
Offline Offline

Posts: 11



View Profile
Re: Ur-Quan Dreadnought to be re-named "Banana Boat"
« Reply #86 on: July 03, 2008, 12:27:23 pm »

What if the ur-quan fusion bolt would explode after few seconds (the range should stay same)  and make some blast damage ? Blast effect could be as large as shofixtis explosion but with considerable less damage. Like 1 point of damage if the target is at max range.
Then it wouldnt be such as sucky ship but not overly powerful either ?
Small low cost ships wouldnt then rip ur-quan apart very easily.
And the fighter craft should be made better like there has been previously mentioned.
Logged
Elvish Pillager
Enlightened
*****
Offline Offline

Posts: 625



View Profile
Re: Ur-Quan Dreadnought to be re-named "Banana Boat"
« Reply #87 on: July 03, 2008, 03:39:12 pm »

Blast effect could be as large as shofixtis explosion but with considerable less damage. Like 1 point of damage if the target is at max range.
Technically, the Shofixti explosion does 1 damage at its max range.

Of course, your proposed Ur-Quan blast would be scaled to 6 at its center, so effectively 1/3 as much damage as the Shofixti blast at any point in the radius (assuming a simple implementation)
Logged

My team of four Androsynth and three Chmmr is the most unfair team ever!
My mod
tartarus
Zebranky food
*
Offline Offline

Posts: 11



View Profile
Re: Ur-Quan Dreadnought to be re-named "Banana Boat"
« Reply #88 on: July 03, 2008, 04:17:28 pm »

Yeah, what do you think, is this stupid idea or not?  Smiley
Logged
Elvish Pillager
Enlightened
*****
Offline Offline

Posts: 625



View Profile
Re: Ur-Quan Dreadnought to be re-named "Banana Boat"
« Reply #89 on: July 03, 2008, 04:39:09 pm »

It's a very interesting idea. It'd make it much more effective at range, about as effective as it should be I think.

It'd still suck at hitting anything that was right next to it.
Logged

My team of four Androsynth and three Chmmr is the most unfair team ever!
My mod
Pages: 1 ... 4 5 [6] 7 8 Print 
« previous next »
Jump to:  


Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!