Gambling Arena

Discussion of all aspects of multiplayer development: unit balancing, map development, server development, and so forth.

Moderator: Forum Moderators

Post Reply
User avatar
Glen
Posts: 77
Joined: August 20th, 2011, 10:59 pm

Gambling Arena

Post by Glen »

I recently made and uploaded a multiplayer scenario called Gambling Arena to the 1.12 add-ons.
A king is hosting a gladiator tournament using all his slaves.(The 5 AI sides, the Human Gladiators, the Elvish Gladiators, the Dwarvish Gladiators, the Undead Gladiators, and the Orcish Gladiators).
He has invited the the human players to bet on the winners of each round. If you get a bet correct, you are rewarded with a unit at the bottom of the screen.
After all 8 rounds of betting, the human players must fight to the death with the units they earned.

UPDATE: Gambling Arena has been remade from scratch and uploaded to 1.14 Add-ons. Most of the bugs have been fixed and there are 10 rounds with several different types



Players bet on who they believe will win each round
Image


Example of a Gladiator Round
Image

Players are awarded a unit and gold whenever they win a bet. After the last round, all players will use their rewards to battle it out.
Image

There are several different round types with varying playing styles. Randomization is used in all rounds for replayability.
Please post any bugs/suggestions/replays you have here.
Last edited by Glen on August 25th, 2021, 7:10 am, edited 15 times in total.
User avatar
The_Gnat
Posts: 2217
Joined: October 10th, 2016, 3:06 am
Contact:

Re: Gambling Arena

Post by The_Gnat »

Cool looks good I'll post comments once I've tried it out (I like the unique idea)
User avatar
The_Gnat
Posts: 2217
Joined: October 10th, 2016, 3:06 am
Contact:

Re: Gambling Arena

Post by The_Gnat »

Hi i am right now playing gambling arena and thought i would just post my comments as i went along.

- I am playing versus three ai players and they obviously don't choose options which is too bad. What i was thinking is that you could check if the player is human at the start of the event with a filter and then if it is create a random variable to choose one of the four.

you probably could do something like this:
A [if] statement dependency for the solution offered below

Code: Select all

#define IF_VARIABLE EQUALS THEN
                [if]
                   [variable]
                        name=randomizer
                        equals={EQUALS}
                   [/variable]
                [then]
                       {THEN}
                [/then]
                [/if]
#enddef
Code i found from watbesh needed for the solution below
viewtopic.php?f=21&t=41347

Code: Select all

#define CONTROL_ACTION HUMAN_ACTION_WML AI_ACTION_WML
    [lua]
        code = <<
          local current_side_number = wesnoth.get_variable("side_number")
          local side_control_human = wesnoth.synchronize_choice(
            function()
              return { is_human = wesnoth.sides[current_side_number].controller == "human" or wesnoth.sides[current_side_number].controller == "network" }
            end
          ).is_human
          local side_control_ai = wesnoth.synchronize_choice(
            function()
              return { is_ai = wesnoth.sides[current_side_number].controller == "ai" or wesnoth.sides[current_side_number].controller == "network_ai" }
            end
          ).is_ai
          wesnoth.set_variable("human_control", side_control_human)
          wesnoth.set_variable("ai_control", side_control_ai)
        >>
    [/lua]

    {IF_VAR human_control boolean_equals yes (
        [then]
            {HUMAN_ACTION_WML}
        [/then]
    )}

    {IF_VAR ai_control boolean_equals yes (
        [then]
            {AI_ACTION_WML}
        [/then]
    )}
#enddef
What you could do to fix this problem

Code: Select all

[event]
       name = side 2 turn 1

       [message]
              speaker = Blue_Leader
              message =_"You are betting on the winner of a battle of gladiators Choose who you believe will win the next battle. If you choose correctly you win gold! This Gold will be very vital to winning the game!"
              side_for = 2
       [/message]

       {CONTROL_ACTION (
                 #in here goes all the normal stuff
       ) (
                #in here is all the stuff for if its an ai
                {RANDOM 1..4}

               [set_variable]
                      name=randomizer
                      value=$random
               [/set_variable]	

               #if the variable is 1
               {IF_VARIABLE 1 (
                       #then the same command that would be run if it had been clicked on
                      [set_variable]
                                 name = Orc_Round1_Choice
                                 value = "Peasant"
                      [/set_variable]
                      [scroll_to_unit]
                                [filter]
                                   side = 5
                                [/filter]
                                for_side=2
                     [/scroll_to_unit]
                     {GOLD_OPTIONS 5 Player2Side}
               )}
               #if the variable is 2
               #xxxx do the same thing here

               #if the variable is 3
               #xxxx do the same thing here

               #if the variable is 4
               #xxxx do the same thing here
               
       )}

You then could do the same thing for the weapon upgrades for the ai or you could just have them always choose do nothing!

Hopefully you'll add this because i think it would be a really good improvement! :D
Other things i saw
EDIT: Also i always play at 30% experience however in this gambling arena it gives massive!!! advantage to the gladiator that advances first so you might want to automatically set the experience to 100% but then again this doesn't really matter ;) i should have been smart enough to change that setting to default before i began :P

also i was thinking that +2 gold per turn might be too much for rounds that sometimes take 10 turns = 20 gold even if you didn't win, maybe set the income to 0

2nd EDIT: turn 11 suddenly all the outside guards just attacked me???? They even killed a few of the betters before the round ended

I restarted and played again and this time it stopped working turn 22 when all the ai guards got their movement back and killed all the other gladiators except me creating an automatic win :P

I restarted and played again with the default era though I don't see why that would matter but it worked this time! :D

3rd EDIT: round 8 (the one with 7peasants,5ruffians,etc.) didn't have any walking corpses even though it said it did? and when it ended it said i won because i bet on the "dwarves" even though i bet on and the ruffians won?

4th EDIT: i don't know whats up but i played it again and round 8 worked??
Overall i think the only thing you need to change is the betting and choosing abilities for their team like i said at the top. I think all the other problems are just me :P

ANOTHER EDIT: yep i've tested and proven that the 5 lords default unit advancements modification when active messes up the gameplay ;) (as author of the 5 lords default unit advancement modification i'll see if i can fix this)

also i was thinking round 1 should have a randomizer for the initial units.
User avatar
The_Gnat
Posts: 2217
Joined: October 10th, 2016, 3:06 am
Contact:

Re: Gambling Arena

Post by The_Gnat »

Hi Glen,

As you probably could tell from my comments i was quite enthusiastic about your addon ;) i decided to go along and implement my idea about the ai. Looking through your code it is quite complicated, and i give you much respect for writing it all!

I have completed a modified version of the gambling arena with the ai randomly choosing who to bet on and weapon modifications. It is unfortunately not very thoroughly tested yet so may have some errors. I have uploaded it to this message. It has only a few minor edits to your main scenario file (a method at the start to check which sides are ai and human, and a method at the start of each players turn to check wether that player is a ai or human and act accordingly). It did take however a large amount of code which is included in the utils folder under the various files. The main.cfg has been edited to load the utils. Hopefully you'll implement this addition in your next addon's update! Even if not i really enjoy playing your modification versus the ai now! :D
Attachments
Gambling_Arena.zip
Here is my modified version of the gambling arena EDIT: A new version has been created and uploaded to the add-on server THIS IS OUTDATED
(31.95 KiB) Downloaded 387 times
Last edited by The_Gnat on November 19th, 2016, 10:39 pm, edited 1 time in total.
User avatar
The_Gnat
Posts: 2217
Joined: October 10th, 2016, 3:06 am
Contact:

Re: Gambling Arena

Post by The_Gnat »

Hello, Glen has allowed me to release a new version of gambling arena. This new release is a beta version that includes support for AI to bet and gain units like human players. This beta is currently not entirely stable so please report any bugs encountered so i can resolve them!

Currently Bugs:
- Error where occasionally the peasant and guards on the edge of the map attack you
- Error where after certain units advancing the round no longer ends

Thank you and please comment and say comments and thoughts!
User avatar
The_Gnat
Posts: 2217
Joined: October 10th, 2016, 3:06 am
Contact:

Re: Gambling Arena

Post by The_Gnat »

Gambling Arena has been massively buggy so i have decided to re-write the scenario. It will probably take some time because it has a large amount of code but i hope to complete it in around a month.

Feedback and ideas are welcome as now this is the stage to add components.

Thank you!
User avatar
Atreides
Posts: 1074
Joined: March 30th, 2019, 10:38 pm
Location: On the 2nd story of the centre village of Merwuerdigliebe turning the lights on and off

Re: Gambling Arena

Post by Atreides »

Latest patch works. Partly. For the draft round the AI once again don't bet and you are asked to do it. The other thing I saw was that after the siege round losers were supposed to lose all their gold but it didn't happen. (Oh snap I just realized I've been hoarding gold for nothing, gotta spend it on upgrades doh!) Err back on track, I also _may_ have observed units vanishing rather than dieing. I'll keep an eye on that and confirm or deny it when I can.
User avatar
Atreides
Posts: 1074
Joined: March 30th, 2019, 10:38 pm
Location: On the 2nd story of the centre village of Merwuerdigliebe turning the lights on and off

Re: Gambling Arena

Post by Atreides »

1.16 version won't load. Missing menu_img_txt I think it said.
Post Reply