Author Topic: Played Count and Played Time STAT files  (Read 1640 times)


  • Newbie
  • *
  • Posts: 2
    • View Profile
Played Count and Played Time STAT files
« on: February 03, 2023, 05:47:53 PM »
This is in reference to the AM/stat folder

My apologies if this has been asked before, but I've been looking forever to fix this in my FE.

Currently, I have several systems (with associated romlists) working just fine.
I also have multiple collections (IE: Mario, Zelda, etc) with working romlists as well.

Problem is, the way AM appears to be working is that it tracks played time and counts through these romlists individually in the stat folder.  IE: If i pick Super Mario Bros from my Nintendo Entertainment System romlist, I get a "Playcount" bump in the "stat/Nintendo Entertainment System/Super Mario Bros (World)" file, but it won't reflect in the 'stat/Mario Collection/Super Mario Bros (World)" and vice versa.  I understand why it's doing this (AM is essentially treating that Mario Collection as a system and both are different files.)  I unfortunately want it to track played counts and time of an individual rom across all systems and collections.

I tried making a master romlist including EVERYTHING and filtering out the NES games when selecting the NES display and Super Mario when picking the Mario display and it works GREAT.  But that created a whole new problem.  Since AM is now saving that playcount to a single Master List stat folder, I'm getting multiple entries in AM if there are multiple games that have the same file name.  (IE: Frogger (USA) for Atari 2600 and Frogger (USA) for Sony Playstation.  IE: if i pick the Atari Frogger, it shows playcount "1", but will also show the same for the Playstation one despite never having played THAT ONE since there is only one "Frogger (USA) file in the stat/Master List folder.

So in summary, is there a way to change how AM records these STAT files so that they can be differentiated between systems when recording to a single romlist (Master List) or can I go back to my original way of having mutliple romlists (by system) but somehow have AM save stats across multiple romlists?  I mean, how exactly is AM saving to this stat folder and can it be manipulated?

I hope this makes sense to someone and there is a simple way to do it.  I'm all ears for any recommendations.
« Last Edit: February 03, 2023, 06:05:02 PM by bearsfan1978 »


  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Played Count and Played Time STAT files
« Reply #1 on: March 08, 2023, 11:49:04 AM »
I can confirm the same issue on my side. The stats are associated with the romlist and not the emulator. I was able to alter the code to use emulator. Below are the changes I made. It's not the most clean solution, but it works for the tests I've done so far.

I have two romlists:
  • Arcade.txt
  • Metal Slug Collection.txt

With the below changes I see the PlayedCount loaded and updated from .attract/stats/Arcade/mslug.stat

for ( FeRomInfoListType::iterator it=m_list.begin(); it!=m_list.end(); ++it ){
   // (*it).load_stats( stat_path );
   (*it).load_stats( m_config_path + "stats/" + (*it).get_info( FeRomInfo::Emulator ) + "/" );

// void update_stats( const std::string &path, int count_incr, int played_incr );
void update_stats( const std::string &path, const std::string &m_config_path, int count_incr, int played_incr );

// std::string filename = path + m_info[Romname] + FE_STAT_FILE_EXTENSION;
std::string filename = m_config_path + "stats/" + m_info[Emulator] + "/" + m_info[Romname] + FE_STAT_FILE_EXTENSION;

// rom->update_stats( path, play_count, play_time );
rom->update_stats( path, m_config_path, play_count, play_time );
« Last Edit: March 08, 2023, 11:59:35 AM by spilinek »


  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Played Count and Played Time STAT files
« Reply #2 on: March 14, 2023, 04:49:24 AM »
Bare with me, I'm an extreme noob at the inner workings of AM.  Where exactly are you making these changes?  I've tried looking through the various files in AM, but can't find where you put this new code in.

Thanks so far with the updates, though!!


  • Hero Member
  • *****
  • Posts: 1135
  • punktoe
    • View Profile
Re: Played Count and Played Time STAT files
« Reply #3 on: March 14, 2023, 05:41:22 AM »
he talking abought, making thoes changes to the source code,
then compiling am for use,   if he were a reley nice guy, he would just send you a link to his binary for you to use... ;) and help you out...
help a friend....