User Pass
Home Sign Up Contact Log In
Forum > Goal Line Blitz 2 > Script for Match Analysis - Feedback
Page:
 
kaiijy
offline
Link
 
Originally posted by Stobie
Those are the play ID's that you can then decipher using both of offense and defense json pages which for the life of me can't remember how to get to.


If you or anyone else could find this json request, for the defense only is good enough, then we're made (:
 
ki11erkiwi
offline
Link
 
Originally posted by kaiijy
Python 3 usually comes with pip pre-installed. Try using pip3 instead

pip3 install requests

for example (:

After installing Python, you'll get a folder in your Applications, you can run the script through IDLE, I believe.


Cheers mate will give a try when I get home tonight.
 
Xavori
offline
Link
 
Found a bug when running game 54551

Traceback (most recent call last):
File "C:\Python34\ultimate_grb2.ph", line 200, in <module>
away_team[down_play][kind_play]+=1
KeyError: '0th & What the fuck?'
 
kaiijy
offline
Link
 
Originally posted by Xavori
Found a bug when running game 54551

Traceback (most recent call last):
File "C:\Python34\ultimate_grb2.ph", line 200, in <module>
away_team[down_play][kind_play]+=1
KeyError: '0th & What the fuck?'


Haha, thanks. Funny, 0th are often kicks and they were supposed to be skipped already.
 
kaiijy
offline
Link
 
Originally posted by Xavori
Found a bug when running game 54551

Traceback (most recent call last):
File "C:\Python34\ultimate_grb2.ph", line 200, in <module>
away_team[down_play][kind_play]+=1
KeyError: '0th & What the fuck?'


https://gist.github.com/philgruneich/2cd7af31bd666c9bc7d5 Get this version.

What happened? It was a 4th down and the offense called a pass. I expected GLB to call a 4th, so I prevented that earlier, but it actually calls a 0th (this is used for kickoffs and after-td field goals). That's why you got the error (:
 
Xavori
offline
Link
 
Yay. Fixed.
 
Xavori
offline
Link
 
And now I noticed a different bug.

Still using game 54551, the box score shows Air Raid running 13 times to 40 passes.
http://glb2.warriorgeneral.com/game/game/54551

The scout script is bringing back 29 runs and 107 passes. Heck, just 1st and 10 it's reporting 16 runs and 51 passes.

So somewhere it's getting its math bungled.

Now, I will say that having manually scouted Air Raid as much as I have, it prolly isn't that far off on the percentages for each down and distance, but it's way off on its count.
 
kaiijy
offline
Link
 
Originally posted by Xavori
And now I noticed a different bug.

Still using game 54551, the box score shows Air Raid running 13 times to 40 passes.
http://glb2.warriorgeneral.com/game/game/54551

The scout script is bringing back 29 runs and 107 passes. Heck, just 1st and 10 it's reporting 16 runs and 51 passes.

So somewhere it's getting its math bungled.

Now, I will say that having manually scouted Air Raid as much as I have, it prolly isn't that far off on the percentages for each down and distance, but it's way off on its count.


It probably messed up reaching for the correct team ID, something to investigate. It looks for the word "handed off" for inside runs, if you open the play by play, you'll find 27 occurrences. Pass is a mix of "threw a pass", "forced a hurried pass" and "sacked" 76 + 26 + 9, so 111 for the whole match. Of course, these results should be split among both teams (you noticed that it prints both teams, right?). Remember that it automatically skips 4th downs for this matter, so you can count +1 inside run. This is, of course, a bit flawed by nature since if you have a QB with "sacked" in the name, the system will consider all his plays a "pass". When I move to the JSON request Stobie suggested, that part will be fixed, otherwise I'll have to appeal to regular expressions.

Before releasing the next version, I'll run a more watchful debug. Thanks (:
 
kaiijy
offline
Link
 
Super quick question:

When you scout a match, are you interested in 1 team or both?
 
kaiijy
offline
Link
 
Ok, I worked on a brand-new version you can get here:

https://gist.github.com/philgruneich/2cd7af31bd666c9bc7d5

Notes:

1. Before we move on, you should install 2 new modules: keyring and ujson. Just do as when you installed requests and BeautifulSoup4

2. This script doesn't display the team names anymore. Neither displays the information for both teams. I believe it makes the whole thing more focused.

3. You'll be prompted for your username and password, they'll be stored in your machine (that's what the keyring module does). I need to create a GLB2 session so we can download the JSON with the entire offensive playbook, which we use to find out the kinds of plays and the nš of receivers. Let me know if you run into troubles with this module since I haven't used it before.

4. Instead of editing the code, now you'll be prompted to insert the Game ID and the Team ID of the team you want to scout afterwards.

5. If you're feeling adventurous, you can look for a dictionary called yards. There you can customize what the script will consider as Very Short, Short, Medium and Long, just as in the Tactics section of GLB2.

6. Let's talk about improvements: This script is at least 8 times faster than the previous version. It displays only the valid information, so no more 0 (0%). It sorts all results in an order I consider pleasant to the eye. It shows percentages for the receivers considering the down, which may be great for you to decide your blitzes.

7. Hope you enjoy, now let me sleep.
 
kaiijy
offline
Link
 
Just a quick fix.

Also included Number of passes and number of rushes by the end of the output.
 
kaiijy
offline
Link
 
Hey, fellas.

I create a repository with all my working scripts here: https://github.com/philgruneich/glb2scripts

It has the Match Analyzer we've been discussing here, a Build Calculator and a brand-new one that calculate the success of your defensive formations against your opponent's offense, great to see what works against QB Rollout.

Enjoy (:
 
peeti
offline
Link
 
Is there any post where I can see how to use them?^^
 
kaiijy
offline
Link
 
Originally posted by peeti
Is there any post where I can see how to use them?^^


Xav has a nice one here: http://glb2.warriorgeneral.com/game/forum/thread/5174072?page=2#48395554
 
Page:
 


You are not logged in. Please log in if you want to post a reply.