Utility Script: Sensor Range Plugin

« Back to Developers

2210 days, 19 hours, 23 minutes ago
Profile Image
kedalion
Utility Script: Sensor Range PluginWrite Reply
Utility Script: Sensor Range Plugin
___________________________________

I create another plugin that allows to visualize the sensor range of your ships and planet on the starmap. It takes your own ships and planet into account as well as of FULL allies. I could add everybody with share intel, but left it this way for now. Opinions?

Likewise it can show the area in which you are currently trying to detect mines. Here only your ships with mission mine sweep are used. I can also change it to also show the area in which you and your allies could detect if the correct mission was set. Opinions here?

The different options can be activated and deactivated through Map Tools menu. 


2210 days, 19 hours, 23 minutes ago
Profile Image
kedalion
RE: Utility Script: Sensor Range PluginWrite Reply
And here is the link to the nicely formatted forum thread:

http://planets.nu/discussion/utility-script-sensor-range-plugin
2210 days, 18 hours, 52 minutes ago
View mjs68508's profile
mjs68508
RE: Utility Script: Sensor Range PluginWrite Reply
Works fine in Chrome/Tampermonkey.
2210 days, 14 hours, 6 minutes ago
Profile Image
kedalion
RE: Utility Script: Sensor Range PluginWrite Reply
Can anybody point me to a finished game that had the 'explore map' feature on? The plugin is coded such that it should handle this case, but I haven't found a finished game to test it in.
2210 days, 14 hours, 4 minutes ago
View mjs68508's profile
mjs68508
RE: Utility Script: Sensor Range PluginWrite Reply
http://planets.nu/#/sector/18249
2210 days, 12 hours, 42 minutes ago
View figak's profile
figak
RE: Utility Script: Sensor Range PluginWrite Reply
Hmm can't get it to work, i disabled my other scripts too but nada.

Using Chrome and Tampermonkey :(
2210 days, 12 hours, 36 minutes ago
Profile Image
kedalion
RE: Utility Script: Sensor Range PluginWrite Reply
Do you see the buttons in the map tools? Do you get an error message?
2210 days, 12 hours, 18 minutes ago
View figak's profile
figak
RE: Utility Script: Sensor Range PluginWrite Reply
Toggle Range & minefield preview.

I can activate and deactivate, but nothing happens.
2210 days, 12 hours, 2 minutes ago
Profile Image
kedalion
RE: Utility Script: Sensor Range PluginWrite Reply
Can you zoom in a bit and see if things pop up? There used to be an issue where no plugin data would be drawn for zoom <140%. But a forced reload of the page should fix that. 

Can you see the territory map from the other plugin?
2210 days, 11 hours, 55 minutes ago
View figak's profile
figak
RE: Utility Script: Sensor Range PluginWrite Reply
Ok, now I deactivated all others and refreshed the page. I got it to work. The buttons were actually SensorRange and MineDetectRange.

It's not pretty but it's functional. I guess it was the refresh that did it...
2210 days, 11 hours, 12 minutes ago
Profile Image
kedalion
RE: Utility Script: Sensor Range PluginWrite Reply
Good. It's pretty messy as there are a lot of circles. Any comments or suggestions on how to make it nicer?
2210 days, 11 hours, 2 minutes ago
View figak's profile
figak
RE: Utility Script: Sensor Range PluginWrite Reply
It looks like each circle is on its own layer, because in some of my busy games some circles are bright (like at the front) and some dim (like at the back).

Also they are cirunferences, not circles (no fill-in).

Idea is to make it solid and a single layer that sits as far back as possible, nearly like a background.

I'm going to get my registers WIN vgaplanets and echoview out on the weekend :-P
2210 days, 10 hours, 23 minutes ago
Profile Image
kedalion
RE: Utility Script: Sensor Range PluginWrite Reply
I see. The problem here is that the plugin draw only lets me draw on top off the rest of the map. I tried filling the circles in, but they need to be transparent if you still want to see you planets and ships. And whenever several transparent circles or discs overlap, they cover more of the background. That's why I went with circles for now.
I'll see if I can rig it into drawing in the background.

And I also just update the plugin to support clearing the range display with hotkey 'x'.
2210 days, 2 hours, 38 minutes ago
View figak's profile
figak
RE: Utility Script: Sensor Range PluginWrite Reply
Thanks, I was wondering why x didn't work ;)

If the background solution doesn't work, an alternative could be to do the outline of the pilled up circumferences into a single drawing.
2207 days, 13 hours, 6 minutes ago
View marklein's profile
marklein
RE: Utility Script: Sensor Range PluginWrite Reply
Just thinking outside the box here (and not sure if possible), but what if you wrote the script to highlight the areas OUTSIDE of the scan range? It wouldn't matter so much if it obscured the view a bit since there wouldn't be anything to view besides unowned planets anyway. Also, you would be able to adjust the transparency based on the number of data points since the extra-scan range area would have a uniform transparency (all data points would overlap in the same amount). Does that make sense?
2207 days, 13 hours, 4 minutes ago
View marklein's profile
marklein
RE: Utility Script: Sensor Range PluginWrite Reply
Oh and on a related note, the reverse of this would be more handy to me, that being a visualization of the enemy's scan range. ;-)
2207 days, 5 hours, 48 minutes ago
Profile Image
kedalion
RE: Utility Script: Sensor Range PluginWrite Reply
Ok, I just uploaded a new version.  

I updated the sensor range drawing such that it will now draw one joint area for the whole sensor area instead of the individual circles. Below is a screenshot of the new display. (Not visible on Activity Stream, but only the forum.) The drawing takes a bit longer as I needed to merge the areas. But then it's not something you'd have on all the time anyway.

2207 days, 5 hours, 23 minutes ago
Profile Image
kedalion
RE: Utility Script: Sensor Range PluginWrite Reply
Oh marklein, the sensor range of the enemy would be quite tough as you normally don't know their locations. You could assume all not owned belong to the enemy, but regarding cloaked enemy ships you'd still be in the dark. Would that still be of interest?
2207 days, 4 hours, 43 minutes ago
View marklein's profile
marklein
RE: Utility Script: Sensor Range PluginWrite Reply
I used the enemy scan range in Echoview which is what made me think of it. Obviously there's room for error due to unknown cloaked ships, Etc, but Echoview based it on visible ships and known enemy planets.
2206 days, 8 hours, 12 minutes ago
Profile Image
kedalion
RE: Utility Script: Sensor Range PluginWrite Reply
Ok, I'll see what I can put in there.
2205 days, 20 hours, 15 minutes ago
Profile Image
anaconda
RE: Utility Script: Sensor Range PluginWrite Reply
i cant see the options either; figak got it working by disabling all other scripts? and, should it work on both, new and old client?
2205 days, 20 hours, 7 minutes ago
Profile Image
kedalion
RE: Utility Script: Sensor Range PluginWrite Reply
I belive, Figak had to reload the page with ctrl + F5 to get the map to draw at <140%.
The plugin should not interfere with any other plugin. And it will only run on the new client.

What browser are you using? You don't even see the Map Tools entries?  Also, when loaded, it is printing out a status message about loading. Do you see that in the console?

2205 days, 19 hours, 35 minutes ago
Profile Image
anaconda
RE: Utility Script: Sensor Range PluginWrite Reply
the problem is the client, then. I dont seem to get the new one working - again. If it works or not seems to be totally random at my end. Or, based on factors i have neither control over nor knowledge of.
2205 days, 19 hours, 10 minutes ago
Profile Image
kedalion
RE: Utility Script: Sensor Range PluginWrite Reply
I would start by disabling ALL plugins to make sure none of them is for the old client. 
Then go to play.planets.nu (or the 'new version' button on normal planets.nu) and hit 'ctrl + F5' to force a refresh. Now see if the client works without any plugin added.

If the client fails to load, you can right click into the browser and select "Inspect Element". Then in Chrome on the bottom left there are multiple buttons. The second button from the left shows a mouse-over-text of "Show console". If you select that, you can see the console output which might tell you potential error messages. In Firefox the button is at the top of the newly opened section and is labeled "Web Console".
2205 days, 12 hours, 23 minutes ago
Profile Image
kedalion
RE: Utility Script: Sensor Range PluginWrite Reply
Marklein, I added a new view: Enemy Sense. It shows the scan range for all know enemy locations (currently visible ships and planets). I had an alternative view which assumed all unknown planets as hostile, but wasn't sure which version people would find more useful.
2205 days, 10 hours, 52 minutes ago
View marklein's profile
marklein
RE: Utility Script: Sensor Range PluginWrite Reply

Excellent work, thank you. You rock.

I'm seeing some incorrect data on mine. I get some scan range circles centered on places that I don't have any ships or planets (my scan range, not enemy scan range). Specifically I have a Peace Agreement (not intel sharing) with a neighbor and it shows my scan range including a large part of his territory that I don't have any presence in. Bug in your script, or is it .NU intel leakage being revealed?

The only other thing I could (strongly) suggest would be the ability to manually add planets that you know/assume are enemy even though they don't show that way on the map. I know of a lot of enemy positions that the map doesn't.

2203 days, 15 hours, 38 minutes ago
Profile Image
mrsebaot
RE: Utility Script: Sensor Range PluginWrite Reply
I've really enjoyed Sensor Range plugin, it is just what I've been looking for. Thank you very much!

Unfortunately I have encountered one small problem with the plugin. I didn't notice that somebody would have mention it, but since the plugin has been updated after I noticed it and the problem is still there, I felt that I need to bring it up. I noticed this after 0.15 update, so when individual circles of Sensor Range changed to joint area.

When I click any of the plugin buttons (SensorRange/MineDetectRange/EnemySense) in Map Tools, in first look they all seem to work alright: they draw what I expected. Everything is OK until I move the map or unselect those plugin visuals: colours of the whole map dims out!

It looks like the map still has some sort of layer over it. Only way how I managed to get back to normal bright colours is to exit and load the turn again (so, unselecting visuals doesn't help).

Why I think problem could be with joint area drawing is because the problem actually occurs only with Sensor Range and Enemy Sense. With Mine Detect Range (which draws individual circles) colours stay all the time as bright as they should.

I have been using Firefox and GreaseMonkey.
2203 days, 12 hours, 17 minutes ago
Profile Image
kedalion
RE: Utility Script: Sensor Range PluginWrite Reply
I'm using Chrome myself as it runs NU so much smoother, but I test in Firefox from time to time. This is a pretty peculiar bug. Switching tabs in firefox makes the color come back... There is a weird error message which points to a Firefox bug that seems to have been around since 2010.
But I'll test it again on another system once I'm home.

Can you tell me if there are any speed issues while using the plugin (with this error)?

2203 days, 8 hours, 4 minutes ago
Profile Image
kedalion
RE: Utility Script: Sensor Range PluginWrite Reply
Just uploaded version 0.18... it should work fine on Firefox now.

It was quite difficult to hunt down as Firefox does not give any details with its error message. In the end I found a stray line of code from an old drawing method that simply didn't get deleted...
2203 days, 7 hours, 7 minutes ago
View marklein's profile
marklein
RE: Utility Script: Sensor Range PluginWrite Reply
What? No love for my issue? ;-) Just giving you a hard time. I invited another player on the other end of the map to share safe passage and I'll let you know if the oddity exists then too.
2203 days, 3 hours, 34 minutes ago
Profile Image
kedalion
RE: Utility Script: Sensor Range PluginWrite Reply
Ups, sorry, had totally forgotten about that. Turns out the NU client methods 'allied(id)' and
'alliedTo(id)' already consider 'Safe Passage' as a commitment. I changed it such that the sensor range of players is only included if they give the player at least 'Share Intel'.
2203 days, 0 hours, 40 minutes ago
Profile Image
mrsebaot
RE: Utility Script: Sensor Range PluginWrite Reply
Excellent work again! I didn't even manage to answer to your guestion (about speed: I didn't notice any significant slow down with the error) before you fixed it. Thank you!
2193 days, 19 hours, 10 minutes ago
Profile Image
kedalion
RE: Utility Script: Sensor Range PluginWrite Reply
I noticed a stupid little but that included all planets in the sensor range. I just fixed it in version 0.20. 
2191 days, 2 hours, 14 minutes ago
View figak's profile
figak
RE: Utility Script: Sensor Range PluginWrite Reply
That snapshot looks like Echoview, beautiful.

Thanks!
2190 days, 20 hours, 7 minutes ago
Profile Image
kedalion
RE: Utility Script: Sensor Range PluginWrite Reply
I actually never used Echoview. So I'm glad I hit the spot. Is there anything else you'd like to see with this?
2190 days, 0 hours, 26 minutes ago
View thin lizzy's profile
thin lizzy
RE: Utility Script: Sensor Range PluginWrite Reply
really like this one !! 
2189 days, 22 hours, 51 minutes ago
View veldan's profile
veldan
RE: Utility Script: Sensor Range PluginWrite Reply
Kedalion any chance you could make this take into account nebulas for stellar cart?
2189 days, 22 hours, 12 minutes ago
Profile Image
kedalion
RE: Utility Script: Sensor Range PluginWrite Reply
I was already looking into that once, but stopped because I wasn't quite sure how things really worked. Maybe somebody can clarify the mechanism a bit for me.

Is the visibility inside the nebula dependent on the location of the own ship or the target ship/planet?
2189 days, 21 hours, 26 minutes ago
View veldan's profile
veldan
RE: Utility Script: Sensor Range PluginWrite Reply
I can take a stab, but I think that's a Joshua question.

My stab at it-- I believe it works like the following;
A tile will be revealed depending upon the lesser of the two detection factors of the current tile. i.e. tile A has a detection range of 40 while tile B has a detection range of 10. If they are 30 ly's apart, Tile B cannot see Tile A, and Tile A cannot see Tile B.

Now if Tile A has a detection range of 40 and Tile B has a detection range of 30 and they are 30 ly's apart, I would believe that Tile B can see Tile A and vice versa.

One thing I'm not certain of is say the visibility at 15 ly's drops to 5ly's... does that mean that the two tiles cannot see one another because the nebula got thick there? I have no idea.
2188 days, 19 hours, 30 minutes ago
View figak's profile
figak
RE: Utility Script: Sensor Range PluginWrite Reply
Hi,

The mine detect range is still a stack of circumferences?

I thought it was a problem on my pc, I tried it on another and all games. And I don't see the red drawing shown in the snapshot above.
2188 days, 18 hours, 6 minutes ago
Profile Image
kedalion
RE: Utility Script: Sensor Range PluginWrite Reply
Yes, the minescan range is still just a stack. I thought it is more useful that way as it's easier to determine which ship's 'fault' it is. What do others think?
(Btw. I tested the script in some finished games and was shocked to see that a game winner with ~200 ships had only 2 of them set to 'mine sweep'....)

The red drawing only shows up in games that have limited planet visibility (also called the 'explore map' setting). Here you only see planets in a certain distance from your own ships and planets. (As a fun fact: if another player grants you 'safe passage', all his planets will appear on your map. :D)

2188 days, 16 hours, 18 minutes ago
Profile Image
kedalion
RE: Utility Script: Sensor Range PluginWrite Reply
Mjs posted a link to an 'explore map' game above: http://planets.nu/#/sector/18249 You should be able to see the red area in there. 
2188 days, 0 hours, 41 minutes ago
View thin lizzy's profile
thin lizzy
RE: Utility Script: Sensor Range PluginWrite Reply

btw circles - just an idea.. ist there a way to make an enemy range overview based on the current speed? 
like those circles that you have for your own ship ranges? would help to find out where the ships came from and possibly go to .. 
2187 days, 21 hours, 46 minutes ago
View ted's profile
ted
RE: Utility Script: Sensor Range PluginWrite Reply
Just one more idea.

Add a function to draw a circles 81.6 (max warp9 distance between 2 xy points ) arround planets and ships.

Planets circles: this cicle is usefull because you can bring your fleet near this planet circle without fear to get kill intercepted while you can one turn later reach the planet without problems. if you have more than one planet near you its cost time to search this safe point with the current GUI.

Ships circles:
Same reason. You want plot a course without fear to get intercepted.
2187 days, 20 hours, 33 minutes ago
View thin lizzy's profile
thin lizzy
RE: Utility Script: Sensor Range PluginWrite Reply
it is already manually possible with the 'draw objects' add-on, if it works with the new ui..

i would however take the actual warp speed for ships, since there are low-techs and gravitronics in there. only exception would maybe be hypers, that you always see at warp 0 after jumping.

but good idea with the planets..
2156 days, 18 hours, 31 minutes ago
View figak's profile
figak
RE: Utility Script: Sensor Range PluginWrite Reply
One little request, when showing the enemy detect range could be pick which races to use? At the moment it takes all other races.
2156 days, 18 hours, 31 minutes ago
View figak's profile
figak
RE: Utility Script: Sensor Range PluginWrite Reply
One little request, when showing the enemy detect range could be pick which races to use? At the moment it takes all other races.
2156 days, 16 hours, 40 minutes ago
Profile Image
kedalion
RE: Utility Script: Sensor Range PluginWrite Reply
Sure, I could do that. I'll have to look into how to select the race though. I'm thinking a little top menu like in beefer's draw plugin would work best.
1952 days, 13 hours, 32 minutes ago
Profile Image
kedalion
RE: Utility Script: Sensor Range PluginWrite Reply
@Arcanix extended my plugin to also show Dark Sense range when playing as EE. He kindly provided his code and I integrated it in the plugin. :)  Everybody should get the new version once they update next.

1952 days, 12 hours, 36 minutes ago
Profile Image
ninjabunny
RE: Utility Script: Sensor Range PluginWrite Reply
I dont think any such add ons should be allowed, it should be just as Tim made the original game, all such additions should be seen as cheats. But those who want to expand on his game, by all means proceed, but dont call it VGAP.
1952 days, 11 hours, 52 minutes ago
Profile Image
anaconda
RE: Utility Script: Sensor Range PluginWrite Reply
wait, what? no really, they are not cheats, nor mods. they are aideees (not to be confused w/ aids). the difference is, you shouldnt be able to do anything you are not able to do with, say, pencil and paper, meaning crushing the numbers for example. if you could do it by "hand", but aideees help you do it faster and more conveniantly - please bring in the aideees, and it will still be the same game.
1952 days, 11 hours, 31 minutes ago
Profile Image
kedalion
RE: Utility Script: Sensor Range PluginWrite Reply
@Ninjabunny: I'm surprised to hear such an opinion. I can assure you that NOTHING our plugins are doing is something you couldn't just do manually (with pencil and paper as @Anaconda mentioned) or just in your mind. They do not give you any more information than you have from the original game. In fact, they just visualize exactly the data the game uses.

Please, if you want to create a thread about plugins being cheats or not liking them, let's start a new thread. This one is dedicated to just this plugin and the people that like to comment on it specifically. Thanks.
1952 days, 11 hours, 10 minutes ago
View mjs68508's profile
mjs68508
RE: Utility Script: Sensor Range PluginWrite Reply
Actually, Anaconda, they are aiders. We, the users, are the aidees.

But, they are simply AIDS,

A-utomatic
I-nformation
D-eployment
(on)S-creen
1901 days, 17 hours, 39 minutes ago
Profile Image
kedalion
RE: Utility Script: Sensor Range PluginWrite Reply
http://planets.nu/discussion/utility-script-sensor-range-plugin
New download location: https://monkeyguts.com/code.php?id=189
1693 days, 23 hours, 30 minutes ago
Profile Image
kedalion
RE: Utility Script: Sensor Range PluginWrite Reply
http://planets.nu/discussion/utility-script-sensor-range-plugin

I updated the sensor plugin to work with the new 'Sphere' setting that was just released for NU.
At the same time I also moved the script location over to Greasyfork. It can be found here:

https://greasyfork.org/en/scripts/7149-planets-nu-sensor-range-plugin