Critical Hits - Page 2

Critical Hits

Requests for features in the spring code.

Moderator: Moderators

SpikedHelmet
MC: Legacy & Spring 1944 Developer
Posts: 1948
Joined: 21 Sep 2004, 08:25

Post by SpikedHelmet »

Seems to me it would be easy enough to put a random tag in HitByWeapon or something, that one in every 100 hits, calls one of those nifty called-by-script weapons to explode, killing the unit... that would be very simply, wouldn't it?
User avatar
yuritch
Spring 1944 Developer
Posts: 1018
Joined: 11 Oct 2005, 07:18

Post by yuritch »

rattle wrote:yuritch: Why not use

Code: Select all

      is_critical=rand(0,1);
      sleep 100;
instead?
This code is better than mine (more random), but it gives 50% chance of a critical hit. This:

Code: Select all

   is_critical=(rand(0,5)==1);
   sleep 100;
should be better (1/6 chance as in my example). Only I'm not sure Scriptor understands such expressions, so this:

Code: Select all

   rand_val=rand(0,5);
   if(rand_val==1)
   {
      is_critical=1;
   }
   if(!rand_val==1)
   {
      is_critical=0;
   }
   sleep 100;
is probably what will work.
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

Code: Select all

#define CRITICAL_HIT_RATE 5
...
...

if (rand(1, 100) <= CRITICAL_HIT_RATE) bIsCritical = TRUE;
else bIsCritical = FALSE;
sleep zzZ;
Slightly shorter, should work as well.

PS:

Code: Select all

   rand_val=rand(0,5);
   if(rand_val==1)
   {
      is_critical=1;
   }
   if(!rand_val==1)
   {
      is_critical=0;
   }
   sleep 100;
This is a 1 in 6 chance to change the is_critical var back to 0 and it's a 1 in 6 chance to be a critical hit. So when a critical hit occurs it will stay a critical hit unless rand_val is 0. So it's not quite what you wanted... I guess.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

Yes but this only allows critical hits, not more fine-grained damage variation.
esteroth12
Posts: 501
Joined: 18 May 2006, 21:19

Post by esteroth12 »

yeah... you should be able to select faces (or add it to a layer on texture 2 for s3o) and make them weak points, and in the .fbi define how weak the weak point is... (or on the tex layer it depends on how dark/light it is)
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

A random damage multiplier would be definitely a start, ranging from 0.5 to 1.5 for instance, and a chance tag on when a critical hit occurs. A ninja type of unit with mediocre damage could have a fixed 1.5 multiplier and a 25% chance while a more clumsy unit with rather high damage output could get a 0.5 to 1.5 multiplier range and a 10% critical hit chance. Not too difficult code-wise.
redcoat
Posts: 36
Joined: 12 Sep 2006, 23:50

Post by redcoat »

Critical hits is only (passibly) admissible if it displays text saying something mod defined such as <CH>... (i think rattle already pointed this out).

And ++1 to spikedhelmet's idea: how the heck is effectiverange not in the TA engine yet? That can be used by anything that even vaguely wants to resemble RL, and adds another element of strategy. Stay at range and fight, or rush in for the quicker kills?
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

Yeah I sort of did point it out.

It's not in yet because the devs got their hands full I guess. Features, fixes, fixing borked patches... just take a look at the bug tracker. Why don't you volounteer to make a code patch? 8)

my incredible mind reading ability tells me you seem to like Pink Floyd...
User avatar
Snipawolf
Posts: 4357
Joined: 12 Dec 2005, 01:49

Post by Snipawolf »

Well, ya know "What if" or something by Creed has the same lyrics as his location line...
bwansy
Posts: 385
Joined: 02 May 2006, 05:21

Post by bwansy »

esteroth12 wrote:randomness is the reason I hate risk... KEEP IT OUT OF SPRING!!!!!!!!!!!!!!!!!!
Inaccuracy is randomness, too. When you play Spring, are you using guided weapons exclusively, build dozens of radar targetting facilities, and micro-manage (or even FPS) every single unit in order to eliminate any randomness?
Moreover, it is not randomness at all, it is realism. What would cause the "randomness" is, again, inaccuracy, plus other factors which, too, have already been existing in Spring from the very beginning, in the OTA era.

+1 for critical hits, although it would potentially make the game slower.
User avatar
Soulless1
Posts: 444
Joined: 07 Mar 2006, 03:29

Post by Soulless1 »

esteroth12 wrote:randomness is the reason I hate risk... KEEP IT OUT OF SPRING!!!!!!!!!!!!!!!!!!
I really don't get why people can't understand that engine features are different to mod features :?
User avatar
Zoombie
Posts: 6149
Joined: 15 Mar 2005, 07:08

Post by Zoombie »

If you don't want randomness then don't play against other people, because people are very randomn...
User avatar
Soulless1
Posts: 444
Joined: 07 Mar 2006, 03:29

Post by Soulless1 »

this would really need to be a new engine feature though, there's only so much you can do with scripting...

How bout a simple 'randomdamage=0/1' tag to enable it, with 'mindam=x' and 'maxdam=y' tags where x and y are like 0.5 and 1.5 etc (they are proportions of the default damage) - the engine just generates a random number between x and y

maybe later also 'complexdamage=0/1' and a way to specify the equation of a curve (eg a bell curve, but but you could use whatever equation you wanted). The engine would generate a random point on the X-axis (using the above tag) and read off the Y-axis value (which would be the damage proportion) at that point. Complex, yes (hence the name of the tag :P) but highly customisable and could probably be used for many other randomised features other than damage. :-)
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

Why's everyone complaining about it? It's not that it should be enforced, it's a goddamn option! You can deactivate options (or simply have them deactivated by default).
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

Soulless: I think a mindamagemultiplier would make more sense, specify the max damage in the damage section and the minimum is defined by a multiplier. That way there's only one multiplier and the damage values actually have a meaning.
User avatar
Snipawolf
Posts: 4357
Joined: 12 Dec 2005, 01:49

Post by Snipawolf »

Soulless1 wrote:this would really need to be a new engine feature though, there's only so much you can do with scripting...

How bout a simple 'randomdamage=0/1' tag to enable it, with 'mindam=x' and 'maxdam=y' tags where x and y are like 0.5 and 1.5 etc (they are proportions of the default damage) - the engine just generates a random number between x and y

maybe later also 'complexdamage=0/1' and a way to specify the equation of a curve (eg a bell curve, but but you could use whatever equation you wanted). The engine would generate a random point on the X-axis (using the above tag) and read off the Y-axis value (which would be the damage proportion) at that point. Complex, yes (hence the name of the tag :P) but highly customisable and could probably be used for many other randomised features other than damage. :-)

We would need something to determin the randomness of the crits.. However I like this layout..
redcoat
Posts: 36
Joined: 12 Sep 2006, 23:50

Post by redcoat »

rattle wrote: Why don't you volounteer to make a code patch? 8)

my incredible mind reading ability tells me you seem to like Pink Floyd...
If it weren't for a lack of free-time, I would. Last time I touched spring was two weekends ago when I got the code to compile (yah!), but I haven't gotten it to run yet (boo!). And I haven't played it in three weekends. :/

But if I end up with some time on my hands (hahaha) I'd be more than happy to do some coding for spring.

And yes, me like pink floyd. Among others. 8)
Post Reply

Return to “Feature Requests”