joeShuff / UHCBasePlugin

Minecraft Plugin for Spigot. Basic UHC controlling and customization.
1 stars 0 forks source link

[REQUEST] Rework Team Logic #3

Open NovaPixell opened 3 years ago

NovaPixell commented 3 years ago

The current system I think is a bit strange. It would be useful a system that with the command /createteam "TEAM-NAME" "TEAM-SIZE", we could create teams by setting the maximum number of players.

And then with the command /fillteams (or something like that) go to randomize the teams by joining "TEAM-SIZE" player in random teams (here you could put a filter that ignores the admins who are in gamemode spectator and creative).

Subsequently with a command "/modifyteams "TEAM-NAME" "OPTION" "VALUE""you can set the colors and configurations for individual teams (alternatively to use the basic command of minecraft).

I hope you can apply these tips in your plugin, thank you!

NovaPixell commented 3 years ago

I add that you can modify the teams system in the main branch, with the first teleport login without problems!

joeShuff commented 3 years ago

Hi Nova! Thanks for creating another request, I have a few comments regarding what you said which may influence your thoughts on this topic,

/createteam "TEAM-NAME" "TEAM-SIZE", we could create teams by setting the maximum number of players.

So my first thought with this is a team size isn't something we can set in Minecraft, it would need to be managed seperately from the Scoreboard mechanics which could lead to mismatched data, so I try to avoid that where possible. My solution to this is already in the /genteams <TEAMSIZE> command that randomly fills teams to a max of TEAMSIZE players. Players in a team can then change the teamname with /teamname command. Teams have a name and a displayname and the displayname is what people see and is changed with the /teamname command. If you feel that genteams is a poor name for the command, then either it needs documenting more clearly or the command name needs changing, what are your thoughts on that?

here you could put a filter that ignores the admins who are in gamemode spectator and creative

This is something I've always been on the edge of, because in the cases when I've used this plugin, all online players were playing and didn't need to ignore admins/spectators. However I do see the use case for this, so I will make it so that you can add players as audience (or something) and they will be ignored by the UHC mechanics but be allowed to join/leave etc.

Subsequently with a command "/modifyteams "TEAM-NAME" "OPTION" "VALUE""you can set the colors and configurations

So currently players can only change their teams name, however admins can change the color of a team with /recolor or using the Minecraft commands. My concern with this is making teams have unique colors, so if we allow players to change their teams color, we could have all teams with 1 color.

I add that you can modify the teams system in the main branch, with the first teleport login without problems!

Could you possibly elaborate on this a bit more? Which commands behave differently on different branches?

One final idea that you inspired I have played UHCs before where the teams are predecided, and it can be a pain using the /team <playername> <playername> command over and over, so I think creating a /loadteams command to instantly create teams and fill with players from a config file that you can create likes pre-load-teams.yml or something like that. What do you think about that, would that be useful?

NovaPixell commented 3 years ago

Seems interesting!

The important thing is that the operation for the UHC in team is this:

at the start time, me, admin , I decide to set the NUMBER of player in each team, each player will join a random team. Then change the team values. I previously managed everything with tags and selector in the command (limit = NUMBER), couldn't you do something similar? Or in the code a while loop that adds NUMBER people in each team. I want this system to be controlled by the administrator and not by the users. in a nutshell I don't want the user to be able to join a team or create one by himself Wouldn't that be possible?

joeShuff commented 3 years ago

Yeah that is what you can do with the /genteams command, for example /genteams 3 will randomly create teams of 3 players MAXIMUM. Then players can change the name of their team if they like. genteams is only usable by OP players.

Is that what you want or am I misunderstanding?

NovaPixell commented 3 years ago

Yea ok, right. however, I want the teams that are created to not have custom names. I want the name to be decided by me, same thing for the color

NovaPixell commented 3 years ago

Hello! Are there any news? Are you working on it?

joeShuff commented 3 years ago

Hi, I have been working on one of my other projects recently so unfortunately this took the back seat. I had a few concerns with your suggestions.

Teams not have custom names

This is fine, I can add a config option for operators to allow players to change their team name or not.

teams decided by me, same thing for color

So I think my suggestion of a team import command is a good solution for this. You would create team info in a yaml file and run a command in game to import those teams. I do currently have a command \createteam that allows you to say what players should be in a team, for example /createteam _Denizen NovaPixell AnotherPlayerName will put those 3 players in one team, however I can see this being a pain having to run command after command to create teams, so I think an import would be better. My rough idea is, something like

teams:
  kingdomofores:
    name: Kingdom of Ores
    color: RED
    players:
      - _Denizen
      - AnotherPlayer
      - MyFriend
  amazingotherteam:
    name: Probably going to Win
    color: YELLOW
    players: 
      - Player1
      - Player2
      - Player3

This would allow for some nice, preplanning of teams but of course you'd have to get the playernames exactly right but that shouldn't be an issue, if it doesn't work they can be manually added with minecraft commands. I will start work on an import command soon.

NovaPixell commented 3 years ago

it's great as a thing. You mean, however, that it is not possible to let 3 random players join the teams at the time of the uhc start?

joeShuff commented 3 years ago

You can generate teams of 3 using the /genteams TEAMSIZE. Is the important thing for you that teams are generated as the UHC starts and not before?

NovaPixell commented 3 years ago

Exactly! At the start of uhc. so that we restrict access to the server, so no one new player can join, then I run /prepuhc and /start-uhc for starting

NovaPixell commented 3 years ago

It would be very important for the /genteams to filter the admins. Only players who are in gamemode adventure should join teams

NovaPixell commented 3 years ago

But once the teams have been randomized, what names will the teams have? We usually use color names, and also assign the associated color

joeShuff commented 3 years ago

At the start of uhc. so that we restrict access to the server, so no one new player can join, then I run /prepuhc and /start-uhc for starting

That's a good point, currently the whitelist gets set when you do /start-uhc which is probably a bit too late. I will work on a better way to finalise playing players. I have started working on seperating admins and playing players so you can have a spectator for the uhc (Which can be you/your admins). This may involve some bigger changes from my old code so it may take a while.

joeShuff commented 3 years ago

Reworking this turned into more of a challenge than it should be. I have started to rework the main flow of the game to make changing this easier. Just updating ya

NovaPixell commented 3 years ago

Have you created a Git branch?

joeShuff commented 3 years ago

The reworking of game logic is on this branch, but the teaming logic changes including spectators is on a local stash for me to reference when I finish this reworking. I have almost finished the reworking though so should be implementing some team changes soon.

joeShuff commented 3 years ago

You can also check out the pull request for it #5

joeShuff commented 3 years ago

I've got contestants/spectators separated out now however I have some issues with the spectators. There is a lot to consider with them being unable to interact in the world. I will keep working on this stuff but it might take a bit longer to be done. What I believe needs doing is as follows:

A few other things I may add, minor control for speed/night vision for spectators, maybe a control to teleport to players/teams.