Jump to content

"Smart" projectiles? Perhaps a way to factor in range


temnix

Recommended Posts

Let's say I want to change a spell so that it throws an extra projectile, an instant one, along with the main one. Now, I could do this by including a Cast Spell among the effects, or maybe there is a faster option inside the projectile setup itself. What could this accomplish? The invisible payload or the spell it casts could inform the engine about the coming main missile by, for example, applying a custom spell state which baldur.bcs could be taught to respond to. Others will know the code for this better without errors I'll probably make, but basically all it takes is an IF custom spell state, THEN apply a RES. The RES might be an adjustment to resistances or AC.

 

Now, correct me if I'm wrong, but this should also work for bows, crossbows, slings etc. They too can be made to lob an instant secondary projectile - or perhaps just a faster one. Now, if speed is not instant, and even when it is, it takes a little while for the engine to process a trigger and apply a RES. This means that over a short range (we could experiment with variables and speeds to set the actual time) the "smart" projectile would not arrive ahead of the main arrow, bolt etc. quickly enough for the engine to react to the custom spell state or another marker we use for singling out the creature.

 

This means that in a point-blank shot the effects of the invisible arrow would not apply, but they would apply over a longer range, because the main missile would still be traveling. In practice, if a custom spell state is used, it should take a second for the engine to respond and the RES to take hold. But - and this is the best part - we can easily delay the engine's reaction by putting Wait(1) or another interval in the action. One second's special delay plus the regular delay is around two seconds during which a shot would have a normal chance of hitting. This should respond for 2/3 of the distance. Later (which is to say farther away from the shooter) the real arrow would find the target under an AC bonus. And if we decide to mod ranged combat for long-distance shooting, we might include two invisible projectiles, one with an AC bonus for medium range, the other, slower-traveling, with a further bonus for long range.

 

If this is, in outline, possible, it should circumvent the fact that the engine does not measure distance for THAC0. We could have sharpshooters and generally more interesting ranged combat.

 

What do you think?

Link to comment
it should circumvent the fact that the engine does not measure distance for THAC0.

 

As a matter of fact, it does. Point-blank shots (~6' or so) receive thaco penalty (-4 or -8? I forgot) that goes away at longer range.

 

If this is, in outline, possible

 

Simple yet solid obstacle - what happens when multiple characters attack the same target? Especially with different weapons at different ranges, so that effects start applying to wrong attacks.

 

As far as academic interest goes, you can just apply the desired "RES" directly with a delay, instead of spell state. With random timing included, albeit less flexible than what SmallWait() would allow.

Link to comment

There is only one THAC0 check for any given attack, regardless of how many projectiles or targets it has. They either all hit or all miss. You might be able to use such or similar to adjust the damage of the attack based on range.

 

But it's possible to apply an effect separately from the projectile, correct? Using an included Cast Spell, for example. Which would have a different projectile, maybe an instant one. That's really the crux of the question: can two separate, different projectiles be fired in one shot? I know a spell can be made to throw one group of effects instantly and another to sail along at a leisurely speed. Well, can missile weapons work the same way? If not, then the whole idea falls through, if they can, then there may be just one THAC0 check. The "smart" projectile to go first doesn't need any checks. It can be an automatic hit. All it needs to do is increase, or decrease, missile AC of the target, and then the actual, effective projectile will have to roll against that AC when it arrives. This is the same as if a creature shot at managed to pull off a defensive spell while the arrow was on the way. There is no need to even involve baldur.bcs here, just vary the speed of the invisible projectile or put a one-second delay in the AC bonus.

 

To Ardanis: there are solutions or at least ways around the problem you bring up. They are not perfect, but I think we should always weigh a gameplay change's imperfection against the fun factor, and if it promises enough fun, let it be makeshift. In this case the RES applied to the remote target could and should include a Remove Effects by Resource effect (opcode 321), pointing to the same resource and higher on the list than the AC bonus. The "smart" missile would clear the target of all previous applications, making sure the bonus isn't cumulative. I often use this technique while modding. As for what would happen if one creature shot at a target from far away and another fired from close by against what is now a more difficult AC, I don't have a ready answer. But in practice, thinking about actual situations, how monsters group or party characters stand, when missile weapons are likely to be used and how long it usually takes for a missile to cross the distance, we can probably avoid this situation almost always. Make the AC bonus last two seconds at most, make it non-cumulative, and this will hardly ever come up.

 

Other, non-human, slower projectiles might take a longer duration. Take ankheg acid-spitting. The blob is slow, so with an invisible fast projectile giving a delayed AC bonus it would actually make sense to try to run away from it, just like in real life.

Link to comment

But it's possible to apply an effect separately from the projectile, correct?

A weapon can apply effects separate from the projectile, but from not the attack itself. The attack must first hit(succeed the attack roll/THAC0 check) for any of its effects to trigger.

That "Cast Spell" effect won't trigger until after the attack has already had its attack roll/THAC0 checked, and either hit or missed(which will prevent the "Cast Spell" effect from triggering at all).

Link to comment

Damage effects with a delay aren't actually applied until the effect timer fires ... Right?

 

Is the damage total rolled at the time of cast / launch or when the projectile arrives?

 

If it is at arrival then you could apply a temporary resistance bonus rather than an AC bonus.

Link to comment

But if it's only one projectile, how would we know what the distance is? The resistance would apply for any shot.

 

I've looked at arrows and bows just now this way and that, and while I think I found a way to have two projectiles, there is no way to factor in proficiencies, racial enemies and other hard-coded bonuses to attack. Alas!

Link to comment

If the arrow hits - sooner or later - then it's going to apply the effects. And let the damage be delayed, it's still going to apply. So what is the difference? My idea was to use two projectiles, one of which, in effect, would warn about the other too late. When there is only one shot, there is no way to play on the time interval.

Link to comment

Using an arrow with a max range of 30, long range at 15+, and does 2d3 damage at short, 1d3 long.

 

The "shot" fires two projectiles, A and B.

A is has a range of 30, does 1d3, and has the appropriate visual effect attached.

B has a range of 15, does 1d3, but has no visual effect.

 

Now this only covers damage, and it doesn't have to be halved. It can come with all kinds of extra functions, like an immunity to that 2nd projectile, for example.

 

I wonder if you could factor in thac0 modifiers using two equipped effect auras on the weapon. [edit: no, because of obvious reason, but I'll leave it here anyway]

 

Aura 1 has a range of 30 and applies a +2 (or whatever) bonus to AC vs missiles.

Aura 2 has a range of 15 and applies a -2 (or whatever) bonus to AC vs missiles.

So to range 15 has no bonus to target's AC, 15 to 30 gets a +2 bonus.

Link to comment

How do you implement the auras? As always-active spell effects?

 

I don't know anything about these auras, I confess. But you know, in principle, we don't need to attach these to weapons. We can put them directly on characters and creatures, permanently, so everyone always irradiates everyone else. The trick is in preventing the effects from being cumulative with each other of the same type(range) and the other range. We could do it like this - for the short aura, in the effects list top to bottom:

 

Remove Effects by Resource (remove the short aura SPL in case it's already in effect from someone else)

AC penalty (say, -4)

Immunity to this SPL (to avoid cumulative effects again)

 

Apply it repeatedly every 2 seconds, maybe.

 

There is a problem with an overlap of the short and the long auras, though. If there are two, they are going to cancel each other out sometimes. With just one aura, it may be possible. And I think one aura, for the long range, should be enough. Since there is a point-blank shot THAC0 bonus already, I think that does it. When a creature is within 10 feet, it's probably sword time. Long range would add more to the fun.

 

The overall problem with AC, though, is that it's for everyone. It's like a public face of a creature. It's not personal to the shooter. Long-range attackers or short-range attackers, they have to deal with the same missile AC of the target. Lower or raise it for one and you'll hinder the other. It's not game-ruining, but still, if it's possible to avoid it...

 

Fiann's idea is attractive, and simple too. But I still think a change to THAC0 would be more interesting - if only hit or missing, getting hit or not getting hit is a bigger thrill than for how much damage (especially to mages). If we can fight for THAC0, we should.

 

So how about auras that apply opcode 167 - Missile THAC0 bonus? Make everyone always exude these auras, and make it so they give people -4 or -2 to their missile THAC0 beyond 30 feet. I imagine it as putting a big skirt around everyone, like in a dervish dance. And everybody who is hit by that skirt gets blinded, sort of. We can avoid cumulativity from overlap as I suggested, and how to prevent party characters from suppressing each other's THAC0, if they stand near? Or how to prevent Kobold Commandos from hampering each other? Well, there are two sides to the struggle of good and evil, GOODCUTOFF and EVILCUTOFF, and we can have two sets of penalties. The side of evil would be immune to its own aura SPL, and the good guys would be immune to theirs.

 

My only concern here is performance.

Link to comment

One aura per CRE means that you'd have to treat short/long range as the same for all weapons. Attaching it to the weapon let's you have 8/16 for daggers and 15/30 for short bows, etc. But yes, you saw the problem that happens either way, which is cumulative bonuses. It's easier to avoid with your one-range-fits-all, but neither is worth all the coding to implement, imo. I'd just focus on the damage, since it's so much easier to execute.

 

Another way to do it might be to make the longer ranged projectile pass a saving throw vs breath.

 

tl;dr I'm not a fan of permanent/persistent auras. I have only one that I'm working on, and it's self-blocking, run in the ARE script, and is only during combat.

Link to comment

Well, we could always remove the auras separately, if they become a problem. But this engine can probably take a lot more stress than I gave it credit for. For example, Otiluke's Sphere applies something like 51 timed effects to a creature at once.

 

Anyway, I hope, of course, that someone does something with these or other ideas for projectiles. But for me this was mostly a mind game, because if we discovered a way to factor in range, that would only be a worthwhile change if we extended missile range by 1.5 at least, or doubled it. There is no point to dividing the 30-feet or 50-feet range into zones. But if we increased shooting range, we would have to increase everyone's vision as well, monsters too. That would upset the balance of encounters and pace of gameplay momentously, and we don't really have the tools to add some genuinely new mechanisms and abilities that would tip the scale the other way. This would be a better game, IMO, if maps were larger, arrows shot farther and melee fighters had options for cover, sneak attacks, crawling and other things you can expect from a real wargame like Jagged Alliance. Combining the excellent role-playing engine of the Infinity games with proper wargame mechanics - I think that's the future for isometric RPGs. But that will take more than modding.

 

Aftermath has actually put the kabosh on several bright ideas I've had. It's not that they couldn't be implemented or simulated, but they would stick out like Ramazith's Tower. Then again, the original small concepts I was going to grow new systems from sometimes turn out to be quite applicable and nice, with some tuning. :)

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...