Main > Main Forum

HI-SCORE: worldwide sharing & public competitions (easy way)

<< < (16/22) > >>

newmanfamilyvlogs:

--- Quote from: torino on June 10, 2011, 09:52:55 pm ---
--- Quote from: cotmm68030 on June 10, 2011, 09:19:40 am ---Like I said, if you REALLY want to do this, the ideal solution is to not modify MAME. Most ideally it should be rather transparent to users like the proposed shared drive via WebDAV.. But for the back-end....

You could probably manage to use something similar to an  SVN system to collect .hi files. Your shared .hi file is not the only singular file; it's presented on a per-client basis. When the back-end detects a write to the WebDAV share, use the .hi parsing engine from projects like HitoText to parse the scores into a database and then dynamically re-build the .hi with the current hi-scores, and write that back to the WebDAV.

Doing it this way would allow you to 'bracket' the scores on a per-user basis so that high scores are more meaningful to the individual players....

What this system does NOT provide is the ability for scores to be dynamically updated IN-GAME. You have to modify mame to do that.. but again if we're generating scores dynamically to begin with then you could make it optional on your user account to have the file updated every n-intervals and have a modified mame build that re-reads and re-patches ram at that given interval. I don't think most people care, but maybe some do. Either way with a properly designed back end it should accommodate both methods of updating.

--- End quote ---

Without embedding this in MAME we don't get "trigger events" when to make reads/writes and sync with the server and I think that's quite important advantage and very good reason to do it that way. I don't see there is any disadvantage to having special MAME build, or simply a patch, just like addition of hi-scores themselves comes as a patch. I would very much like to avoid background process doing any file access at some time intervals, especially during gameplay.


--- Quote ---I'm sure there are flaws in this system, and scenarios I've not though about. I think it's an interesting technical proposal but I don't have terribly much interest in doing it myself, nor would I be interested in participating. Either way I don't believe you can run such a system reliably on freely available services, thus being able to pay to provide the service becomes an issue, and as small as the community is, and even smaller those interested in a such a system, I just don't see it  happening.

--- End quote ---

My system, whatever that is, would surely have minimum possible flaws and be the most optimal with given resources.

--- End quote ---

Did you even read what you are quoting?

torino:
What do you mean? We generally agree and I just explained why I prefer one solution (internal) over the other (external). Is there anything else you want to add, maybe agree or disagree with something? Go ahead and tell us, I appreciate your input. Speak your mind, my friend.

torino:

Here is an easy "external" solution...

Play off-line if you like, as usual, and connect to internet only when merging hi-scores, or alternatively transfer .hi files to another computer with internet connection and do the syncing with the server from the there. The program is simple batch script (.BAT) using HiToText utility to both parse and merge hi-scores. It also does removal of duplicate entries and regulates server file access to ensure no score will be lost. I'm lazy tester but this time I did test it quite a bit and it appears it works very well. Who would think you could program this thing with DOS .BAT script, eh? Anyway, this one is hard coded for Galaga, but it's quite possible to generalize it and make it work for all the other games supported by HiToText.

SYNC.BAT *** GALAGA ONLY ***


--- Code: ---@echo off & SETLOCAL ENABLEDELAYEDEXPANSION
cls & echo Local init, server lock...
mkdir hi
rename z:\Hi-Score\galaga.hi galaga.tmp
echo. & echo File locked, downloading...
copy z:\Hi-Score\galaga.tmp hi\galaga.hi

echo. & echo Merging SERVER Hi-Scores...
FOR /f "skip=1 tokens=1,2,3 delims=|" %%A IN ('HiToText -r ../hi/galaga') do (
SET /a IsDuplicate=0
FOR /f "skip=1 tokens=1,2,3 delims=|" %%E IN ('HiToText -r ./hi/galaga') do (
if %%B==%%F (IF %%C==%%G SET /a IsDuplicate=1) )
IF !IsDuplicate!==0 HiToText -w ./hi/galaga %%A %%B "%%C"
)

echo. & echo Uploading back, unlocking...
copy hi\galaga.hi z:\Hi-Score\galaga.hi
echo. & echo  - SERVER UPDATE FINISHED - & echo.

echo. & echo Merging CLIENT Hi-Scores...
FOR /f "skip=1 tokens=1,2,3 delims=|" %%A IN ('HiToText -r ./hi/galaga') do (
SET /a IsDuplicate=0
FOR /f "skip=1 tokens=1,2,3 delims=|" %%E IN ('HiToText -r ../hi/galaga') do (
if %%B==%%F (IF %%C==%%G SET /a IsDuplicate=1) )
IF !IsDuplicate!==0 HiToText -w ../hi/galaga %%A %%B "%%C"
)

echo. & echo Cleaning up temporaries...
del z:\Hi-Score\galaga.tmp
del hi\galaga.hi & rmdir hi

--- End code ---


How it works?

1.) Rename the server file (poor man locking)
2.) Copy server file to temporary local folder
3.) Merge client scores with server scores
4.) Upload back with correct name (unlock)
5.) Merge server scores with client scores
6.) Delete temporary client and server files

severdhed:
i tried reading through this entire thread, but with all the bickering, it was tough to get through.  I set up a drop box account so i could sync hi scores between my two cabinets and my friend's cabinet. i don't need to see how much i suck compared to all of you, but i figured being able to sync these scores between these 3 cabinets would be nice.  i haven't had alot of time to test, but it seems to work ok.  i guess the only way it could be a problem is if we are both playing the same game at the same time...which probably will not happen very often. 

the other problem i see is that i have mala running as the windows shell, so drop box doesn't actually run, unless i exit mala and let explorer launch, then drop box runs and syncs the files.  i'm assuming this could be resolved by using a 3rd party utility to run dropbox as a service.   i'd love to have this working, but i am a little hesitant to have a really awesome game and set an awesome hi score, only to have it disappear because my friend was playing at the same time.

torino:

--- Quote from: severdhed on June 14, 2011, 10:42:54 pm ---I set up a drop box account so i could sync hi scores between my two cabinets and my friend's cabinet. i don't need to see how much i suck compared to all of you, but i figured being able to sync these scores between these 3 cabinets would be nice. 

--- End quote ---

I can help you make it work properly. Instead of dropbox you can use www.drivehq.com to set up shared web-folder, it's also free, but the advantage here is that only one person needs to open account and no one needs to install anything but map web folder as a network drive and from there on it's just the same as dropbox. You can use my drivehq account (see above) to try it out, there is already dkong, 1942 and galaga .hi files there.



--- Quote ---i guess the only way it could be a problem is if we are both playing the same game at the same time...which probably will not happen very often. 

--- End quote ---

That's right, as cotmm68030 pointed out, but you can sort that problem as well with HiToText utility and .BAT script.



--- Quote ---the other problem i see is that i have mala running as the windows shell, so drop box doesn't actually run, unless i exit mala and let explorer launch, then drop box runs and syncs the files.  i'm assuming this could be resolved by using a 3rd party utility to run dropbox as a service. 

--- End quote ---

You can handle all the initialization via .BAT script.



--- Quote ---i'd love to have this working, but i am a little hesitant to have a really awesome game and set an awesome hi score, only to have it disappear because my friend was playing at the same time.

--- End quote ---

Only testing will tell for sure, but as far as I tested my proposed solution works very well. I can also extend that script to make backups in case something does go wrong.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version