Skip to content

Add team sharing of players prospection findings using GTNHLib Teams - #85

Merged
tiffit merged 15 commits into
masterfrom
algent/team-sharing
May 25, 2026
Merged

Add team sharing of players prospection findings using GTNHLib Teams#85
tiffit merged 15 commits into
masterfrom
algent/team-sharing

Conversation

@Algent

@Algent Algent commented May 24, 2026

Copy link
Copy Markdown

Replace Shared Prospecting
(which is currently broken in dailies due to mixins being dodged by newer VP PRs)

Share all prospection findings (ore veins, underground fluids, veins marked depleted from map) across members of a same GTNHLib Teams.

Default to on but can be disabled via B:enableTeamSharing=false in config/visualprospecting.cfg.

explorer_4XhgZ2CBZ8.mp4

How it works

  • Broadcast live findings to every team player online
  • Store these findings into team data (Solo player still have data to share because of the "solo team" system)
  • For offline player in a team, send them catch up on login
    • Catchup is "lazy", only for the dimension a player is in. Then when they move dim they get new data
    • Do similar catchup for every member when team get "merged" (someone accept an invite)

TeamProspectionData

Manage what get stored into gtnhteams <teamuuid>.json file.
Did my best to keep it compact and fast.
Only store coordinate keys then match it to VP server cache files.
Compress everything into a gzipped base64 blob of data (with some tricks to make it more compressible).
Since currently gtnhteams are all loaded on server start I also doesn't expand the data until a team is accessed.

New commands

  • /vp_team_info [player] [detailed]: inspect a team's prospection record. (only your team if not op)
  • /vp_team_clear <player>: wipe a team's server-side prospection record (op/console).

Limitation

Right now you can't push client data. So until player or someone in the team re-prospect an area that data won't exist on server side and can't be shared. Allowing client cache upload could be maybe a future improvement (with item or command).

Known Bug

Need help deciding

  • If someone leave a team, do they get to keep the data or get a blank state ?
    • Just added a conf for it. Default to true.

Status

I tested it on full pack. Both in SP and with server + 2 clients setup.
Had a 50+ points checklist and solved every issue I found
It's "ready"

I do have a list of things I could improve later on.

@Algent
Algent requested review from Luca-Guettinger and tiffit May 24, 2026 16:56
@Algent Algent added the Enhancement Improve an existing mechanic. Please explain the change with a before/after comparison. label May 24, 2026
@github-actions

Copy link
Copy Markdown

#86

@tiffit tiffit left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

a bunch of very minor nits, code looks good otherwise. Will do some in-game testing once GTNHLib is updated

Comment thread src/main/java/com/sinthoras/visualprospecting/database/ClientCache.java Outdated
Comment thread src/main/java/com/sinthoras/visualprospecting/database/ClientCache.java Outdated
Comment thread src/main/java/com/sinthoras/visualprospecting/database/ServerCache.java Outdated
Comment thread src/main/java/com/sinthoras/visualprospecting/teams/TeamProspectionData.java Outdated
Comment thread src/main/java/com/sinthoras/visualprospecting/teams/TeamCatchupHandler.java Outdated
Comment thread src/main/java/com/sinthoras/visualprospecting/teams/TeamCatchupHandler.java Outdated
Comment thread src/main/java/com/sinthoras/visualprospecting/teams/TeamCatchupHandler.java Outdated

@tiffit tiffit left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@tiffit
tiffit merged commit bd76fc5 into master May 25, 2026
1 check passed
@tiffit
tiffit deleted the algent/team-sharing branch May 25, 2026 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement Improve an existing mechanic. Please explain the change with a before/after comparison.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants