Pseudo-Random Dueling System

HahaGetItPEE

New Member
Reaction score
0
Your typical hero wars map.
I've already got a working random player duel system, however some players tend to be randomed more than others, thus dueling more often. I would like to create a "Pseudo-Random" duel system, so when the duel system selects a random unit, players who have already dueled won't have a chance to be selected to duel again.

I would like to create a player group consisting of players who haven't dueled yet, so that all players will eventually get a chance, and when every player duels once, it resets the player group to consist of all players in the game.
when a player duels, the player is removed from the player group "HasntDueled"

So far i've got the player group, and every player in the game is in it. Removing players who duel is no problem, but i'm not sure how i can get the player group to recycle when there are no players left in it.
Help is very much appreciated.
 

Asdfblah1

New Member
Reaction score
10
If
number of players in hasntdueled = 0
then
pick every player
add picked player to hasntdueled
 

asipo

New Member
Reaction score
15
You need to to track back each player fight with another player.
If there maximum number of player is 12

Then you might need 12 x 12 = 144 combination
Which is create 12 boolean array variable with size 12 name hasFight1[12] until hasFight12[12]

hasFight1[12] refer to Player 1 has fight with whom
Eg:
If player 1 has fight with player 5
then hasFight1[5] = true

p/s:
You need to set by default hasFight1[1] = true, hasFight5[5] = true. Since this actually referring to the same player.

This is kinda complicated stuff since you need to write your own logic and algorithm actually.
 

Moridin

Snow Leopard
Reaction score
144
I think the easiest solution is:

Condition: If HasntDueled is empty.
Actions: Pick (All Players) and do Multiple Actions:
- Add (Picked Player) to HasntDueled

The condition to check if a unit group is empty or not is under Boolean -> Unit Group - Unit Group is empty.
 

asipo

New Member
Reaction score
15
Hero1 already fight with Hero2 and
Hero3 already fight with Hero4.

Both Hero1,2,3 and 4 will be remove from group HasntDueled. Since they have duel.
But Hero1 and Hero4 actually didnt fight with each other yet

I think this is called sorting if we learn programming in c++
 

Moridin

Snow Leopard
Reaction score
144
Asipo I don't think HAHA..... meant it to be that way.

What I think he meant was:
A random duel system where an even number of players pick heroes and square off against a random opponent. Each player fights one other counterpart per round.

So I don't think he needs every single combination of fight...
 

HahaGetItPEE

New Member
Reaction score
0
^^ that's correct, and you posted exactly what i wanted moridin.
i wanted to know a particular way of recognizing when the group was empty, and you gave me just that.

is there a way i can rep you or something?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top