Beam physics

Post ideas & suggestions you have pertaining to the game here.
george moromisato
Developer
Developer
Posts: 2875
Joined: Thu Jul 24, 2003 9:53 pm
Contact:

Mon Nov 28, 2016 4:52 am

I'm thinking of introducing a radical change to beam weapons and I'd like to solicit opinions.

As you know, speed/distance in Transcendence is reasonably accurate. A laser beam travels at lightspeed, which in the game is about 48 pixels per frame (30 frames per second). Everything else is proportional to that: ships move at ~20% of lightspeed, so about 10 pixels per frame; missiles travel at ~50% of lightspeed, so about 24 pixels per frame.

The problem is that the speed difference between beams and missiles/bullets is too small. If beams were much much faster (say, 10 times faster) we would get more interesting mechanics. Bullets/missiles could be dodged and would be harder to aim, but beams would be faster and more accurate, and would presumably have trade-offs (weaker, etc.).

A larger speed difference would be good for the game, which is why people like creating hit-scan weapons.

There are two obvious problems: (1) all beam weapons would have to be re-balanced; (2) we'd have to abandon the "realism" of speeds in Transcendence.

PROBLEM 1: RE-BALANCING

If we like the idea of faster beam weapons, I think re-balancing will be worth it. It won't happen for the end-of-the-year timeframe, but that's OK. I'm thinking of changing a subset of current beam weapons to the new system. All laser weapons, obviously. But not all particle weapons need to change, nor all ion or positron weapons. Those can have a diversity of speeds (with appropriate trade-offs).

We'll have to test out the new system to get a feel for the proper balance, so it will take time, but I think it will be worth it in the end. I'd love to hear opinions one way or the other.

PROBLEM 2: REALISM

This problem is minor--game mechanics trump realism--but in this case I think we can have both. The trick is to ADD more realism.

Imagine that you're on a ship 1 light-second away from a station. The station fires a laser beam at you at time 0. The beam reaches your ship at time 1 (one second later). Here's the question: When do you (on the ship) first see the station fire the beam? Since it takes 1 second for light to reach your ship from the station, you won't see the beam being fired UNTIL IT HITS YOU. From your perspective, the beam has traveled at INFINITE SPEED (i.e., you had 0 warning time).

You get the same effect for all speeds. For example, imagine the station fires a missile at you at 50% of light-speed. The station fires at time 0. The light from the missile launch reaches your ship 1 second later at time 1. But by this time, the missile is in reality half-way to you. The missile hits you at time 2 (2 seconds after launch). But because you didn't see the missile until 1 second ago, it seems to you that the missile flew AT LIGHTSPEED.

We can derive an equation for how much faster an object appears to be:

Code: Select all

Speed-Factor = (1 / [(1 / S) - 1]) + 1

where S is the speed as a fraction of lightspeed (0.5 = 1/2 lightspeed).
The result, Speed-Factor, is what you multiply the actual speed to determine the APPARENT speed. As you can see, when S=1, we get a division by zero because the speed factor is actually infinite.

Obviously this equation won't work at lightspeed, but we can cap Speed-Factor at some high-value (e.g., 10) and get the effect we want. Thus implementing this formula means that when you specify that a beam is speed="50" (50% lightspeed) we run it through the formula and get an apparent speed of 100% of lightspeed. Higher speeds give us apparently superluminal speeds.

IMPLEMENTATION DETAILS
From a practical perspective I plan on implementing this by introducing a new weapon type. Most weapons are either type="missile" or type="beam". I'm going to introduce type="continuousBeam". This kind of weapon will be able to draw a solid beam across multiple repeat frames (for example, for the mining laser would end up as a single solid beam instead of four separate line segments).

In addition, I would add the above speed adjustment so that light-speed actually ends up being about 10 times faster.

This would only work on continuousBeam weapons, but I can imagine in the future adding flags to control that behavior separately on all weapon types.

continuousBeam weapons will show up in the next beta so we can try it out. Let me know what you think!

User avatar
Shrike
Fleet Admiral
Fleet Admiral
Posts: 2702
Joined: Mon Aug 17, 2009 4:27 am
Location: Scouting the borders of sanity (there's a lovely view of the abyss).

Mon Nov 28, 2016 5:22 am

Personally I consider most non-beam weapons to be too fast rather than beam weapons being too slow. Stuff like the flenser can easily get slowed down. But at the same time, this would be an interesting change. In terms of balance, I'd prefer focus on armors and shields.
Your friendly local genderqueer weapons designer & forum moderator. My pronoun is "They".

User avatar
Xephyr
Militia Captain
Militia Captain
Posts: 828
Joined: Fri Dec 14, 2007 1:52 am
Location: Orion Arm, Milky Way
Contact:

Mon Nov 28, 2016 5:45 am

I wouldn't be too worried about time scales when it comes to beams.

The game is split up on so many distance scales - Space, stars, worlds, stations & ships. So, which one should we measure beams on? It's entirely acceptable to add in another scale where we measure continuous beam weapons, where regular beams honor the space scale.
Project Renegade (Beta) : "The Poor Man's Corporate Command!"
"Cowards die many times before their deaths; The valiant never taste of death but once. " -Julius Caesar as written by William Shakespeare, a notorious permadeath player.

User avatar
JohnBWatson
Fleet Officer
Fleet Officer
Posts: 1355
Joined: Tue Aug 19, 2014 10:17 pm

Mon Nov 28, 2016 1:59 pm

Xephyr wrote:I wouldn't be too worried about time scales when it comes to beams.

The game is split up on so many distance scales - Space, stars, worlds, stations & ships. So, which one should we measure beams on? It's entirely acceptable to add in another scale where we measure continuous beam weapons, where regular beams honor the space scale.
I agree with this. The ability to see lightspeed weapon fire at all is a bit unrealistic.

Shrike wrote:Personally I consider most non-beam weapons to be too fast rather than beam weapons being too slow. Stuff like the flenser can easily get slowed down. But at the same time, this would be an interesting change. In terms of balance, I'd prefer focus on armors and shields.
Being fast is the entire point of the flenser - it's a relativistic weapon. Of course, it could do to be nerfed, but reducing the projectile speed isn't the most intuitive way to do that. Given how close most ships can come to *outrunning* bullets that are fired at them, I don't think slowing most weapons down is a good answer either - the omnidirectional tritium cannon already looks somewhat silly coming from a (fairly slow) Omnithor heavy gunship due to the game's conservation of momentum effects.

User avatar
digdug
Fleet Admiral
Fleet Admiral
Posts: 2600
Joined: Mon Oct 29, 2007 9:23 pm
Location: Decoding hieroglyphics on Tan-Ru-Dorem

Mon Nov 28, 2016 3:47 pm

I'm going to introduce type="continuousBeam".
YES ! awesome !
Also I agree with Xephyr, I'm ok having a different scale for continuous beams and discrete-packets beams. And you know, "beams" are not all supposed to be lasers, particles and ions are not elctromagnetic waves and travel at less than the speed of light, so I'm ok with them looking different and slower.

User avatar
Wolfy
Fleet Admiral
Fleet Admiral
Posts: 5351
Joined: Tue Feb 05, 2008 1:10 am
Location: Somewhere in the Frontier on a Hycrotan station, working on new ships.

Mon Nov 28, 2016 4:36 pm

You could just use the current reasoning behind speeds, and just rescale everything to be 0.1% of C instead of C, and compress the systems so everything APPEARS to be exactly the same, except stuff with 'beam' or 'continuousBeam' which would be going at a value of 1000 instead of 100. Relativistic weapons might need to have their values bumped up.

You will need to improve the hit detection logic though, as currently weapons fire moving fast enough can 'phase through' a target
(shpOrder gPlayership 'barrelRoll)
(plySetGenome gPlayer (list 'hycrotan 'nonBinary))
Image

george moromisato
Developer
Developer
Posts: 2875
Joined: Thu Jul 24, 2003 9:53 pm
Contact:

Mon Nov 28, 2016 5:38 pm

Wolfy wrote:You will need to improve the hit detection logic though, as currently weapons fire moving fast enough can 'phase through' a target
Agreed. The continuousBeam type already handles this correctly, but the other types don't.

PM
Fleet Admiral
Fleet Admiral
Posts: 2235
Joined: Wed Sep 01, 2010 12:54 am

Tue Nov 29, 2016 7:53 pm

I do think beams and missiles are mostly indistinguishable from each other. Beams behave too much like bullets, instead of being hitscan beams as in several other games, including Star Control. I would love beams to become hitscan weapons, instead of being bullets as they are now.

How would FTL weapons work, if we fight aliens with such tech in part 2 or beyond?

With the current game mechanics, humans do have FTL tech, namely news about player crimes, huge nuclear explosions, cyber-attacks or communications, and ship scanners (i.e., what you see on the screen); but are too oblivious or stupid to realize that.

One more thing, the balance formula may be too harsh for hitscan weapons. Hitscan weapons with significant range have huge penalty (like around 100, much like full Omni). They are a bit too weak for player use, but can help the player when attacked by the AI with such weapons.
Download and Play in 1.7 Beta...
Playership Drones v7 (Beta): Acquire and command almost any ship in Stars of the Pilgrim or Eternity Port.
Drake Technologies (Alpha): More hardware for combat in parts 1 and 2!
Star Castle Arcade: Relive classic arcade gaming in a new Transcendence adventure!
Godmode v3 (WIP): Dev/cheat tool compatible with D&O parts 1 or 2.

NMS
Militia Commander
Militia Commander
Posts: 386
Joined: Tue Mar 05, 2013 8:26 am

Wed Nov 30, 2016 2:00 am

Time lag (or the lack of it) actually affects many aspects of the game, including what ships know about their targets' positions. So while instant beams are more realistic in one specific way (you can't see them coming and dodge them), they're actually less realistic in every other way. Most relevantly, they're perfectly accurate against a randomly dodging target.

This is problematic from a game balance perspective. Perfect accuracy out to maximum range strikes me as better than double damage. Many games that have both instant beams and unguided projectiles keep the maximum beam range comparable to or shorter than the effective range of projectiles to limit this advantage. In Transcendence, a maneuverable ship with an omnidirectional instant beam with a range of about 20 light seconds would be nearly unbeatable by any ship using only unguided projectiles.

One way to deal with the dodging issue would be to continue treating light-speed weapons as projectiles, but make them invisible to the player until they've traveled a distance equal to the distance between the player and the point where they were fired (at which point they could be detected, and their path predicted via backscatter). You could even draw an instant beam from the fire point to the current position when the shot becomes detectable to make it clear what's going on. But, by definition, in reality the firing ship would still appear to be at the location where the shot was fired at the time it becomes detectable, raising the question of why the player can see what the ship does without time lag, but not the shot.

Actually modeling time lag (even without special relativity) would require keeping track of what every object has done for at least the past 100 seconds of game time (50 ticks), displaying everything as it was an amount of time in the past based on its distance to the player, and reworking the AI to use information about objects' past positions and velocities to predict their present and future positions. This would make manual aiming nearly impossible without some kind of predictive assistance. Naturally, most (if not all) games throw up their hands at this and just show everything at the same time in the same reference frame.

If you really want to make a bigger distinction between light-speed and sublight weapons, I think adjusting the spacial scale is a better way to do it. However, this would require either doing away with (vaguely) realistic system sizes (as Wolfy suggests), or allowing autopilot to scale up much faster, so that ships could cross systems in a reasonable amount of real time. This might be difficult performance-wise, but NAEV manages it. The lower ship speeds would make the drive technology and weapon accuracy in Transcendence somewhat closer to plausible (still not particularly close though), but lower shot speeds would also (realistically) make nonrelativistic unguided projectiles basically useless against ships.

User avatar
Shrike
Fleet Admiral
Fleet Admiral
Posts: 2702
Joined: Mon Aug 17, 2009 4:27 am
Location: Scouting the borders of sanity (there's a lovely view of the abyss).

Wed Nov 30, 2016 2:12 am

I think NMS has some good points here. Spacial scale is likely the best way to handle this.

On other notes from me, because I am genuinely concerned with the level of change this is going to have:

1. We just got all the weapons rebalanced, and it took several months of tweaking and discussion. This is going to undo quite a lot of work on that front.
and
2. This really should not be thrown into a beta right before a major release. I strongly urge adding the system, but not changing vanilla gear until the 1.8 development cycle. We're already missing a lot of stuff that was going to be in 1.7. That's going to be worse with a major change thrown in right at the end of the beta releases. This is what the alphas are for. Adding major stuff into betas isn't supposed to happen.

I don't like hitscan weapons, especially at long range, but I can probably live with them. Eventually. Under protest. But adding them in like this is a recipe for another major release with balance and playability issues that could easily be avoided by delaying alpha stuff for the next alphas. I strongly urge saving hitscan for Part II weapons, where they can be tested without breaking the established balance in Part I.
Your friendly local genderqueer weapons designer & forum moderator. My pronoun is "They".

snafu
Commonwealth Pilot
Commonwealth Pilot
Posts: 58
Joined: Tue Apr 07, 2009 9:03 pm
Location: London, UK

Wed Nov 30, 2016 2:48 am

NMS wrote:One way to deal with the dodging issue would be to continue treating light-speed weapons as projectiles, but make them invisible to the player until they've traveled a distance equal to the distance between the player and the point where they were fired (at which point they could be detected, and their path predicted via backscatter).
There's another potential method here: make (hitscan) beam weps /incredibly/ energy-intensive ('attenuation' is the current term IIRC) over range, so (say) starting lasers have an instant dmg of x, but this falls off over distance (inverse square over cube rule? can't remember atm). Higher powered beams require more nrg to do similar dmg over further distances (or higher dmg at shorter ranges), with appropriate 'cooldown' times

A 'pulse laser' (as opposed to continuous beam) may offset the cooldown somewhat, at the cost of reduced accuracy & dmg per second. So you get almost insta-hit for short-range or pulse beams (starting ship maybe), & progressively worse results as you rank up thru the beam wep-types unless/until you have a suitable reactor (or charges/capacitors) to fuel them
You could even draw an instant beam from the fire point to the current position when the shot becomes detectable to make it clear what's going on. But, by definition, in reality the firing ship would still appear to be at the location where the shot was fired at the time it becomes detectable, raising the question of why the player can see what the ship does without time lag, but not the shot.
Jack Campbell addressed this problem in his 'Lost Fleet' series quite nicely: how to deal with timescales in fleet engagements that may take only seconds or less over distances that /require/ relativistic motion & consequences. Unfortunately his tactics aren't applicable to Trans as it is currently (the tactics require a fleet rather than a single ship), but it's a good way to start thinking

Eg the Targetting Computer may predict a certain shot from a certain wep would hit at x range, but increase that range or add evasive manoeuvrers (player/AI/WHY action) & the accuracy will fall off..
Dom 8-)

User avatar
JohnBWatson
Fleet Officer
Fleet Officer
Posts: 1355
Joined: Tue Aug 19, 2014 10:17 pm

Wed Nov 30, 2016 6:18 am

NMS wrote:
This is problematic from a game balance perspective. Perfect accuracy out to maximum range strikes me as better than double damage. Many games that have both instant beams and unguided projectiles keep the maximum beam range comparable to or shorter than the effective range of projectiles to limit this advantage. In Transcendence, a maneuverable ship with an omnidirectional instant beam with a range of about 20 light seconds would be nearly unbeatable by any ship using only unguided projectiles.
That's an important point - even regular omni weapons feel a bit OP without reduced range, given that the facings system boosts their effective range significantly relative to fixed weapons. Perhaps restricting hitscan weapons to the role of fixed dogfighting guns would alleviate this issue while making guns that are neither long range WMD nor omnidirectional flyswatters less of a scrappy category.
One way to deal with the dodging issue would be to continue treating light-speed weapons as projectiles, but make them invisible to the player until they've traveled a distance equal to the distance between the player and the point where they were fired (at which point they could be detected, and their path predicted via backscatter). You could even draw an instant beam from the fire point to the current position when the shot becomes detectable to make it clear what's going on. But, by definition, in reality the firing ship would still appear to be at the location where the shot was fired at the time it becomes detectable, raising the question of why the player can see what the ship does without time lag, but not the shot.
I agree with what I think you're saying here - handwaving how the player is able to see everything on the LRS is a necessary evil - going for realistic relativistic physics here would take days of coding while rendering the game impermeable to new players.
If you really want to make a bigger distinction between light-speed and sublight weapons, I think adjusting the spacial scale is a better way to do it. However, this would require either doing away with (vaguely) realistic system sizes (as Wolfy suggests), or allowing autopilot to scale up much faster, so that ships could cross systems in a reasonable amount of real time. This might be difficult performance-wise, but NAEV manages it. The lower ship speeds would make the drive technology and weapon accuracy in Transcendence somewhat closer to plausible (still not particularly close though), but lower shot speeds would also (realistically) make nonrelativistic unguided projectiles basically useless against ships.
I like this idea - NAEV's system was a lot of fun to play around with.

PM
Fleet Admiral
Fleet Admiral
Posts: 2235
Joined: Wed Sep 01, 2010 12:54 am

Wed Nov 30, 2016 2:10 pm

Another thing about hitscan weapons: Unless the weapon has swivel or Omni (i.e., no auto-aim), smaller screen size and limited facings means that additional range beyond a certain point is useless for the player. Hitscan weapons are very effective under auto-aim. With auto-aim they will hit. However, in case of repeating hitscan, and you usually want repeating so that the beam stays visible long enough, AI only aims at the first frame, then merely maintains that angle, such that a moving target often takes hits for only some of the frames.

Hitscan weapons that are balanced by the current balance algorithm are a bit underpowered for the player because at short ranges, say, anything you see on the screen, a simple light-speed weapon (with 100 speed shots) is fast enough to hit things within a few frames simply by point-and-shoot. It helps lessen the damage player takes when he gets sniped at by the AI from long range.

My biggest problem with hitscan weapons in part 1 is I cannot really mod those weapons in for humans without (probably) violating canon (unless I have a special plot reason for an adventure). The sooner part 2 comes out, the sooner I can export them to a faction that has FTL tech.
NMS wrote:In Transcendence, a maneuverable ship with an omnidirectional instant beam with a range of about 20 light seconds would be nearly unbeatable by any ship using only unguided projectiles.
Twenty light-seconds is very short. At that distance, a simple 100 speed weapon is about as accurate, and much more damaging than a balanced hitscan weapons with even maximum range of 30. (I added a series of hitscan weapons with range 28 to DrakeTech, and while flashy, I much rather use the normal beam weapons because they have better range and damage, and they are fast enough to be mostly undodgable within sub 30 range. Hitscan weapons become much nastier when they can aim and hit things beyond screen range like say, range 50 or beyond.

Also, for omnidirectional hitscan, that will always hit only if the hitscan attack is not repeating. AI does not update aim for subsequent frames of a repeating attack. For repeating attacks, what happens against a fast target is the first frame or two hits, then the rest misses because the target moved away, but the hitscan beam did not update and track. I wanted to have my Omni hitscan weapons have repeating=7, but that made them underpowered because most of the repeat shots missed against the intended target, due to aim not updating; so I had to settle for less repeating and faster fireRate.
Download and Play in 1.7 Beta...
Playership Drones v7 (Beta): Acquire and command almost any ship in Stars of the Pilgrim or Eternity Port.
Drake Technologies (Alpha): More hardware for combat in parts 1 and 2!
Star Castle Arcade: Relive classic arcade gaming in a new Transcendence adventure!
Godmode v3 (WIP): Dev/cheat tool compatible with D&O parts 1 or 2.

george moromisato
Developer
Developer
Posts: 2875
Joined: Thu Jul 24, 2003 9:53 pm
Contact:

Wed Nov 30, 2016 3:02 pm

Shrike wrote: 2. This really should not be thrown into a beta right before a major release. I strongly urge adding the system, but not changing vanilla gear until the 1.8 development cycle. We're already missing a lot of stuff that was going to be in 1.7. That's going to be worse with a major change thrown in right at the end of the beta releases. This is what the alphas are for. Adding major stuff into betas isn't supposed to happen.
I totally agree with this. That's my plan. Add the underlying mechanics but leave weapons alone until a future update.

The reason I'm adding the mechanics at all is because I need them (want them) for Part II.

george moromisato
Developer
Developer
Posts: 2875
Joined: Thu Jul 24, 2003 9:53 pm
Contact:

Wed Nov 30, 2016 3:04 pm

PM wrote:My biggest problem with hitscan weapons in part 1 is I cannot really mod those weapons in for humans without (probably) violating canon (unless I have a special plot reason for an adventure). The sooner part 2 comes out, the sooner I can export them to a faction that has FTL tech.
This is why I floated the idea of using light-lag and apparent velocity as a way of explaining hitscan weapons without invoking FTL. I still think that explanation is plausible enough.

Post Reply