a2-4am / 4cade

100s of games at your fingertips, as long as your fingertips are on an Apple ][
https://archive.org/details/TotalReplay
MIT License
153 stars 21 forks source link

Request export high scores from Total Replay #632

Open wyatt-wong opened 2 months ago

wyatt-wong commented 2 months ago

Request a function to export high scores from all games from a previous version of Total Replay and import to a new version of Total Replay

roughana commented 2 months ago

This would be doable with an external utility that knew the structure of the titles that have high score files. It can extract the highscore files for each title, and replace the files in the later version. I think such a tool would need to be scripted and operate on a list of known titles. This probably limits target platforms for the tool to the same set that can be used to build Total Replay. To start the ball rolling, the list of known titles must be created. I suggest creating a Google Sheet with the titles from the latest release (Games.conf) - Full name and package name will be needed. Add a column for High Score file Yes/No

wyatt-wong commented 2 months ago

Since I rebuild the 4cade source into binary from time to time, all high scores stored in the previous version of 4cade.hdv will be lost after a new build was created, so migrating high scores to the new build would be beneficial.

I don't mind to execute the script to export and import of high scores by manual.

roughana commented 2 months ago

Qkumba advises that not all games with hi score files use a .HI suffix. This will mean that the solution will need to know what the high score file is named for each game. Therefore the high score file column can be the name of the file instead of Y/N boolean. If there is no name, implies there is no high score file.

peterferrie commented 2 months ago

If you can make the list of games with high scores, I can tell you the names of the files.

On Tue, 24 Sept 2024 at 00:49, Andrew Roughan @.***> wrote:

Qkumba advises that not all games with hi score files use a .HI suffix. This will mean that the solution will need to know what the high score file is named for each game. Therefore the high score file column can be the name of the file instead of Y/N boolean. If there is no name, implies there is no high score file.

— Reply to this email directly, view it on GitHub https://github.com/a2-4am/4cade/issues/632#issuecomment-2370457111, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABWSFMZTG4RFDC7DO2EQTWDZYEKSFAVCNFSM6AAAAABOKNVNBCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNZQGQ2TOMJRGE . You are receiving this because you are subscribed to this thread.Message ID: @.***>

wyatt-wong commented 2 months ago

If you can make the list of games with high scores, I can tell you the names of the files. On Tue, 24 Sept 2024 at 00:49, Andrew Roughan @.> wrote: Qkumba advises that not all games with hi score files use a .HI suffix. This will mean that the solution will need to know what the high score file is named for each game. Therefore the high score file column can be the name of the file instead of Y/N boolean. If there is no name, implies there is no high score file. — Reply to this email directly, view it on GitHub <#632 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABWSFMZTG4RFDC7DO2EQTWDZYEKSFAVCNFSM6AAAAABOKNVNBCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNZQGQ2TOMJRGE . You are receiving this because you are subscribed to this thread.Message ID: @.>

So here is a partial list of the games:

A E Alien Ambush Alien Downpour Alien Munches Apple Invader Apple Panic Arkanoid Bandits Boulder Dash Boulder Dash II Brubble Bobble Buck Rogers: Planet of Zoom Bug Attack BurgetTime Ceiling Zero Centipede Championship Lode Runner Chip Out Choplifter County Fair Cracky Crime Wave Cross City Darkstar Unhinged David's Midnight Magic Diamond Mine Dino Eggs Dino Smurf Donkey Kong Drol Epoch Ether Quest Exterminator Falcons Federation Floppy Galaxy Gates Glutton Guntus Hadron Handy Dandy Hard Hat Mack Hardhat Hopman Hyper Head On I.O. Silver Impetus Jouster Jovian Attack Kamikaze Lady Tut Lift Lode Runner Mad Bomber Manic Miner Marauder Marble Madness Mario Bros. Mazy Micro Invaders Millennium Leaper Minotaur Montezuma's Revenge Mr. Do! Ms. Pacman Mutant Mutant (Steve Waldo) Norad Neon Neptune Neuras Neutrons Night Crawler Night Mission Pinball Oid Zobe Orbitron Osotos Outpost Pacman Paipec Panic Button Peeping Tom Pentapus Planetoids Plasmania Pooyan Quasar Repton Roadblock Robotron 2084 Ruptus Sabotage Sabotage II Sea Dragon Serpentine Short Circuit Sigma Seven Snack Attack Space Eggs Space Rescue Star Cruiser Star Maze Starblaster Succession Super Puckman Super Zaxxon Tapper Teritory Tetris The Asteroid Field The Heist The Spy Strikes Back Thunderbird GX Titan Cronus Tsunami Tunnel Terror Vindicator Viper Patrol Wall Defence Wavy Navy Xevious Yewdow Zaxxon

peterferrie commented 2 months ago

I should have been more specific: if you can make the list of games which save high scores, I can tell you the names of the files. Many in this list do not save the scores.

wyatt-wong commented 2 months ago

I should have been more specific: if you can make the list of games which save high scores, I can tell you the names of the files. Many in this list do not save the scores.

Very well then, I should also been more specific to ask you name a few games that do NOT save the high scores. I am sure you can name a few if you said "many in this list do not save the high scores"

roughana commented 1 month ago

I opened TR 5.2 image in Ciderpress and I can see a number of files with .HI suffix and several other files that seem like they may be holding score data. X:AERONAUTS.HI X:APE.ESCAPE.HI X:ARDY.HI X:BELFRY.HI X:CATSCORES X:CEST.LA.VIE.HI X:CRAZY.MAZEY.HI X:CRIME.WAVE.HI X:CYCLOTRON.HI X:DAVESCORES X:DD.DIR:DAVESCORES X:DD.RETDIR:DAVESCORES X:EGGS.IT.HI X:EXTH.DIR:EQSCORES X:FIRE.ICE.HI X:GEN.DIR:HS X:GEN2.DIR:HS X:GEN3.DIR:HS X:GEMINI.HI X:GLUTTON.HI X:HARDHAT.HI X:HIGH X:HISAVE X:HISC X:HISCORE.ARC X:HISCORE.DAT X:HISCORER X:HISCORES X:HORIZON.V.HI X:J.BIRD.HI X:KAMUNGAS.HI X:LABRYINTH.HI X:MIRV.HI X:MUTANT.HI X:NEUTRONS.HI X:NIGHTMARE.HI X:NIGHTMISSION.HI X:OID.ZONE.HI X:PENTAPUS.HI X:PIEMAN.HI X:PRE.HISCORE.ARC X:QUADRANT.HI X:ROACH.HOTEL.HI X:ROBOTICS.HI X:RODS.REVENGE.HI X:S2.DIR:SPY.STRIKES.HI X:SCORES X:SPECTRE.HI X:STAR.MAZE.HI X:STARGLIDER.HI X:TDSCORES X:TETRIS.HI X:THUNDER.HI X:TIME.TUNN.HI X:TORAX.HI X:TUBEWAY.HI X:VIPER.PATROL.HI X:XEVIOUS.HI

roughana commented 1 month ago

Sean McNamara suggested that comparing files from one to the other would potentially reduce the workload necessary (MD5 hash based?) Hash the hi score files after release and record them. During the script run, hash the users files and compare to the recorded hash to see if it is the same; if not do the extract & overwrite.

I think this could potentially be done with a website service so that people can upload their image and receive the latest version with the high score files migrated.

If the methodology has not changed for a title then all previous versions are acceptable, otherwise if the methodology has changed for a title then only later releases would be suitable. Assume for now that the methodology has not changed.

Need to confirm that this is the full list somehow? Is 55/502 in the ballpark of titles that save high scores?

roughana commented 1 month ago

Use these commands in the script for each file in the file list that needs to be overwritten. Cadius EXTRACTFILE <USER hdv_image_path> <prodos_file_path> <output_directory> Cadius DELETEFILE <TR hdv_image_path> <prodos_file_path> Cadius ADDFILE <TR hdv_image_path> <prodos_folder_path> <file_path for output directory where extracted>

peterferrie commented 1 month ago

If a game is only a single file then it won't save high scores. That will reduce the list. If the game has a ".HI" then that is the high scores. I am intentional about that. For anything else, Sean's idea is good. Play the game, get a high score, extract the files and compare them. Just "FC" is enough, no need for hashing.

roughana commented 1 month ago

If a game is only a single file then it won't save high scores. That will reduce the list.

Did you mean that single file games do not save a high score file so we need to check if they change (because scores are saved within the file), or did you mean that single file games do not need to be checked for changes? What do you mean by "FC" ?

peterferrie commented 1 month ago

Single-file games won't save high-scores. That is, any game that does not appear under the X/ directory will not save high scores. "FC" is the name of a File Compare utility in Windows. Sorry, just my shorthand suggestion. The idea is that just a quick binary compare is enough to know if something was saved.

On Tue, 1 Oct 2024 at 06:32, Andrew Roughan @.***> wrote:

If a game is only a single file then it won't save high scores. That will reduce the list. Did you mean that single file games do not save a high score file so we need to check if they change (because scores are saved within the file), or did you mean that single file games do not need to be checked for changes? What do you mean by "FC" ?

— Reply to this email directly, view it on GitHub https://github.com/a2-4am/4cade/issues/632#issuecomment-2385892001, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABWSFMZP7E64UAQXSHL5RTDZZKI7VAVCNFSM6AAAAABOKNVNBCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOBVHA4TEMBQGE . You are receiving this because you commented.Message ID: @.***>

wyatt-wong commented 1 month ago

Use these commands in the script for each file in the file list that needs to be overwritten. Cadius EXTRACTFILE <USER hdv_image_path> <prodos_file_path> <output_directory> Cadius DELETEFILE <TR hdv_image_path> <prodos_file_path> Cadius ADDFILE <TR hdv_image_path> <prodos_folder_path> <file_path for output directory where extracted>

I used the following command and found there is no filename called BURGERTIME but the game was in 4cade.hdv, I am not sure how the game was saved in 4cade.hdv.

cadius CATALOG 4cade.hdv

Furthermore, I checked the game BurgerTime do NOT persists high score on each time when 4cade.hdv was executed and like what @peterferrie said the game that does not appear under X/ directory will not save high scores. But it is interesting that I couldn't even find the name of the game in 4cade.hdv file

wyatt-wong commented 1 month ago

I found that Dino Eggs keep high scores but I do not see the DINO.EGGS.HI file

Screen1

peterferrie commented 1 month ago

Games that don't appear under X/ are inside the TOTAL.DATA file, and not referenced by name. Games under X/ that have .HI files save scores to the .HI file. So, the task is to play the games that are under X/ but which do not have .HI files. They are the ones that need to be identified as either saving high scores or not.

On Tue, 1 Oct 2024 at 09:31, Wyatt Wong @.***> wrote:

I found that Dino Eggs keep high scores but I do not see the DINO.EGGS.HI file

Screen1.png (view on web) https://github.com/user-attachments/assets/1fbf8bb5-ad80-49af-adef-4a3e40952e71

— Reply to this email directly, view it on GitHub https://github.com/a2-4am/4cade/issues/632#issuecomment-2386468834, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABWSFMZPH6N4NHHNNV3LVHDZZLE4TAVCNFSM6AAAAABOKNVNBCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOBWGQ3DQOBTGQ . You are receiving this because you were mentioned.Message ID: @.***>

peterferrie commented 1 month ago

To determine the names of the games under X/, look in GAMES.CONF. For each game with a '0' before the ',', it's under X/. They're the interesting ones. The ones with '1' before the ',' are in TOTAL.DATA and can be ignored.

On Tue, 1 Oct 2024 at 12:21, Peter Ferrie @.***> wrote:

Games that don't appear under X/ are inside the TOTAL.DATA file, and not referenced by name. Games under X/ that have .HI files save scores to the .HI file. So, the task is to play the games that are under X/ but which do not have .HI files. They are the ones that need to be identified as either saving high scores or not.

On Tue, 1 Oct 2024 at 09:31, Wyatt Wong @.***> wrote:

I found that Dino Eggs keep high scores but I do not see the DINO.EGGS.HI file

Screen1.png (view on web) https://github.com/user-attachments/assets/1fbf8bb5-ad80-49af-adef-4a3e40952e71

— Reply to this email directly, view it on GitHub https://github.com/a2-4am/4cade/issues/632#issuecomment-2386468834, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABWSFMZPH6N4NHHNNV3LVHDZZLE4TAVCNFSM6AAAAABOKNVNBCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOBWGQ3DQOBTGQ . You are receiving this because you were mentioned.Message ID: @.***>

wyatt-wong commented 1 month ago

Is there update on how to extract the high scores files manually ?

roughana commented 1 month ago

As a quick proof of concept, given these files in a folder: Total Replay v5.0.hdv Total Replay v5.2.hdv

Using these commands

MKDIR TR_HI_Extract CADIUS EXTRACTFILE "Total Replay v5.2.hdv" TOTAL.REPLAY/X/EGGS.IT.HI TR_HI_Extract CADIUS DELETEFILE "Total Replay v5.0.hdv" TOTAL.REPLAY/X/EI/EGGS.IT.HI CD TR_HI_Extract CADIUS ADDFILE ../"Total Replay v5.0.hdv" TOTAL.REPLAY/X/EI/ EGGS.IT.HI#000000

I was able to replace the high score file in TR 5.0 with the one from TR 5.2 that contained my previously recorded score.

Note that the 5.0 and 5.2 directory structures are different, so further investigation will be required to determine the full paths for 5.0 titles.

roughana commented 1 month ago

I found that Dino Eggs keep high scores but I do not see the DINO.EGGS.HI file

Try X:DINO.EGGS.J

wyatt-wong commented 1 month ago

Looks like I need to extract every file fork the 4cade.hdv file and replace those high score files to my local 4cade source tree and then I can build the new 4cad.hdv which preserve the high scores records

roughana commented 1 month ago

That is another way of achieving the outcome you want, but it depends on the build process. I know you are familiar with that, so it will work for you. Others can use Cadius like I showed above.

wyatt-wong commented 1 month ago

The build is simple, just type make. But Andrew Roughan mentioned cadius so I think o can figure out how to extract the files.But I am not sure overwriting the TOTAL DATA file will cause any impact or not.Sent from my iPhone 12 Pro MaxOn 14 Oct 2024, at 7:34 PM, Andrew Roughan @.***> wrote: That is another way of achieving the outcome you want, but it depends on the build process. I know you are familiar with that, so it will work for you. Others can use Cadius like I showed above.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

roughana commented 1 month ago

TOTAL.DATA is NOT the target. Qkumba stated above that all games in TOTAL.DATA do NOT save high scores. Only contemplate files in the X: directory!

wyatt-wong commented 1 month ago

I didn’t seem to find X.DINO.EGGS.J file in the source tree.Sent from my iPhone 12 Pro MaxOn 14 Oct 2024, at 5:45 PM, Andrew Roughan @.***> wrote:

I found that Dino Eggs keep high scores but I do not see the DINO.EGGS.HI file

Try X:DINO.EGGS.J

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

roughana commented 1 month ago

Most of the files in X: will NOT be in the source tree. They are copied from the res/dsk images.

wyatt-wong commented 1 month ago

I got totally confused between your message and Peter Ferrie.He said those that don’t have a .HI file have high scores stored in TOTAL.DATA but you are saying a different thing.The question is which message should I trust ?As none of the solution was provided, I could only explore by extracting the hi score files from a previous version of 4cad.hdv that contains hi scores and migrate them to an up-to-date 4cade source so that when I build the latest source into the binary, it will incorporate all hi scores files into the latest binary for myself.Sent from my iPhone 12 Pro MaxOn 14 Oct 2024, at 8:05 PM, Andrew Roughan @.***> wrote: Most of the files in X: will NOT be in the source tree. They are copied from the res/dsk images.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

roughana commented 1 month ago

You are certainly confused.

"Single-file games won't save high-scores. That is, any game that does not appear under the X/ directory will not save high scores." The ones with '1' before the ',' are in TOTAL.DATA and can be ignored.

Todo: https://github.com/a2-4am/4cade/issues/632#issuecomment-2386779558