Statistic and Output Information

A section for those creating 3rd party tools and add ons. Lots of techincal code creation type questions would go here.

Moderator: David Winter

mbsports
Posts: 275
Joined: Sun Jan 07, 2007 5:21 pm
Contact:

Statistic and Output Information

Post by mbsports »

As many of you know, and probably many of you don't:

My #1 absolute least favorite part of Maximum Football is the stats output or lack thereof.

I find the game outputs, the season stat outputs, the career stats, etc. etc. to be extremely counterproductive and a massive hindrance on running any sort of a league with MaxFB.

In fact I would go so far as to say it is near impossible to run a league with what Maximum Football outputs. For as much customization and all the good things about it, this is a serious issue that I've been working thru 2 seasons to come up with some sort of solution.

What I would like to do is to find out what other MaxFB users are doing in order to get their leagues running and to provide output.

Our website is at http://www.mbsportsnet.com/mbfl/mbcfl.htm

What we did after Season 2, due to the 2.0+ changes that kinda' clear away career stats, is output every piece of statistical data so that our league history wouldn't be wiped clean and we would have some career information. I took that mostly from the Stats_League table utilizing access. I then fired that out into excel with no team information - IE remove nulls in the player column and There is a thankfully a stat group column so I was able to pull that to determine which stats were which.

then I worked on this horrific data field
1:0/2:0/3:0/4:0/5:0/6:0/7:0/8:0/9:0/10:0/11:0/12:0/

The absolute only way I was able to turn this into anything that can't be described as useless is to convert all colons and slashes into commas. I output the whole table to excel with the team stats exclued as stated above. Then I just did a replace all on the colons and slashes. I saved as a CSV and imported back into Access and used delimination to create the new columns

From there I was able to link everything together and actually produce stats that make some sense.

Now I run an NFL League as well which I use Madden for. For all of Madden's shortcomings the community has done a real nice job of breaking it's information into nice data packets and MADCAT is absolutely fantastic for any commish. So I took the MADCAT formats and information and CFL-Ized it based on the mess of data that I now had from MaxFB.

The result is no where near perfect. In fact I'd go far to say there are some massive limitations due to the missing fields.

I won't and can't even justify the reporting that comes out of Maximum Football. It's attrocious and it might be the single worst thing about the sim. In my opinion just about everything else can be worked around in some way or another to achieve a reasonable game of football, but at the end of the day if you can't show what happened to the GMs of your league all of that is great but meaningless.

So what's on the docket for me

1 I need to make the ratings lineup properly, they're off one column and I'm struggling with how to fix that, my php skills are limited.

2 I need to fix some stats holes for kickers and punters - this is due to the lack of blocked/touchback/kickoff stats from MaxFB.

3 Cleanup the scheduled games sql DB so that BC Lions become BCLions and things like that.

4 By using Deft's play analyzer, which actually outputs a nice scoring summary put together a format for game result uploads.


Overall that will go a long way towards fixing my issues, but I want to know what else is out there being done in the community. As all of this gets compiled MBCFL has career stats up to date whenever we put in weekly stats and standings and we have a player card for each player to be clicked on showing their career numbers.

I believe this is an understated issue that really hurts the acceptance of the sim in the community.

Thanks,

Mike



MBFL - MB Sports Net - Simulated NFL, AFL, CFL, NFL-E
Tullius
Posts: 1174
Joined: Thu Nov 18, 2004 2:31 pm
Location: Saxony (Germany)

RE: Statistic and Output Information

Post by Tullius »

then I worked on this horrific data field
1:0/2:0/3:0/4:0/5:0/6:0/7:0/8:0/9:0/10:0/11:0/12:0/

At the moment i am dealing with Visual Basic 2008 again and have noticed that problem again. Now i think i have at least a theoretical solution.

This line could be converted in a string, then processed in useable data and fill a table in a new database.

Much of the problems could be caused by the fact that developement of the game started at the beginning of this century and using Access97 as database and a recordset was at that time standart and now a reason for headaches.
Tullius
Posts: 1174
Joined: Thu Nov 18, 2004 2:31 pm
Location: Saxony (Germany)

RE: Statistic and Output Information

Post by Tullius »

then I worked on this horrific data field
1:0/2:0/3:0/4:0/5:0/6:0/7:0/8:0/9:0/10:0/11:0/12:0/

At the end it was easy when you know what to do. Visual Basic has a class named "String" and in this class you have a "Replace" method. This method allows you to replace every letter or sign even with nothing. So the expression "1:" becomes "" and "/" and ",". Here is a test application to show the result. When you add the player name and team you can save the result in a csv file, too.



Image
Attachments
form1.jpg
form1.jpg (13.42 KiB) Viewed 448 times
mbsports
Posts: 275
Joined: Sun Jan 07, 2007 5:21 pm
Contact:

RE: Statistic and Output Information

Post by mbsports »

very cool, I'll have to give her a shot on my machines and see if I can make it hum.
 
MBFL - MB Sports Net - Simulated NFL, AFL, CFL, NFL-E
User avatar
garysorrell
Posts: 2176
Joined: Sat Jan 29, 2005 7:47 pm

RE: Statistic and Output Information

Post by garysorrell »

If you guys could ever come up with something to pull the stats out and output it in useable format, you will be hailed as great conquering heros [:)]
mbsports
Posts: 275
Joined: Sun Jan 07, 2007 5:21 pm
Contact:

RE: Statistic and Output Information

Post by mbsports »

It actually shouldn't be that bad I don't think - it can be done now but if I ever can figure out VB a little better, should be doable.
 
 
MBFL - MB Sports Net - Simulated NFL, AFL, CFL, NFL-E
User avatar
Mykal
Posts: 1777
Joined: Thu Apr 03, 2008 4:59 pm

RE: Statistic and Output Information

Post by Mykal »

ORIGINAL: garysorrell

If you guys could ever come up with something to pull the stats out and output it in useable format, you will be hailed as great conquering heros [:)]
I'll 2nd that
Tullius
Posts: 1174
Joined: Thu Nov 18, 2004 2:31 pm
Location: Saxony (Germany)

RE: Statistic and Output Information

Post by Tullius »

I have found an other intersting way. You have the ability to export the roster. When you export a roster the actual stats were included. The export is done as html. The interesting is that even the player id will be included (i think this was not intended by DW but could now very fortunate fact)

I have now found a html - edior, formated the text and removed all tags and had so a clean text. The last step would be adding commas and reformat the text but how is not clear for me - at least in the moment.



Image
Attachments
stats.jpg
stats.jpg (131.62 KiB) Viewed 447 times
Tullius
Posts: 1174
Joined: Thu Nov 18, 2004 2:31 pm
Location: Saxony (Germany)

RE: Statistic and Output Information

Post by Tullius »

And then is there an other way.

Export all the stats so you have an html - file. Load it using Excel or Open Office Calc. They have a function called "change table in text" and so you can create csv file.
Tullius
Posts: 1174
Joined: Thu Nov 18, 2004 2:31 pm
Location: Saxony (Germany)

RE: Statistic and Output Information

Post by Tullius »

If you guys could ever come up with something to pull the stats out and output it in useable format

XML ?
mbsports
Posts: 275
Joined: Sun Jan 07, 2007 5:21 pm
Contact:

RE: Statistic and Output Information

Post by mbsports »

I'm not all that good with XML - I have to start learning that one.  What I ended up doing was kicking it out and creating a series of SQL scripts that makes the data play nice with MADCAT and then I use that .php framework for the sites.

I was pretty geeked the other day when I got the CFL Records part up...

MBFL - MB Sports Net - Simulated NFL, AFL, CFL, NFL-E
Tullius
Posts: 1174
Joined: Thu Nov 18, 2004 2:31 pm
Location: Saxony (Germany)

RE: Statistic and Output Information

Post by Tullius »

Ok, then is no need to push something and JD will have his own solution. In the last 24 hours i had a real "creative" phase and found my answers to some problems. Here i have a snapshot from a little programm which could be the first step. The table you can copy to Excel, the database you can transform in XML and then html (? - but here i have no clue) and it should be possible to write the database in a textfile (csv). And i think some time i crack the string a write the numbers in a new table but there is no schedule. There are only 4 QB listed as i have made it only for the passing stats at the moment. The league consists only of 4 teams and only the first week in the first season is played.

Attachments
step1.jpg
step1.jpg (128.82 KiB) Viewed 470 times
mbsports
Posts: 275
Joined: Sun Jan 07, 2007 5:21 pm
Contact:

RE: Statistic and Output Information

Post by mbsports »

Nice work, that's pretty cool!  I'm brainstorming and trying to find a better output methodology and it looks like you've got it about 90% of the way there :-)

MBFL - MB Sports Net - Simulated NFL, AFL, CFL, NFL-E
Tullius
Posts: 1174
Joined: Thu Nov 18, 2004 2:31 pm
Location: Saxony (Germany)

RE: Statistic and Output Information

Post by Tullius »

Approach Run ...



Image
Attachments
apr.jpg
apr.jpg (45.62 KiB) Viewed 449 times
Tullius
Posts: 1174
Joined: Thu Nov 18, 2004 2:31 pm
Location: Saxony (Germany)

RE: Statistic and Output Information

Post by Tullius »


A stat viewer is on my draw board. Created tables you could copy in Excel or Writer (Open Office). In Open Office you can transform this file in pdf or html. A text (csv) file is perhaps in the cards.
Marauders
Posts: 4428
Joined: Thu Mar 17, 2005 5:37 pm
Location: Minnesota

RE: Statistic and Output Information

Post by Marauders »

Looking good, Uwe!
 
User avatar
Shaggyra
Posts: 608
Joined: Fri Feb 10, 2006 7:05 am

RE: Statistic and Output Information

Post by Shaggyra »

Some code to help you.

Option Compare Database
Function CountCSWords(ByVal S) As Integer
' Counts the words in a string that are separated by commas.
Dim WC As Integer, Pos As Integer
  If VarType(S) <> 8 Or Len(S) = 0 Then
    CountCSWords = 0
    Exit Function
  End If
  WC = 1
  Pos = InStr(S, "/")
  Do While Pos > 0
    WC = WC + 1
    Pos = InStr(Pos + 1, S, "/")
  Loop
  CountCSWords = WC
End Function

Function GetCSWord(ByVal S, Indx As Integer)
' Returns the nth word in a specific field.
Dim WC As Integer, Count As Integer, SPos As Integer, EPos As Integer
  WC = CountCSWords(S)
  If Indx < 1 Or Indx > WC Then
    GetCSWord = Null
    Exit Function
  End If
  Count = 1
  SPos = 1
  For Count = 2 To Indx
    SPos = InStr(SPos, S, "/") + 1
  Next Count
  EPos = InStr(SPos, S, "/") - 1
  If EPos <= 0 Then EPos = Len(S)
  GetCSWord = Trim(Mid(S, SPos, EPos - SPos + 1))
End Function

Function CountWords(ByVal S) As Integer
' Counts the words in a string that are separated by commas.
Dim WC As Integer, Pos As Integer
  If VarType(S) <> 8 Or Len(S) = 0 Then
    CountWords = 0
    Exit Function
  End If
  WC = 1
  Pos = InStr(S, ":")
  Do While Pos > 0
    WC = WC + 1
    Pos = InStr(Pos + 1, S, ":")
  Loop
  CountWords = WC
End Function

Function GetWord(ByVal S, Indx As Integer)
' Returns the nth word in a specific field.
Dim WC As Integer, Count As Integer, SPos As Integer, EPos As Integer
  WC = CountWords(S)
  If Indx < 1 Or Indx > WC Then
    GetWord = Null
    Exit Function
  End If
  Count = 1
  SPos = 1
  For Count = 2 To Indx
    SPos = InStr(SPos, S, ":") + 1
  Next Count
  EPos = InStr(SPos, S, ":") - 1
  If EPos <= 0 Then EPos = Len(S)
  GetWord = Trim(Mid(S, SPos, EPos - SPos + 1))
End Function


Example:  Yards =  GetWord(GetCSWord([Statvalues],2),2)
             Long: GetWord(GetCSWord([Statvalues],3),2)
             TD: GetWord(GetCSWord([Statvalues],4),2)


          
Tullius
Posts: 1174
Joined: Thu Nov 18, 2004 2:31 pm
Location: Saxony (Germany)

RE: Statistic and Output Information

Post by Tullius »

@ Shags

Thanks. I have found an other way:

Code: Select all

 
 (Form)
 
 For Each DsRow As DataRow In dataset01.Tables("StatsTab").Rows
                             Conversion(DsRow("StatsValues_Group1"))
 ...
 Next
 
 (Modul)
 Public StatArray() As String
 ...
 Public Sub Conversion(ByVal StatGroup)
         Dim A As String
         Dim B As String
         Dim i As Integer
         Dim x As String
 
         A = StatGroup
 
         For i = 1 To 30
             x = i & ":"
             If i > 10 And i < 21 Then x = "1:"
             If i = 20 Then x = "20:"
             If i > 20 And i < 30 Then x = "2:"
             A = A.Replace(x, ":")
         Next
 
         B = A.Replace(":", "")
 
         StatArray = Split(B, "/")
 
 (REM It would be better to count from 30 to 1 then you can save some ifs but this function has worked))
 
 
Tullius
Posts: 1174
Joined: Thu Nov 18, 2004 2:31 pm
Location: Saxony (Germany)

RE: Statistic and Output Information

Post by Tullius »

Here is a little preview. The report screen is not ready but the main components works. I have now to add all the stats and this needs more diligence than brain and it costs time. This is only 1 of 13 possible team reports which include all teams and then players have stats, too.
The report is here sorted by TO Ratio. You can sort all stat columns and even the rank will be displayed correct.

Edit: The recorded team stats were not complete in all categories (Defense only Sacks and Tackes) or not existing (Receiving) so the abilty to add some more stats which are not shown by the game was limited. I do not speak about individual stats. So the receiving stats for players are recorded but no stats as team summary.

Image
Attachments
statpreview.jpg
statpreview.jpg (42.75 KiB) Viewed 451 times
User avatar
garysorrell
Posts: 2176
Joined: Sat Jan 29, 2005 7:47 pm

RE: Statistic and Output Information

Post by garysorrell »

Absolutely fantastic!
Post Reply

Return to “3rd Party Developers Area”