Easier way to perform these functions?
Hi guys. So I'm currently playing around with how to do various things. Right now it's an 8-player turn based system, I'm trying to figure out a decent way to do turn priority.
As it stands now, it works exactly as I want it to, but the problem is, it's 163 events long. I'm hoping there's some way to condence it. Here's how it currently works.
The system is dependant on 26 different values:
A1, B1, C1
A2, B2, C2
A3, B3, C3
A4, B4, C4
A5, B5, C5
A6, B6, C6
A7, B7, C7
A8, B8, C8.
D1, D2
A and B are the important values here. A is the turn order. When it's determined, they're each assigned a value between 1 and 8. Which value each A is assigned is dependant on the B values, which are different depending on that that player is going to do. A is default set to one, then when the B values are compared, A adds 1 to it's value for every B value thats LOWER than it's own B value.
coding example:
If B1 < B2, +1 To A1
-----
If B1 < B3, +1 To A1
-----
Repeat for every combination for a total of 49 events.
If two B values are the same, then it looks at the C value, which is each players speed stat. It will look at which ever is lower, and add 1 to the lower one's A value.
Coding Example
If B1 = B2 AND C1 < C2, +1 to A1
-----
If B1 = B2 AND C2 > C1, +1 to A2
Again, repeat for every combination of slots. Once for X being higher and once for Y being higher, for a total of 56 events.
But then there's the rare chance that both the B AND C values are the same, and there's where the D values come in. The D values are randomized each time the calculations start. Also, if D1 = D2, Randomize again, so they can't land on the same value. Thats two events are there, and, you guessed it Lower one is the winner.
Coding example
If B1 = B2 AND C1 = C2 AND D1 > D2, +1 to A1
If B1 = B2 AND C1 = C2 AND D2 > D1, +1 to A2.
Again, repeat for every possible combo, for another 56 Events.
Grand total event count: 163.
I've been playing around a bit but I can't seem to figure out a means to condense this. Anyone have any ideas? After learning about the 20,000 event limit I'm trying to get everything as small as possible.