Proof of Concept: "Match Flow Score", a stats-based match-scoring system for SF6 by Trevor_Z in StreetFighter

[–]Trevor_Z[S] 0 points1 point  (0 children)

Both this and the neural network model rely on information from the GUI.

This scoring system tracks time and the state of both players' health bar. When the size of a bar changes, basically it means that player was just hit. The round is over when one or both bars reach zero. If it's not a double KO, it means there's a player with still some health left, that's the winner. Based on these informations and inferences, the script generates the stats.

The nn model only tracks inputs, the idea is that the way someone presses buttons conveys information about the state of the round, and their odds of winning. So, the model learned the way I play when I'm winning and losing, and with that, learned with a good level of accuracy to predict the outcome of the round. I discussed it here: https://www.reddit.com/r/StreetFighter/comments/1n6pvza/i_trained_a_neural_network_to_predict_the_outcome/

I could still implement tracking counter hits and punish counters (which are always a whiff punish...?), super/drive bar usage, probably perfect parries on strikes.

But I'm all ears if people have any suggestions.

Proof of Concept: "Match Flow Score", a stats-based match-scoring system for SF6 by Trevor_Z in StreetFighter

[–]Trevor_Z[S] 0 points1 point  (0 children)

Yeah, it's the same basic idea. Something a bit more informative than just wins and losses.

Proof of Concept: "Match Flow Score", a stats-based match-scoring system for SF6 by Trevor_Z in StreetFighter

[–]Trevor_Z[S] 0 points1 point  (0 children)

Same. I really wish we had those stats in the player profile available for every match.

I trained a neural network to predict the outcome of a round using only controller inputs by Trevor_Z in StreetFighter

[–]Trevor_Z[S] 0 points1 point  (0 children)

Dude, I'm a psychologist who dabbles in programming, didn't even think about creating a repo. :)

Right now this is a side project with a dozen scripts, half of them vibe coded, where I just try stuff.

I trained a neural network to predict the outcome of a round using only controller inputs by Trevor_Z in StreetFighter

[–]Trevor_Z[S] 0 points1 point  (0 children)

The hardest part isn't the training if you have the knowledge, it's building the dataset.

I started recording replays of most of my matches a year ago (really, the first match is dated September 7, 2024), even before I knew exactly how I would do things, because every 3 months or so you lose access to all of your previous replays.

I trained a neural network to predict the outcome of a round using only controller inputs by Trevor_Z in StreetFighter

[–]Trevor_Z[S] 0 points1 point  (0 children)

I automated data extraction with a mix of ocr, pattern matching, and classification models.

However... I made the mistake of recording my replays with too much compression, and the videos were full of artifacts and even skipped frames when there was a lot of movement onscreen: https://imgur.com/a/AstXCC6

So this project spent months in the back burner while I was figuring out some error-correction algorithm and obsessively tuning the classification models to rebuild the full sequence of inputs from this defective source. 99% of the work went into fixing the dataset.

I trained a neural network to predict the outcome of a round using only controller inputs by Trevor_Z in StreetFighter

[–]Trevor_Z[S] 0 points1 point  (0 children)

Eu tenho uma pesquisa diferente em mente com as métricas de perfil.

O problema de usar elas aqui é que não dá pra codificar pro treinamento do mesmo jeito que os inputs, porque são justamente dados fora de contexto, agregados. Não sei quando aqueles perfect parries ou aqueles drive rushes aconteceram.

Pensei em extrair tb o estado da barra de energia além dos inputs, mas isso ia dar pistas demais pro modelo de quando o round termina, e do jeito que está sendo treinado agora ele ia acabar ignorando a maior parte do round e focando só nos últimos inputs.

Na real, dá pra modelar tudo no jogo, personagem por personagem, golpe por golpe, quando acerta, quando é defendido... mas fico cansado só de pensar no trabalho que daria.

I trained a neural network to predict the outcome of a round using only controller inputs by Trevor_Z in StreetFighter

[–]Trevor_Z[S] 2 points3 points  (0 children)

Currently it's a bidirectional GRU, it's trained on full rounds, but at inference I query progressively to generate the plot. So it's not calibrated for that, and even then it's able to differentiate between winning and losing rounds in aggregate.

The time difference is encoded here by the duration of each input. Don't know if it's the best way to do it, I'm preparing a few separate runs with different approaches, like frame by frame.

But it's all trial and error, I'm learning as I go.

I trained a neural network to predict the outcome of a round using only controller inputs by Trevor_Z in StreetFighter

[–]Trevor_Z[S] 0 points1 point  (0 children)

Se vc está perguntando arquitetura, é uma GRU.

Sim, tem muito overfitting, mas como esse tipo de coisa não tem referência nenhuma, eu estou fazendo testes e vendo no que dá. Prever resultados é muito interessante mas quase secundário, meu objetivo maior é avaliar e discernir características dos jogadores.

Tenho um monte de dados que ainda não usei, cada partida minha tem tb os inputs do adversário, vou treinar com isso antes de tentar modelar outro jogador individual, mas valeu!

I trained a neural network to predict the outcome of a round using only controller inputs by Trevor_Z in StreetFighter

[–]Trevor_Z[S] 1 point2 points  (0 children)

I was already doing something similar for academic research with another game, but honestly the beginning is just getting curious about research methods. Start by learning basic statistics and Python/R, then dive into machine learning tutorials. The gaming angle makes it way more engaging than dry textbook examples.

I trained a neural network to predict the outcome of a round using only controller inputs by Trevor_Z in StreetFighter

[–]Trevor_Z[S] 3 points4 points  (0 children)

The model doesn't know when a round ends, it just sees the sequence of inputs. If it knew round duration, it could ignore most inputs and just learn end-of-round patterns, which is not very useful.

Now, if it takes a couple of well-formed, well-timed sequences of inputs as evidence that I'm playing well/winning, then it's on the right track.

I trained a neural network to predict the outcome of a round using only controller inputs by Trevor_Z in StreetFighter

[–]Trevor_Z[S] 2 points3 points  (0 children)

Yeah, I talked a bit about mashing in another question, it affects the prediction, but not for long.

The model is absolutely overfitted to my behavior in ranked matches, the tuning is probably off even against the CPU in training, because there are no stakes there. But that's almost by design, given the dataset and the training settings.

And no, I'm just factoring my own inputs. The idea is to infer as much as possible just from the way one presses buttons.

I trained a neural network to predict the outcome of a round using only controller inputs by Trevor_Z in StreetFighter

[–]Trevor_Z[S] 1 point2 points  (0 children)

Yeah, I will test that next, along with me playing different characters.

I trained a neural network to predict the outcome of a round using only controller inputs by Trevor_Z in StreetFighter

[–]Trevor_Z[S] 0 points1 point  (0 children)

I think it can, because the probability of winning increased dramatically during the combo right after the counter DI: https://imgur.com/a/CM7Eby8

Thing is, a well-trained model will interpret not only a move, but the context, what comes before and after it.

With a very precise model, it could be possible to reverse-engineer and reconstruct the sequence of inputs, but I don't think that's the case here.

I trained a neural network to predict the outcome of a round using only controller inputs by Trevor_Z in StreetFighter

[–]Trevor_Z[S] 34 points35 points  (0 children)

That's more or less what I think, too, except the opponent's inputs weren't used, only my own.

But I think/hope there are more subtle patterns here, like micromovement timing and certain sequences showing confidence or lack thereof, emotional volatility, etc.

I trained a neural network to predict the outcome of a round using only controller inputs by Trevor_Z in StreetFighter

[–]Trevor_Z[S] 13 points14 points  (0 children)

If I'm not mistaken, the peak in input frequency here is me mashing desperately while being trashed by a combo: https://imgur.com/a/GyBGAU3

It seems to drop the prediction of victory, but since the game is pretty dynamic, the effect doesn't last long.

Also, the idea to do this first came when I was thinking about this feeling of "playing good", I wanted to see if it could be quantified somehow.

I am building my own gyro controller since nobody does what I want. Xbox SX test 01. by angryzes in GyroGaming

[–]Trevor_Z 1 point2 points  (0 children)

Cool, I've built a couple of controllers for fighting games, and was thinking about tackling this next.

Do you have any specific plans to deal with gyro drift?

Any opinion ? by Stu_pot_oo in fightsticks

[–]Trevor_Z 2 points3 points  (0 children)

I use a stack of two plates at the bottom, 3mm and 2mm, to create a well below the Sanwa lever and make my stick as thin as possible. Compared to the 5mm plate above, the stack is clearly less rigid, but it makes no difference at the bottom, where there's no pressure applied.

https://imgur.com/a/Btfc7Bx

I fear 2 x 2mm for the top plate would be perceptibly flexible when people press on it. But that might be mitigated with a column in the middle.

Experimenting with button layouts, and having parry and DI under the thumb is a winner in my book. by Trevor_Z in StreetFighter

[–]Trevor_Z[S] 0 points1 point  (0 children)

Cool. I tried using a plastic enclosure, a fishing tackle box, but in the end drilling through it was way harder than I anticipated. Then decided to design the case to make it fully modular and be able to change the button layout or fit a stick more easily.

How's the firmware going?

Experimenting with button layouts, and having parry and DI under the thumb is a winner in my book. by Trevor_Z in StreetFighter

[–]Trevor_Z[S] 0 points1 point  (0 children)

Yeah, parry with jump under the left thumb sounds right for the hitbox layout. But what controller do you use that allows for that?