Pages: [1]
  Print  
Author Topic: Updating cg_weaponOrder default value? Applying it also to "out of ammo"?  (Read 584 times)
Gig
In the year 3000
***

Cakes 47
Posts: 4321


WWW
« on: July 30, 2018, 07:07:45 am »

In this post: 1) introduction about cg_weaponOrder; 2) Updating its default value?; 3) Applying it to "out of ammo"?; 4) What about a "best weapon key"?

1) Introduction about cg_weaponOrder
For who doesn't know it, in oa 0.8.8, "cg_weaponOrder" is a variable which can be customized by the user to let him determine which weapons are "better" for him. The weapons on the left are considered "worse" and those on the right are considered "better". This list is used for determining if the game has to "autoswitch" the weapon when you grab one in the arena: the list is checked only in case "cg_autoswitch" is either set to 3 (better) or 4 (new&better).
See (DO NOT LINK)  h t t p s : / / openarena . wikia . com/wiki/Autoswitch_weapons for more infos. Weapon numbers are listed DO NOT LINK[/b])  h t t p s : / / openarena . wikia . com/wiki/Manual/Controls#Weapon_numbers]here.

2) Updating its default value? Your thoughts required!
Default "cg_weaponOrder" value in OA 0.8.8 is "/1/2/4/3/6/7/8/9/5/" (meaning gauntlet/machinegun/grenade/shotgun/lightning/rail/plasma/BFG/rocket)... such value lacks the three TeamArena weapons... and considering that the autoswitch doesn't happen in case either the currently used or the picked up weapon is not in the list, it is not good to have an incomplete list. I think we really should update the default list to include those three weapons.
Updating the default value should be a very trivial task, just updating a line in gamecode/code/cgame/cg_main.c... even I could do it... but before doing that, I would like to know your opinion about which would be the better order.
I already thought a bit about this years ago and back then I thought about a possible new default as "/1/2/4/12/3/11/8/6/13/7/5/9/" (meaning gauntlet/machinegun/grenades/prox mines/shotgun/nailgun/plasma/lightning/chaingun/raigun/rocket/bfg).
Thinking again about it, maybe "/1/2/3/4/12/8/13/6/11/7/5/9/" (meaning gauntlet/machinegun/shotgun/grenades/prox mines/plasma/chaingun/lightning/nailgun/railgun/rocket/bfg) may be even better. IMHO, of course.
I think it's ok for the list to do not include weapon 10, as the grapple isn't a real weapon. Not sure if shotgun should be considered better or worse than grenades and mines.
What do you prefer? Do you have more suggestions?

3) Applying it to "out of ammo"?
Another topic to which I thought a few years ago, but recently capodecima brought up in Discord, is that cg_weaponOrder is ignored when the autoswitch happens due to "out of ammo" (trying to fire again) instead of due to picking up a weapon. Maybe that should check if cg_weaponOrder value is valid, then switch to the weapon most on the right of that list (if available); in case the value isn't valid (or it doesn't mention any weapon with available ammo), it may just fall back to the classic behavior.
Maybe this may be applied only in case cg_autoswitch is set to 3 or 4... or maybe it may be always applied, I'm not sure.
I'm not capable of making a such change in the code... however Rdnt Cntrl said that the "Ratmod" honors cg_weaponOrder when you're out of ammo, too (I don't know if there is available somewhere the source code of that mod).

4) What about a "best weapon key"?
Another thing I thought about years ago: considering the players have the ability to customize this list of their favorite weapons, it may be nice to have the ability to bind a "best weapon key" which, when pressed, would automatically switch to the weapon more on the right of your list (obviously, the first one that you actually have, and with ammo). Also in this case, someone actually capable of coding it would be required. Of course, this is just an idea!
« Last Edit: July 30, 2018, 10:01:37 am by Gig » Logged

I never want to be aggressive, offensive or ironic with my posts. If you find something offending in my posts, read them again searching for a different mood there. If you still see something bad with them, please ask me infos. I can be wrong at times, but I never want to upset anyone.
sago007
Posts a lot
*

Cakes 62
Posts: 1661


Open Arena Developer


WWW
« Reply #1 on: July 30, 2018, 09:32:40 am »

2) I still don't believe that the prox mines should be included.

3) Applying to "out of ammo" should be relatively easy to do.

4) The hardest part is adding the key to the UI. The list is not available in the UI either, so it might not matter much. It is incomplete either way.
Logged

There are nothing offending in my posts.
Gig
In the year 3000
***

Cakes 47
Posts: 4321


WWW
« Reply #2 on: July 30, 2018, 10:15:18 am »

2) I still don't believe that the prox mines should be included.
On one hand, having autoswitch not working from and to a certain weapon may give a sense of incompleteness/bug of the feature... on the other hand, I get your point of the prox mines being a particular weapon, mostly used to place traps and more rarely directly on enemies. So I don't know. Other people can share their thoughts?

Quote
4) The hardest part is adding the key to the UI. The list is not available in the UI either, so it might not matter much. It is incomplete either way.
Well, we have many features which are available through the console only, it wouldn't be the first one... Smiley However I thought that the main reason for going to UI3 in OA3 was to have more easily editable menus... (Note: I mean that adding a new key binding shouldn't be too hard.... not that I can see any easy way to make customizing cg_weaponorder really user-friendly!)
« Last Edit: July 31, 2018, 02:00:14 am by Gig » Logged

I never want to be aggressive, offensive or ironic with my posts. If you find something offending in my posts, read them again searching for a different mood there. If you still see something bad with them, please ask me infos. I can be wrong at times, but I never want to upset anyone.
fromhell
Administrator
GET A LIFE!
**********

Cakes 32
Posts: 14490



WWW
« Reply #3 on: July 30, 2018, 07:12:54 pm »

for the UI it'd probably have to either be:

- Draggable item listbox (i.e. UT)
- Separated multi selector items with special owners
- Sliders with weapon icon notches


Each one would require extensive UI code hackery to read the values into UI values and then back to the weapon order cvar....
Logged

asking when OA3 will be done won't get OA3 done.
Progress of OA3 currently occurs behind closed doors alone

I do not provide technical support either.

new code development on github
Gig
In the year 3000
***

Cakes 47
Posts: 4321


WWW
« Reply #4 on: August 11, 2018, 06:59:54 am »

Here https://github.com/OpenArena/gamecode/compare/7de5b36b468e...82c30c29e7fe it looks like you did something about 3) among a few changes about voting. Smiley

But I'm on the seaside at the moment, I will not be able to test anything for a couple of weeks.
« Last Edit: August 11, 2018, 07:08:32 am by Gig » Logged

I never want to be aggressive, offensive or ironic with my posts. If you find something offending in my posts, read them again searching for a different mood there. If you still see something bad with them, please ask me infos. I can be wrong at times, but I never want to upset anyone.
sago007
Posts a lot
*

Cakes 62
Posts: 1661


Open Arena Developer


WWW
« Reply #5 on: August 12, 2018, 04:00:15 am »

I did look at it. I may need to do a little extra change in regards to undefined weapon orders. At the moment if the plasma gun is not in cg_weaponOrder it will be still be selected.
Logged

There are nothing offending in my posts.
Gig
In the year 3000
***

Cakes 47
Posts: 4321


WWW
« Reply #6 on: August 13, 2018, 04:39:03 pm »

I did look at it. I may need to do a little extra change in regards to undefined weapon orders. At the moment if the plasma gun is not in cg_weaponOrder it will be still be selected.
I wonder why the plasma... IIRC it's the weapon it usually autoswitches to in case of out of ammo. But I guessed it was simply due to it being the one with the higher weapon number of those you usually have, and that if you had bfg or TA weapons available it would have switched to them ("higher weapon number" would still have sense as fallback behavior if no weapon from cg_weaponorder is available - although I can guess that would mean your cg_weaponorder would not even include gauntlet... which may be the case of incorrecly setting the variable, for example), but I didn't test.

PS: it looks like this you did may be a good starting point in case you wished to also do 4). :-)
« Last Edit: August 14, 2018, 04:12:05 am by Gig » Logged

I never want to be aggressive, offensive or ironic with my posts. If you find something offending in my posts, read them again searching for a different mood there. If you still see something bad with them, please ask me infos. I can be wrong at times, but I never want to upset anyone.
sago007
Posts a lot
*

Cakes 62
Posts: 1661


Open Arena Developer


WWW
« Reply #7 on: August 15, 2018, 09:47:01 am »

I did include the "weapbest" command in https://github.com/OpenArena/gamecode/commit/57fadbe5030a3805a28ff2adcef6deada41ecfcb

It can even be bound in the UI.
Logged

There are nothing offending in my posts.
Gig
In the year 3000
***

Cakes 47
Posts: 4321


WWW
« Reply #8 on: August 15, 2018, 05:34:09 pm »

I did include the "weapbest" command in https://github.com/OpenArena/gamecode/commit/57fadbe5030a3805a28ff2adcef6deada41ecfcb

It can even be bound in the UI.
Wow, you are a wizard!

Ps: I also see for the moment you updated cg_weaponorder default to /1/2/4/3/6/7/8/5/9/ ... the only change being the 9 bfg placed after the 5 rocket, which makes sense of course.
Logged

I never want to be aggressive, offensive or ironic with my posts. If you find something offending in my posts, read them again searching for a different mood there. If you still see something bad with them, please ask me infos. I can be wrong at times, but I never want to upset anyone.
Gig
In the year 3000
***

Cakes 47
Posts: 4321


WWW
« Reply #9 on: September 03, 2018, 05:45:37 am »

Okay, I did some testing (Warning: WOT ahead! Read when you have some time, there is nothing urgent!).

More important considerations:
- Everything seems to work as expected (e.g. leaving cg_weaponOrder empty falling back the classic behavior of "higher weapon number", in case of out-of-ammo). Good work Sago, thank you!  Wink

- Now it has become more important that the default cg_weaponOrder value is more comprehensive, as currently the game does not autoswitch to TA weapons in case of out-of-ammo anymore (while with "classic behavior" they were the first weapons to be used if available), while it has very little sense to autoswitch to gauntlet when you still have nailgun (up to 300 HP damage IIRC) available; I think chaingun and nailgun should really be added.
I'd like to ask for possible cg_weaponOrder suggestions on Discord, but before that, what to do with prox launcher? You said you were planning to do not include it, as it's mostly used to place traps instead of to fight directly, which has got sense.[1] But in case of out-of-ammo, maybe it may still be better than using the gauntlet? Maybe one may place it right after the gauntlet (e.g. "/1/13/2/etc." or "/1/2/13/etc."), to do not autoswitch to prox when grabbing it... but in that case it would still autoswitch from it when grabbing any other weapon -in case of cg_autoswitch 3 or 4-). So, I really don't know what would be the best thing to do about it. Undecided

Less important considerations:
- Maybe the key binding in the GUI for weapbest may include a mouseover text saying "Best weapon determined by cg_weaponOrder." (well, in theory also the "autoswitch weapons" option in the gui may include a "Better weapons determined by cg_weaponOrder" mouseover text).

- Doing the tests, I realized that when you play in Elimination and similar modes, you still start with the weapon with the higher number (usually the plasmagun... but it would be BFG or even prox launcher if they were enabled by server admin), instead of your "best" weapon. It goes to the higher number weapon some seconds before the start of each round.
It might be useful to apply also to that... (now that I think about it, personally I find it a bit annoying to always start with plasmagun in Elimination, when I have rockets available, so the first thing I usually do as soon as the match starts is switching to rockets. I did think about this in the past, but for some reason didn't think about it while opening this thread.)... but maybe this would be a bit more "risky" change than the previous one?[2] At least, the current one can be a scenery where the weapbest key can actually come handy, at round start! giggity

- Maybe the point above may have been even more useful than the "weapbest" key, and I may have suggested it instead[3]... But this is the "idea pit" forum, ideas come as a flow... not all of them really need to be implemented. E.g. one might also think about a "weappicked" or "weapgrabbed" key to switch to the latest weapon you picked up (in case one has autoswitch turned off but sometimes may want to quickly switch to the weapon just grabbed), but probably that's not worth it, considering usually the best weapon depends from the situation and that's not necessarily the one you just got.

[UPDATE] Maybe I found the reason why I didn't think about the Elimination thing while opening this thread. Because that's not a really big problem. Because you can choose the weapon you wish in the few seconds before the round start, and the game will switch to it ASAP when the round will start, so making the time with the "wrong" weapon extremely little. Am I an idiot? Yes, I am an idiot, but this is no news... punched However I confirm weapbest key is handy for it!

[1] Note: when I proposed applying cg_weaponOrder to out-of-ammo, as someone asked for on Discord, I didn't know you were planning to leave prox launcher out of the list.
[2] As maybe Elimination spawn/round procedures are quite complex and so messing with them may more easily end up introducing some kind of bug? Just brainstorming...
[3] Well, as said above, weapbest key can be useful as workaround for that.
« Last Edit: September 03, 2018, 06:47:00 am by Gig » Logged

I never want to be aggressive, offensive or ironic with my posts. If you find something offending in my posts, read them again searching for a different mood there. If you still see something bad with them, please ask me infos. I can be wrong at times, but I never want to upset anyone.
Mapsking
Nub


Cakes -2
Posts: 9


« Reply #10 on: November 08, 2018, 11:31:46 am »

Not sure if this is the right place to post this, feel free to move it.  I know the gauntlet, by design, is not included, when scrolling through weapons, but personally, I would like to see it be included.  Whether or not I have ammo in other weapons, sometimes it is fun to just use the gauntlet to kill your kids and family.  It is currently not convenient to achieve, if you use the arrow keys and mouse.  (I have tendonitits, making WASD difficult to use, as they are out of alignment with each other, (I was used to using arrow keys before WASD even became an option in most games), and therefore, my hand is nowhere near the number keys along the top of the keyboard.  It would be convenient, and also make logical sense, to allow the gauntlet to be selected when using the next weapon/previous weapon option, like scrolling the mouse.

As far as setting the order of preference, if that is a big deal, I know the right-click of the mouse currently goes back a menu, but would it be hard to modify its usage, to allow alternate options, or maybe just simply, allow two options in the form x:y or x,y, where x is the preferred BUTTON to press, and y is the preferred ORDER of importance?  That seems like it would be simple to implement, and also simple for the engine to read from the menu selection?  Just an idea.

I admit I am not a hardcore player, but sometimes when there are too many options, it makes it hard to understand how to do what you want.  Personally, I think the weapon order should be set by the game, like it currently is, with an option to only automatically switch when a better weapon comes up, automatically when you get a new weapon, or not at all.  When my wife plays, she is never going to go into the console, unless she needs to, she is not a programmer, just wants to open the game, and have fun fragging our kids and me.  Since there is an option to manually set the keys, people that are more hardcore players will have already likely set them to whatever keys are convenient for them, and may have this functionality turned off anyways.

That is my opinion.
Logged
sago007
Posts a lot
*

Cakes 62
Posts: 1661


Open Arena Developer


WWW
« Reply #11 on: November 08, 2018, 12:04:38 pm »

Quote
Personally, I think the weapon order should be set by the game, like it currently is, with an option to only automatically switch when a better weapon comes up, automatically when you get a new weapon, or not at all.
Setup -> Control -> Shoot -> autoswitch weapons makes it possible to choose between:
Never, Always, New, Better, Better & New

The default (which for some reason is set by the engine) is "New". I choose "New" to allow a new player to more quickly discover new weapons while limiting the amount of auto switching. The amount of auto switching may still be too high and "Better & New" may be a better default.

Originally the game only had autoswitch on and off.
Logged

There are nothing offending in my posts.
Gig
In the year 3000
***

Cakes 47
Posts: 4321


WWW
« Reply #12 on: November 08, 2018, 01:25:51 pm »

"Right click goes back a menu"? I do not remeber what's the default binding for right mouse button, but of course you can change it to what you prefer (jump, zoom, weapon 0 -gauntlet-, etc.), mostly from the GUI.

Including or not the gauntlet in scrolling weapons is a diffent thing than autoswitch or out-of-ammo forced switch, which are the focus of this thread....
.... however I'm not completely against it, but probably it would need a new variable, disabled by default, to do not mess up what's people are accustomed to since almost 20 years. I do not remember how Quake Champions manages it (but I have the feeling the gauntlet in QC is a bit more useful than in Q3/OA... but I'm not sure).
« Last Edit: November 08, 2018, 01:43:55 pm by Gig » Logged

I never want to be aggressive, offensive or ironic with my posts. If you find something offending in my posts, read them again searching for a different mood there. If you still see something bad with them, please ask me infos. I can be wrong at times, but I never want to upset anyone.
Pages: [1]
  Print  
 
Jump to: