Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Visual Prospecting/Journeymap Integration #9

Merged
merged 5 commits into from
Nov 14, 2023

Conversation

Lyfts
Copy link
Member

@Lyfts Lyfts commented Nov 6, 2023

Finally the ability to see all those lovely claims at once.

Chunks will be brighter when loaded and will be the same color as your team color.

Unloaded/Loaded difference

loaded

Hovering over a claim will show the teams name, whether they're an ally and if the chunk is loaded.
If admins only want players to see their own team they can set the "serverutilities.journeymap.other" permission to false.
If they want to disable it entirely for certain ranks/players, the "serverutilities.journeymap.enable" permission can be set to false.

Due to api constraints only limited chunk interaction is available.
Double click toggles loaded/unloaded state and the VP "deplete" key will unclaim the chunk. It's not currently possible to interact with unclaimed chunks so no claiming available.

Chunk info is requested by the client once they're in view of the map if the overlay has been toggled on. In order to not spam the server with packets every time a player moves the map or walks around with the overlay turned on a 10 second timer has been set between requests. This is just a random number that I picked out a hat and certainly not the greatest solution, any suggestions are very welcome.
Due to this all chunks that the client receive are kept in memory whilst connected to the server, when tested with 2800 chunks that only amounted to about 182kb of memory according to VisualVM so it should be fine.
The exception to this is the unclaim/remove packet which is sent by the server to everyone whenever a chunk is unclaimed. I was unable to figure out a better way to remove chunks on client side.

Map screenshot

Overview of 2200 or so claims
overview

@Ethryan
Copy link
Contributor

Ethryan commented Nov 10, 2023

Do ask the GTDevelopers for a review when this is ready.

@bombcar bombcar requested a review from a team November 10, 2023 13:55
@bombcar
Copy link
Member

bombcar commented Nov 10, 2023

No comments on the code, but it loads, runs, and works in the latest nightly.

@glowredman
Copy link
Member

Does VP have a hard-dep on GT? If so, it would be nice to not depend on VP here, if possible.

@Lyfts
Copy link
Member Author

Lyfts commented Nov 10, 2023

There's no hard dep on VP here, runs as per usual without it.

@glowredman
Copy link
Member

glowredman commented Nov 10, 2023

There's no hard dep on VP here, runs as per usual without it.

I should've clarified: I meant hard-dep with respect to this feature.
This feature is very useful and it would be sad to see it only be enabled in GT modpacks with VP.

@bombcar
Copy link
Member

bombcar commented Nov 10, 2023

The way it works is by using VPs “ore handling” so that part would have to be brought over for modpacks without VP

@Lyfts
Copy link
Member Author

Lyfts commented Nov 10, 2023

I agree for sure. But doing it without VP is gonna be quite the pain seeing as Journeymap doesn't have any api in 1.7.10...
So it would require turning this into a mixin mod aswell as remaking a bunch of the infrastructure it's utilizing from VP.

The ideal solution if the license allows it would be implementing an api in Journeymap so we don't have to rely on mixins.

Or alternatively making a whole other mod and move VPs mixins there, so that the whole 1.7.10 community would be able to utilize it without relying on GT.

@bombcar
Copy link
Member

bombcar commented Nov 10, 2023

The ideal solution if the license allows it would be implementing an api in Journeymap so we don't have to rely on mixins.

Apparently JourneymapLegacy is now LGPL and they are open to patches: https://github.com/TeamJM/journeymap-legacy but we'd probably have to write the API ourselves and upstream it

@mitchej123
Copy link
Contributor

The ideal solution if the license allows it would be implementing an api in Journeymap so we don't have to rely on mixins.

Journeymap is FOSS for 1.7.10 https://github.com/TeamJM/journeymap-legacy

There is also an API, but it's not FOSS (just visible source), and for 1.8+ https://github.com/TeamJM/journeymap-api

Or alternatively making a whole other mod and move VPs mixins there, so that the whole 1.7.10 community would be able to utilize it without relying on GT.

👍

@mitchej123
Copy link
Contributor

If it works, it doesn't have unnecessary hard deps, and it's an improvement, let's ship it and iterate

Copy link
Contributor

@Ethryan Ethryan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just went and checked the license for JourneymapAPI, it’s ARR sadly…

Otherwise I would really like it if this wasn’t dependent on VP.

@bombcar
Copy link
Member

bombcar commented Nov 13, 2023

Just went and checked the license for JourneymapAPI, it’s ARR sadly…

Otherwise I would really like it if this wasn’t dependent on VP.

Yeah we’d have to create a new API for journeymap-legacy. Probably worthwhile if we continue to add more features (and I could see eventual expansion of serverUtilities to replace more and more of thermos doing that).

I’ve been running this for awhile and it’s working fine.

Maybe a tooltip hover over the on/off icon in JM to explain how to use it? Or at least document it in ServerUtilities.

@Ethryan
Copy link
Contributor

Ethryan commented Nov 13, 2023

Just 1 thing, have a friend that tried to use this in GT6 and found out that VP Crashes hard so this don't work with that mod.
It works when you remove GT6 though, so it's the modid issue.

@Caedis
Copy link
Member

Caedis commented Nov 14, 2023

@Ethryan Can you post the crash report?

@Ethryan
Copy link
Contributor

Ethryan commented Nov 14, 2023

Log
Crash Report

@Lyfts
Copy link
Member Author

Lyfts commented Nov 14, 2023

@Ethryan I doubt there's much we can do about that until an api becomes available.

Am I good to merge for now?

@Ethryan
Copy link
Contributor

Ethryan commented Nov 14, 2023

@Ethryan I doubt there's much we can do about that until an api becomes available.

Am I good to merge for now?

Yes, I think so

@Lyfts Lyfts merged commit 4f09d31 into GTNewHorizons:master Nov 14, 2023
1 check passed
@Lyfts Lyfts deleted the vp-integration branch November 14, 2023 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants