supertuxkart / stk-code

The code base of supertuxkart
Other
4.41k stars 1.04k forks source link

Factor Distance Into Powerup Distribution #3890

Closed DarkArc closed 5 years ago

DarkArc commented 5 years ago

Another idea I had, in addition to the suggested powerup in https://github.com/supertuxkart/stk-code/issues/3888 is an additional rework to the algorithm for item distribution.

After playing SuperTuxKart with some friends off and on for the past few weeks, there are definitely a lot of item drops that just don't make sense. For instance, while playing in a close race you can be just feet from the player in first place, and get a basketball/rubber ball, and when playing in a race where there is a large distance between each player, you can find yourself in last place swarmed with flyswatters and bubble gum.

I think a reasonable way to handle this would be to add some logic to almost guarantee some powerups based on distance away from the player in the position immediately preceding yours.

The idea being, this would provide a good way to always keep races interesting, and make sure that players can't get so far behind that they feel completely out of the race.


While I do not have the experience with graphical assets, and rendering to implement https://github.com/supertuxkart/stk-code/issues/3888, I would very much be interested in implementing these changes to powerup distribution.

A preliminary review of the code seems to suggest it would be reasonable to record a relative weight for each kart as an additional weight for the powerup distribution system:

float distance_remaining = full_distance - kart_info.m_overall_distance;
...
// where n is the position in the race of the current player
float relative_weight = n == 1 ? 0 : distance_remaining[n] - distance_remaining[n - 1];

This would then be integrated with the powerup.xml data in some fun & configurable way, I've yet to mentally fully flesh out.

Would love feedback on this idea, and hope to start work as soon as the issues plaguing my game server partially described in https://github.com/supertuxkart/stk-code/issues/3886 are resolved (more waiting on my host to fix the networking situation than for the actually issue to be fixed) -- so that I can play test with friends.

DarkArc commented 5 years ago

This would then be integrated with the powerup.xml data in some fun & configurable way, I've yet to mentally fully flesh out.

I think a reasonable way to do this might be to allow xml nodes similar to the following:

<race-weight-list>
  <distance-weights>
      <distance-weight distance ="50"
              single  ="140      0   300   100      225      75     160     0     0     0"
              multi   ="  0      0     0     0        0       0       0     0     0     0" />
      <distance-weight distance ="150"
              single  ="140      0   300   100      225      75     160     0     0     0"
              multi   ="  0      0     0     0        0       0       0     0     0     0" />
      <distance-weight distance ="300"
              single  ="140      0   300   100      225      75     160     0     0     0"
              multi   ="  0      0     0     0        0       0       0     0     0     0" />
  </distance-weights>
  <weights num-karts="1">
    ...
  </weights>
  ...
</race-weight-list>

There can be only 1 distance-weights node, each distance-weight entry in the distance-weights would be merged with each num-kart weight entry.

There wouldn't be any interpolation, given the above you'd get 4 "probability matrices" for each weight node:

The matrix used would be your relative weight bucket calculated as the nearest bucket rounded down (distance 49 = bucket/matrix 0, distance 150 = bucket/matrix 2).

Alayan-stk-2 commented 5 years ago

make sure that players can't get so far behind that they feel completely out of the race

You need to have reasonably close skill levels for this to happen, or to use handicap (which ought to be improved). Because otherwise, the only way to make a terrible player have any chance against a good player is to make the game terribly unfair and random.

In the most awesome online races I had, the thrill came mostly from a close skill level, leading to small time differences. If I put handicap on, I don't mind to lose sometimes. But if average players could just randomly catch up because they would get tons of speed-boosting item (actually with just zippers they'd crash a lot on most tracks, but I consider this suggestion in light of your warp drive suggestion too) when behind, then hope for some lucky event (basket ball etc.) to get ahead, then it's an issue.

Factoring distance to determine powerup distribution doesn't reward good driving, to the contrary it makes it less relevant. This isn't something I endorse.

Today, KartOym beat me once in XR591. I had picked a light kart which wasn't ideal (to show the light kart isn't that bad) and got exploded a few times (two by him as I was coming back), but he nonetheless raced very well and it was a nice victory for him. Some time ago, ExtremeDafeid pulled off the impressive feat of winning against AntonioP, Andet and me.

If STK was very random, we could just brush these off and say it was just luck. The feats wouldn't be rare or impressive. And they'd also be much less satisfying for the players pulling them off.

Now, I'd certainly like STK to be even more popular and it's easy to think than by making it more casual you can achieve this, but the existing audience matter too. And STK has a competitive part.

Look at the online rankings, and sort by race count : https://online.supertuxkart.net/rankings.php

You can see that the top 5 players in points are also the top 5 players in races done. You can also see that mv81 is 700 points below the top4 despite having done double the race, because the system is elo-like.

The top 10 players in ranked races done are ranked 1 to 5 then 7, 13, 19, 29 and 52. Their total ranked races count is (as of this writing) 9345. Meanwhile the 755 players having done the less ranked races (but still at least one) total 2134 races.

So you could have a change which make 755 players slightly more happy and 10 players slightly less happy, and still have that change reduce the average fun of people playing online races...

I also invite you to watch this very interesting video who is focused on street fighter but makes many relevant points: https://www.youtube.com/watch?v=iSgA_nK_w3A (this part in particular : https://youtu.be/iSgA_nK_w3A?t=303 )

So as you guessed from the rest of my message, this is a wontfix. I'm not entirely against targeted improvements for e.g. how the basket ball works and which positions can get it (and I do want to reduce the factor of players in the middle exploding each other while the 1st is safe), but giving better and better powerups to other karts as the 1st get more ahead isn't something I can endorse.

DarkArc commented 5 years ago

I also invite you to watch this very interesting video who is focused on street fighter but makes many relevant points: https://www.youtube.com/watch?v=iSgA_nK_w3A (this part in particular : https://youtu.be/iSgA_nK_w3A?t=303 )

I disagree with the comparison. A street fighter is more similar to Quake, you can perfect every aspect of the game, and eliminate any randomness other than your opponents choices. If you truly wanted to make STK 100% skill based, and extremely competitive, every element would be predictable with powerups. They'd either be predictable, or you'd get your choice of powerup.

Also, because of the item placement, there's no way you'll run into the situation of success from "button mashing" -- ex, your previously described case of the newbie using all 3 zippers immediately.


The nature of kart racing makes it incredibly random, but with enough skill you can overcome that randomness. If you can agree with me on this point, then, here's the real underlying issue as I see it:

As it stands right now with no good way to promote catch up, an equally skilled racer needs only to get dumb luck once (two triple speed boost right out of the gate, player A gets a triple speed boost and player B crashes into a wall, etc). Once that occurs, the probability of their opponent recovering, is extremely low, given equal skill. There's nothing really there to promote long range conflict, and give them the chance to antagonize their opponent so they can get back in the lead.

Furthermore, how is a bowling ball while your opponent is out of frame competitive? Getting bubble gum while your opponent is about to lap you, just isn't fun. I'd rather have the pressure and heat constantly on me to always be on the lookout, always anticipating what my opponent might pull out of their hat, and always on my toes, rather than just "meh I got this in the bag".

In that street fighter game, your opponent doesn't just disappear and become largely irrelevant because you're good at staying on the screen.


So as you guessed from the rest of my message, this is a wontfix. I'm not entirely against targeted improvements for e.g. how the basket ball works and which positions can get it (and I do want to reduce the factor of players in the middle exploding each other while the 1st is safe), but giving better and better powerups to other karts as the 1st get more ahead isn't something I can endorse.

You're missing an important point here too, it's relative distance to the next player, not the first player. This only serves to "squish" the game together, and could be balanced to be mild, but improve the probability of the game not giving you a worthless power up. (Giving players in the middle the opportunity to catch up to the first player, or giving players far behind a chance to at least see the last player in the pack in the middle).


IMO, I think you're writing off good ideas, that would require a bit of game play testing, and related balancing, and worst case could be disabled for the portion of the audience that doesn't want them.

I apologize if any of this "rubs you the wrong way". I must admit I'm more than a bit frustrated with the response of "over my dead body" especially when I'm offering to implement -- in this case -- the entirety of the logic.

I mean I appreciate the detailed responses about why, but I would be far less frustrated if you simply acknowledging there is a desire for this functionality, and proceeded by starting a discussion about how we can work towards integrating it in a healthy way for the game, and the broader community/players that don't yet exist.

DarkArc commented 5 years ago

One idea, a "rule set" system could be added that allowed multiple powerup.xml files, or multiple configurations in a powerup.xml that could be selected by server owners.

Alayan-stk-2 commented 5 years ago

I disagree with the comparison. A street fighter is more similar to Quake, you can perfect every aspect of the game, and eliminate any randomness other than your opponents choices.

I didn't say STK is a game of the same nature, but many of the points of that video do apply in some measure here.

The nature of kart racing makes it incredibly random, but with enough skill you can overcome that randomness.

It certainly has a good chunk of randomness, with random powerups that's expected. A well timed bowling ball or swatter can change a lot.

But "incredibly" is an overstatement for STK. Andet, right now no.1 has 8105 points in the rankings. Singo the no.10 has 6137. The expected win ratio of Andet against Singo according to ratings is 90,57%. Wolfs the no.30 has 4778 giving a 97,87% expected win ratio for Andet. And if anything those are underestimates.

As it stands right now with no good way to promote catch up, an equally skilled racer needs only to get dumb luck once (two triple speed boost right out of the gate, player A gets a triple speed boost and player B crashes into a wall, etc). Once that occurs, the probability of their opponent recovering, is extremely low, given equal skill. There's nothing really there to promote long range conflict, and give them the chance to antagonize their opponent so they can get back in the lead.

Triple zippers are only given to karts in bad position. That said, yes, a single event can have long lasting effect. The usual example is a bowling ball soon after start.

On the flip side, if game mechanics consistently gave a 8-10% speed advantage to the 2nd place player compared to the 1st place one (about what is needed to consistently erase the disadvantage from a bowling ball hit in a 40s lap), this would be enormous and would more than erase a noticeable skill advantage.

The probability of a recovery is extremely low only if the player ahead makes no mistake.

At the top level, there are some races where a good start snowballs into a runaway victory, but it's still far from decided, mistakes and imprecisions remain frequent enough they can be taken advantage of.

If you don't mind me showing some of my multiplayer videos : https://www.youtube.com/watch?v=cxtflJPXyOw I had a terrible first lap and a poor second lap, but went back from 8 seconds behind 1st to 2 seconds behind in the last lap and almost got 2nd. https://www.youtube.com/watch?v=cxtflJPXyOw Andet was 4.5 seconds behind after the first lap, he ended up winning.

I more than once had a race in the bag before doing a stupid mistake losing me 5 seconds and the race, and I more than once won the same way.

The lower the level of play (and casual play is quite below that), the more you will have mistakes and thus opportunities for the worse placed players to get back. Comebacks don't happen every single race, if they did they would be boring, but there is an opportunity for them.

Powerups are here to give a pseudo-random equalizing effect with better powerups to worse placed players. Players having raced worse get better powerups, but if you are a few positions behind while being still close in time (overperformed for your position) your items don't get worse, and if you're very far behind (underperformed) they don't get better. This means that what you do still matter. With very strong rubberbanding comeback mechanisms a la Mario Kart, what you do in the first half of the race is almost irrelevant to the final result, you could clock a time-trial-level first lap and just get caught anyway after a minor stumble in the third lap.

Currently, I think that powerups result in too much inter-destruction for players in the middle of the pack, so they don't really end up helping players in the middle, to the contrary. This is something that can be observed with AIs and in online races. But this isn't an issue in how the weights are done, it's a limitation of the current powerup set which has too much focus on direct destruction.

Furthermore, how is a bowling ball while your opponent is out of frame competitive?

The bowling ball is completely overpowered... When thrown backwards. Jokes aside, destructive items work better to defend against a player behind you than to attack a player ahead of you, which is somewhat imbalanced. It's true that to catch with a player 3 seconds ahead, they are (except the basket ball) useless.

The expectation of having every single powerup you get from an item box be the useful one you'd like is not reasonable, though.

Getting bubble gum while your opponent is about to lap you, just isn't fun.

That's in part a limitation of the item set. The last place can't get 100% zipper/parachute. Gums are reasonably useful (protect from banana and gums on the ground, can slow down other players the next lap, protect you from attacks when you catch up with some zippers)

If you're about to be lapped, however, it means you're leagues behind in skill. There is not much that can be done except enabling handicap for the stronger player or having insane powerups like the "warp" one.

I'd rather have the pressure and heat constantly on me to always be on the lookout, always anticipating what my opponent might pull out of their hat, and always on my toes, rather than just "meh I got this in the bag".

Option A : the game makes lap 1 and 2 barely relevant with very strong catchup Option B : an outright domination in lap 1 and 2 leading to a 8s+ lead that a single 4-5s screwup can't erase ends up with a win.

You seem to want A, I'll take B.

And that's not to say I don't like close and well-fought races, I do like them. I don't like doing a very solid race and losing because my opponent got 5 zippers to catch up before caking me, however.

Not every single race can reach the top levels of excitement and fun, just as not every soccer or chess or starcraft game reaches it.

You're missing an important point here too, it's relative distance to the next player, not the first player. This only serves to "squish" the game together, and could be balanced to be mild, but improve the probability of the game not giving you a worthless power up. (Giving players in the middle the opportunity to catch up to the first player, or giving players far behind a chance to at least see the last player in the pack in the middle).

Distance to the next player doesn't make much sense ? Let's assume player 2 is 200 units behind player 1 and player 3 is 50 units behind player 2. You could then conceivably see player 2 get better powerups from item box than player 3 because is is farther behind the player ahead of him. If you want to have the distance effect play a non-negligible role, you'll quickly bump into this.

I think it is important to always keep an item distribution where the player at rank N+1 gets better powerups than the player at rank N.

IMO, I think you're writing off good ideas, that would require a bit of game play testing, and related balancing, and worst case could be disabled for the portion of the audience that doesn't want them.

I don't think these are good ideas. I do have a bias certainly, but at the same time with 1000+ online races and tons against the AI, I do have a good knowledge and understanding of the game and its balance. And I keep into account newbies liking to get an exciting powerful item

I apologize if any of this "rubs you the wrong way". I must admit I'm more than a bit frustrated with the response of "over my dead body" especially when I'm offering to implement -- in this case -- the entirety of the logic.

Your posts have been detailed and courteous. I've responded in kind.

Your offer to implement it is appreciated but if the feature is not desired in the first place for the main game (and that's a balance change of the kind which can't be really optional, and would in any case introduce maintenance burden), then it doesn't change my "wontfix" answer.

If you really want to do something, I'd rather suggest you to work on implementing a new item or two whose style and effect would be discussed and agreed upon beforehand. The main roadblock for that is artist work, however.

I would be far less frustrated if you simply acknowledging there is a desire for this functionality, and proceeded by starting a discussion about how we can work towards integrating it in a healthy way for the game, and the broader community/players that don't yet exist.

There is obviously a desire for this functionality, as you desire it. That this desire is widely shared, or that the amount of satisfaction it may generate outweigh the dissatisfaction, however, is not clear.

I'd rather care first about people who are invested into the game than "players that don't yet exist".

DarkArc commented 5 years ago

But "incredibly" is an overstatement for STK. Andet, right now no.1 has 8105 points in the rankings. Singo the no.10 has 6137. The expected win ratio of Andet against Singo according to ratings is 90,57%. Wolfs the no.30 has 4778 giving a 97,87% expected win ratio for Andet. And if anything those are underestimates.

I'll admit to being largely uninterested in the ranking system, though despite that...

And I keep into account newbies liking to get an exciting powerful item

I'm rank #140, and I've beat hecksel on at least on occasion on a ranked server #13. I may be new to SuperTuxKart, but I'm by no means new to kart racers. Between Lego Racers 1 & 2 alone, I've easily got hundreds if not thousands of hours. Alas that series hasn't seen a release in years, and I don't see that changing anytime soon -- especially not with a release that works on Linux.

My point being, I'm not exactly a struggling newbie that can't win races. I just would like the dozen or so people I've showed the game to have the opportunity to play the game in a fun way, and grow their kart racing skills. Instead, I hear them complain about having bubble gum being 3/4 of the track behind me. They're going to quit if nothing changes, I can almost guarantee it, and then me as well, because I want to race with my friends. I doubt I'm the only one with a similar story. I am however a programmer, and someone who's played a heck of a lot of kart racing, so I'm not totally dumbfounded as to how I might be able to make the game more enjoyable for them, and if nothing else, give them the illusion of having a chance -- that's all noobs really want in my experience.

... with very strong rubberbanding comeback mechanisms a la Mario Kart, what you do in the first half of the race is almost irrelevant to the final result, you could clock a time-trial-level first lap and just get caught anyway after a minor stumble in the third lap.

Option A : the game makes lap 1 and 2 barely relevant with very strong catchup Option B : an outright domination in lap 1 and 2 leading to a 8s+ lead that a single 4-5s screwup can't erase ends up with a win.

You seem to want A, I'll take B.

Yes, I do want A, with A if you want to win consistently, you better have the skill to maintain a near perfect race. You shouldn't get lucky in lap 1, and have the race in the bag, there should always be a real threat to your position.

Those few mistakes you make here: https://www.youtube.com/watch?v=cxtflJPXyOw. They effectively put you out of the race, you managed to make up a fair amount of ground last second, but there simply aren't enough laps to really let any true skill shine through. I run into this when playing with my much less experienced friends on occasion, I'll make a few minor mistakes, and rather than what happens 95% of the time where I dominate them, they dominate me, and the best I can pull off is a last second gain which results in a photo finish -- the rest of the race we don't even see each other.

Furthermore, I played a racing game I loved Freekstyle which did have these heavy rubber banding mechanics, but only for AI races. It made the AI races so challenging. If you made 1 screw up, at any point during the race, it could cost you the race, the only way to win was to be flawless. It was incredibly frustrating, but incredibly fun because it held you to such a high standard.

The reason I like the warp drive idea is actually having seen how this rubber banding creating a super challenging environment plays out in Freekstyle, it makes you work hard for that win, every time. Also, if you note, there was clearly a noob in your race, that got so frustrated mid match they just left. The game couldn't even be bothered to feed their appetite a bit by having them brawl the person in second to last place -- you -- a bit.

Currently, I think that powerups result in too much inter-destruction for players in the middle of the pack, so they don't really end up helping players in the middle, to the contrary. This is something that can be observed with AIs and in online races. But this isn't an issue in how the weights are done, it's a limitation of the current powerup set which has too much focus on direct destruction.

I think this is a result of how the game prioritizes powerups. I think position alone is silly. A race played with 5 karts all extremely close, is much different from a race played with all karts extremely far apart -- I've been in both, the first case, REALLY fun REALLY exciting, the last, everyone is just watching paint dry, a random parachute comes in and someone goes "I hate you whoever that was" because we all know it's not making any difference in the outcome, it's just making the race take longer.

The problem is worse for low kart counts ~3 players, as equalizing powerups like the basketball and parachute might not even be seen the entire game. The balancing seems to assume a close match up.

I think the flaw in the system is evident by the games conditional here: https://github.com/supertuxkart/stk-code/blob/master/src/items/powerup_manager.cpp#L606

IMO if the game is making good decisions about who needs what powerup to keep the game play interesting, then this isn't necessary.

Distance to the next player doesn't make much sense ? Let's assume player 2 is 200 units behind player 1 and player 3 is 50 units behind player 2. You could then conceivably see player 2 get better powerups from item box than player 3 because is is farther behind the player ahead of him. If you want to have the distance effect play a non-negligible role, you'll quickly bump into this.

I think it means everything, in fact, I think it's the main reason you end up with a cluster of people in the middle, not the power ups available in game. What happens is this: player 2 & 3 never end up with anything good enough to disrupt player 1, unless the game has a rogue player way in the back. It's funny, the best way to beat the person in first; you need a person or two way behind, and some people in the middle to stack the weights, so that you have enough players for your game to include basketballs.

If you wanted to increase the relevance of basketballs in 3 player races, right now you really couldn't do that without severely undermining the play of a close match.

What inevitably ends up happening when you weight the distance to the kart in front of you, is you end up having the karts get closer together, because any outlier triggers more extreme powerups to present themselves at a higher rate. It also makes it extremely unlikely that you'll end up with a balance breaking item when everyone is close together. If all 5 karts are close together, the person in first place has absolutely no reason to get hit with a basketball -- that's super unfair.

I actually wanted to try a distance only weight, and ignore kart count as an experiment after implementing this to see how it played -- I suspect it might make the game feel far more consistent, and far more sane.

Let me make myself clear, I'm NOT saying this should be so powerful as to guarantee you 100% basketball powerups because you suck. If it's balanced right, you'll still get plenty of bubble gum, however, you'll have much better odds than you do currently of a late game recovery, and not feeling totally helpless. I think in the vast majority of cases, neither a warp drive, nor a distance factor -- if properly balanced -- would make outcomes all that different, with a skill gap present. It would however, in the case of a skill gap, produce the illusion of a chance, and without a skill gap, ensure some randomness early on doesn't result in everyone just waiting for the race to end with victors predetermined at lap 2.

This is also another reason I like the warp drive. Right now the only truly powerful powerups are the basketball and the parachute, both of which are highly offensive and impact the drivers in front in ways they simply must endure. Having the presence of something like a warp drive allows a player to catch up, without slowing everyone else down. If they really suck, they'll crash immediately after, or throw a bowling ball into their own kart.

I mean if your real concern is it being used at the last second to win a race, that could be fixed by a last lap restriction that prevents it from taking you < 10 seconds away from the finish line. Since the way I proposed it to work was to put it 3 seconds behind the next player with a speed boost, if they were in second place, it could actually be balanced so that it's impossible for it to give you a last second overtake into first place, maybe for second, but not for first. The benefit to a warp drive is you can add all kinds of logic about how it works that's non visible expert level knowledge that a pro can abuse, and a noobie can get wrecked by -- BUT the noobie still feels the benefit of it, and feels included in the race.


A little background on the Lego Racers series, that's kind of orthogonal to this discussion but perhaps interesting none the less:

Racers 1 had a very nice skill based mechanic where you "built" your powerup by picking up a base brick, and then charging it with white bricks to make it more powerful. This lead to very little room for error and the infamous Rocket Racer, race, at the end of the game. Rocket Racer's most noteable trick over the other opponents in the game? He'd warp boost, just like the player. The way it played though, it wasn't unbalanced, and there are videos online of players beating Rocket Racer with only the third speed boost powerup (4th being the warp). It was an incredibly skill based game, despite having a warping mechanic. At my peak playing the game many years ago, I could easily best Rocket Racer, and was truly only challenged by my brother -- it only had split screen multiplayer sadly.

Racers 2 in contrast had item boxes similar to STK, Mario Kart, and the ilk. It didn't have a single powerup to target the player in first place specifically. The game had a kart health system, and with it a noteably rare powerup that would attack every kart but your own regardless of position, and destroy weakened karts. The game also had a mechanic to make it more skill based at an elite level where you could if you were fast enough, and skilled enough to do it, stop the gift box distribution on demand to get the exact powerup you were after.

DarkArc commented 5 years ago

I'm actually curious how you'd feel about a screen similar to the smash brother's item configuration screen where you can turn powerups on and off? Probabilities would have to be predefined still, but items could be added/removed from the running as a server owner sees fit.

I'm also curious how you'd feel about making powerups something available via addons -- effectively making them Lua scripts that could be downloaded, and interpreted, rather than hard coded C++ logic.

Alayan-stk-2 commented 5 years ago

The reason I like the warp drive idea is actually having seen how this rubber banding creating a super challenging environment plays out in Freekstyle, it makes you work hard for that win, every time.

If you have the race 80% coin-toss 20% skill, then indeed you definitely need to work extra-hard to have the skill part matter and have a higher win rate. But when you lose, does it mean your opponent necessarily worked extra-hard ? No, they could race poorly and have the coin-toss hand things to them quite often.

Now your suggested change wouldn't make things that extreme of course, but this argument of additional luck forcing to work hard for the win is really silly if you ask me.

A race played with 5 karts all extremely close, is much different from a race played with all karts extremely far apart

Yes. And I was aware of this. This doesn't change my point of view. You get a cake with nobody close ? Tough luck. Either try to get another item at the next box, or hold onto it if you think you can catchup soon without. You get a triple zipper while 5th and only 2 seconds behind the 1st ? Lucky sure, but at the same time you're rewarded for having managed to be only 2 seconds behind. The powerup rates aren't such that you'd voluntarily slow down to get something better anyway. Try to make good use of it, because with 5 karts so close a bowling ball, swatter or cake may soon hit you.

For casual races with wide skill gap between players, use the handicap option to give more equal winning chances.

Yes, I do want A, with A if you want to win consistently, you better have the skill to maintain a near perfect race.

With A, you don't need a perfect race. You only need a perfect final lap. Of course the same is true of your opponents which make it more of a coin-toss as the longer the relevant part of the race the less an upset is likely. In MKWii, I could go yolo for the first half of the race and drive seriously on the second half and barely worsen my average final result.

You want to trade some uninteresting end of races (due to results becoming clear soon) with uninteresting beginning of races (due to them being barely relevant) and sacrificing in the process the races which manage to be quite interesting all along.

You shouldn't get lucky in lap 1, and have the race in the bag, there should always be a real threat to your position.

You almost never have the race in the bag in lap 1, unless you consider it's possible to have a race in the bag before it even started because you take into accounts skill gaps and they are big. An advantage of several seconds can quickly melt if you do a mistake, and such mistakes do happen. One example : https://youtu.be/sx2ZsOcdtfI?t=64

If they very rarely happen, then the track/difficulty setting is not hard enough for the players. Nessie's Pond and Shifting Sands for example are too easy for good players.

The problem is worse for low kart counts ~3 players, as equalizing powerups like the basketball and parachute might not even be seen the entire game.

Parachute and basket ball are rather stupid with 3 players only. Low kart counts races usually end up less fun anyway as it gets less likely to have another player of similar enough skill level.

The balancing seems to assume a close match up.

The less players, the bigger the difference between player N and player N+1 but the smaller the difference in powerup quality between first and last. This is sensible to not have them getting a stronger influence on the outcome with less players.

Now if you put a strong player against a weak player without any handicap setting, sure, the weak player will be crushed and won't be close to having a chance. As it should be.

I think the flaw in the system is evident by the games conditional here

At the start, everyone starts very close and explosive items are extra-annoying. Start happens in every single race. Having as much karts just as close later on is extremely rare.

IMO if the game is making good decisions about who needs what powerup to keep the game play interesting, then this isn't necessary.

It sounds like you want the game to evaluate what item would be most useful to a player trying to catch up (and least useful for a player it selects as a catch up target) and use that to weight if not completely decide the item.

I'd call that an anti-feature.

If all 5 karts are close together, the person in first place has absolutely no reason to get hit with a basketball -- that's super unfair.

It's not like you really care about fairness as you are arguing for more luck ? It's not like the basket ball is harder to dodge than a cake or does more damage, and at close enough range to make the basket ball unavoidable, the cake is too.

I think it means everything, in fact, I think it's the main reason you end up with a cluster of people in the middle, not the power ups available in game.

Either you give tons of zippers, which is completely imbalanced, or you must include a fair share of offensive powerups causing interdestruction.

I have done more than a thousand online race, I raced the AI a lot too, I know very well what I'm talking about here.

Being e.g. 4th at the 20s mark increases significantly the likelihood of getting hit by a cake/swatter/bowling ball in the rest of the race compared to the first player, which tends to make the kart slower when driving equally well.

If you wanted to increase the relevance of basketballs in 3 player races, right now you really couldn't do that without severely undermining the play of a close match.

I don't think close range basket balls are worse than cakes honestly. Actually increasing a bit basket balls rate for low player counts may be not such a bad idea.

I actually wanted to try a distance only weight, and ignore kart count as an experiment after implementing this to see how it played -- I suspect it might make the game feel far more consistent, and far more sane.

I mean, STK is open source, you're free to experiment whatever variant you want.

ensure some randomness early on doesn't result in everyone just waiting for the race to end with victors predetermined at lap 2.

You're talking as if any difference happening early would necessarily be "randomness". And I'll repeat again it's (in most situations) incorrect to say victors are predetermined at lap 2

If they really suck, they'll crash immediately after And if the players are more closely matched, it increases randomness by a good chunk.

or throw a bowling ball into their own kart.

Hey, don't joke on that. I've at least 3 recorded attempts of self-strike in multiplayer races. :smile:

I'm actually curious how you'd feel about a screen similar to the smash brother's item configuration screen where you can turn powerups on and off? Probabilities would have to be predefined still, but items could be added/removed from the running as a server owner sees fit.

It would be nice if a server could automatically share its configuration (playing on a server with custom config requires all players to have it if good sync is desired), though non-default configuration should be signaled to end users.

As for the rest, I'm not entirely sure of what you're thinking about exactly so it's hard to answer.

I'm also curious how you'd feel about making powerups something available via addons -- effectively making them Lua scripts that could be downloaded, and interpreted, rather than hard coded C++ logic.

Theoretically, I guess you could create a set of API with a range of effects an "addon powerup" could trigger, but the powerup probabilities would get messy, and more importantly you certainly wouldn't be able to have unconventional effects nor any custom graphical animation

DarkArc commented 5 years ago

For casual races with wide skill gap between players, use the handicap option to give more equal winning chances.

I don't find handicaps fun for racing games, the kart moving slower just isn't as fun to me :sweat_smile:.

It sounds like you want the game to evaluate what item would be most useful to a player trying to catch up (and least useful for a player it selects as a catch up target) and use that to weight if not completely decide the item.

Definitely not a fan of nerfing the player in front, just giving the player behind, if they are significantly behind, enough of an advantage to catch up -- to a point. I don't want someone to be able to park their car on the track for the first 2 laps, then start driving and get anything but last place -- unless they're like literally the best kart racer in existence, and have extremely amazing luck. The (below?) average player should not be able to casually win just because of a dice roll, they should however be able to stay in the race if they're trying.

You want to trade some uninteresting end of races (due to results becoming clear soon) with uninteresting beginning of races (due to them being barely relevant) and sacrificing in the process the races which manage to be quite interesting all along.

I think what I want, really, is to optimize the fun of races. I want races where every part of the race matters, from the start to the finish. Right now the bias is definitely towards the beginning of the race, I want to pull in some elements to let players close the gap faster than they can currently, and have a better chance of recovering from an early loss; I don't think much needs to happen to have that effect.

In a multiplayer race with 20 people, I want everyone to be in contest with someone, nobody should feel totally irrelevant. The player in position 20 definitely won't get to first, but they won't feel like they can't even get to 19th.

EDIT: Trying to fix this by improving probabilities for players in or near last place, I only foresee backfiring and giving the exact situation you're talking about. Without distance factored, a heavy biased towards the player in last place gives the player in last place an extremely unfair advantage.

It would be nice if a server could automatically share its configuration (playing on a server with custom config requires all players to have it if good sync is desired)

Is there really that much of an issue with desync of powerup boxes? I suppose in extreme ping cases you may want prediction, but even at 300ms ping this seems it would be hardly noticeable.

I mean, STK is open source, you're free to experiment whatever variant you want.

I think the best thing I can do to plead my case at this point is to actually implement this, make an initial balancing pass, and let you and some other top players try it. I think we're stuck on beliefs about how it would play, vs how it would actually play. At the end of the day I don't think either of us cares exactly how the item system works, just that racers are fun. I've got a new perspective, maybe it's good, maybe it's bad.

ex: I thought Minecraft was the dumbest idea ever before I actually tried it. Similarly, I've been on the other side, thinking a game was going to be fun, and it actually ending up being boring.

qwertychouskie commented 5 years ago

I haven't had time to read the whole thread yet, but I thought I'd post this link here: https://www.youtube.com/watch?v=P8S176RmRJg

It's a very well-thought-out video with a lot of insight into game mechanics and definitely worth a watch.

"Skilled players may hate items, but items that mix luck and randomness are crucial in making the game palatable for newer players." Sound familiar? ;) "And it's not like they turn the game into a Mario Party-esque factory of randomness. Skill still plays a big role, even if items do shake things up."

I could post the whole transcript here, but watching it would be easier :)

DarkArc commented 5 years ago

Yes, he absolutely makes many of the same points I'm try to about item balance.

Based on some IRC discussion I'm convinced that the best way to do this may actually be to create time tiers (ex):

Or something of that ilk, so we reuse the existing balance but make it based on the distance/time away from the first kart, rather than based on the absolute position. This should make the system less helpful in close competitive races, and more helpful in distant casual races.

One concern I had was how to handle the case where there's a run away, and a TON of basketballs might appear. I think a reasonable way to handle this might be to restrict the frequency of basketballs/parachutes, ex: when one is handed out another can't be handed out for at least 30 seconds.

qwertychouskie commented 5 years ago

I'm pretty sure basketballs specifically already have a frequency restriction somewhere in the code, not sure about parachutes though.

DarkArc commented 5 years ago

I've implemented this, it needs a bit more code clean up, some documentation fixes, and it needs play tested against other actual players, but my initial few games with the AI, and a couple of knee jerk balancings later it seems to be working pretty well. I won't really know how well for sure until I've had the chance to play against players of varying skill.

I based it off the 5 kart balancing:

    <!--              bubble cake bowl zipper plunger switch swattr rubber para  anvil -->
    <weight single  ="130     80   260    75      230      60     165     0     0     0"
            multi   ="  0      0     0     0        0       0       0     0     0     0"
            distance="0" />
    <weight single  ="150    135   240   125      145      45     135     0     0     0"
            multi   ="  0      0    25     0        0       0       0     0     0     0"
            distance="30" />
    <weight single  ="150    135   225   144      135      36     135    15     0     0"
            multi   ="  0      0    25     0        0       0       0     0     0     0"
            distance="90" />
    <weight single  ="160    120   140   205      110      30     100    70    30     0"
            multi   ="  0      0    35     0        0       0       0     0     0     0"
            distance="180"/>
    <weight single  ="145    105    45   240        0      24       0    40    80     0"
            multi   =" 40      0    80   175       26       0       0     0     0     0"
            distance="225" />

There's no interpolation -- because I with distance, what do you use as your interval 10? 1? 15?, I just decided to leave it up to the config author/an external tool, it's more flexible that way -- just when you fall far enough behind to fall into a bracket, you're in that bracket and get its benefits.

I also need to figure out how to handle follow the leader, right now I just commented out the follow the leader weight list code.

Initial code can be found here: https://github.com/supertuxkart/stk-code/compare/1.0...DarkArc:distance-based-item-balancing

(also appears I left some logic from me trying to mess with some networking stuff, I'll get that out and clean this up in general/work on better balancing sometime within the next two weeks hopefully)

Hi-Angel commented 5 years ago

Incidentally, just ½ a day ago I played STK with my gf, and I was mourning exactly this problem.

@Alayan-stk-2 STK is not a realistic racing game, it's an arcade. You wouldn't have the items and stuff if it was not an arcade. It is fun not because it's a race (otherwise you'd play NFS-like games, right?), but because you interact with other players: you smash them, you make traps, you throw bombs at them…

And simplifying racing part in preference of player interaction is what such games do. Examples:

I'm hoping I've shown you that the query is absolutely justified.

Hi-Angel commented 5 years ago

@Alayan-stk-2 I must emphasize my prev. comment point: every new player who ever gets to try STK would expect an arcade, something to have fun time with friends (I hope it's clear why, but I can elaborate if needed), disregarding their "gaming experience". That's what people expect from arcades. If you're developing an arcade, but not targeting the arcade auditory, clearly you gonna leave most of those who gets to try your game disappointed.

DarkArc commented 5 years ago

@Hi-Angel What the game does currently is actually close to what you're suggesting. It definitely leaves something to be desired however.

I think part of the issue may be online multiplayer races not having bots breaks the system, and leaves a 1v1 race feeling extremely different from a larger race.


The code I'm proposing above should make balancing easier, and scale better regardless of kart counts. It uses the distance between your kart, and the kart in first place to determine a "speed tier" (at least that's what I've kind of nick named it). This is used instead of your actual position, because second place within a kart of each other, is very different than, second place 3/4 of the track behind.


The initial testing with the balance above still didn't show this helping terribly much with a huge skill gap. To be clear, it makes helpful decisions at a far higher rate, and does give you the tools to make a comeback -- if you've got the skill to pull it off -- it won't however, give you much more than a marginal chance to win the race as the less skilled player.

I was finding the powerups weren't enough to overcome my friend's relative lack of skill 1) staying on the track, and 2) using them effectively in a methodical maner.

I think it's still something worth doing however, because it honestly just made the powerup system do its job better.


On a somewhat related note, I'm leaning towards the idea that the only way to really allow all parties to be happy is to allow for heavier customization to the powerup system. For instance, allowing a server owner to add(enable?) a bullet bill/warp drive sytyle powerup to their server, and allow them to more easily tweak the powerup system's probabilities to be nicer to new players than the defaults.

Alayan-stk-2 commented 5 years ago

I'm pretty sure basketballs specifically already have a frequency restriction somewhere in the code, not sure about parachutes though.

They don't. These item-specific code were removed as the rebalanced item frequencies were introduced last year.

Mario Kart Racing: (AFAIK STK is its clone, right? And MKR in turn is probably a clone of something though :Ь).

STK is NOT a MK clone.

items probability is relevant to your position

Item probability already depends on position

I'm hoping I've shown you that the query is absolutely justified.

STK already has items meant to help come back (often offset by other items causing explosions for players in the back). There is a question of balance.

Is STK required to strike the exact same level of catchup amount and randomness as say MK ? I'd say no. MK's level is I'd guess rather good for pure casual gameplay "everybody can win" (not really true if you take the worst against the best, but true even with rather wide range), but this doesn't mean STK has to be at it.

This is not a simple yes/no binary mechanic.

The initial testing with the balance above still didn't show this helping terribly much with a huge skill gap.

For reference, a distance of 225 is something like 6-7 seconds at SuperTux speed + skidding. This is very small of a gap between where you give worse item mix and best item mix.

I think it's still something worth doing however, because it honestly just made the powerup system do its job better.

I don't think so.

I was finding the powerups weren't enough to overcome my friend's relative lack of skill 1) staying on the track

My number 1 tip for noobs would be : don't focus on reaching a high top speed, focus on not crashing. Steady slow is much faster than big boost/crash loop

qwertychouskie commented 5 years ago

I'd love to have a choice between "fair" and "crazy" item distributions. MKWii has a similar setting, and it allows the player to decide what experience they want, rather than just having it "one-size-fits-all". Ultimately the real issue here seems to be that there's only one choice, and there's disagreement on which is objectively better, even though there is no "objectively better". I'll open a new issue.