rtxa / agmodx

AG Mod X is an improved Mini AG alternative made as a plugin for AMX Mod X from the ground. It's easy to add new stuff, make improvements, do changes, etc.
GNU General Public License v3.0
22 stars 9 forks source link

Suggestion: vote gamemode + map in one vote #18

Closed gundogfan closed 1 year ago

gundogfan commented 2 years ago

The idea is to make one vote for both things instead of voting one first and then the other. Example:

agmap arena stalkx

Also it'd be better if the hud message says:

ADMIN x: changelevel arena stalkx

rtxa commented 2 years ago

Yeah, I though about that I have some concerns like for example:

  1. If this can conflict with others votes, extreme cases like a map with the name of arcade which the vote input will be agmap arcade arcade.
  2. The fact that the vote system is limited by design by only two inputs (agmap arena stalkx is already 3 inputs). This will require a redesign which I don't know if it would be easy task or not.
  3. The length of HUD messages are limited to 255 characters, which means if the vote message becomes to long, the message will not display correctly.

Of course, this can be workarounded by using vote agnextmap stalkx then later vote arena but I get what your want, it's more easy to people to vote only once. I need to analyze this and see if this is viable. Thanks for the suggestion.

gundogfan commented 2 years ago

Got it.

Another idea would be getting rid of "agmap" command and just stick to "gamemode map" syntax (arena stalkx, for example). Being always the first command the gamemode and the second one the map, thus avoiding conflicts with maps named as a gamemode and also avoiding the rest of the problems you listed. Just an idea though.

EDIT: we should also think of how single votes would work. I mean, the gamemode I guess remains the same, but how about maps? If we are only trying to change the map and not the gamemode should we keep the "agmap" or delete it? That's my concern.

rtxa commented 2 years ago

Yeah, seems like a good idea to use the <gamemode> [map] syntax. Thanks, it will avoid the need to rework the vote system. I'm gonna work on it whenever I finish some other projects.

I don't get what you're trying to say in your last paragraph but votes for changing the map are still going to be there. I don't see a reason to remove it. People sometimes just want to change the map and not the gamemode and viceversa. The issue comes when you want to change both at the same time.


This is kind of offtopic but I find troublesome how the vote system works. I mean, votes can be executed by invoking the command name itself, without using the vote command before the vote. What happens when a plugin has commands with the same name?. I don't see it as a wise decision by the AG creator. If I can go back in time, I'll suggest to always use vote before a vote to keep it clean and simple.

If you're starting a listen server (A LAN server created in-game) you wouldn't be able to change basic commands from the console like mp_timelimit as an admin, because now it has become a vote. I means it just cumbersome and it adds complexity unnecessaraly.

By the way, I tried to fix this in the past by enforcing the vote command but the community reject it, showing me that backward compatibility is very important.

Anyway, I always use the command vote before any vote to avoid any issues. Example: vote agmap stalkx, vote map stalkx or vote arcade.

Still, I can't blame BulliT for that, by the time that AG come out (if I'm not wrong), plugins weren't a thing very spread, only Admin Mod was available (which later became AMX, then AMXX), so some decisions were taking by not expecting other plugins/mods/commands interfering.

rtxa commented 1 year ago

The commit https://github.com/rtxa/agmodx/commit/4f2d3338bcc826192ad4486f9a9575b3e8ee6e8a should adress this issue.

Please @gundogfan, test it from the latest artifact in Github Actions and let me know what you think. I'm also thinking in adding this command for admins too. Currently is only for normal players.

gundogfan commented 1 year ago

Works perfect! Although (going back to what we talked before about syntax), I find it unintuitive and difficult to learn how many kind of votes are out there:

agmap crossfire vote map crossfire vote agmap crossfire

And the new one:

vote tdm crossfire

I keep in mind what you said about the community being against the command "vote", but in my opinion, it'd be better if the vote system is simplified and standardized. For example:

vote map crossfire vote gamemode tdm vote tdm crossfire

rtxa commented 1 year ago

It can work if I implement a cvar with the name of sv_ag_vote_new_syntax and you switch to another map to see the reflected changes. Maybe I would implement the cvar, but not by default of course, it needs to be implemented slowly or players will reject it. My guess is that a lot of players use pre-configured configs from Pro players which use the vote system, and that is hard to change, probably some people don't even know, but if your start using vote always in your binds on your config, it would be better.

rtxa commented 1 year ago

@gundogfan

Please, test the new changes, this should definitely close this issue. Now the new syntax should work when not using vote before the vote and when calling from the server console. For example: arcadex bounce.

I was simplifying a lot of code and I could have broken something in the process, maybe sv_ag_allowed_gamemodes is not working as expected in these votes.

gundogfan commented 1 year ago

Voting through gamemode + map syntax works fine, but this is what happens now.

Let's say I'm on tdm Killbox and I type arena on console:

] arena "sv_ag_gamemode" changed to "arena" "amx_nextmap" changed to "killbox" "amx_nextmap" changed to "" "mp_chattime" changed to "12.000000" "amx_nextmap" changed to "stalkx"

It does change to arena but it changes the map as well to the following map listed on mapcycle.txt, it shouldn't.

This should be the correct behaviour:

] arena "sv_ag_gamemode" changed to "arena" "amx_nextmap" changed to "killbox" "mp_chattime" changed to "12.000000"

rtxa commented 1 year ago

Thanks gundog, it was late and I forgot to add the else clause.

Fixed on https://github.com/rtxa/agmodx/commit/50356a5d2e2310d7771e22a485a38dbfef60e995

I'll close the issue by now, if something doesn't work as expected, I will re-open it.