MantisBT - Zandronum
View Issue Details
0001420Zandronum[All Projects] Suggestionpublic2013-07-21 00:592025-08-31 17:27
Dusk 
Dusk 
normalfeatureN/A
resolvedfixed 
 
3.2 
0001420: Custom vote definitions, aka VOTEINFO
'http://wiki.zandronum.com/VOTEDEF [^]'
No tags attached.
related to 0000700closed  Random Captains function (callvote randomcaptains) 
parent of 0000918closed Torr Samaho callvote kickfromgame 
parent of 0002345resolved DrinkyBird Callvote Nextmap 
diff votedef.diff (79,646) 2014-11-01 02:32
/tracker/file_download.php?file_id=1320&type=bug
Issue History
2013-07-21 00:59DuskNew Issue
2013-07-21 00:59DuskStatusnew => assigned
2013-07-21 00:59DuskAssigned To => Dusk
2013-07-21 00:59DuskRelationship addedrelated to 0000700
2013-07-21 01:00DuskRelationship addedparent of 0000918
2013-07-21 01:02DuskDescription Updatedbug_revision_view_page.php?rev_id=3740#r3740
2013-07-21 01:03DuskDescription Updatedbug_revision_view_page.php?rev_id=3741#r3741
2013-07-21 01:07DuskDescription Updatedbug_revision_view_page.php?rev_id=3742#r3742
2013-07-21 15:50DuskNote Added: 0006728
2013-07-21 15:58DuskNote Edited: 0006728bug_revision_view_page.php?bugnote_id=6728#r3744
2013-07-21 17:09DuskNote Added: 0006729
2013-08-01 05:59WatermelonNote Added: 0006873
2013-08-01 11:37MonsterovichNote Added: 0006874
2013-08-01 14:14DuskNote Added: 0006879
2013-08-01 14:15DuskNote Edited: 0006879bug_revision_view_page.php?bugnote_id=6879#r3841
2013-08-01 16:04DuskSummaryCustom vote definitions, aka VOTEDEFS => Custom vote definitions, aka VOTEDEF
2013-08-01 16:04DuskDescription Updatedbug_revision_view_page.php?rev_id=3848#r3848
2013-08-01 18:35DuskDescription Updatedbug_revision_view_page.php?rev_id=3853#r3853
2013-08-01 18:36DuskNote Added: 0006889
2013-08-01 18:36DuskStatusassigned => feedback
2013-08-01 19:56DuskNote Edited: 0006889bug_revision_view_page.php?bugnote_id=6889#r3855
2013-08-01 19:56DuskStatusfeedback => assigned
2013-08-01 22:47DuskStatusassigned => feedback
2013-08-01 22:48DuskNote Edited: 0006889bug_revision_view_page.php?bugnote_id=6889#r3856
2013-08-01 23:27DuskNote Edited: 0006889bug_revision_view_page.php?bugnote_id=6889#r3857
2014-11-01 02:30DuskDescription Updatedbug_revision_view_page.php?rev_id=5901#r5901
2014-11-01 02:32DuskFile Added: votedef.diff
2014-11-01 02:34DuskNote Added: 0010755
2014-11-01 02:34DuskStatusfeedback => assigned
2014-11-01 02:34DuskStatusassigned => needs review
2014-11-02 08:01Torr SamahoNote Added: 0010790
2015-07-15 15:00DuskRelationship addedparent of 0002345
2015-07-15 21:47DuskNote Added: 0012949
2015-07-15 21:47DuskStatusneeds review => needs testing
2015-07-15 21:47DuskNote Edited: 0012949bug_revision_view_page.php?bugnote_id=12949#r7690
2015-07-15 21:48DuskNote Edited: 0012949bug_revision_view_page.php?bugnote_id=12949#r7691
2017-04-18 20:25WirtualnoscNote Added: 0017205
2017-04-18 20:35WirtualnoscNote Edited: 0017205bug_revision_view_page.php?bugnote_id=17205#r10344
2017-04-26 06:12Torr SamahoNote Added: 0017337
2017-04-26 06:14Torr SamahoNote Edited: 0017337bug_revision_view_page.php?bugnote_id=17337#r10407
2017-04-26 06:14Torr SamahoNote Revision Dropped: 17337: 0010406
2023-12-30 14:22KaminskyNote Added: 0022940
2023-12-30 14:22KaminskyTarget Version => 3.2
2023-12-30 14:22KaminskySummaryCustom vote definitions, aka VOTEDEF => Custom vote definitions, aka VOTEINFO
2024-01-24 09:42FusedNote Added: 0023000
2024-01-24 09:43FusedNote Edited: 0023000bug_revision_view_page.php?bugnote_id=23000#r14047
2024-01-24 09:44FusedNote Edited: 0023000bug_revision_view_page.php?bugnote_id=23000#r14048
2024-01-24 09:46FusedNote Edited: 0023000bug_revision_view_page.php?bugnote_id=23000#r14049
2024-01-24 09:50FusedNote Edited: 0023000bug_revision_view_page.php?bugnote_id=23000#r14050
2024-01-27 16:39TrillsterNote Added: 0023012
2024-03-01 03:08Ru5tK1ngNote Added: 0023142
2024-03-01 03:08Ru5tK1ngStatusneeds testing => feedback
2024-08-30 03:51TrillsterNote Added: 0023990
2024-08-30 03:53KaminskyStatusfeedback => needs review
2025-02-24 04:45TrillsterNote Added: 0024214
2025-02-24 11:39KaminskyStatusneeds review => needs testing
2025-08-31 17:27Ru5tK1ngNote Added: 0024565
2025-08-31 17:27Ru5tK1ngStatusneeds testing => resolved
2025-08-31 17:27Ru5tK1ngResolutionopen => fixed

Notes
(0006728)
Dusk   
2013-07-21 15:50   
(edited on: 2013-07-21 15:58)
I wrote up a draft documentation page:'http://wiki.zandronum.com/VOTEDEFS [^]'

I'm not totally convinced that going for console commands is a good idea here for obvious reasons even though that's what the current vote types base on. On the other hand the votes can be seen as the public voting for console commands being executed on the server.. and there isn't really any good alternative. ACS could do for mods' purposes but I don't know how to implement kick votes in that...

Maybe there could be native vote types (the current loadout + kickfromgame) and then ACS-based vote effects for mods to use?
EDIT: The more I think of it, the more I'm convinced that this is the best way to do it. Let's see here...

(0006729)
Dusk   
2013-07-21 17:09   
OK I got the ACS-based stuff to work, draft updated.
(0006873)
Watermelon   
2013-08-01 05:59   
Truly awesome


Is there supposed to be two lines of
                type->flags = 0;


Is it operational?
(0006874)
Monsterovich   
2013-08-01 11:37   
Good. :)

Can you delete "Flags { ... }" section. Decorate like style is best.
Add argument type: string.
(0006879)
Dusk   
2013-08-01 14:14   
(edited on: 2013-08-01 14:15)
Quote from "Watermelon"

Is there supposed to be two lines of
                 type->flags = 0;

Probably not.

Quote from "Watermelon"
Is it operational?

Yeah, for the most part. It still needs work though.

Quote from "Monsterovich"
Can you delete "Flags { ... }" section. Decorate like style is best.

I have the Flags{} syntax so as to reserve the option to remove it later. Who knows how this will evolve later on.

Quote from "Monsterovich"
Add argument type: string.

I don't know how would a string argument work in ACS - dynamic strings seem to have problems (0001307).

(0006889)
Dusk   
2013-08-01 18:36   
(edited on: 2013-08-01 23:27)
Links at description updated, I think this is somewhat ready now.

EDIT: I just realized that I need to update the 'call a vote' menu too...
EDIT 2: OK, I got the menu working now too.
EDIT 3: Value range is now required for int and float types, made no-arg votes handled better.

(0010755)
Dusk   
2014-11-01 02:34   
I've pretty much finally, finally, finally gotten to the point that I'm pretty much finished with custom vote classes now. I tested this with edward-san and Water today and what this now needs is a build of some sort for public testing.

The current head is here:
'https://bitbucket.org/crimsondusk/zandronum-sandbox/commits/0acc721f9f3a16ba9115a53aa7884927042b8dae [^]'

I've attached a diff containing the changes.
(0010790)
Torr Samaho   
2014-11-02 08:01   
Looks promising at first glance, but we'll need to figure out a way to review patches of this size. Carefully going through such a patch line by line seems to be infeasible to me. Let's discuss this in the next dev meeting.
(0012949)
Dusk   
2015-07-15 21:47   
(edited on: 2015-07-15 21:48)
After a considerable amount of refining and some new features (named script support and callvote nextmap), I think this is in a testable state now.

WaTaKiD has provided a build here:'https://www.dropbox.com/s/td6ykj3c4iveex8/zandronum-3.0-r150715-2140-181819b-windows.zip?dl=0 [^]'
Source changes here:'https://bitbucket.org/crimsondusk/zandronum-sandbox/compare/votedef..Torr_Samaho/zandronum#diff [^]'
Documentation is still here and is now updated:'http://wiki.zandronum.com/VOTEDEF [^]'

Would be nice if this got tested. I'm particularly concerned whether existing votes still behave like before.

(0017205)
Wirtualnosc   
2017-04-18 20:25   
(edited on: 2017-04-18 20:35)
Is there a chance this will get implemented into 3.0 or do we have to wait a bit longer for this feature? :( Considering this is quite old now and is mostly finished, it would be really nice to see it working in the upcoming versions. I have tested this with my mod and I don't see any problems with it, as well as existing votes.

(0017337)
Torr Samaho   
2017-04-26 06:12   
(edited on: 2017-04-26 06:14)
Here is an updated link:'https://bitbucket.org/zandronum/zandronum-sandbox/compare/votedef..Torr_Samaho/zandronum#diff [^]'

That's quite a large change and I'm hesitant to include this so shortly before the expected release of 3.0. In any case, as you can see in the link, there are a lot of conflicts in the code now that first need to be taken care of. Also, this needs very thorough testing of the entire voting system.

Dusk, what do you think about this?

(0022940)
Kaminsky   
2023-12-30 14:22   
This lump (now called VOTEINFO) was pushed into the stable repo not too long ago:'https://foss.heptapod.net/zandronum/zandronum-stable/-/commit/6834253b22fc9e0685da0695e16d376d5717ed12 [^]'
(0023000)
Fused   
2024-01-24 09:42   
(edited on: 2024-01-24 09:50)
I have been using this feature using its initial implementation and here's my opinion.

Compared to the initial pitch (https://wiki.zandronum.com/VOTEDEF) the final implementation (https://wiki.zandronum.com/VOTEINFO) really needs some work in general. The amount of control that exists on creating custom votes is very bare bones. I understand this was done initially because most of it can be done with ACS when the vote passes, but there are a lot of flags and options in the initial idea that limit calling votes in the first place. The fact that I can now call a vote without these restrictions, and only be notified after the vote passes is bad user experience.

I suggest a new option is added to fix this, something like the existing Action parameter but instead this option specifies a script that is called to validate a vote when it is called. If the script results in `true`, the vote may be called. This gives full control over what restricts a vote, and even makes the ForbidCvar option obsolete.

(0023012)
Trillster   
2024-01-27 16:39   
In addition to the notes from Fused, I think this feature could be made more failure-proof by allowing VOTEINFO VoteType blocks to specify a display name and internal name for a user-defined menu that would automatically be added to the ZA_CallVote menu.

The current alternative is for mods with custom vote types to manually overwrite ZA_CallVote, but this can easily cause menu conflicts between mods that add new vote types.
(0023142)
Ru5tK1ng   
2024-03-01 03:08   
Setting status to Feedback while it is being determined if more changes will be made.
(0023990)
Trillster   
2024-08-30 03:51   
I've created an MR to address this feedback as well as implement some extra features that came to mind.
'https://foss.heptapod.net/zandronum/zandronum-stable/-/merge_requests/181 [^]'
(0024214)
Trillster   
2025-02-24 04:45   
Updates to VOTEINFO have just been merged, so it should now be able to more closely match the initially pitched VOTEDEF lump.
'https://foss.heptapod.net/zandronum/zandronum-stable/-/commit/a8e2a2d9cb9a59a9b6ae8adb6ee0700553de16a7 [^]'
(0024565)
Ru5tK1ng   
2025-08-31 17:27   
This was merged in. Reopen if necessary.