Career mode - DIY cups generator

3 years 2 months ago - 3 years 1 month ago #144590 by EMPI
Special thanks to anoxic, starwindz and last but not least - my lovely wife :D
This post is long - but worth reading believe me. Grab a drink before reading - you've been warned... 8)

About a year ago I've played last career mode from zero to hero (starting in ENG Div3). As I was playing it I have started to think about getting into *.CAR file and pulling out some info from it. I knew CAR file contains a lot of information but I wanted to understand how much can be usefully extracted. The result was I've started to build my own Python application which allowed me to browse my current squad and also see RES and TRIAL players stats. I know these kind of apps exist already but it was also a part of my Python self-learning effort. Well I always like to link learning and fun. :wink:

Building my very basic alpha version of CAR file browser (it's very basic) forced me to save and load my career progress very often and learn from my mistakes. What caught my attention was loading a game right after a new season generation when all the leagues are scrolled on the screen (it took ages on Amiga). I don't know why, but i thought about getting those final season standings actually extracted from SWOS and saved to *.csv or *.txt files.

It took approx. 2 months (considering personal life) to dig through CAR file just to find anything that reflects other leagues standings - no effect. Apart from currently played league I couldn't find a single hex value that would represent other leagues. It was obvious this info is not stored within a CAR save file. After thinking this over I recalled a situation which happened on an old Amiga 500. New season generation took ages there as well as VIEW WORLD option because it was loaded on the screen on player's request. SWOS never actually "plays" leagues simultaneously with the league you play in career mode. Yep - SWOS cheats on you. :dry:

So now I knew CAR file won't give me any info from other leagues. I had to use some other soft to analyze what takes place in SWOS process and catch this info straight from memory. Some basic debugging tool allowed me to catch hex address within the memory and change what was displayed on the screen in real-time.

File Attachment:

Picture: View World Albanian League PTS changed in real-time using debugging tool

As you surely know my programming knowledge ended here and without other people help I wouldn't figure out how to get this data out of SWOS in a usable form. Because SWOS had it's refreshed premiere some while back I've decided to reach out to starwindz and get his point of view on how to get this data from SWOS. Apart from sharing some details and technical stuff there was no significant progress in this topic.

Then I've started to share my knowledge and vision with anoxic. That was it! 8)

Sharing my discoveries with him was an insta-progress I would say. It took just a moment for him to understand what I'm trying to achieve and I was surprised how well he responded to the entire idea. After some time a basic tool in a form of plugin was ready to extract data from localized memory sectors which held other leagues standings. It was exactly this moment in time when you could read a topic from anoxic on SWOS cheating on you in career mode >>LINK TO THAT TOPIC for some time the entire thing was parked because you know - personal life has a top priority. This short exercise allowed us to confirm that:
  • SWOS generates some sort of seed to calculate league results.
  • This seed is constant throughout entire season. Other leagues results will be always the same if you load career.
  • It was technically possible to extract leagues standings but difficult because...
  • SWOS uses offset values in memory to represent leagues and teams rather then values we know from database hex editing.
  • Offset values will change with every SWOS.EXE release - or I should say are almost sure to change.

  • File Attachment:

    Picture: Offset manipulation repleaced TEAM NAME with PLAYER NAME (Andi Lila was/is a Tirana's player)

    Proof of concept
    Knowing above I just had to come back to this in a future. Well... Future is now. :side:
    Couple of days ago I've reached out to anoxic once again. Many versions of SWOS-PORT-RELEASE.exe file came out and his previous plugin was already obsolete. Again, this is because as the development goes forward, SWOS executable keeps on changing and so this should be reflected in offset values. Bearing that in mind I've proposed him to update the plugin and make some sort of proof of concept whether we can actually export end season standings as the career mode creates new season (scrolls over leagues on screen). After hours (well that wasn't as dramatic...) of discussion and testing the plugin worked and confirmed. Yes! We're able to extract final leagues standings from career mode. How we can achieve that?

    There are two files needed to make it possible. One is a DLL, another one is anoxic's plugin file. The only thing which needs to be done is to put those files under swos directory and let the magic happen. 8) The plugin will be called during new season generation process and download all information stored within SWOS process memory. This part of memory is constantly overwritten as another and another league is being displayed on the screen. The plugin will create a separate file for each league and store is under separate directory created for that purpose. Each extract will have league's table in a csv (txt) form which can be then used according to player's will. Take a look at screenshots below:

    File Attachment:

    Picture: End of career season screen.

    File Attachment:

    Picture: League scrolling (in background files are being saved).

    File Attachment:

    Picture: Final result. Comparison of screen and file.

    Some points to consider
    Please bear in mind that:
  • This plugin will surely work only with SWOS 2020 EXECUTABLE version 1.5
  • SWOS PORT RELEASE.EXE version different than 1.5 may or may not work.
  • Plugin is in a veeeeery early stage of development. I wouldn't even dare to say there's a development at all.
  • Considering above this is just proof of concept and some starting point to a discussion on whether this should be developed further.
  • This functionality could potentially enhance career mode in a way described at the end of post.
  • You are more than welcome to test this plugin and share your view, experience and excitement in this topic. :D :D

    1). Make sure you've got a backup of your precious saves.
    2). Download *.zip file from this post.
    3). Extract to your SWOS 2020 installation folder under swos subfolder.
    4). Launch SWOS and n-joy!
    5). Play your career and see magic happens during new month generation.
    6). Your *.txt files will populate under careerlogs folder created under swos subfolder.
    7). Under main swos subfolder a file __log.txt will be created.

    For Linux users
    To allow WINE to use this plugin you need to enable winmm.dll under wine settings. Please refer to the screenshot below:
    File Attachment:

    Possible plugin use and future development
    One may ask - why should we even care about this functionality?!
    The answer is quite simple. This simple tool could be used to develop missing competitions under SWOS. How? Let me explain...

    It's actually genius how entire database is build under Football Manager. Not all the leagues are playable but still you can play all real life competitions without bothering the in-game cup's format will not reflect real one. This is done thanks to "not playable" leagues and teams. You can't play the game as some minor league team's coach/manager - but these minor league teams will appear in cup games. You face teams from San Marino, Andorra, Georgia, Kosovo etc. You can play African Champions League and Copa Libertadores. I think the same could be achieved in SWOS.

    Teams database contains a lot of leagues thanks to SWOS community. Players keep on updating teams database hoping one day it will be possible to tweak SWOS and replicate real Champions League etc. under career mode. What if I told you there's a simple solution. What if those exctracted files could be used to generate DIY COMPETITIONS on the fly as the season ends and generate all possible cups - even those invented by the players? Since DIY files contain all info needed incl. squads - it would be possible to store non-playable teams in a separate files and those teams would be randomly picked to build i.e. proper Europa League, CAF Champions League etc. This could be customizable with SWOS 2020 launcher.

    This would be probably much simpler and faster to do (than entire native swos career mode rebuild). The downside is - you won't get your trophy under management stats. But who cares? Everyone stores manager history in excel files anyway so I guess it's not that bad at all, isn't it? 8)
    Time to build 100 years of every domestic title holders. That will be 5 careers and a lot of extracted files. Good luck!

    We'd also like to extract the DOMESTIC CUP winners. It's still under research. Fingers crossed. :D
    Last edit: 3 years 1 month ago by EMPI.
    The following user(s) said Thank You: wongojack

    Please Log in or Create an account to join the conversation.

    3 years 1 month ago - 3 years 1 month ago #144682 by EMPI
    A progress has been done. We're testing an automatically generated DIY tournament at the end of career season. During "leagues review" a DIY file will be created which will contain a Champions League. Player's team will be included together with squad from career. Teams will be populated considering final leagues' standings. It's still subject to change but 26 teams will be taken from top leagues + 6 teams will be taken randomly from weaker leagues - still considering domestic champions.

    To play your DIY cup. Save your career after new season started. load your generated DIY - have fun! 8)
    Updates since last time:
    • Works with 1.5.3 SWOS Executable.
    • Tables are now sorted which reflects final league standings.
    • Champions League available after new season started (DIY file).

    There are plans to generate following cups considering SWOS limits to teams and/or tournaments mechanics:
  • Champions League... (currently testing)
  • Europa League
  • Europa Conference League
  • Copa Libertadores (South America)
  • Copa Sudamericana (South America)

    Please refer to 1st post in thread.
    You may also want to visit Project's Github page
    Last edit: 3 years 1 month ago by EMPI.
    The following user(s) said Thank You: obmij77, wongojack

    Please Log in or Create an account to join the conversation.

    3 years 1 month ago #144719 by Playaveli
    Wow... you are crazy!!! :D Congrats on this project. Must have been a lot of work!!

    Please Log in or Create an account to join the conversation.

    1 year 6 months ago #146245 by wongojack
    This sounds like a really cool way to add some depth to the game. However there have been a lot of excellent updates in the last 18 months (or so). Any chance for an update to make this work with the current SWOS version?

    Please Log in or Create an account to join the conversation.

    Time to create page: 0.261 seconds
    Powered by Kunena Forum