[REQ] Proximity Alert
Moderators: Moderators for English X Forum, Scripting / Modding Moderators
-
- Posts: 137
- Joined: Thu, 23. Oct 08, 17:06
[REQ] Proximity Alert
We need a proximity alert feature script for player ships that will have a user configurable list of ship types ie.; Stations, Asteroids, M6, M1, M5 etc. that can each be toggled on or off and a user settable range, when an NPC ship that it's one of your own ships comes within that range we should get a verbal warning such as "Proximity Alert" or "Collision Warning" and a written warning indicating the name, class and speed of the approaching ship, maybe in Red if it's an enemy and Blue if it's neutral. This should have a hotkey to toggle it on/off in combat...
Can anyone do this? it'd keep me from being plowed over by the ninja silent TLs while sitting in system all the time
Can anyone do this? it'd keep me from being plowed over by the ninja silent TLs while sitting in system all the time
It is do-able, but very in-efficient (i.e. It'll burn up lots of computing power)
The main reason is that distance has a square root in its equation, which means it essentially does maths like 20 times until it gives the correct distance. Then it'd have to do a distance check on every ship in the sector, then asteroids, and debris etc.
And then I'd assume you'd want to run this proximity check fair frequently (Every second? few seconds? a couple times a second?).
And of course, when running seta x10, it does 10x as many checks.
Now i'm running on a... AMD64 3000 (which is a 2Ghz equiv) with 2gb of ram (sadly running at 2700, ie ddr 333, dual channel). And when I wrote something similar, I almost froze my computer when I ran it on 15 ships at once. It went from a smooth 40+ fps, to about 0.5 fps.
Now I'm sure your saying yeh I'll just run it on 1 ships. But.. if you had that one ship on seta, it would be like running it on 10 ships. So it'd give you like 2 fps..
So in short, yes its totally do able.
But, it will cook your computer.
And even if you have a fast computer, its still not advisable as all apps will tend to run at 100% any way.
And lastly, and most importantly, tbh, its easier just to look, or if your just idle seta-ing, seta next to an asteroid/station, or run the command idle and seta, as all flight scripts have collision avoidance.
Presumably the game's stock collision avoidance system is more efficient as it runs seamlessly, but there is no known way of getting into it.
The main reason is that distance has a square root in its equation, which means it essentially does maths like 20 times until it gives the correct distance. Then it'd have to do a distance check on every ship in the sector, then asteroids, and debris etc.
And then I'd assume you'd want to run this proximity check fair frequently (Every second? few seconds? a couple times a second?).
And of course, when running seta x10, it does 10x as many checks.
Now i'm running on a... AMD64 3000 (which is a 2Ghz equiv) with 2gb of ram (sadly running at 2700, ie ddr 333, dual channel). And when I wrote something similar, I almost froze my computer when I ran it on 15 ships at once. It went from a smooth 40+ fps, to about 0.5 fps.
Now I'm sure your saying yeh I'll just run it on 1 ships. But.. if you had that one ship on seta, it would be like running it on 10 ships. So it'd give you like 2 fps..
So in short, yes its totally do able.
But, it will cook your computer.
And even if you have a fast computer, its still not advisable as all apps will tend to run at 100% any way.
And lastly, and most importantly, tbh, its easier just to look, or if your just idle seta-ing, seta next to an asteroid/station, or run the command idle and seta, as all flight scripts have collision avoidance.
Presumably the game's stock collision avoidance system is more efficient as it runs seamlessly, but there is no known way of getting into it.
for ships, you can just use a single command, 4 times a second, and u should have no problem with performance
can repeat the same for asteroids, althou i wouldn't both with stations, especially terran ones, as thier collosion bubble is huge
Code: Select all
dist = [THIS] -> size of object
dist = dist + 500
$ship = find ship: sector=[SECTOR], maxdist=$dist, refobj=[THIS]
Hey it was apart of my hyperspace (like slipstream) script. And for smoothness and dont kill-me-ness I thought it be wise to do anti collision at every tic forward (10'ms)
Any way, needless to say, after that... one bad test run... I canned it, and instead I just use the games collision avoidance instead. I run the hyperspace separately, and if the ship tries to turn, then i kill it. (I think I said a tolerance of up to 200 rotation units... although I have no idea any more..)
Any way, needless to say, after that... one bad test run... I canned it, and instead I just use the games collision avoidance instead. I run the hyperspace separately, and if the ship tries to turn, then i kill it. (I think I said a tolerance of up to 200 rotation units... although I have no idea any more..)
-
- Posts: 137
- Joined: Thu, 23. Oct 08, 17:06
Cycrow you're a genius, besides you don't have to check every second, an object shouldn't be so close to you that you need to check every second, every few should be enough, I mean it checks scanner ranges as it is, it can't be too difficult, I don't suppose Cycrow could whip together that script into something I could use?
i would like a auto-distance
would it be possible to run it, on the 5 closest objects?
you could further reduce load a distance limit, like 200M (presumably if you are worried bout a collision, you aren't running at 200M/S
Im running a Quad core, a Q6600 (2.4x4) 4 Gb of ram (ddr 1066) so i have plenty of calc's per second.
would it be possible to run it, on the 5 closest objects?
you could further reduce load a distance limit, like 200M (presumably if you are worried bout a collision, you aren't running at 200M/S
Im running a Quad core, a Q6600 (2.4x4) 4 Gb of ram (ddr 1066) so i have plenty of calc's per second.
-
- Posts: 403
- Joined: Sun, 18. Apr 04, 17:04
I'd love this. When in my new Split Elephant, i am forever plowing over unfortunate freighters when exiting a gate. It's so hard to tell where ships are in relation to your own capital ship at times. Also at times i forget to hit the boost extension when exiting gates, so i kind of drift slowly a short distance, and get rammed in the engines by another freighter/ship also exiting the gate, so they eat my hull plating before they can swerve. Or i just fly along not really paying attention to where i'm going and run over multiple smaller ships. Whoops.
Rawr.
-
- Posts: 137
- Joined: Thu, 23. Oct 08, 17:06
I'm more worried about being the one run overKhaak_Slayer wrote:I'd love this. When in my new Split Elephant, i am forever plowing over unfortunate freighters when exiting a gate. It's so hard to tell where ships are in relation to your own capital ship at times. Also at times i forget to hit the boost extension when exiting gates, so i kind of drift slowly a short distance, and get rammed in the engines by another freighter/ship also exiting the gate, so they eat my hull plating before they can swerve. Or i just fly along not really paying attention to where i'm going and run over multiple smaller ships. Whoops.
the performance problem mentioned by s9ilent, is that the mathimatical calculation to compute the distance between 2 objects requires a square root, which is quite taxing on the CPU, so using an excessive of these can slow things down.corhen wrote:i would like a auto-distance
would it be possible to run it, on the 5 closest objects?
you could further reduce load a distance limit, like 200M (presumably if you are worried bout a collision, you aren't running at 200M/S
Im running a Quad core, a Q6600 (2.4x4) 4 Gb of ram (ddr 1066) so i have plenty of calc's per second.
the only way to find out what the 5 closest objects are is to run this calcutation on every ship in the sector. So the number of ships you use or the distance you choose to limit it to would make absolutly no difference to the performance problem, as you still need to check every ship before you know they are outside of your limit.
infact, having a bigger limit can actually help. The bigger the limit, the more likly a ship would be detected. If one is detected, it could simply quite of the loop without needing to do all ships. So the more chance of finding a ship the more chance the loop can be cut short.
however, this problem only exists if you try to check too often. Im talking ms here.
so a few times a second really isn't a problem, its when you start trying to check 100 times a second to be really acurate, which tbh, isn't required
im abit busy right now, but if i get chance ill see if i can make the script, should only take me a few mins to make it
-
- Posts: 137
- Joined: Thu, 23. Oct 08, 17:06
thanks Cycrow, you're the bestCycrow wrote:the performance problem mentioned by s9ilent, is that the mathimatical calculation to compute the distance between 2 objects requires a square root, which is quite taxing on the CPU, so using an excessive of these can slow things down.corhen wrote:i would like a auto-distance
would it be possible to run it, on the 5 closest objects?
you could further reduce load a distance limit, like 200M (presumably if you are worried bout a collision, you aren't running at 200M/S
Im running a Quad core, a Q6600 (2.4x4) 4 Gb of ram (ddr 1066) so i have plenty of calc's per second.
the only way to find out what the 5 closest objects are is to run this calcutation on every ship in the sector. So the number of ships you use or the distance you choose to limit it to would make absolutly no difference to the performance problem, as you still need to check every ship before you know they are outside of your limit.
infact, having a bigger limit can actually help. The bigger the limit, the more likly a ship would be detected. If one is detected, it could simply quite of the loop without needing to do all ships. So the more chance of finding a ship the more chance the loop can be cut short.
however, this problem only exists if you try to check too often. Im talking ms here.
so a few times a second really isn't a problem, its when you start trying to check 100 times a second to be really acurate, which tbh, isn't required
im abit busy right now, but if i get chance ill see if i can make the script, should only take me a few mins to make it