Jump to content
LaunchBox Community Forums

Play time?


JKeift

Recommended Posts

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.
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

Jason, Maybe this program is worth your look,Gameplay Time Tracker. There is an article here also. Gameplay time tracker pic1 Gameplay time tracker pic2 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.
Link to comment
Share on other sites

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."
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

Great work @ps4isthefuture Smile 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.
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...