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

feat(subsystems): add creating and loading reflections.cache for subsystems #4274

Merged
merged 12 commits into from
Nov 26, 2020

Conversation

DarkWeird
Copy link
Contributor

Contains

Creating and loading reflection.cache for subsystems.
define upToDate of cacheReflection task for engine, modules, subsystems.

How to test

  1. Open Terasology
  2. Check that DiscordRPCSystem works (should connects to Discord App, if enabled)

@iHDeveloper
Copy link
Contributor

Can confirm the subsystem works!

Now the Discord-RPC changes when the player is playing (not in the lobby aka main menu)
image

@jdrueckert
Copy link
Member

@iHDeveloper Where does that "Solo | Test" come from in the screenshot? 🤔

@DarkWeird
Copy link
Contributor Author

@iHDeveloper Where does that "Solo | Test" come from in the screenshot? thinking

There from DiscordRPCSystem#getGame

public String getGame() {
NetworkMode networkMode = networkSystem.getMode();
String mode = "Playing Online";
if (networkMode == NetworkMode.DEDICATED_SERVER) {
mode = "Hosting | " + game.getName();
} else if (networkMode == NetworkMode.NONE) {
mode = "Solo | " + game.getName();
}
return mode;
}

@jdrueckert
Copy link
Member

There from DiscordRPCSystem#getGame

public String getGame() {
NetworkMode networkMode = networkSystem.getMode();
String mode = "Playing Online";
if (networkMode == NetworkMode.DEDICATED_SERVER) {
mode = "Hosting | " + game.getName();
} else if (networkMode == NetworkMode.NONE) {
mode = "Solo | " + game.getName();
}
return mode;
}

I see it differentiates between "Hosting" and "Singleplayer"... What happens for players joining a hosted game? Will networkMode DEDICATED_SERVER, NONE or something entirely different?

@DarkWeird
Copy link
Contributor Author

There from DiscordRPCSystem#getGame

public String getGame() {
NetworkMode networkMode = networkSystem.getMode();
String mode = "Playing Online";
if (networkMode == NetworkMode.DEDICATED_SERVER) {
mode = "Hosting | " + game.getName();
} else if (networkMode == NetworkMode.NONE) {
mode = "Solo | " + game.getName();
}
return mode;
}

I see it differentiates between "Hosting" and "Singleplayer"... What happens for players joining a hosted game? Will networkMode DEDICATED_SERVER, NONE or something entirely different?

Will "Playing online"

subsystems/build.gradle Outdated Show resolved Hide resolved
@DarkWeird DarkWeird merged commit ff89d80 into develop Nov 26, 2020
@jdrueckert jdrueckert deleted the fix/systems-in-subsystems branch November 26, 2020 15:11
@iHDeveloper
Copy link
Contributor

iHDeveloper commented Nov 26, 2020

@iHDeveloper Where does that "Solo | Test" come from in the screenshot? 🤔

@jdrueckert

That's the game state of the player that represents what's the player playing.

The DiscordRPCSystem changes the state of the player's discord RPC as follows:

Solo | GameName meaning the player is currently playing a single-player game
Hosting | GameName meaning the player is hosting a game
Playing Online meaning the player is playing online in a server (not hosting it)

The state doesn't represent a party state and it's confusing more than encouraging the player's friends to join.
I'm planning to improve the state in #4271 by following the rich presence best practices

The data in your players’ profiles is the first thing that others on Discord will see about your game, both those familiar with it and those who have never played. It should answer two questions: can I play with my friend right now, and if not, when can I? Show data like:

  • What the player is currently doing
  • How much time has elapsed or remains (if applicable)
  • Their party state
  • Your cool artwork!

How should you think about the data you show? -Rich Presence Best Practices

Source: Discord Developer Documentation

@jdrueckert
Copy link
Member

@iHDeveloper Thanks for the detailed information 🙂
I believe, Solo, Hosting and Playing Online describe different dimensions and do not cover the full space.
For instance, the opposite of solo is not hosting or playing online in general, it's multiplayer (can also be played on LAN which is not necessarily online).

I don't think this is critical and getting it to work at all is good progress, so I merged this PR. However, I believe we should consider doing a follow-up that improves the naming of the states.

@keturn
Copy link
Member

keturn commented Nov 26, 2020

I hope I remember to come back and look at this again later.

I've got no objections to this having been merged, but the reflections cache stuff is the part of our gradle build that has the most problems fitting in with gradle's default build logic. For the benefit of my own understanding and working on things like #4022, I'll want to learn what's been added to the subsystem build here and how it is same/different from what happens for the rest of engine and the plugins.

ping #4015

(but also also I was hoping to get gestalt v7 merged before returning to #4022, and between that and some other work-in-progress we might not need to worry so much about reflections.cache anymore?)

@DarkWeird
Copy link
Contributor Author

I hope I remember to come back and look at this again later.

I've got no objections to this having been merged, but the reflections cache stuff is the part of our gradle build that has the most problems fitting in with gradle's default build logic. For the benefit of my own understanding and working on things like #4022, I'll want to learn what's been added to the subsystem build here and how it is same/different from what happens for the rest of engine and the plugins.

ping #4015

(but also also I was hoping to get gestalt v7 merged before returning to #4022, and between that and some other work-in-progress we might not need to worry so much about reflections.cache anymore?)

Gestaltv7 using reflection.cache too (only in json format, not xml)

Better solution - use annotation processing like ClassIndex. Common for gradle and idea.
Also we have specific build directories...because gestalt-module's SourceModule...

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.

4 participants