Doing tank-combat, with angled armor.

Doing tank-combat, with angled armor.

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

Post Reply
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Doing tank-combat, with angled armor.

Post by Argh »

Now, before everybody jumps on me- I haven't done this yet, but this is how I think it can be done:

1. Weapon hits, does instant damage (that works now in SVN version). Have the weapon do a very specific (and very low) amount of damage.

2. Get the weapon hit-by angle.

3. Cross-check the amount of damage done vs. previous hitpoints to determine the exact type of weapon.

4. Cross-check the weapon type, the hit-by-angle... and... here's the big part... explode a weapon attached TO THE UNIT at the UNIT'S CENTER that can ONLY DAMAGE THAT UNIT TYPE. The amount of damage done would be determined by the logic that is checked.

iow... make damage occur via scripted event. Now that we can make units damage themselves completely reliably, it should be easy.
User avatar
yuritch
Spring 1944 Developer
Posts: 1018
Joined: 11 Oct 2005, 07:18

Post by yuritch »

Weapons in Spring always aim for the center of the hitsphere, right? If so, this will definitely work.
However, I can see some problems with this method. What happens if the unit has self-repair (or is repaired by something else while being attacked)? Stored hitpoints will be inaccurate then... Some form of weapon ID is needed in the HitByWeapon() script function.
User avatar
Nemo
Spring 1944 Developer
Posts: 1376
Joined: 30 Jan 2005, 19:44

Post by Nemo »

Some form of weapon ID in the script (as well as angleX, angleZ :D) is coming (hopefully) fairly soon. Yeha said he'd work on it.


I like that idea argh, although its potentially a CPU-clogger with all the things that need to happen, scriptwise, with every weapon hit.

What I've been working on is using very small shields to represent different armor sides - say one for each side of the tank, as well as front and back.

Then, have the weapon that's firing at the tank fire a shell that does zero damage to anything with armor - its still deadly to infantry, buildings, whatever, so it has its normal AoE (but doesn't damage armor, so the shields not blocking area of effect damage problem is avoided).

The trick is that every time the 'shell' fires, I script-fire a beamlaser that DOES damage the tank, and which the shields can block (and thus drains the shields). Beamlaser because its the only weapon type that hits consistantly. By sleeping a bit between the firing of the shell and the firing of the damage dealing beamlaser, they can be made to hit at very close to the same time. The issues with this are 1) it'll be difficult to know what the status of your tank armor is, and 2) unable to be repaired (shields just have to regenerate on their own over a long time)

Unfortunately, 99 times out of 100, the beamlaser script-fires at a totally random angle into the sky. I've tried slaving it, but it results in weird things where the beamlaser keeps firing when it shouldn't, or never fires when it should, ect.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: Doing tank-combat, with angled armor.

Post by KDR_11k »

Argh wrote:2. Get the weapon hit-by angle.
We've tried that before ("we" being those of us who tried to use realistic tank battles in their mods), Spring doesn't report the angle at all.

Nemo: HIDDEN lasers? Why didn't I think of that *hits head on table*?

I can force fire beam lasers in Dozers (development version, the published one doesn't have force fired lasers) but I wouldn't slave them to a ballistic weapon since those can often fire when a beam laser doesn't get a free line of fire so maybe make the beam fire normally and slave the ballistic weapon to it.
User avatar
Nemo
Spring 1944 Developer
Posts: 1376
Joined: 30 Jan 2005, 19:44

Post by Nemo »

Yes, hidden (low intensity)

Its okay for low angle ballistic weapons even firing from the same firepoint. However, if it has the possibility of firing when the laser could not, just set the firepoint for the beamlaser to be up in the air above the unit. As long as there's no flare/indication that the beamlaser is firing, it can fire from a hidden point high above the unit and so have roughly the same ability to hit over slight terrain as a ballistic weapon.
Saktoth
Zero-K Developer
Posts: 2665
Joined: 28 Nov 2006, 13:22

Post by Saktoth »

Hrrm... interceptor weapons with specific angles?

I think i read somewhere that this can be done, that interceptor weapons can be given angles. I dont know how feasible it is in system resources reliability etc. Ive spent the last hour trying to do this, interceptor seems really fussy, im not sure what variables it needs exactly to function (Twostage, at least, i think)- though ive figured out it doesnt need to be a stockpile weapon.

Anyone else know more about how interceptor weapons work?
Saktoth
Zero-K Developer
Posts: 2665
Joined: 28 Nov 2006, 13:22

Post by Saktoth »

Tested it, it is utterly infeasible.

Perhaps linking two units together, using transports. Units cannot be made to fire while loaded, so i guess no modular turrets and chasis and what have you- but they can still be hit by weapons. Perhaps there is some potential there to do something, but i guess in the end the shield thing sounds like the most elegant approach.
User avatar
MadRat
Posts: 532
Joined: 24 Oct 2006, 13:45

Post by MadRat »

So is this a plea for m$ Close Combat style of combat?
User avatar
yuritch
Spring 1944 Developer
Posts: 1018
Joined: 11 Oct 2005, 07:18

Post by yuritch »

Saktoth wrote:...Units cannot be made to fire while loaded...
Units CAN fire while loaded. This is controlled by IsAirBase FBI tag on the transport unit (I seem to remember it was split into 2 tags some versions ago, can't remember their names, look in the changelog for them).
Loaded units can't be controlled by the transport unit (it cannot pass fire orders to loaded things), so such "turrets" will fire on their own.
Post Reply

Return to “Game Development”