Post new topic    
Metal Slime
Send private message
Tournament Bracket 
 PostWed Feb 06, 2019 10:56 pm
Send private message Reply with quote
Hello, and a fine day to you.

I would like to go about scripting a tournament bracket like the following:

But I haven't the foggiest idea where to start.

Some features I'd like to have:

    Random seeding
    Automatic bracket progression
    A way to resolve matchups that don't involve the player

Here's my general thinking, but please offer suggestions:

Each seed in the bracket is a global variable, linked to an enemy formation, but one seed is the player.
They're randomly arranged on the bracket.
As the player wins his/her battles, they advance up the bracket.
"Enemy" seeds will have their winner determined through a bit of RNG and stat comparisons behind the scenes.
Possibly using "write formation" to further randomly determine the enemies in each "enemy seed", and storing that information for the duration of the tournament (even perhaps afterwards).
I intend to have slice/sprite based information showing the progression of the tournament at each stage.

Any help, suggestions or opinions welcomed. Thanks Angel
Liquid Metal King Slime
Send private message
 PostWed Feb 06, 2019 11:46 pm
Send private message Reply with quote
Sounds fun

So what I'd normally do in a situation like this would be to create a lot of random commands and while commands

The first part, seeding;

You should make a while command that basically checks to see if all the globals are full. Something like this

While (a+b+c+d+e+f+g+h<>36) do, begin

You'll be assigning the formation number to each variable, of 1-8 so those added should be 36
You should be sure to set them all to 0 before starting, just in case.

Next you generate 2 numbers, 1 for place and 1 for team/formation, we can assume 1 means the player, it shouldn't matter too much
place:=Random (1,8)
team:=Random (1,8)

and then you check, if that team has already been assigned. If not, it assigns it to the place, if it has then the loop ends and restarts, trying another combination. We use a switch to assign numbers to variables.

if(a<>team,and,b<>team,and,c<>team,and,d<>team,and,e<>team,and,f<>team,and,g<>team,and,h<>team) then , begin
switch(Place) do(
case(1) do ( a:=team )
case(2) do ( b:=team )
case(3) do ( c:=team )
case(4) do ( d:=team )
case(5) do ( e:=team )
case(6) do ( f:=team )
case(7) do ( g:=team )
case(8) do ( h:=team )

and then end the loop

that should seed things.

The other 2 would be much easier
Automatic bracket progression
A way to resolve matchups that don't involve the player

First, you just need to assign a number to another variable that equals that next bracket progression. That's as easy as something like this:

To figure out resolving matches, you can set a difficulty level for the teams.
And then run 2 random commands with the second part being the difficulty. And then compare them.
If (random (1,difficultyTeamA)>>random (1,difficultyTeamB)
then (runTeamAwins)
else (runTeamBwins)
Metal Slime
Send private message
 PostWed Feb 06, 2019 11:53 pm
Send private message Reply with quote
Thanks SW! A quick response. Looks good so far. I'll do some playing around and see what I come up with.

Display posts from previous: