Utility Script: Mine-sweep visualization

« Back to Developers

2677 days, 21 hours, 26 minutes ago
View big beefer's profile
big beefer
Utility Script: Mine-sweep visualizationWrite Reply
Another add-on that does basic mine sweep previewing. Enemy fields being swept are made a little darker with a brighter middle representing the remaining field. The changes can be subtle, especially for fields being swept completely or barely at all, so another map tool was also added. "Minefield Preview" will allow you to view the minefield laying and sweeping preview without having to select a ship doing one of those missions.

Does not currently calculate for scooping your own mines with "msc", colonial fighter sweep, or mines destroy mines, but may in the future.

http://userscripts.org/scripts/show/130845


Note: this script assumes minefield colors as defined on the settings page, so may give strange results if used with the dedicated color per race script. Haven't tried it yet.

Also, if someone knows a good game, player, turn combination with a lot of varied mine sweeping going on, it could help me with testing..
2677 days, 19 hours, 35 minutes ago
View vepr's profile
vepr
RE: Utility Script: Mine-sweep visualizationWrite Reply
NICE!!! I'll check it out right away.  I hate doing manual calculations.
2672 days, 21 hours, 36 minutes ago
View big beefer's profile
big beefer
RE: Utility Script: Mine-sweep visualizationWrite Reply
New version posted with a minor addition to show how many mines (both normal and web) can be swept when ship mission is set to mine sweep. To see, just set any ship's mission to mine sweep and it should display sweeping power next to the mission (similar to how cloak fuel/turn is displayed).
2669 days, 19 hours, 21 minutes ago
Profile Image
joesnoffy
RE: Utility Script: Mine-sweep visualizationWrite Reply
I do see the sweeping power, which is nice, but unfortunately no minesweeping previewing of enemy minefields being swept. This would have been awesome.

I this just me or has anybody else experienced this?

Other scripts are working fine.

Firefox 11.

Best wishes,

JoeSnoffy


2669 days, 17 hours, 12 minutes ago
Profile Image
kedalion
RE: Utility Script: Mine-sweep visualizationWrite Reply
It works fine for me on Chrome, FF10, and FF11.0

On all versions I can see the predicted size of the enemy minefield. 
2669 days, 8 hours, 41 minutes ago
View thin lizzy's profile
thin lizzy
RE: Utility Script: Mine-sweep visualizationWrite Reply

There we have a very mine intense game : http://planets.nu/games/18074 if this helps.
team game with webs and regular mines, onion minefields, the whole range, lots of mines...
but how do oyu want to tet there? it's a running game...

to me the script looks pretty good, but sometimes it's a bit hard to understand what now is your minefield and which you ally's ;) thank you!
2662 days, 12 hours, 51 minutes ago
View tom n's profile
tom n
RE: Utility Script: Mine-sweep visualizationWrite Reply
Thanks! This is a very useful tool!
2658 days, 14 hours, 43 minutes ago
Profile Image
kedalion
RE: Utility Script: Mine-sweep visualizationWrite Reply
Can you remove "http://planets.nu/games/*" from the include tags? It keeps throwing an error as obviously it cannot find "vgapShipScreen" here.
2658 days, 0 hours, 5 minutes ago
View big beefer's profile
big beefer
RE: Utility Script: Mine-sweep visualizationWrite Reply
I can, but is it causing any serious issues that other scripts aren't? It seems like pretty much anything altering the in-game interface would cause these problems, since the games page does not load the vgap.js file (also why lord helmet's play button didn't work as expected I think). I run with a bunch of these loaded and they seem to die quietly enough.

I'd prefer to leave the games directory included (though am open to alternatives), because that is where finished games are viewed from, and I'd like my add-ons to work for them too. It's interesting that finished games seem to load the vgap.js script while active games accessed via the games directory do not.

2657 days, 23 hours, 50 minutes ago
Profile Image
kedalion
RE: Utility Script: Mine-sweep visualizationWrite Reply
Fair enough. I hadn't noticed that finished games aren't viewed from home.
And yes, it dies pretty quietly. :) I just thought it slipped by...
2644 days, 16 hours, 3 minutes ago
View big beefer's profile
big beefer
RE: Utility Script: Mine-sweep visualizationWrite Reply
New version 0.4. Now when a ship's mission is lay mines (or webs), shortcut links appear next to the mission in the ship screen. These correspond to the X in a "mdX" friendly code, and clicking on any of them will set the friendly code accordingly. I'm playing a game as crystals now, and it was getting on the tedious side to keep opening the FC change box to adjust these (especially when I'm trying a lot of different sizes out).

Also, added the new client to the included web pages list, though I have done absolutely zero testing with it. If anyone finds any issues with it let me know.

I'm also open to ideas (and better yet code) on how to improve these links visually. Pretty ugly right now though they work ok.
2644 days, 2 hours, 57 minutes ago
View kira benodo's profile
kira benodo
RE: Utility Script: Mine-sweep visualizationWrite Reply
Nice idea - but I don't know md0 and mda, can you explane them.

Perhaps you can do the msc with "Mine sweep"

Thank you
2644 days, 1 hours, 8 minutes ago
View big beefer's profile
big beefer
RE: Utility Script: Mine-sweep visualizationWrite Reply
md0 means to lay 100 mines. mda means to lay all mines. mda is not an actual special friendly code (almost any other would have the same effect), but I wanted to have an easy way there to "turn off" laying a smaller number of mines with mdX, and making up an "mda" code made things simple for me to code.

I may add something similar for "msc" when mission is mine sweep, but I don't find myself tinkering with that one as much as the mdX codes, it's either just on or off. I have some other mine scoop improvements planned (showing it in the preview and calculating "scooping power", how many mine units you can pick up and how many torpedoes it will make) but we'll see when I get to them,
2639 days, 12 hours, 43 minutes ago
View vepr's profile
vepr
RE: Utility Script: Mine-sweep visualizationWrite Reply
hey beefer.
i was wondering if u could add the visualization of the mines swept to appear all the time, not just when you have the selected ship on a mine sweep mission.  it would simplify movements through mine fields when you are trying to coordinate multiple ships, some of which have different missions. 

v
2639 days, 12 hours, 17 minutes ago
View big beefer's profile
big beefer
RE: Utility Script: Mine-sweep visualizationWrite Reply
The latest version (whatever it was), should have an option "Minefield Preview" or something similar under the map tools drop down, which should do exactly that. The toggling isn't written that well and it can get out of sync various ways (which doesn't harm anything), so if you click it and don't see a change, just click it again. I'll fix that one of these days maybe, but it's good enough for now.

Let me know if that's not what you were looking for or it doesn't work at all.
2638 days, 11 hours, 13 minutes ago
View tom n's profile
tom n
RE: Utility Script: Mine-sweep visualizationWrite Reply
Thanks again, but can "mines destroy mines" be added to the visualization? It would be great to see the affect of my future minefield vs my opponents, allowing me to decide whether to sweep or lay mines to clear the way.
2627 days, 23 hours, 44 minutes ago
View tom n's profile
tom n
RE: Utility Script: Mine-sweep visualizationWrite Reply
This is my favorite script. Invaluable. But seems to only show 1 ships effect on the minefield. If I have 3 ships in a fleet, all sweeping, I still only see 1 ships effect. All 3 should show the entire field cleared. Is this a bug???
2627 days, 22 hours, 35 minutes ago
View big beefer's profile
big beefer
RE: Utility Script: Mine-sweep visualizationWrite Reply
I think it is right, but I can't guarantee it. I'll take a look. But can you check one thing? I've see it come up in my games, and I think it's a case where this tool actually is more helpful than I had even anticipated.

Ships sweep in order of ID and the minefield is reduced in size accordingly with each one before the next sweeps. So a lower ID ship can actually reduce the size of a minefield it is sweeping enough that other ships trying to sweep the same field will not be able to reach it.

To see if this is the case in your situation, I'd recommend the following.
1. Turn all the ships within 5ly of the minefield off of minesweep.
2. Set the lowest ID ship to minesweep. You show see the preview of the swept field.
3. Look at the distances of the other sweeping ships to the edge of the "previewed" field.
4. If the distances are greater than 5ly, the script is correct and showing you what will happen: the first ship will sweep the field out of range of the other sweepers, and they won't actually sweep anything (unless enemy lays more mines). Otherwise, yes it would be a bug and I will investigate further,

I've had a couple times already where I stopped a lower ID ship from sweeping so that a higher ID ship with better sweeping power would still be able to reach the field and actually sweep more.mines total than if both had been set to sweep. It's a rather annoying part of vgap mechanics and something I never would have bothered to try and calculate before I wrote this.

This is also why, in general, when using multiple ships to sweep you want to position them so that higher ID ships are closer to the middle of the field.

Anyways, let me know what you find out. Also, I do plan on adding "msc" and mines destroy mines sometime, but it might be awhile. Summer tends to draw my interest from the computer back to the real world some...
2627 days, 13 hours, 27 minutes ago
View tom n's profile
tom n
RE: Utility Script: Mine-sweep visualizationWrite Reply
Right you are! So much to remember in this complex game, I forgot the ships sweep one at a time. Thanks again!
2626 days, 16 hours, 11 minutes ago
View big beefer's profile
big beefer
RE: Utility Script: Mine-sweep visualizationWrite Reply
Minesweep preview script has been updated (ver. 0.5) to work with new client (vgap2.js 1.97)
2626 days, 4 hours, 54 minutes ago
Profile Image
judge red
RE: Utility Script: Mine-sweep visualizationWrite Reply
thanks! I have no idea how I used to be able to play this game without your script :-) best star map script.
 
2626 days, 2 hours, 20 minutes ago
View emork the lizard king's profile
emork the lizard king
RE: Utility Script: Mine-sweep visualizationWrite Reply
Big thx Big Beefer!!! This is the script with the by far most relevance for me.

With or against the Crystals one LJ of minefield radius can be crucial. Calculating this for many different minefields and different ship positions is impossible.
 

2625 days, 15 hours, 6 minutes ago
View tom n's profile
tom n
RE: Utility Script: Mine-sweep visualizationWrite Reply
My mine-sweep add-on is not working with the new 'NU' "update". It was fine yesterday, now I have to disable the extension in Google Chrome tools so I can make my moves.
2625 days, 14 hours, 48 minutes ago
View big beefer's profile
big beefer
RE: Utility Script: Mine-sweep visualizationWrite Reply
Tom, did you download the recently updated version? I just finished my turn using it without any issue. I do use firefox though. Guess that could be it too.
2625 days, 13 hours, 33 minutes ago
View tom n's profile
tom n
RE: Utility Script: Mine-sweep visualizationWrite Reply
Just downloaded v5 and all is well. Seemed to work with v4 yesterday. Thanks again! You know I got by years without your program, but now I can't get by without it. I always tell my allies about it, and make sure not to mention it to my enemies. ;-D
2623 days, 6 hours, 32 minutes ago
Profile Image
kwesy
RE: Utility Script: Mine-sweep visualizationWrite Reply
I think this script removes the yellow ring that shows the ship that has the "focus" (current selection on the starmap).

I'm not 100% sure, but I see the ring when I disable the script (in Greasemonkey) and reload the game.
I don't see the ring when it's enabled.
2623 days, 1 hours, 41 minutes ago
Profile Image
kedalion
RE: Utility Script: Mine-sweep visualizationWrite Reply
I had something similar, but turned out that the ring was too small and would be painted over by something else right away. But I cannot reproduce it any more. The ring is fine in both Chrome and FF for me. 
2623 days, 0 hours, 15 minutes ago
View big beefer's profile
big beefer
RE: Utility Script: Mine-sweep visualizationWrite Reply
Kwesy, you don't see the yellow focus ring for any of your ships with the script running? That is odd, I've never had an issue with that. I just checked to be sure in my current game and everything seemed fine. What browser are you using? I use ff pretty much exclusively, so that could be where the difference lies.
2622 days, 7 hours, 8 minutes ago
Profile Image
kwesy
RE: Utility Script: Mine-sweep visualizationWrite Reply
@big beefer, I usually use FF and I'm having the described problem there.
Strangely I don't have the problem in another Firefox installation (different computer) with your script.
I'll report if I find out new details. As it seems it's more like my personal problem :-D

2621 days, 1 hours, 38 minutes ago
Profile Image
kwesy
RE: Utility Script: Mine-sweep visualizationWrite Reply
Hmm - I trying to nail it down a bit.
The configuration with that I have the problem with your script is FF 12.0 .
When your script is enabled I actually see the yellow focus ring for at least the first ship that I select (after entering the game). When I click "next" (for the next ship) a few times the ring isn't drawn anymore (for no ship from then on).
That happens as soon as I select a ship that is in a minefield and does "mine sweep".


2618 days, 23 hours, 46 minutes ago
View big beefer's profile
big beefer
RE: Utility Script: Mine-sweep visualizationWrite Reply
Well, this script is for the most part obsolete now. The planets.nu team has rolled most of this code into the game itself. Only reason to still run the add-on (and the reason I still do) would be for the more convenient mdX links the script provides. I assume Joshua and team moved them inside the mission select window so they had room to spell out the settings and make it more clear for new users, but the whole idea of having them on the ship screen itself was to make it quicker and easier to change. Having to open the mission window to do so is really not that much more convenient than having to open the FC change window. Just a case of having 2 different target audiences I guess. I think as the .nu team further updates the interface it would be nice to have more settings to customize these sorts of things. New users will appreciate having things written out clearly for them as the are learning, but with more experience will likely be more interested in efficiency improvements, since to play this game well can take a big chunk of time, much of which can end up spent on rather tedious details.

Anyways, I don't intend to maintain this script further, though I may add a new one later to add the quick-links back to the ship screen (and maybe more links for other FCs). Probably on the friendly code line now instead of the mission.


2618 days, 23 hours, 15 minutes ago
View emork the lizard king's profile
emork the lizard king
RE: Utility Script: Mine-sweep visualizationWrite Reply
I didn't realize that the mine-field preview has been added to the official interface. That's good news. Oh .. how I would love release notes!

Anyway, many thanks Big Beefer, to make life so much easer in the last months!
2618 days, 23 hours, 3 minutes ago
Profile Image
kedalion
RE: Utility Script: Mine-sweep visualizationWrite Reply
Yep, release notes would be awesome. Also nice would be one of the developers quickly commenting when the content of a userscript has been integrated... Shoudn't be too difficult (and also gives some recognition).

Big Beefer, why don't you strip the addon down to the now missing functionality? Take out the code that has been integrated. I like the quick links right there.
2618 days, 21 hours, 48 minutes ago
View big beefer's profile
big beefer
RE: Utility Script: Mine-sweep visualizationWrite Reply
Kedalion, yes that was certainly the easiest way to go about things, and I'm glad you suggested it! I hadn't played enough since the change to see all the needlessly duplicated info when running the script. Anyways, the updated version 0.6, does just that, nothing but the links. Well, I niced up the formatting just a touch too, but nothing too exciting...
2618 days, 21 hours, 27 minutes ago
Profile Image
kedalion
RE: Utility Script: Mine-sweep visualizationWrite Reply
Awesome. :)

Generally, wouldn't it be nice to have a variable in each of the NU files that reports the version number? Then we could just check for that and disable the addon if the number is higher than our compatibility...
2615 days, 5 hours, 49 minutes ago
Profile Image
kedalion
RE: Utility Script: Mine-sweep visualizationWrite Reply
Beefer, I just stumbled across some weird behavior of the new minefield preview / actual sweeping.

After coding this, I assume you picked apart the formulas quite well. Maybe you can make sense of it:
2610 days, 17 hours, 43 minutes ago
View nakor's profile
nakor
RE: Utility Script: Mine-sweep visualizationWrite Reply
I just saw the new minefield preview (for scooping up mines) for the first time. This is really nice! Thanks for that! :)
Hope it works correctly... ;)
2610 days, 17 hours, 36 minutes ago
Profile Image
kedalion
RE: Utility Script: Mine-sweep visualizationWrite Reply
I don't think it works correctly... at least I saw two different cases (see post above) in which preview and actual sweeping don't agree... but I don't know if beefer's script did a better job in those cases.
2291 days, 6 hours, 3 minutes ago
View jobo's profile
jobo
RE: Utility Script: Mine-sweep visualizationWrite Reply
This script stopped working today (or perhaps yesterday). Sure the only thing it did was add md1, md2, md3, etc to the Lay Minefield mission on the ship screen, but I was using that a lot...

Any ideas?

I'm using the "old" planets.nu website, not sure if it still works on the new website, it's not really usable for me yet, so I'm stuck with the old website.
2291 days, 3 hours, 43 minutes ago
View jobo's profile
jobo
RE: Utility Script: Mine-sweep visualizationWrite Reply
Ehm... my bad.

I had turned off greasemonkey :(
2290 days, 22 hours, 30 minutes ago
View big beefer's profile
big beefer
RE: Utility Script: Mine-sweep visualizationWrite Reply
Well anyways, since you brought this old script up, and at the same time I was growing weary playing the colonies and having to turn on/off "lfm" all the time, I made a minor update that adds quick links for all of the applicable FCs (the same list you get if you open the FC box). Also one for a random FC.