Page 6 of 11
Re: Railgun.oxp v 1.1 now available
Posted: Thu Apr 28, 2011 5:03 pm
by Thargoid
Commander McLane wrote:EDIT: Hmmm, considering that a mining laser costs only 800 credits, perhaps I've gone a little overboard. On the other hand you can use the railgun as a weapon against big, slow-moving ships, and its firing rate is slightly better than a mining laser's. It's a difficult decision... Okay, I reduce the price to 7500, same as the heavy railgun, and adjust the firing rate to the same as the mining laser's.
You can also use a cargo pod, and they're much cheaper...
Re: Railgun.oxp v 1.1 now available
Posted: Thu Apr 28, 2011 7:12 pm
by Commander McLane
Thargoid wrote:Commander McLane wrote:EDIT: Hmmm, considering that a mining laser costs only 800 credits, perhaps I've gone a little overboard. On the other hand you can use the railgun as a weapon against big, slow-moving ships, and its firing rate is slightly better than a mining laser's. It's a difficult decision... Okay, I reduce the price to 7500, same as the heavy railgun, and adjust the firing rate to the same as the mining laser's.
You can also use a cargo pod, and they're much cheaper...
... but they're more difficult to aim, and shooting them forward requires fuel, and carries the danger of accidentally crashing into your target yourself ...
Re: Railgun.oxp v 1.1 now available
Posted: Thu Apr 28, 2011 10:42 pm
by Cmdr Wyvern
Commander McLane wrote:Thargoid wrote:
You can also use a cargo pod, and they're much cheaper...
... but they're more difficult to aim, and shooting them forward requires fuel, and carries the danger of accidentally crashing into your target yourself ...
Our own rascally grey felinid is something of a legend for using a scoop-slingshotted cargo pod of food to splash a pirate Sidewinder. A feat that gives a new meaning to food fighting, that to my knowledge has never been repeated... But then, an unusual kind of luck navigates with good Captain Hesperus.
Re: Railgun.oxp v 1.1 now available
Posted: Fri Apr 29, 2011 1:17 am
by Commander Wilmot
My thought was that a hitscan script would reduce (or completely stop) the issues with the railgun overpenetrating the target without doing damage at low frame rates. As for the script projecting the target forward of the target ship, that would enable you to use a hitscan and still require the player to lead the target. Maybe there's a better way to do this, I assume the twin plasma cannon use a hitscan; maybe you could borrow programming from the source code.
Re: Railgun.oxp v 1.1 now available
Posted: Fri Apr 29, 2011 7:29 am
by JensAyton
The plasma cannon uses its amazing power of being slow. Basic collision detection works fine in that case.
Re: Railgun.oxp v 1.1 now available
Posted: Fri Apr 29, 2011 7:51 am
by Commander McLane
Commander Wilmot wrote:... I assume the twin plasma cannon use a hitscan ...
No, they don't. The target has ample time to get out of the plasma balls' way. Which is why the twin plasma cannon sucks as a weapon.
I assume that nothing in Oolite uses hitscan, not even the lasers. As far as I understand the laser beam is a very long and narrow entity that is added in its totality in one frame, and therefore intersects with other ships immediately. (I can be wrong, though; I don't actually know too much about the inner workings of Oolite.)
Commander Wilmot wrote:maybe you could borrow programming from the source code.
How would I do that? The source code is in objectiveC, scripts are in JavaScript. I don't know any objC, and I'm not into learning it. I'm happy that I have achieved enough superficial knowledge of JS to be able to write decent OXPs. I don't have more ambition for what at the end of the day is a pastime only.
Also, for me part of the fun with the projectiles is that they do take some travel time, and you visually see the impact on your target. The annoying thing about hitscan, as far as I understand, is that the visual feedback you get has nothing to do with the actual hit score. For me this would be un-Oolitey.
For v 1.2 I have reduced the fly-through problem a little simply by making the projectiles longer. They are now 30m long instead of 7.68m. With the (admittedly ideal) 100-FPS setting on my computer I didn't have a fly-through event anymore even with a boulder. For me that's the point where my ambition ends.
Re: Railgun.oxp v 1.1 now available
Posted: Fri Apr 29, 2011 4:37 pm
by m4r35n357
Don't know if this is any use, but I've seen these in my log file:
13:48:22.561 [script.javaScript.exception.ooliteDefinedError]: ***** JavaScript exception (railgun-projectile 1.1): Error: Ship.reactToAIMessage: Not valid for player ship.
13:48:22.561 [script.javaScript.exception.ooliteDefinedError]: /home/super/.Oolite/AddOns/railgun.oxp/Scripts/railgun-projectile.js, line 89.
13:48:23.003 [script.javaScript.exception.ooliteDefinedError]: ***** JavaScript exception (railgun-projectile 1.1): Error: Ship.reactToAIMessage: Not valid for player ship.
13:48:23.003 [script.javaScript.exception.ooliteDefinedError]: /home/super/.Oolite/AddOns/railgun.oxp/Scripts/railgun-projectile.js, line 89.
No idea what caused them, but just passing on the info . . . HTH.
Re: Railgun.oxp v 1.1 now available
Posted: Fri Apr 29, 2011 8:03 pm
by Commander McLane
They are caused by your ship colliding with one of the projectiles. I'm curious how you managed to do that.
It probably happens because the projectile is spawned too close to your ship when it's launched. See
this post for instructions how to fix it.
Which ship are you flying? I'm interested to know which ship types need an adjustment of the firing position.
Re: Railgun.oxp v 1.1 now available
Posted: Fri Apr 29, 2011 9:07 pm
by Commander Wilmot
I tried SHIFT-F and nothing happened. Also when will version 1.21 come out.
Commander McLane wrote:They are caused by your ship colliding with one of the projectiles. I'm curious how you managed to do that.
It probably happens because the projectile is spawned too close to your ship when it's launched. See
this post for instructions how to fix it.
As for the projectile collision error, i.e. shooting yourself in the face, I have had that, possibly due to low frame rate (as I use an hp netbook, I usually have decent frame rate though, and am running in low detail mode.) It doesn't seem hard to achieve, I already mentioned that I have had this error; what I didn't mention was that I was only going half speed when it happened. I had launched and pulled up away from the planet (I didn't want to drop a ton of depleted uranium on some farmer living on the planet's surface). I start firing a lot of rounds off and see...nothing, I go to an external view and see sparks coming out of the nose of my ship.
I don't think that having the rail gun being a near-instantaneous weapon would be bad, necessarily. But under current conditions, it would probably unbalance it as it is only meant to be back up weapon. Maybe the twin plasma cannon will get improved in Oolite version 2.0.
Re: Railgun.oxp v 1.1 now available
Posted: Fri Apr 29, 2011 9:31 pm
by Commander McLane
Commander Wilmot wrote:I tried SHIFT-F and nothing happened. Also when will version 1.21 come out.
Commander McLane wrote:They are caused by your ship colliding with one of the projectiles. I'm curious how you managed to do that.
It probably happens because the projectile is spawned too close to your ship when it's launched. See
this post for instructions how to fix it.
As for the projectile collision error, i.e. shooting yourself in the face, I have had that, possibly due to low frame rate (as I use an hp netbook, I usually have decent frame rate though, and am running in low detail mode.) It doesn't seem hard to achieve, I already mentioned that I have had this error; what I didn't mention was that I was only going half speed when it happened. I had launched and pulled up away from the planet (I didn't want to drop a ton of depleted uranium on some farmer living on the planet's surface). I start firing a lot of rounds off and see...nothing, I go to an external view and see sparks coming out of the nose of my ship.
I don't quite follow you.
- How do you know that you have a 'decent' frame rate, if not by checking it? The only way to check it is to read it from the upper right corner of your Oolite window after pressing SHIFT-F.
- I have already explained to you that I assume your problem stems from the projectile being created too close to your ship. I also gave you detailed instructions on how to increase this distance. Have you followed these instructions? If yes, I would really like to know whether this fixed your problem, and therefore my assumption was right, or not. If no, I don't think I can do anything else for you.
- As I've already pointed out a few posts above, version 1.2 of this OXP will only work in Oolite 1.75.2, which doesn't exist yet. I have no knowledge when Oolite 1.75.2 will be released.
Here's a screenshot of how the FPS-display toggled by SHIFT-F looks like, with explanations about what the numbers mean:
Re: Railgun.oxp v 1.1 now available
Posted: Fri Apr 29, 2011 10:05 pm
by Commander Wilmot
I don't quite follow you.
- How do you know that you have a 'decent' frame rate, if not by checking it? The only way to check it is to read it from the upper right corner of your Oolite window after pressing SHIFT-F.
- I have already explained to you that I assume your problem stems from the projectile being created too close to your ship. I also gave you detailed instructions on how to increase this distance. Have you followed these instructions? If yes, I would really like to know whether this fixed your problem, and therefore my assumption was right, or not. If no, I don't think I can do anything else for you.
- As I've already pointed out a few posts above, version 1.2 of this OXP will only work in Oolite 1.75.2, which doesn't exist yet. I have no knowledge when Oolite 1.75.2 will be released.
- first of all I have played other games with higher system requirements and better graphics than Oolite on it, with a decent frame rate. It is not impossible that my frame rate is worse with Oolite, though. And I did press SHIFT-F; I didn't get Oolite to display anything.
- My netbook is having trouble charging, so I'm using my desktop, which doesn't have Oolite on it, once I get it working again I'll try it and tell you. Either way, I will be watching what comes of this oxp.
- I missed the comment that "Version 1.2 will only work with current trunk."
Re: Railgun.oxp v 1.1 now available
Posted: Sat Apr 30, 2011 4:47 am
by JensAyton
Commander McLane wrote:How do you know that you have a 'decent' frame rate, if not by checking it? The only way to check it is to read it from the upper right corner of your Oolite window after pressing SHIFT-F.
The only way to know whether you have a “decent” frame rate is to consider whether it feels annoyingly jerky or not. No magic number will make a subjective judgement for you.
Re: Railgun.oxp v 1.1 now available
Posted: Sat Apr 30, 2011 7:18 am
by Commander McLane
Ahruman wrote:Commander McLane wrote:How do you know that you have a 'decent' frame rate, if not by checking it? The only way to check it is to read it from the upper right corner of your Oolite window after pressing SHIFT-F.
The only way to know whether you have a “decent” frame rate is to consider whether it feels annoyingly jerky or not. No magic number will make a subjective judgement for you.
While this is certainly true, I wonder why SHIFT-F doesn't bring up the display for Commander Wilmot. This used to be a vanilla Oolite key. Has that changed to be only available in connection with Debug.oxp recently?
Re: Railgun.oxp v 1.1 now available
Posted: Sat Apr 30, 2011 7:33 am
by JensAyton
Commander McLane wrote:While this is certainly true, I wonder why SHIFT-F doesn't bring up the display for Commander Wilmot. This used to be a vanilla Oolite key. Has that changed to be only available in connection with Debug.oxp recently?
No, it should work in all configurations (although in custom “deployment” builds it will only show frame rate, not the other stuff).
Re: Railgun.oxp v 1.1 now available
Posted: Sat Apr 30, 2011 8:39 am
by Commander McLane
Ahruman wrote:Commander McLane wrote:While this is certainly true, I wonder why SHIFT-F doesn't bring up the display for Commander Wilmot. This used to be a vanilla Oolite key. Has that changed to be only available in connection with Debug.oxp recently?
No, it should work in all configurations (although in custom “deployment” builds it will only show frame rate, not the other stuff).
Perhaps Commander Wilmot has a custom key configuration with
key_show_fps
not defined?
Anyway, the problem with launching the projectile inside the player ship is that the script has to make an educated guess how big the player ship actually is. For that I'm using
player.ship.collisionRadius
and add a couple of meters for safety. Obviously this gives only more-or-less-good results, depending on the player ship's geometry.
For a better approach it would be helpful if I could access the actual ship size through JS. Therefore the request (post-1.76, I guess): is it even possible to expose things like length, width, and height of an entity to JS (they're not even in shipdata, only in the DAT-file)?
As a workaround, what about things like
weapon_position_foo
,
view_position_foo
,
missile_launch_position
and
aft_eject_position
(and, while we're at it,
scoop_position
)? Can they be exposed to JS (presumably read-only)? Then I could use for instance the missile launch position and add a couple of meters to the z-component.
EDIT: I'm putting this in scripting requests as well.