JKeift Posted June 5, 2015 Author Share Posted June 5, 2015 Hi. I downloaded LaunchBox a couple of days ago and, for lack of a better term, I'm positively infatuated with it. Thank you for this gem. Anyway, about my question, I was wondering if there's a play time feature (i.e., hours played) for each game or if it's going to be added in the future. I searched the forums but couldn't find anything about this. Quote Link to comment Share on other sites More sharing options...
Jason Carr Posted June 7, 2015 Share Posted June 7, 2015 Hi JKeift, welcome. Glad to hear you're enjoying LaunchBox. :) Currently, there isn't really a play time feature. It's a hard feature to implement because you have to be able to tell when a game is running or not, and without a tighter integration with your games like Steam has, it's almost impossible. Even Steam has trouble with that feature (for example, my GTA IV hours are way, way, way up there for no apparent reason), so without a tight integration, it would have to be mostly guesswork. I would like to have that feature as well, but I haven't tried to implement it because it would likely end up being so inaccurate. Quote Link to comment Share on other sites More sharing options...
JKeift Posted June 7, 2015 Author Share Posted June 7, 2015 Ah, gotcha. And here I thought it was actually a simple feature to implement. Then again, I know nothing about programming. Thanks for the reply, and great job. EDIT: btw, just purchased the premium license. You deserve every penny for your work, and the fact that you're still developing it and adding new features makes it even more exciting. Quote Link to comment Share on other sites More sharing options...
ps4isthefuture Posted June 8, 2015 Share Posted June 8, 2015 Jason, Maybe this program is worth your look,Gameplay Time Tracker. There is an article here also. Maybe if it's installed in the launchbox directory you guys could find away to pull the time data from this program into launchbox. The software is free but you need permission from the developer for modification or distribution rights. I know you have your plates full but maybe it could be of help. Or if people just want to use this program to track their gameplay times separately for the time being. Quote Link to comment Share on other sites More sharing options...
ps4isthefuture Posted June 8, 2015 Share Posted June 8, 2015 Found one big issue with the Gameplay Time Tracker, it is only triggered by an exe. Unless "we" the community could find a wway to force the program to allow a trigger with any file type. Quote Link to comment Share on other sites More sharing options...
ps4isthefuture Posted June 8, 2015 Share Posted June 8, 2015 Just sent off an email to the developer to ask if it would be possible to modify his program to be triggered by any file type. I will keep you informed if I get a reply from him. Quote Link to comment Share on other sites More sharing options...
Jason Carr Posted June 9, 2015 Share Posted June 9, 2015 Very cool ps4. I'll take a look at that soon. :) Quote Link to comment Share on other sites More sharing options...
bd00 Posted June 10, 2015 Share Posted June 10, 2015 I have a feeling I am missing something obvious here, but what circumstances would require anything other than an .exe? Quote Link to comment Share on other sites More sharing options...
ps4isthefuture Posted June 11, 2015 Share Posted June 11, 2015 bd000 said I have a feeling I am missing something obvious here, but what circumstances would require anything other than an .exe? The individual roms, otherwise it would just tell you how long you had zsnes.exe open. Maybe amongst us all we could somehow find a way to make this work for us, one day. Also this was the reply I received from the developer: "Mikhail Petrov Hello! I understand your request, in fact I play many game titles with emulators by myself. But the problem is that one can't detect (by any reliable means) that some program (executable file) loads particular ROM or CD image file. Unfortunately, this functionality can only be developed by emulator's authors. Right now I have no spare time for such complex task. Sorry." Quote Link to comment Share on other sites More sharing options...
bd00 Posted June 11, 2015 Share Posted June 11, 2015 Yeah, I knew that ROMS are never processes that Gameplay Time Tracker could monitor, without emulator integration that is. I thought there might be something else I was missing. With ROMs, the game loaded would have to be identified first, then the emulators .exe monitored. After the emulator was closed, the session time would need to be added to the games current time in the LB xml. I could probably create something in Powershell that would pull the data from GPTT and import it into a custom field in LB, but it would be tricky and to be honest would probably be just a waste of my time if Jason ends up implementing something natively when he gets back. ... Thinking about a script, we wouldn't even need to use GPTT. We could monitor the time a process is running pretty easily. It is getting that data into the correct place in the LB xml that poses the biggest obstacle. Again, something that would be a whole lot easier for Jason to do inside LB. Using a script would also mean that it would need running first, prior to the emulator/game and that would involve adding it as an "additional app" for every game. Very time consuming especially for large libraries unless another script was created to add the additional apps automatically and that has the same obstacle of getting the data into the correct place in the XML. It would be tricky to do from a script but possible. Quote Link to comment Share on other sites More sharing options...
ps4isthefuture Posted June 12, 2015 Share Posted June 12, 2015 I found something simple that might help the effort a small bit, not sure...never know. So here is a timer bat that I found. echo start measure %time% >> timer.txt YOUR COMMAND GOES HERE echo stop measure %time% >> timer.txt So I tested this out on a Sega Saturn game, as I had all those bat files I made to launch them. echo start measure %time% >> AfterburnerII_play_time.txt "C:/Program Files (x86)/DAEMON Tools Pro/DTAgent.exe" -mount dt, 0,"C:/HyperSpin/Emulators/Sega Saturn/ISOs/Sega Saturn /Games/JAPAN/Afterburner II(JAP)/Afterburner II(JAP).nrg" start /wait "" "SSF.exe" "C:/Program Files (x86)/DAEMON Tools Pro/DTAgent.exe" -unmount dt, 0 echo stop measure %time% >> AfterburnerII_play_time.txt And after I launched and then closed the game, the txt file was saved to the same directory as the bat. And this is what it read: start measure 13:50:07.19 stop measure 13:50:36.57 I know it's primitive but it's a stepping stone. Quote Link to comment Share on other sites More sharing options...
ps4isthefuture Posted June 12, 2015 Share Posted June 12, 2015 I have just tried to see if it would also capture the date. echo start measure %date% %time% >> timer.txt YOUR COMMAND GOES HERE echo stop measure %date% %time% >> timer.txt I ran the bat for the Sega Saturn game again with the "%date%" added to the code and this was my return in the text: start measure 13:50:07.19 stop measure 13:50:36.57 start measure Fri 06/12/2015 14:06:36.55 stop measure Fri 06/12/2015 14:07:12.99 So you can see that it keeps a log every time I play Afterburner II. Now with the new date code inside it will also track the date of play. So possibly this is the idea I was thinking something could work for LB, but we will have to wait for Jason to return from his vacation to receive his feedback. So Jason if you are reading this right now, stop and go enjoy your family time! Anyway I was thinking maybe LB could use a simple process like I have demonstrated to capture time played for any game. As in LB knows the game you selected, and it counts the times played already. So if a bat or something better could run this for each game to track time played. Then a way will need to be devised to add the total time up every time and displayed within LB. I am not a programmer of any kind, I am just throwing ideas out to the community to get the creative juices flowing. There are a lot of smart talent in this community and I think Jason would love the assistance. Quote Link to comment Share on other sites More sharing options...
bd00 Posted June 12, 2015 Share Posted June 12, 2015 Great work @ps4isthefuture Unfortunately, the difficult part is getting that data into the LB XML in the correct place. It is very difficult to do this externally from a script and I don't even think it is possible from a batch. You would need something more powerful. I have had success using Powershell in the past (see my separate platforms sript) however, this would need to be more complex in order to get the data in the exact place. Not to mention pulling the data first so we can add to it. This will be much easier for Jason to do in house. If we were going to do something externally, we would be better creating an app that could properly manage the XML file. If we did it that way we could extend it's usage beyond tracking game time. Quote Link to comment Share on other sites More sharing options...
Rhedox Posted June 12, 2015 Share Posted June 12, 2015 I guess the easiest way to implement this would be to just periodically check if a specified process is running and if so start counting. The way ps4 would handle it wont work on Steam games though. The console would not await the end of the game as it doesn't really launch the game either. It'll launch Steam and stop. The actual launching then is done by Steam. Some games even make their executables launch themselves from Steam if you double click them. Implementing that batch technique in Launchbox would also require to synchronously await the end of the game and therefor blocking Launchboxes UI thread for the whole time your game is running. Thats not acceptable from a users point of view which is why having the UI always responsive is one of the main priorities of applications. Quote Link to comment Share on other sites More sharing options...
bd00 Posted June 12, 2015 Share Posted June 12, 2015 If it was going to be a script it wouldn't be batch. LB already knows when a game/emulator starts and finishes you wouldn't need a timer, just timestamps at those two points. You can use the additional apps feature (before and after) and grab the time it started (run before) and the time it finished (run after), then calculate the play time. The hardest part is getting it into the XML. Quote Link to comment Share on other sites More sharing options...
ps4isthefuture Posted June 13, 2015 Share Posted June 13, 2015 We will all have a brainstorming session with Jason when he gets back. I'm sure we can find a solution. Thank you all for helping on this, it was a request of mine back when LB was 1.something Some people don't think it's a big feature and it really isn't....but I find it cool and interesting how much a game is played or what game is played the most in one sitting... This community is great, Jason should be proud that he had a vision and it brought, and will continue bringing great people together. Also thank you Nintendo for not letting video games die and reviving the market after the crash of '83. Quote Link to comment Share on other sites More sharing options...
ps4isthefuture Posted June 13, 2015 Share Posted June 13, 2015 Rhedox said I guess the easiest way to implement this would be to just periodically check if a specified process is running and if so start counting. The way ps4 would handle it wont work on Steam games though. The console would not await the end of the game as it doesn't really launch the game either. It'll launch Steam and stop. The actual launching then is done by Steam. Some games even make their executables launch themselves from Steam if you double click them. Implementing that batch technique in Launchbox would also require to synchronously await the end of the game and therefor blocking Launchboxes UI thread for the whole time your game is running. Thats not acceptable from a users point of view which is why having the UI always responsive is one of the main priorities of applications. I knew it wouldn't be a practical way to be carried out, I was just trying to get ideas going. I'm not a programmer of any kind, I can do somethings I have taught myself over the years but really I don't know much. Unfortunately I really missed out, I grew-up in the 80's and if I had a computer then, I would have no idea where I'd be today. But I had my first computer in 2000, lol, a little late. Anyway I'm just trowing ideas around, help where I can sometimes, let the smart guys work, and on occasion can fix things they miss. Keep the ball rolling everyone and we will get there. Quote Link to comment Share on other sites More sharing options...
Jason Carr Posted June 13, 2015 Share Posted June 13, 2015 Hey guys, I'm back! Finally. ;) It's actually not overly difficult to time when an app starts and ends, for the most part, so it can be done, even with emulators. The trick is that often times, games will contain more than one EXE. For example, a launcher EXE, and an EXE for the actual game. So what can happen is that the launcher EXE is used to start the game, then fires off a new EXE for the game, and then LaunchBox will think that the game isn't running anymore, when it is. There are similar related issues as well. That said, even Steam struggles with some of these issues, but they do it anyways. So I'll put it on my list to implement it as best I can, knowing that it can't ever be 100% accurate. I think the problem games would most likely be the exceptions, but that's really just a guess as I haven't done much experimentation. I think emulated games would work, so long as you can assume that the emulator will be closed after the game is done, and a different game won't be loaded up inside the emulator. Even still, I personally find it a bit lacking, because if I pause a game, even for long periods of time, the play time is still increasing. But Steam does the same thing, I think. Quote Link to comment Share on other sites More sharing options...
bd00 Posted June 13, 2015 Share Posted June 13, 2015 How does LB determine when an game/emulator is closed, to run the (after) additional app? Quote Link to comment Share on other sites More sharing options...
SentaiBrad Posted June 13, 2015 Share Posted June 13, 2015 bd000 said How does LB determine when an game/emulator is closed, to run the (after) additional app? Process monitoring I would assume. My more pressing concern about time reading is making it as accurate to each game as possible. You launch Legend of Zelda: LttP and in RetroArch you tell it to load Mario Bros All Stars instead. So the time is off. I close down the emulator and launch it again from LB, but there are also instances when im recording that I will close LB after the game loads to conserve RAM. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.