Gravity not affecting ballistic range properly

Gravity not affecting ballistic range properly

Various things about Spring that do not fit in any of the other forums listed below, including forum rules.

Moderator: Moderators

User avatar
munch
Posts: 311
Joined: 26 May 2005, 20:00

Gravity not affecting ballistic range properly

Post by munch »

I noticed the other day that though gravity is modelled correctly in physics terms, the engine doesn't adjust unit range appropriately, which means gravity doesn't have any real effect on gameplay.

On low gravity maps ballistic rounds like plasma should go further - on higher gravity maps they should have a shorter range.

On a low gravity map, a fixed gun like an MRPC will just refuse to fire beyond its normal range (indicated by range ring) even though it can fire further in a low-g environment. On a high gravity map, it will happilly try to fire well beyond its reduced range and just end up making holes in the ground.

Similarly, a mobile unit like a Hammer will get closer to it's target than it needs to on a low gravity map, and on a high gravity map, just doesn't get close enough.

I guess the solution is to calculate weapon range on the fly, instead of relying on a precalculated "range" figure - presumably we want this anyway, so that units on high ground can take advantage of the range advantage they have?

Cheers

Munch
Kixxe
Posts: 1547
Joined: 14 May 2005, 10:02

Post by Kixxe »

I agree

Right now gravity has an effeckt of wrekage, and how long a unit is airborn becuase of explosion.

This could lead to divsety in maps, where 1 map for example has low gravity, where a popup cannon can shot as long as a bertha. Or on hig gravty maps, where longrange wepons are useless.

1 problem tho... missiles. how are we gonna calculate gravity on missiles whitout it looking corny?
User avatar
GrOuNd_ZeRo
Posts: 1370
Joined: 30 Apr 2005, 01:10

Post by GrOuNd_ZeRo »

In OTA, targetting range was never increased due to gravity as far as I remember.

I also think that when a weapon travels beyond it's range it should gradually lose it's destructive force and lose speed.
User avatar
Buggi
Posts: 875
Joined: 29 Apr 2005, 07:46

Post by Buggi »

Ironically this should be an easy fix @___@

Load map, load gravity and iterate through all units and adjust the range as a % of gravity from the default.

I'll look into it.

Oh, just what IS the default gravity?

-Buggi
User avatar
[K.B.] Napalm Cobra
Posts: 1222
Joined: 16 Aug 2004, 06:15

Post by [K.B.] Napalm Cobra »

Why would gravity reduce firing distance? Gravity goes vertical not horizontal, the unit would merely aim further up to compensate.
Icedragon
Posts: 20
Joined: 16 Jun 2005, 06:07

Post by Icedragon »

It has to do with projectile angles. While that would work at minimal effective range difference, it doesn't work much farther in or out. For every angle that a projectile can be fired, it's opposite across a 45 degree line yields a hit in the exact same spot, baring different wind resistances. At the edge of the range circle, the unit already has few firing angles at which to land a shot on or near the target, thus when non-normal gravity comes into play, aiming becomes even more difficult.
User avatar
Delta
Posts: 127
Joined: 09 May 2005, 15:33

Post by Delta »

Since lower gravity makes the projektile fall slower, it goes father before hitting the ground.
For example: a shot is fired in 45 degrees in earth gravity (maximum weapon range) this reaches 1500 meters. When the same weapon fires in the same angle in a environment with half of earth gravity, the shot reaches maybe 4000 meters.
This since the vertical acceleration/(gravity) slows the vertical speed of the shot much slower than on earth. 9,82 m/s^2 (earth) compared to 4,91 m/s^2.

(I dont remember the exact eqations, but this shuld be somewhat accurate)
SJ
Posts: 618
Joined: 13 Aug 2004, 17:13

Post by SJ »

Someone would have to adjust all the weapons first for this to be feasible since otherwise some would get more or less infinite range.

And it will make it really hard for map makers to adjust gravity since any deviation from the normal will tend to make ballistic units either worthless or a must have.
User avatar
Min3mat
Posts: 3455
Joined: 17 Nov 2004, 20:19

Post by Min3mat »

Basic (AS level) eqquations to use are:
v=u+at
s=ut+1/2at^2
assuming no air resistance. i thiunk theres another 1 but i cant remember :S
Icedragon
Posts: 20
Joined: 16 Jun 2005, 06:07

Post by Icedragon »

SJ wrote: And it will make it really hard for map makers to adjust gravity since any deviation from the normal will tend to make ballistic units either worthless or a must have.
But as a RTS this is exactly the kind of thing that you want to have mulling over in the player's brains. "Well, let's see this planet has a gravity of .95G so I'm going to go with long range balistics units over missle units."

All mappers would have to do is not adjust gravity by extraordinary ammounts if they don't want the ranges of units to be adversely affected.
Keep in mind I have yet to look at the mapping tool(s) but I assume that there is variable gravity rather than "Low-Normal-High" radio buttons.
User avatar
Delta
Posts: 127
Joined: 09 May 2005, 15:33

Post by Delta »

Then its just up to buggi (his mapconv) to include a simple equation to illustrate how the gravity affects weapon ranges when set for the map.
example (assuming 100 is standard):

"gravity: 70 ==> range: 1,5x normal"

(not calculated values)
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Post by zwzsg »

Like SJ said, you'd need to redo all ballistic weapon, or balance will be turned upside down, since in TA very few guns fired at 45°.
User avatar
munch
Posts: 311
Joined: 26 May 2005, 20:00

150

Post by munch »

Buggi wrote: Oh, just what IS the default gravity?

-Buggi
150 yeah wierd number =)

Munch
Last edited by munch on 16 Jun 2005, 15:03, edited 2 times in total.
User avatar
munch
Posts: 311
Joined: 26 May 2005, 20:00

Plasma balance

Post by munch »

SJ wrote:Someone would have to adjust all the weapons first for this to be feasible since otherwise some would get more or less infinite range.

And it will make it really hard for map makers to adjust gravity since any deviation from the normal will tend to make ballistic units either worthless or a must have.
LOL well it's funny you should say that, because a while back when somebody was suggesting we had spherical maps, it did occur to me that LRPCs would probably put their shells in to orbit.

As for having infinite range on reduced gravity maps, that's not true - range decreases linearly with gravity - double the gravity and you get half the range (contrary to the dubious interpretation of Min3mat's excellent rudimentary physics posted earlier).

There are a number of points here:
  • 1. Map makers can already change gravity - as you know, the engine already supports it.... it's just that the units aren't aware that they have a different range.
    2. You're right it would be feasible to have very high gravity maps which make ballistics infeasible, but then a lot of maps make use of ships infeasible. It just makes for a different game (think of pincushion)
    3. You don't have to go for something outlandish, you could make small adjustments
    4. It's not as simple as low gravity = longer range = better. Low gravity also gets you flatter trajectory (less ability to shoot over wreckage), longer flight times for HT shots (which means you get lower accuracy and also a mobile target is more likely to have moved).
But all of this is pointless because the engine already does all this, as you know!! Gravity already has all these effects in game... it's just the range calculation that's wrong... because it's not calculated, it's fixed before the game starts.

For this to work, I think we have three options:
  • 1. treat plasma rounds as magic bullets, which work on some psuedo gravity of their own (would be a real shame IMHO considering how realistic the physics is in the rest of the game),
    2. calculate range on the fly, so that in high gravity you can't attempt to attack a target beyond your max range, in low gravity you aren't prevented from shooting at a unit just because the fixed range calculation is wrong
    3. Just allow anybody to try and shoot at anything, and not limit fixed guns from shooting beyond some range. I.e. they behave the same as they do for high gravity right now - they try and hit the target, but fail. Surely that's an easy fix?
Just my tuppence

Munch
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Thankyou for that, you hav reminded me of the oval and cylindrical weapons ranges and infinite aircraft altitude with weapons diminishig i n power and accuracy with height.
Spectre
Posts: 42
Joined: 03 May 2005, 16:57

Post by Spectre »

munch you forget that there are units which have a high plasma velocity. A Fido could fire 10x further when range was calculated with equations on the fly... and a bertha for example could fire at least from one edge of a 32x32 to the other...

edit: but I agree units with a lowered range should be stopped from firing when their target is out of the new range.
User avatar
Delta
Posts: 127
Joined: 09 May 2005, 15:33

Post by Delta »

munch wrote: ...
range decreases linearly with gravity - double the gravity and you get half the range (contrary to the dubious interpretation of Min3mat's excellent rudimentary physics posted earlier).
...
This puzzled me a lot (enough for me too look it up on wikipedia) and after testing it with some calculations I realized that you are right, (I've forgotten way to much physics in the past year).
I stand corrected...
User avatar
sp2danny72
Posts: 60
Joined: 09 Jan 2005, 04:52

Post by sp2danny72 »

There is a couple of things that could be done that will make it
possible to have low-gravity maps without it affecting range too
much: one is to implement air-resistance, another is to have
all range-weapon lose strength as the shot travels, and dissapear
when strength reaches zero. Yet atother possibillity is to
recalculate firing-strengh (velocity) for all weapons on map-load
taking gravity into account, so that the actual range equals the
given. Or that map-maker could just specify a velocity-modifyer.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Post by zwzsg »

:idea: Idea! :idea:

- Make plasma shots affected by gravity.
- Make it so that on high gravity maps, ballistic weapon range is limited by the gravity law.
- Make is so that on low gravity maps, ballistic weapon range is limited by their "range" tag in the weapon tdf so we don't have fido firing intercontinental rounds.

The idea is that ballistic weapon would have two limits, the gravity limit, and the limit defined in the weapon specification, and would be limited to the lowest of the two.

That way, if someone feels like using only gravity-determined range, all he has to do is to modifiy all weapons tdf to put ridiculously high value in each "range" tag. So that's easily available for anyone feeling like making that for his own mod, but OTA units keep their range balanced.

OH NOES!!! THAT'S WHAT OLD TA AND SPRING ALREADY DO!!! SO THIS THREAD IS USELESS!!!

I just tested, by modifying a .smd to give a map a gravity of 7000, even XTA berthas can hardly fire further than their barrel length.

You want ballistic weapon range to be only limited by gravity? Fine, take HPIView and HPIPack, open every file in /weapons/, and everytime you see ballistic=1; change the range to something extreme. You don't need any change to the source code. You don't need any coding skill.

However, it's true that a few minor issues need to be adressed:
- I ordered said bertha to fire a screen away, it accepted the order, turned at an angle of maybe 20° instead of 45°, and fired, the shot fell to the ground a few meters after going out of the muzzle. Instead, the bertha should have refused to fire. Or at least fire at max range, 45°.
- Range circles that are sometimes shown must adapt if the gravity limit is lower than the range tag limit. Possibly with a slightly different color. I hope it won't take too much CPU to draw many real ballistic range deformed by relief, but just show a circle with a radius of ballistic range on flat terrain if it does.
- Units mustn't try to fire at something out of the ballistic range, even if under the range tag.
- Allow ballistic weapons to not have no range tag, and that would mean, range only limited by gravity.
10053r
Posts: 297
Joined: 28 Feb 2005, 19:19

Post by 10053r »

It seems that we have 2 problems. Both of these problems were hidden in OTA, because the game designers went out of their way to hide it. In spring, however, we are probably better off dealing with the problem.

1) Range circles displayed to the user are not realistic. They neither reflect gravity, nor terrain. This needs to be fixed.

2) Range on ballistics is not a derivative of gravity, firing angle, bullet speed, and terrain. Instead, it can be set magically as an independant variable. I think this should be fixed as well.

We will have to fix all the units so that you set bullet speed rather than range, but we will end up with a much more realistic system that is more intuitive and will ultimately make for a more varied and interesting game. Map makers will be able to decide if they want ballistics to be a large factor in the game, and can choose to make maps where toasters can fire across the whole map, or berthas can only fire one screen. Unit scripts will have to be smart, as bomber bombs are now ballistic as well, and the bombers will have to be smart about where they drop their bombs.
Post Reply

Return to “General Discussion”