Critical Hits
Moderator: Moderators
-
- MC: Legacy & Spring 1944 Developer
- Posts: 1948
- Joined: 21 Sep 2004, 08:25
This code is better than mine (more random), but it gives 50% chance of a critical hit. This:rattle wrote:yuritch: Why not useinstead?Code: Select all
is_critical=rand(0,1); sleep 100;
Code: Select all
is_critical=(rand(0,5)==1);
sleep 100;
Code: Select all
rand_val=rand(0,5);
if(rand_val==1)
{
is_critical=1;
}
if(!rand_val==1)
{
is_critical=0;
}
sleep 100;
Code: Select all
#define CRITICAL_HIT_RATE 5
...
...
if (rand(1, 100) <= CRITICAL_HIT_RATE) bIsCritical = TRUE;
else bIsCritical = FALSE;
sleep zzZ;
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;
-
- Posts: 501
- Joined: 18 May 2006, 21:19
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.
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?
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?
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?esteroth12 wrote:randomness is the reason I hate risk... KEEP IT OUT OF SPRING!!!!!!!!!!!!!!!!!!
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.
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
) but highly customisable and could probably be used for many other randomised features other than damage. 
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


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) 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..
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. :/rattle wrote: Why don't you volounteer to make a code patch?
my incredible mind reading ability tells me you seem to like Pink Floyd...
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.
