Split: Player Ship Lasers

General discussion for players of Oolite.

Moderators: winston, another_commander

User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Re: Show and Tell (new ships/ ships in progress)

Post by Commander McLane »

Ganelon wrote:
there's no reason why two lasers couldn't do the same, much like in Elite.
Note that in Elite it wasn't actually two lasers, but merely two lines merging in the middle of the screen, as you say.
Ganelon wrote:
So far as a multiple laser resulting in at least one of the beams being wasted, do we currently see that being applied to NPC ships with multiple lasers?

Yes, of course. Just get into a firefight with an Imperial Courier and you'll see. If your ship is narrower, only the middle laser will hit you. You could even see the other beams miss you and pass by your ship through one of the side views, or an external view.
Ganelon wrote:
A hit would still be determined by "was the target correctly positioned in the reticle" ... But in any case, since the range to the targeted ship is known, there is no reason to assume the multiple beams couldn't converge accurately. ... With lasers, the game engine doesn't need to plot trajectory.
Fortunately you're wrong on all accounts. :wink: In Oolite, laser beams are entities, just like ships. As long as they are visible, they exist physically in the Ooniverse. (You can check this by either hitting 'F' and watch the entity count rise during a firefight, or making an entity dump by hitting 'P' and then '0' during a firefight.) It is really like a very long-and-narrow spike protruding from the firing ship. And this spike needs to physically touch the target in order to count as a hit. Positioning a target in the reticle merely ensures that the protruding spike will indeed hit it. In itself it accounts for nothing. Remember, NPCs can hit you too, and they don't have target reticles.

So it's also impossible to have the protruding spikes converge. For starters, where would you want to let them converge? 1 km in front of your ship? 5 km? 15 km? 30 km? Your target could be at all of these distance, or at any point in-between.

Lastly, because each laser beam is a proper entity, of course the engine needs to plot its trajectory. It does this each frame for each laser that is being fired, and then it checks each laser for collisions with each other entity in order to determine who has hit whom.
Ganelon wrote:
Now, new weapons. Especially kinetic weapons like railguns.. That's a really tantalizing notion. I'd love to see it, but I doubt it will ever happen in Oolite. ... Trajectory of a projectile would take additional math and graphics and etc for the engine (and people's computers) to cope with. Add maybe up to hundreds or even thousands (remember that the NPCs would likely be using those weapons as well, so there could be an awful lot of projectiles flying around) of small items for the game to track in a big furball, and then think of what it would do to frame-rates. It could take a lot of coding, and it could have very undesirable effects on actual game performance.
Not really. Compared to lasers, railguns are a piece of cake. I think I'll use the rest of this evening to come up with one, although it would need to be pylon-mounted or used as a primed equipment at the moment. Each projectile would simply be a small box flying in a straight path for a pre-determined distance. Basically a missile without pitch or roll, with a high initial velocity, and without its own propulsion. That's all. The entity count could be kept down by tuning the firing frequency. No law dictates that a railgun must fire dozens of projectiles per second. Maybe its only one per second, maybe even less. Therefore it doesn't need to create many more entities than a laser is creating anyway.
Ganelon wrote:
Take all that into account, and I doubt most beginner or average players would actually want more than one laser.
That's basically what I wanted to say. If a ship designer hasn't thought it through yet, he may be under the impression that multiple lasers would be good for the player. But actually, accounting for everything, they would be bad for all but the most experienced players. Contrary to the ship designer's intuition they would make life harder for the potential ship owner, not easier.
Switeck
---- E L I T E ----
---- E L I T E ----
Posts: 2411
Joined: Mon May 31, 2010 11:11 pm

Re: Show and Tell (new ships/ ships in progress)

Post by Switeck »

Commander McLane wrote:
But if you want it to appear only together with Thargoids, one easy and guaranteed way is to have it appear only in interstellar space. Make a small script that adds one or a couple of the ships whenever the player has a misjump.
I do find it odd how "crowded" interstellar space is after adding a few OXPs...because they script their special ships to always or almost always be there. :lol:

Best to test with them always appearing but use a low random chance and/or other criteria in the release version.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: Show and Tell (new ships/ ships in progress)

Post by Eric Walch »

Commander McLane wrote:
Ganelon wrote:
So far as a multiple laser resulting in at least one of the beams being wasted, do we currently see that being applied to NPC ships with multiple lasers?

Yes, of course. Just get into a firefight with an Imperial Courier and you'll see. If your ship is narrower, only the middle laser will hit you. You could even see the other beams miss you and pass by your ship through one of the side views, or an external view.
Multiple beams are not wasted but are useful against bigger ships :P . The more the npc has, the bigger the chance that one hits the target. NCP ships are very bad in aiming. They always assume the target must be in front of them, and not in front of the laser. The further the laser is placed out of centre, the bigger the chance of a miss. But this is equal for the main laser as well as for the subentitie lasers. The bigger the target, the bigger the change of a hit. I fly a BCC and despite that it is stronger than the IC, it is probably more vulnerable in combat than the IC because more of the npc ships firing at me do score a hit at my big ship.
Ganelon
---- E L I T E ----
---- E L I T E ----
Posts: 534
Joined: Fri Jul 02, 2010 11:45 am
Location: Around Rabiarce or Lasoce

Re: Split: Player Ship Lasers

Post by Ganelon »

Well, when in a fight, I'm not so good that I have a *lot* of spare time to look around. I do use the views some in the course of fights, though. But I've seen at least a few occasions where I'm at least pretty sure a single beam "passed by" while still scoring a hit, though. I can't say for certain on that unless I basically record some fights and then analyse them in depth looking for instances of that. I don't use a screen recorder much, since I need to run the game in a window to do it and I feel it bogs the game down a bit.

Imperial Couriers are nice little ships, and they bite kinda hard if you're in front of their lasers. I'm usually busy enough taking them out early in the fight to be watching to see how many beams actually hit me. If I'm getting tagged at all, I'm taking evasive action.

So far as what distance the beams converge at.. Well, the game and the reticle are already tracking the distance to whatever ship you have targeted. I was thinking of that, rather than an arbitrary number. However, since you've pointed out that the beams are entities, obviously that point is quite moot. Thank you, by the way, for explaining it. Oolite uses a more sophisticated system than I had been assuming.

Your point of NPC ships not having target reticles, I find a bit confusing. Of course they don't. The reticle (as well as all the graphics, for that matter) are visual representations of mathematical occurrences within the game. The reticle is for the convenience of the player, the NPC doesn't need it since there obviously isn't actually a little pilot inside the computer sitting in it's little seat and looking at you through it's viewscreen and trying to get you in the gunsight. :lol: I would assume the game takes the player coordinates in a fight and turns the NPC ship towards that location until it has a shot. Then it takes the shot but with only a certain percentage allowed for it to actually hit, even you were most likely "dead in it's sights". Otherwise, NPCs would never miss and players would be pressing space very very soon.

Or at least that's my current best attempt at understanding how it works.

Now, so far as checking entity count and entity dump, I assume those are debug functions? I don't mess with that stuff, I'm pretty much just a player. I feel that with games, the Deus ex Machina is more enjoyable if you don't look too close to see the wires and mirrors it operates by. LOL A certain amount of understanding of how the game operates can help with appreciating how well it's done, but I've never tinkered with debug functions or etc.
No law dictates that a railgun must fire dozens of projectiles per second. Maybe its only one per second, maybe even less.
Yes and if a railgun was firing dozens of rounds per second, it would also be contributing to the heat problems. A lower firing rate could be a sensible enough idea, though. Logically, it would also take a noticeable bite out of the energy banks each time it fires. Railguns are pretty impressive, but take a lot of power.

http://en.wikipedia.org/wiki/File:Railg ... y_2008.jpg

Pod mounting could make sense, in particular. Since the rails get damaged over time, a practical version might have a certain number of shots and after those are fired the pod could be jettisoned and replaced or perhaps at least need repair and reloading.

It could add a bit to gameplay, I think, since at least when not used at close range, there's some chance to be able to dodge a projectile at typical railgun velocities. I don't think it should be trackable like a missile, but if there was some observable sign that a railgun shot has been fired, like a muzzle-flash, that could be enough of a clue for an observant player (who happened to be looking in the right direction at the moment).

That would be assuming NPC ships could also sometimes be equipped with railguns and using them. Especially along with your NPC shields OXP, that might make the game even more interesting! LOL
Sleep? Who needs sleep? Got game. No need sleep.
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Re: Split: Player Ship Lasers

Post by Commander McLane »

Ganelon wrote:
Your point of NPC ships not having target reticles, I find a bit confusing.
Never mind. I just wanted to say that laser hits are not counted by measuring how well-centered the target is on the player's screen (which could be a convenience method for a player-centered game where laser beams are no entities). My point was that in Oolite that wouldn't work, because the NPCs are firing, too. I guess my phrasing wasn't quite clear. But the main point of laser beams being entities has come across.
Ganelon wrote:
Now, so far as checking entity count and entity dump, I assume those are debug functions? I don't mess with that stuff, I'm pretty much just a player. I feel that with games, the Deus ex Machina is more enjoyable if you don't look too close to see the wires and mirrors it operates by. LOL A certain amount of understanding of how the game operates can help with appreciating how well it's done, but I've never tinkered with debug functions or etc.
No problem, you don't have to. Although especially the entity count is really easy to reach. Have you ever used the 'F'-key to display your frame rate? Just below is the number of entities currently in your system.
Image

Concerning the railgun, it turns out to be more difficult than I thought. I'll be able to present a proof of concept soon, but it has severe limitations which are non-trivial to overcome.
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Re: Split: Player Ship Lasers

Post by Thargoid »

Commander McLane wrote:
Concerning the railgun, it turns out to be more difficult than I thought. I'll be able to present a proof of concept soon, but it has severe limitations which are non-trivial to overcome.
Eh? They're easy to do - the problem is given sizes and distances they're absolutely useless and couldn't hit the broad-side of an Anaconda at 5km.

I got bored a few weeks back and had some silly fun making an asteroid gun, especially as I then modified the asteroids to be homing asteroids. The sight of a Thargon frigate being chased around the scanner by a couple of asteroids was quite bizarre...

Or are you meaning something more than just firing some dumb projectile straight forward along the axis you currently happened to be viewing? Like for example being able to aim it properly to the centre of the cross-hairs (which will of course depend on the shipdata as to where they are and that location being inaccessible to script).
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Re: Split: Player Ship Lasers

Post by Commander McLane »

Thargoid wrote:
Commander McLane wrote:
Concerning the railgun, it turns out to be more difficult than I thought. I'll be able to present a proof of concept soon, but it has severe limitations which are non-trivial to overcome.
Eh? They're easy to do - the problem is given sizes and distances they're absolutely useless and couldn't hit the broad-side of an Anaconda at 5km.
Yeah, that's about it.
Thargoid wrote:
I got bored a few weeks back and had some silly fun making an asteroid gun, especially as I then modified the asteroids to be homing asteroids. The sight of a Thargon frigate being chased around the scanner by a couple of asteroids was quite bizarre...
To begin with, I'm working with something considerably smaller than an asteroid. Smaller than a cargopod, actually, roundabout the same size as the basic missile, but with a really high speed. One major problem is that most of the time the projectile flies straight through the target, even if aimed perfectly. Collision detection, again. Which is of course bad for a weapon which deals its damage only through collision.

Another problem is that its next to impossible to connect the projectile to the firing entity (in this case the player ship). The owner property is read-only. So if it isn't defined as a missile (which I don't want, because missile firing is inconvenient; you have to press two keys each time, and you need a target first), it doesn't get attached to the player, and the engine doesn't recognize it as a weapon. Therefore no kill is attributed, no legal retribution, and no AI-reaction to an attack.

An oddity is that the amount of damage dealt is increasing with distance. I have incorporated some sort of 'space friction', so the projectile loses (a little) speed over time. Nevertheless it becomes more destructive.
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Re: Split: Player Ship Lasers

Post by Thargoid »

I've got a test oxp (possibly for inclusion into Armoury) which is along similar lines. I was just using the asteroid as a convenient model (one I could see from a distance to check what it was doing) - the end model will like yours be smaller, but may expand on launch (sub-ents which open out like wings) to increase the size and make more chance of hitting.

For the kills attribution etc, I had similar problems in the past with the captured thargons and the guardians in Aquatics. And if you spawn the projectile entity rather than fire it, you should still get owner set? Or am I misunderstanding what you're trying to do?

[handwavium]Worst case scenario is that as they're just dumb projectiles, then no kills etc are attributed as they can be launched fairly covertly etc and tracking systems may not recognise them as weapons (like launching a cargo pod at someone)...[/handwavium]
Switeck
---- E L I T E ----
---- E L I T E ----
Posts: 2411
Joined: Mon May 31, 2010 11:11 pm

Re: Split: Player Ship Lasers

Post by Switeck »

I seem to recall that Q-mines give the player kills and can be fired without being targeted...but would that preclude firing this weapon forwards?
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Re: Split: Player Ship Lasers

Post by Thargoid »

They use the energy blast AI command (becomeEnergyBlast), which is not something that McLane (or I)would want to consider at this junction - these things are supposed to be dumb projectiles that give damage simply by impact. The end effect of using energy blast could be rather like the eponymous nuclear hand grenade... ;)

That said I am going to test using becomeExplosion on contact, which may be a route to awarding kills.
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Re: Split: Player Ship Lasers

Post by JensAyton »

Switeck wrote:
I seem to recall that Q-mines give the player kills and can be fired without being targeted...but would that preclude firing this weapon forwards?
You could script a “mine” to fire forwards, but they still need a two-key activation process – you press T to arm the mine, then M to fire. The only difference is that you don’t need a target selected to arm it.
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Re: Split: Player Ship Lasers

Post by Commander McLane »

Thargoid wrote:
For the kills attribution etc, I had similar problems in the past with the captured thargons and the guardians in Aquatics. And if you spawn the projectile entity rather than fire it, you should still get owner set? Or am I misunderstanding what you're trying to do?
I've tried them all: ejectItem, ejectSpecificItem, spawn, spawnOne. In all cases the entity gets 'self' as its owner, in no case is it owned by the spawning/ejecting ship.

This means that kills attribution etc has to be simulated by script anyway, which is relatively easy for the kill count (I've done it before in Killit.oxp), and a little more complicated for bounty calculation. There has to be a check whether either police or main station are in the vicinity, and then a bounty has to be awarded analogous to what they would do. Which is, I think, something like currentBounty OR something if the killed ship was a trader, and currentBounty OR something bigger if it was a police ship (that's binary OR in both cases, not PLUS). Doable, but makes the script longer.

And still, it wouldn't trigger an ATTACKED message in the target's AI.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: Split: Player Ship Lasers

Post by Eric Walch »

Commander McLane wrote:
I've tried them all: ejectItem, ejectSpecificItem, spawn, spawnOne. In all cases the entity gets 'self' as its owner, in no case is it owned by the spawning/ejecting ship.
Have you tried setting is_subminution in shipdata? That was introduced specific for this case: credit the kill to the right ships after spawning submunition from a missile. Not tested, but I think it should also work when the ship itself spawns the munition.
thargoid wrote:
the end model will like yours be smaller, but may expand on launch (sub-ents which open out like wings) to increase the size and make more chance of hitting.
I think the essential part of a kinematic weapon is that its size is small. In order to to damage, it must transfer its kinematic energy to a very small part of the target, in order to penetrate the hull. On firing a kinematic weapon, the shooter receives the same but opposite energy in order to fire it. The shooter only survives the 'launch' because it can disperse the energy over a larger area. (and sometimes time)
Last edited by Eric Walch on Sat Apr 23, 2011 10:11 am, edited 1 time in total.
Switeck
---- E L I T E ----
---- E L I T E ----
Posts: 2411
Joined: Mon May 31, 2010 11:11 pm

Re: Split: Player Ship Lasers

Post by Switeck »

Ahruman wrote:
You could script a “mine” to fire forwards, but they still need a two-key activation process – you press T to arm the mine, then M to fire. The only difference is that you don’t need a target selected to arm it.
With mines you only have to press T ONCE to then fire multiple mines in a row using the M key. That's a minor inconvenience to have to "arm" your gun before firing it. It's a bigger inconvenience for switching between that gun and (other) missiles/bombs/mines.
User avatar
DaddyHoggy
Intergalactic Spam Assassin
Intergalactic Spam Assassin
Posts: 8515
Joined: Tue Dec 05, 2006 9:43 pm
Location: Newbury, UK
Contact:

Re: Split: Player Ship Lasers

Post by DaddyHoggy »

Eric wrote:
On firing a kinematic weapon, the shooter receives the same but opposite energy in order to fire it. The shooter only survives the 'launch' because it can disperse the energy over a larger area. (and sometimes time)
There are some good, real world examples of this: The A10 Thunderbolt only fires its 1Kg DU rounds in very short bursts, lest its forward velocity is adversely affected. (there are other reasons too). Also the 30mm Chain Gun beneath the nose of the A64 only fires at c. 600 m/s otherwise as the gun moves round during firing/target tracking with the TADS system it could push the nose up or force it to yaw left/right
Selezen wrote:
Apparently I was having a DaddyHoggy moment.
Oolite Life is now revealed here
Post Reply