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

Cakes 48
Posts: 4246


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 https://openarena.wikia.com/wiki/Autoswitch_weapons for more infos. Weapon numbers are listed 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 61
Posts: 1651


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 48
Posts: 4246


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 31
Posts: 14480



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 48
Posts: 4246


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 61
Posts: 1651


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 48
Posts: 4246


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 61
Posts: 1651


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 48
Posts: 4246


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.
Pages: [1]
  Print  
 
Jump to: