Utility Script: Improved ship movement tools

« Back to Developers

2688 days, 17 hours, 56 minutes ago
View big beefer's profile
big beefer
Utility Script: Improved ship movement toolsWrite Reply
First let me say I've done only the most minimal of testing with this, so use at your own risk. Maybe give it a shot in a game vs. computer or something first. It's based on the movement calculation from donovan's and should match vgapcalc, but have not confirmed it's right in all cases.

This user script attempts to fix what I saw as some of the shortcomings of the movement interface. Specifically:
1. It adjusts the threshold for movement per turn to include rounding (ie. at warp 9, up to 81.5ly is 1 turn now.)
2. It fixes a few other issues involving warp wells when calculating travel times (like the magic 0 turns trip).
3. It adds a new item "Next Turn" which shows the coordinates of where your ship will be the next turn if it follows the set path. Adjusts for warp wells.
4. Adds little circles along the waypoint path to indicate where the ship will be each turn.
5. Stops showing "Never!" just because a ship doesn't have enough fuel to make it to the final waypoint. Much more useful to know how long it would take anyways, for a whole variety of reasons.

What it does NOT do:
1. Change the fuel calculations, some of which (particularly for multi-leg trips) are not always right.
2. Fix the issue of using warp wells in multi-stage trips: My updated code assumes if you had a waypoint set to a warp well with warp > 1 that the planet was your desired destination, and moves on to the next leg of the journey. I don't believe the host code does this currently and will continue to try to move you into the warp well.

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


Screenshot:
http://planets.nu/_library/2012/3/bettertravelprediction.jpg



2688 days, 12 hours, 51 minutes ago
Profile Image
kennyra
RE: Utility Script: Improved ship movement toolsWrite Reply
Awesome job... can't wait to try it out! I posted the need for visible waypoints (in a multi-waypoint chain) in the feedback forum a long time ago. I wonder how long it took you to do this script... and why the developers don't seem to have the time for this type of basic fix.

Next on my wish list... having a ship be able to "click" on a waypoint in another ships chain to meet it there.
2685 days, 13 hours, 17 minutes ago
View big beefer's profile
big beefer
RE: Utility Script: Improved ship movement toolsWrite Reply
Ha thanks! Joshua should give me a job! But regardless, I've posted a new version that includes some changes for HYP given to me by Lord Helmet (thanks Helmet!). I think it works well in most normal usages of HYP, though there are some issues with multiple waypoints when there are non-direct (<340 or > 360 ly) waypoints. But who really does that? (on purpose, I mean). Hopefully some of the changes will also help prevent accidental HYPing by making it more obvious where you'll really end up.
2606 days, 21 hours, 11 minutes ago
Profile Image
xeye
RE: Utility Script: Improved ship movement toolsWrite Reply
Nice addon! Loved from the first run.

I want to suggest some changes in rangeCircle phase (I can make a separate addon but you have this code overlapped, so it whould be better to use it inside yours)

Reasons:
current range circle is useless because: 
1) it shows range for next turn at a destination, while I need to know the range for current position and possible on the next turn
2) it shows range based on engine level, while I can use higher warp in critical situation, especially with light ships and gravitonics.

My implementation just makes range circles like VPA: two circles from the current point with 81/162 range.

        this.drawCircle(ship.x, ship.y, 81 * this.zoom, { stroke: "cyan", "stroke-width": "1", "stroke-opacity": "0.1" });
        this.drawCircle(ship.x, ship.y, 162 * this.zoom, { stroke: "cyan", "stroke-width": "1", "stroke-opacity": "0.1" });


2604 days, 22 hours, 6 minutes ago
View big beefer's profile
big beefer
RE: Utility Script: Improved ship movement toolsWrite Reply
I actually rather like the .nu range circle implementation. I've found it pretty flexible.

For #1 above, you can set the waypoint to the ship itself to see range from the current position, and when you set a waypoint, for the destination as well.

For #2, the range circle uses warp setting, not engine level. Nothing stops you from setting a Tech 1 engine ship to warp 9 to see if incoming enemies can reach it in one turn, or whatever you. Just make sure you set it back if you don't actually want to go that speed (or wonder where all your fuel went next turn).

I suppose it might be less useful if you use a lot of multiple or long waypoints (which I typically do not), but I've been pretty happy with the range circle offered, so I think I'll leave it alone for now.
2453 days, 19 hours, 22 minutes ago
Profile Image
xeye
RE: Utility Script: Improved ship movement toolsWrite Reply
we do need urgent fix for v3 code :)
pls pls, or I will have to do this myself.
2451 days, 8 hours, 1 minutes ago
Profile Image
anaconda
RE: Utility Script: Improved ship movement toolsWrite Reply
This might be a stupid question, but what the frak is that rather large circle around Wanikurak; it doesnt appear to be a minefield, and it is too smal to be a HYP circle?
2450 days, 23 hours, 37 minutes ago
View big beefer's profile
big beefer
RE: Utility Script: Improved ship movement toolsWrite Reply
That's the "range circle". It is drawn around the current ship's waypoint and shows how far you can get in one turn (using your current warp speed).

It's built in to the .nu code (no addon required), but I've heard it's broken in v3. You can toggle it on or off by pressing the 'a' key, or I think there's an option in the map tools as well.

Xeye, I don't know when I'll get around to updating these scripts for v3. The end of the year is always a crazy busy time for me so it might not be until sometime in January. If you want to update it yourself go ahead, and feel free to post it. Everything still works fine in v2 though.
2415 days, 20 hours, 59 minutes ago
Profile Image
july
RE: Utility Script: Improved ship movement toolsWrite Reply
There seems to be an issue with fuel-less ships and stardrives (or going warp 1). Every time I have a ship without fuel, going warp 1, the script hangs. I guess it's trying to draw a few dozen or maybe infinite tiny circles which causes issues.

You can reproduce this: Start a new game (blitz vs computer), go to your starbase and build any ship with warp 1 engines. End turn. When it's built, go to the starmap, select the ship and set a waypoint. The script (and the browser) will hang.
2373 days, 15 hours, 56 minutes ago
View sjharley's profile
sjharley
RE: Utility Script: Improved ship movement toolsWrite Reply
any news on an updated version of this - it was an absolute life saver for me - miss it loads.
2358 days, 15 hours, 46 minutes ago
View tom n's profile
tom n
RE: Utility Script: Improved ship movement toolsWrite Reply
Hi big beefer,  I use Chrome (Windows 7 64bit) and I had to disable this script. Going to miss it, but I use warp 1 quite a lot and the script is freezing the game anytime I set warp 1. Have you had time to see what happened?  Thanks,  tom n
2288 days, 2 hours, 4 minutes ago
View big beefer's profile
big beefer
RE: Utility Script: Improved ship movement toolsWrite Reply
Well, after looking at this a good number of times, I think I FINALLY found the warp 1 problem, and updated for it. It accidentally got introduced in the newer versions of the script. Anyways, let me know if you see any other issues.

It still only works with the old version (as far as I know).
2287 days, 21 hours, 23 minutes ago
View tom n's profile
tom n
tom nWrite Reply
Thanks again Big Beefer. From reading NU's Roadmap to the Future at http://play.planets.nu/#/post/planets-nu-roadmap , my hope is you may be spared the drudgery of converting all your helpful scripts to the new version. Sounds like they will try to incorporate your mods.
2159 days, 17 hours, 44 minutes ago
View big beefer's profile
big beefer
RE: Utility Script: Improved ship movement toolsWrite Reply
I believe I now have a working update (0.8) for the new version. I pulled out the HYP stuff because I think the new client does that OK, but otherwise I think it works well, and quite similarly to the old-client version. Give it a shot and let me know if it gives you any problems, particularly with HYP or chunnel, because I didn't really test it with those. This was one of my "must-have" scripts before I (finally) switch over to the new version. I hope you find it useful as well!
2047 days, 20 hours, 35 minutes ago
View figak's profile
figak
RE: Utility Script: Improved ship movement toolsWrite Reply
Subscribe