Odd Beam Behavior


I’m testing out a concept for a beam weapon that constantly stays “on”, meaning it doesn’t have a visually detactable firing interval. In my attempts, I set it so that the beam duration is longer than the firing interval. No dice though, since there’s still gaps between firing. Oh well.

However, I found something really weird. If a target is inside minimum distance, it shouldn’t be fired upon, right? Here is a section of the salient code:

beam_duration = 300
beamwidth = 18.0
blasttexture = "beam_orange_atlas.dds"
cost = 1200
damage = 25
fire_interval = 250
grain = "beam_purple_atlas.dds"  
has_grain = 1
icon = turret
max_range = 1400
min_range = 1350
optimum_range = 1375

When testing the weapon out, though, I noticed something weird. Despite clearing the (extremely high) minimum distance, targets will still getting slammed by the beams.
(Big thanks to Darkstar’s Uni-T for being my test dummies again)

I’m completely puzzled by this behavior. The ships are way inside the minimum distance, yet they’re still getting hammered.

And yes, I know the weapon is ridiculous. Just a proof of concept test for right now.


Your welcome, but they aren’t dummies, the AI is just not as evolved as i would like . . .

Had a look at the vid (thanks to my new phone :P) and i mas admit it was rather strange and has me intrigued. Therefore could you please try this:

  • Remove all engines and other weapons from the ship.
  • Feel free to load it out with more sheilds and armor (and maybe one or 2 more of these new PoC weapons) to increase survivability.
  • Deploy the ship in the Point Blank Survival Mission. <-[Most important]
  • Set the max and min range for the PoC weapon to 1500 and 1000 <-[see if the behaviour disapears]
  • Watch the results.

See when the ship stops firing at the drones which are on approach.
My current guess is that there is a minimum number between max_range & min_range for it to work properly.



Anyway, changed max/min to 1500/1000, and plopped the battlestation (I used a different hull for this test) in the Point Blank survival mission.

Behavior was similar, though less pronounced. Some of the probes clearly went past the minimum distance marker yet were still getting hit.

EDIT: Wait, I forgot to remove all other weapons. Hold a sec for another test.


Have you tried setting your beam duration to 99999? Only problem is you get just one hit…hmmm…


OVER 9000!?!?!?!?!?

I’ll give it a shot, but I don’t think it’ll do much. I’ll let you know in a bit.

Star, like I said before, behavior is similar, but not as pronounced. The beams still clearly take swings at your little demolition surprises even when they’re inside the minimum distance, but not nearly as many as in the video.


PoC = Proof of Concept.

Ok, next test.

  • Find a vanilla weapon.
  • Match tne new weapon ranges to the vanilla weapon of your choice. (make sure the beam colors are different)
  • Rinse repeat.

In theory the vanilla weapon and the new weapon should behave the same


I matched it up to the Rebel Beam laser, but it still seems it’s getting some free hits when they’re inside minimum range.


Need more information:
Was it only the new beam that was getting the free hits or were both the rebel and your PoC Beam firing shots they shouldnt ?


It looked like the PoC weapon was getting a few extra hits, but it was hard to tell because the minimum range is 260.

(Sorry, I meant regular beamlaser, with 770/260, not Rebel Beamlaser)



We have 2 beam lasers with the same

  • Min Range
  • Optimal range
  • Max Range
    yet it appears that one of them is getting a few more hits in.

This would mean that the Min/Max/Optimal range is not causing the problems with the new weapon
In other words its possible to have a beam with the following parameters
max_range = 1400
min_range = 1350
optimum_range = 1375
And not have it get extra hits in.

It also means that there is a problem somewhere else in your code.
Fix that and you fix the beam

Post the Entire code for this weapon,
Gives the members of the forum something more to work with and pinpoint the problem.


The beam would disengage when the target was terminated in theory, problem being that no matter how long the beam lasted you only get the initial damage hit…

off to experiment


I suspect that it’s the refire rate. But I dunno.

armour_penetration = 250
beam_duration = 230
beamwidth = 18.0
blasttexture = "beam_orange_atlas.dds"
category = "WEAPONS"
classname = "SIM_BeamWeaponModule"
color = 255,16,16
cost = 1200
crew_required = 45
damage = 10
description = "Placeholder"
fire_interval = 250
grain = "beam_purple_atlas.dds"  
guiname = "Force Beam!"
has_grain = 1
hitpoints = 200
icon = turret
lockable = 0
max_range = 1400
min_range = 1350
name = "ForceBeam"
optimum_range = 1375
powerconsumed = 850
shield_penetration = 250
size = "CRUISER"
slot_type = TURRET
sound = "Solarian/data/sounds/PetawattLaser.ogg"
soundvolume = 1.0
texture = "beam_orange_atlas.dds"
tracking_speed = 12.0
turret_sprite = turret_las_v3
turretsize = 32.0
unlockcost = 0
weight = 170
uisortpos = 9070
restricted = "solarian"


All i can suggest at this point is that you increase the refire rate and see.

Question: Is the name = “ForceBeam” unique ?

Other than that i will have to wait till i get home to conduct live fire testing.
(cant run GSB from phone - pity)


Okay, just did some testing…

We have two fundamental issues, long beam duration only dictates how long we see the pretty beam, no affect on damage/fire. Therefore you are left with only the damage from the initial blast, and tying up a turret for how ever long.

Short fire intervals with slightly longer beam durations (beam duration = 1100, fireinterval = 1000) the problem is the beam often times chooses another target, but does produce a near constant beam.

What you really are looking for I think is a continual damage effect from a beam weapon. IF on windows with the latest version you MAY be able to code a bullet weapon with a beam texture to achieve your desired effect? I hope that makes sense.


Question Magnus,
In your testing did the beam fire outside the range parameters ?
(see youtube video in original post for example)


It didn’t seem to, but with the shorter reset it probably wouldn’t.


Abandoned the idea of using constant-damage beam–since it wouldn’t look like a constant damage beam–and went with the idea of rapid bullets instead.

It seems that the firing beyong minimum distance is gone now, but it’s hard to tell since a bullet can be fired just as the ship enters minimum range and it looks like the ship is being hit.

But anyhow.


EDIT: I’ll probably can this idea. Doesn’t look like what I was shooting for.


Well fear not, it wasn’t all for naught. I did discover a technique of coding weapons that will be vital to me very soon while experimenting on your problem.


I can’t explain this odd beam behavior but I MIGHT be able to assist you in your quest to find a beam that “stays on”

I have 2 such weapons that I’ve had some sucess with, The first is the Genesis Cutting Laser, it’s on a salvo function where the fire interval is equal to the beam duration. With a tracking speed of 1.4 the weapon APPEARS to “flicker” for just a moment when the fire interval kicks in as though.

The second weapon is one I’m developing for Union’s “R&D package” as I’m calling it right now. Essentially its a 1-damage beam with an extremely short beam duration and fire interval on something like a 60 shot salvo. It’s fast enough that the beam appears continuous, except for the fact that it’s jumping all over the target randomly.

Just some info to think about. But as for your question about your beam acting unusual…I’ve got nothing.


When could we expect this Union R&D package?