Allies and teams wanted to help test new information sharing script

« Back to Developers

2558 days, 0 hours, 14 minutes ago
View big beefer's profile
big beefer
Allies and teams wanted to help test new information sharing scriptWrite Reply
I've been working on a script to help allies coordinate better by allowing them to share their current moves with each other. Unfortunately I'm not in any games right now, so I can't do that much testing with it. I'm hoping some teams or allies out there in current games could try it out and let me know how it does with realistic game data. I have a small test game I use and it seems to work there OK, but I'm not convinced it's ready for prime time.

If anyone's interested here's how it works:
1. You must have a FULL alliance with someone.
2. BOTH players in the alliance need to install the userscript from the link below
3. You can tell it is working (at least in some form) by going to the diplomacy menu. Notice the new menu item "Update Allies".
4. After you make some changes to your turn, click the "Update Allies" button and a message will be sent to your allies containing all your current ship/planet/starbase data. You should see an "Updated Info" message sent (and they should get email notification, just like any other message.
5. When your ally opens their turn, the message you sent will be parsed automatically and that information will be used when displaying your stuff, so they will see all of the moves you've made and can coordinate with them as needed.

So basically both sides will now get all the CURRENT info on what's going on (waypoints (including snap-to ally's waypoint), current FCs even if changed, what's being built at each other's bases, missions, cloak states, etc). It should all be there, down to the build targets and tax rates on planets. You will now also view your allies stuff using the same interface you use to view your own, though you should not be able to edit them.

Anyways, if there are some groups out there who want to give this a shot and help me get it cleaned up that would be awesome. I know there are still some issues with it, so keep that in mind and be prepared to disable it if needed. But I think you will also find it to be an extremely useful tool for team play once it reaches a stable state.

DISCLAIMER: Because this script involves getting (and believing) information from an external party (your ally), it could be used to maliciously send bad information, etc. I don't really see that happening, but it is a possibility, so you should only use this with players you trust.

OK, here's the link to the script:
http://userscripts.org/scripts/show/140620
2558 days, 0 hours, 7 minutes ago
View mithras's profile
mithras
RE: Allies and teams wanted to help test new information sharing scriptWrite Reply
I don't currently have any allies in games, but wow, if I did, I would be all over this.  The concept alone gets you props from me.
2557 days, 17 hours, 59 minutes ago
View donaldworrell's profile
donaldworrell
RE: Allies and teams wanted to help test new information sharing scriptWrite Reply
does this work on any operating system and browser.  I am using a mac running safari
2557 days, 16 hours, 29 minutes ago
View big beefer's profile
big beefer
RE: Allies and teams wanted to help test new information sharing scriptWrite Reply
It *should* work I think, so long as safari has some kind of userscript support (not really that familiar with it). If you've been able to use any of the other userscripts out there, this one isn't that different really. I do only test what I use though, which is firefox on windows, so no guarantees. It should be pretty obvious if it's working or not, and I'm happy to help anyone troubleshoot it as well.


2557 days, 14 hours, 55 minutes ago
View big beefer's profile
big beefer
RE: Allies and teams wanted to help test new information sharing scriptWrite Reply
This script also has some things that may be of use to other userscript writers:

1. The old pre-API methods of posting data to be saved still seem to work, which is useful if you need to send large amounts of data, among other things (this should avoid the 414 error Lord Helmet was seeing when trying to save large notes) . The POSTrequest function provides this functionality. POSTsendMessage is an updated version of the pre-API sendMessage function and others can be created similarly. Note that data.add() now requires the 3rd param (encode) to be false in this case. Also note the "jsonp: false" in POSTrequest works around an issue where a double question mark (??) in the data was causing problems.

2. There is an odd issue in the messaging system where if a string goes on for 80 characters without a space, a space is added for some reason, which will really screw up long data strings. The function cleanMessage attempts to undo this behavior (which seems to take place server side and so is out of our control). It's not perfect in that a legitimate space char could be deleted if exactly 80 chars after another one, but so far it's worked for me.
2556 days, 13 hours, 58 minutes ago
View emork the lizard king's profile
emork the lizard king
RE: Allies and teams wanted to help test new information sharing scriptWrite Reply
Hi Big Beefer,

great idea! I installed the script, I see the "Update Allies" option but when I press it nothing happens. I also don't see a message to my ally.

I have Windows 7 and Firefox 14.01.
Other than your script I only have only two scripts installed that improve the score screen (ally score, last turn changes).

Best regards, Emork

2555 days, 19 hours, 19 minutes ago
Profile Image
lil beefer (test)
RE: Allies and teams wanted to help test new information sharing scriptWrite Reply
Emork, thanks for getting me that info. It was exactly the kind of help I was looking for with this. Version 0.5 should fix the cyclic object issue you were seeing (or at least the one I found). Give it a shot and let me know of there are more issues.
2555 days, 13 hours, 45 minutes ago
View emork the lizard king's profile
emork the lizard king
RE: Allies and teams wanted to help test new information sharing scriptWrite Reply
Ok, now a message "Updated turn info: Turn 91 " was sent. I asked my ally if he is willing to try it out. If he does I give feedback.


2555 days, 13 hours, 21 minutes ago
View emork the lizard king's profile
emork the lizard king
RE: Allies and teams wanted to help test new information sharing scriptWrite Reply
Hi Big Beefer,

I found a bug. All buttons (mission, speed, transfer ...) on the ship/planet/base screens don't work any more. I have the impression this was after I clicked on an allied ship. My ally hasn't installed the script, only me. Seems you set the screens to read only mode when displaying an allied item but don't set them back.
2555 days, 3 hours, 20 minutes ago
View big beefer's profile
big beefer
RE: Allies and teams wanted to help test new information sharing scriptWrite Reply
Thanks again for checking this out, Emork! I realized that I left in some code from another script that will cause ships/planets/bases marked as ready to also be locked (or read-only as you say). Can you see if this is the case? Things that don't have ready checkmarks should still be editable.

Note there is one issue there because I didn't copy all the locking code over: if you have a ship marked ready and you clear the checkmarlks, you will need to close the ship screen and reopen it to "unlock" the ship.

If you still can't edit anything, can you send me the web console info via pm again? It was extremely helpful last time.

Finally, I'm debating on leaving the "lock-when-ready" code in, maybe making it a setting. It's something players have asked for in the past, to keep from accidentally changing orders. Would you consider it useful (once you knew what was going on and I fixed the need to reopen issue) or is it just an annoyance?
2555 days, 1 hours, 31 minutes ago
View emork the lizard king's profile
emork the lizard king
RE: Allies and teams wanted to help test new information sharing scriptWrite Reply
You are right, it was the code that locks ready items. If I unlock an item, close and reopen the item screen I can edit it again.
I'm not sure about this function. The way it is now (close/reopen the item screen to edit) it is clearly an annoyance in my opinion. Even without that I'm not sure if I like it. I rarely change my commands by accident but I often reconsider and make changes to ready items. But if you make it a setting that is by default disabled then it won't hurt, or?

BR, Emork
2555 days, 1 hours, 18 minutes ago
View big beefer's profile
big beefer
RE: Allies and teams wanted to help test new information sharing scriptWrite Reply
I'm inclined to agree with you. I thought it would be a nice safeguard, but found it more irritating than useful myself (even with the fully working version from the other script). For now, I just pulled it from the new version 0.6. If someone really wants it I could clean it up and put it back as a setting, but generally I don't write things I don't expect to use!
2554 days, 14 hours, 56 minutes ago
View emork the lizard king's profile
emork the lizard king
RE: Allies and teams wanted to help test new information sharing scriptWrite Reply
Hi Big,

another issue with V 0.6: I'm Crystal and my special mission to lay webs vanished from the mission screen.

When selecting a ship that was set to lay webs last turn I get this error message on the web console:
[07:45:19.555] TypeError: this.getMission(g.mission) is null @ http://play.planets.nu/vgap2.1.js?ver=1.97:1
2554 days, 5 hours, 3 minutes ago
View big beefer's profile
big beefer
RE: Allies and teams wanted to help test new information sharing scriptWrite Reply
You're finding all the good stuff! I was confused at first,since in my test game I play the crystals, and that was one of the things I checked, since I had to change some code around it. Then I realized you're in one of the melee games. Basically I was getting the special missions based on the playerid (slotid) instead of race. Which happens to work just fine in normal 11 player games. Anyways, should be fixed in version 0.7. One remaining issue with it: if you are looking at your allies ships (if we ever get that far!) and they have the special mission set, the mission will appear correctly for their race, but the mission subtext will be for your race. Ex. If you are crystal and your ally is birdman (as in my test game), Your birdman ally's ship will appear to have mission "Super Spy (convert 0 torps to 0 web mines)". Pretty minor, I'll get to fixing it at some point.
2553 days, 17 hours, 41 minutes ago
View emork the lizard king's profile
emork the lizard king
RE: Allies and teams wanted to help test new information sharing scriptWrite Reply
Hi Big,

let's enter the next round. I get the share data message from my ally now  but nothing changed when I click on an allied item. Web console shows an "unexpected end of stream" error when parsing the ally data, see below. If you want the complete ally data I can send it to you as PM.

{"turn":92,"ships":[{"friendlycode":"rur","name":"J-Schneepflug","warp":9,"x":1982,"y":2209,"
... omited ...
{"x":2023,"y":3145}],"iscloaked":true,"readystatus":0," @ http://planets.nu/home:13

[05:03:13.100] 0 @ http://planets.nu/home:13

[05:03:13.106] ({length:1, prevObject:{0:({}), length:1}, context:(void 0), selector:"#MESSID_vgapShareWithAllies", 0:({})}) @ http://planets.nu/home:13

[05:03:13.108] SyntaxError: JSON.parse: unexpected end of data @ http://planets.nu/home:13

2553 days, 3 hours, 32 minutes ago
View big beefer's profile
big beefer
RE: Allies and teams wanted to help test new information sharing scriptWrite Reply
Man, this was supposed to be a fairly simple project, but the technical workarounds are getting painful! It appears (thanks again to Emork), that the server is getting all of the data sent (as it all appears in the notification email sent), but is truncating it when it sends it down with the turn file. Seems to accept about 64k chars, which wasn't even enough to get through all of the ships in the game file you sent me, much less the planets and bases (and forget the other players' messages I was going to add). I looked and my last game the info I was trying to transfer would have come out to about 490k.

So I'm looking into compression. I tried a JS LZW implementation from stackoverflow, but the server also butchered sending down the compressed data (though again seemed to store it correctly. If anyone knows of a decent text-compression algorithm that will work with the server here, I'd love to know about it. Otherwise, I guess I could write a .nu-specific compressor, but that's some tedious work there.
2553 days, 3 hours, 25 minutes ago
View joshua's profile
joshua
RE: Allies and teams wanted to help test new information sharing scriptWrite Reply
Beefer, I had this problem too. Initially I was doing a complete data save at the end of a turn, but what I found was that some clients actually truncate the save data. It didn't matter what I did on the server, some browser clients will actually limit the amount in a post. I first went down the same route you are, starting with LZW compression (from stack overflow) but I couldn't make it work. Then I split the save up into many small save commands which worked out better in the end. 
2553 days, 3 hours, 12 minutes ago
View big beefer's profile
big beefer
RE: Allies and teams wanted to help test new information sharing scriptWrite Reply
I don't think that's the problem here. Since the email Emork is getting contains the full data his ally was posting, I assume it must have all been posted OK to the server. It's when we access the message from the mymessages array that we are seeing the truncation.

Though I guess if other clients will truncate the post, another solution is still needed anyways.
2553 days, 1 hours, 32 minutes ago
View emork the lizard king's profile
emork the lizard king
RE: Allies and teams wanted to help test new information sharing scriptWrite Reply
Maybe you could shorten the field names in the message and expand them on the client before invoking the parser? Just an idea. I have no clue about the mechanics you have to deal with.
Additionally you could send seperate messages for ships, planets and bases and omit the history in the ship message.
2552 days, 21 hours, 59 minutes ago
View big beefer's profile
big beefer
RE: Allies and teams wanted to help test new information sharing scriptWrite Reply
I'm going to readily admit I've spent too long on this today. But who doesn't like a good challenge? I cut a bunch of fields, the ship history for one, and a bunch of stuff that you would already know anyways, so no need to duplicate in transmission. Then I wrote a not-too shabby (though not all-purpose) compression function on top of that. Got my large game info block down form ~490k to ~45k. So give version 0.8 a whirl when you have the time. You will obviously have to have send new update messages after installing it before things will work right, so it will likely throw some errors until that happens, but shouldn't hinder you in any way.

The code's a mess of patches right now, but it seemed to work OK in the few test scenarios I could throw at it.
2551 days, 23 hours, 33 minutes ago
View emork the lizard king's profile
emork the lizard king
RE: Allies and teams wanted to help test new information sharing scriptWrite Reply
Congratulations Big Beefer! I just tested v0.8 for a few minutes now. It works and it is simply


GREAT!


It is soo helpful and using the regular screens to display all the informations was an ingenious idea

Many thanks for this!   Emork

2551 days, 23 hours, 30 minutes ago
View emork the lizard king's profile
emork the lizard king
RE: Allies and teams wanted to help test new information sharing scriptWrite Reply
P.S.: I hope you don't mind that I asked in the "disconnect" thread if all these guys are also using your script. I really don't think there is a relation but it can't hurt to verify this.

Update: The first one with many disconnects answered that he has not installed this script. Verified! 

2551 days, 7 hours, 1 minutes ago
View chas's profile
chas
RE: Allies and teams wanted to help test new information sharing scriptWrite Reply
This script looks really helpful.

Two bugs I noted:
1.  At a planet with a lot of ships, the icons increase in size to the point that the bottom ones disappear.  Both Chrome and Firefox.
2.  An ally ship is labeled as going to a planet, but the yellow path ends just outside the warpwell.

Is it possible to show ally ship paths on the starmap?  I mean without having to select a ship.
2550 days, 22 hours, 52 minutes ago
View big beefer's profile
big beefer
RE: Allies and teams wanted to help test new information sharing scriptWrite Reply
Chas, is #1 true for both your planets and allies, or only one or the other? Does it matter who owns the ships? Is this true only for the planet screen, or also for the ship and starbase screens as well?  A screenshot would be awesome if you can get one.

I'm not sure what you mean by showing ally ship paths. They should all be shown all the time. If not, something probably isn't working right. Again, screenshots would be helpful and we can troubleshoot from there.

Also don't know on the yellow path not showing the ship going all the way to the planet. Are you using any other userscripts that could be conflicting?
2550 days, 1 hours, 52 minutes ago
View big beefer's profile
big beefer
RE: Allies and teams wanted to help test new information sharing scriptWrite Reply
OK, version 0.9 should correctly size the fleet pics so everything will be visible so #1 above should be fixed. Can you send me a pic of what you mean by #2, chas? I'm still not sure I understand.
2532 days, 2 hours, 35 minutes ago
View big beefer's profile
big beefer
RE: Allies and teams wanted to help test new information sharing scriptWrite Reply
Just curious if anyone out there is still using this, and if so it's going well? I started using it in my current game, and it seems to work well. But that game is very young and simple yet. Anyone had any luck with it in a more developed game?
2532 days, 2 hours, 17 minutes ago
View emork the lizard king's profile
emork the lizard king
RE: Allies and teams wanted to help test new information sharing scriptWrite Reply
Hi Big,

my ally Joe and I are using your script every turn of 33817: Cheeseball Sector.
That's a big and fully developed game and we have no problems with the script. It's a tremendous help. Well done!
2531 days, 5 hours, 10 minutes ago
View mycroft's profile
mycroft
RE: Allies and teams wanted to help test new information sharing scriptWrite Reply
I'm trying to get a friend of mine to test this out on a game approaching midgame. We'll see if we can find more work for you yet :)
2530 days, 15 hours, 25 minutes ago
View mycroft's profile
mycroft
RE: Allies and teams wanted to help test new information sharing scriptWrite Reply
Could possibly (I know this is a huge way to much work probably)

The draw feature be tied into this extension, so that you can share allied drawings with each other? Perhaps put it all together as a single "layer" and have the option to show/hide all layers. Possibly even to only share layers that you yourself are having as shown at that moment.

Also, quick question since we haven't driven this app yet. Should the minefield sweep previewed extension show allied sweeping laying efforts? Likewise visably see allied mine laying efforts ordered? 
2530 days, 4 hours, 57 minutes ago
View big beefer's profile
big beefer
RE: Allies and teams wanted to help test new information sharing scriptWrite Reply
I do intend to add some method for sending drawings, but wanted to make sure that the mechanisms for sending the data via in-game message were working before starting on that.

Currently, you won't see your allies mine laying or sweeping, but it's a good idea. I'll see how much work it would take. Also, will add indications of towing/being towed by allied ships.

Emork, thanks again for your help in testing this and helping track down some of the big issues. And glad you've found it useful!


2530 days, 3 hours, 38 minutes ago
View mycroft's profile
mycroft
RE: Allies and teams wanted to help test new information sharing scriptWrite Reply
Also are HYP and Chunnel lines shown with this? (Maybe with a -> in the line showing direction every 50-100 LY's) 

"msc" should be included in the mine viewing data too if it's possible to reverse calculate:
 (Tech Tube [mines to scoop p/kt]) x (Available Cargo) - ("X" Mines in range)   = (remainder [which can then be adjusted visually])

I guess the difficulty would be showing the fields actually pulled for multiple overlapping fields. Which would distribute the changes properly for each modified field. As pulling an equal % from all fields would show incorrect assumptions.

(btw, this modification should become a game update more then an extension when it's finished.)
2530 days, 3 hours, 8 minutes ago
Profile Image
lil beefer (test)
RE: Allies and teams wanted to help test new information sharing scriptWrite Reply
Well it turns out ally mine laying/sweeping and towing wasn't too tough to add, so it should work in version 0.10. Didn't do much testing, so let me know if there are problems. You shouldn't need updated info from your allies to see this either, since all we're doing is displaying information we already had.

I assume HYP and chunnel work OK, but have tested neither personally. I'd have more confidence in HYP though.

As for the mine-laying stuff, I think it's all in the current .nu code. Joshua took the old mine preview code and added the things I never got around to: "msc" for one, and colonial fighter sweeping. If you're running an old version of the mine preview script, I'd turn it off or update to the new version that just adds the quick-lay links.
2529 days, 2 hours, 10 minutes ago
View red megaman's profile
red megaman
RE: Allies and teams wanted to help test new information sharing scriptWrite Reply
Very cool script.  I'm using this with an ally in a private game.  Will report if I see any bugs.

RM
2102 days, 18 hours, 57 minutes ago
View veldan's profile
veldan
RE: Allies and teams wanted to help test new information sharing scriptWrite Reply
Hey Beefer any chance this has been updated to work with the new client?
2100 days, 1 hours, 31 minutes ago
View big beefer's profile
big beefer
RE: Allies and teams wanted to help test new information sharing scriptWrite Reply
Nope, no chance... It's one of the more painful ones to do I think. And I don't currently have a great game to test it with. But hopefully sometime! It was a pretty nice script...
2066 days, 10 hours, 55 minutes ago
View azazel's profile
azazel
RE: Allies and teams wanted to help test new information sharing scriptWrite Reply
Hi Beefer

There seems to be an issue with the plug-in at the moment. When I try to send an update it gives an error message

Exception has been thrown by the target of an invocation. in callback method=SendMessage System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.MissingMethodException: Method not found: 'System.String MasterData.NuHostService.SendEmail(System.String, System.String, System.String, System.String, System.String)'.
at PlanetsNu.GameFunctions.SendMessage(Dictionary`2 data)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at Lara.UI.LBasePage.Callback(String method) in c:\Users\Joshua\Documents\Dev\Lara2\_code\UI\LBasePage.cs:line 37
2066 days, 4 hours, 38 minutes ago
View big beefer's profile
big beefer
RE: Allies and teams wanted to help test new information sharing scriptWrite Reply
@Azazel, did you send me an email too? (sorry, I have trouble keeping track of real names to player names). This looks to me like an issue on the host side, so I'm curious if other people are seeing it too, or if it's particular to your data. What game id is showing this, or is it all of them?
2066 days, 4 hours, 35 minutes ago
View azazel's profile
azazel
RE: Allies and teams wanted to help test new information sharing scriptWrite Reply
@Big Beefer

This occurs in DIE HARD 4, game 62102. @Veldan is also using the script to no avail, at the moment.

I did not e-mail you on this matter. Only informed you of that Veldan's turn was ready in DIE Hard 4.
2066 days, 4 hours, 22 minutes ago
View big beefer's profile
big beefer
RE: Allies and teams wanted to help test new information sharing scriptWrite Reply
OK, then this seems like a widespread failure. Maybe the new host doesn't continue support for the really old message function I was using. I'll take a look and see it's an easy fix to switch to the new one.
2066 days, 4 hours, 20 minutes ago
View azazel's profile
azazel
RE: Allies and teams wanted to help test new information sharing scriptWrite Reply
Thanks!
2065 days, 15 hours, 16 minutes ago
Profile Image
glyn
RE: Allies and teams wanted to help test new information sharing scriptWrite Reply