Jump to content
MarkShot

[Released!] SC4 Backup Checkpoint Tool - SC4Ckpt

193 posts in this topic Last Reply

Highlighted Posts

  • Original Poster
  • Posted:
    Last Online:  
     

    All assets are now with Simtropolis.  I am expendable.  The release will go forward.

    I want to quote something I said to Cori and CB yesterday.  Thank you, all.  I had a lot of fun.  Yesterday, was the most exciting day of the project.  I hope this will improve your SC4 experience.  Also, for those not in IT, I hope this thread gave you a chance to look behind the scenes as to what programming is.  We made a decision that EVERYONE gets the source code.  We did this, since the future of our societies depend more and more on not only using computers, but understanding how they work.

    "Thank both of you for the chance to do a small project. It was very much like something I might have got assigned in my first year out of school. It was very nostalgic."

    • Like 2
    • Thanks 1

    SC4Ckpt.exe ----- Lead Programmer (okay ... yes, there was only one programmer)

    SC4Ckpt: Backup Checkpoint Tool

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    Oh, cool!  I get to be the first to report an error to the idiot who programmed this.  :)

    It looks like a STABILIZE constant will go back in as this was never seen with the 3 second stabilize; mind you this is small region with only a 560 msec zip, and I have done smaller at about 150msec, but they had STABILIZE.  And larger with a 6 second zip.

    But this is not a useless result.  One of the design considerations, was to allow STABILIZE to be a configuration value.  But the question was how can one know what is the right value?  Well, such error is a perfect guide.  For the moment, I will return STABILIZE static, before I add it to the configuration.  Another more user friendly approach might be the following.

    On INI creation we we start at 3 seconds, but every time you see an error 18 we don't error, but issue a warning that you failed to checkpoint and bump up the stabilize value by 2 seconds.  So, effectively SC4Ckpt.exe will try to dynamically find a value for you, and on a region switch we can allow you to reset it to default.  Well, I am just going to add stabilize back, and wait to see how the rest of you do before any serious code changes.

    SNAG-0000.jpg.daa8bdf43a263833556e2a87d75eb482.jpg


    SC4Ckpt.exe ----- Lead Programmer (okay ... yes, there was only one programmer)

    SC4Ckpt: Backup Checkpoint Tool

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    As long we are keeping with computer flavored thread theme.  This highlights the difference between pathetic error handling, meaningful error handling, and robust error handling.

    Pathetic:  Program blows up without providing any useful information (I am sure you have all seen this.)

    Meaningful:  Program terminates with an informative message (above)

    Robust:  Program fields the error and continues on while minimizing the impact (proposal)

    If you are driving your new Tesla and a heat mirage in Arizona makes it look like a car is out of lane, how do you want the auto-drive function to respond?  :)

    robust AKA fault tolerant


    SC4Ckpt.exe ----- Lead Programmer (okay ... yes, there was only one programmer)

    SC4Ckpt: Backup Checkpoint Tool

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    Stabilize is back.  No errors from a 15msec to 6500msec region.

    Back to my game.


    SC4Ckpt.exe ----- Lead Programmer (okay ... yes, there was only one programmer)

    SC4Ckpt: Backup Checkpoint Tool

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    I have must say from a user perspective this is a pleasure over WINZIP.  My WINZIP used to flip in and out of the game.  It was a real disturbance.  I have no doubt that it zipped faster using 6 cores, but the speed was not worth the flipping.


    SC4Ckpt.exe ----- Lead Programmer (okay ... yes, there was only one programmer)

    SC4Ckpt: Backup Checkpoint Tool

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    Ah living the life!  I have been doing lots of checkpoints.  I am not really an AUTOSAVE type, I am kind of a twitchy saver.  I've already done two recoveries:  first for NAM neighbor connections and second for NAM road/rail junction when I just tried to even up road segments properly and ended up with a bulldoze apocalypse! :) I am sure you know those.  No problems since STABILIZE went back in.  I know someone is going to ask how much is that.  ~1Gb of checkpoints, but you don't have to keep them.  You can delete them anytime.  Now with all running.  Or before tomorrow's session I could get rid of all but the last at the top left.  You manage the space between the SAVEs along with Windows Explorer; the disk belongs to you.  I think, Mr. Pakistani asked am I hiding this stuff.  Nothing is hidden.  It's all front and center.  (trying to do a NAM L2 T junction flex hook up along with rail)  I am going to get it!  I am a graduate of the HalJackey School of "If you want it, it's there for you"!

    SNAG-0001.jpg.320f10243eb62154f571be952852af55.jpg


    SC4Ckpt.exe ----- Lead Programmer (okay ... yes, there was only one programmer)

    SC4Ckpt: Backup Checkpoint Tool

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    Green light! Green light! Green light!

    For those in North America, launch will be coming late night/early AM. Or Taipei/Beijing midday on 07/05/22 local. I have not built it yet, but I would say single zip 5-6 Mb. 32 bit ANSI US English. Compatible from WINXP to WIN11. Link will be in Post #1. 


      Edited by MarkShot  

    Info
    • Like 4

    SC4Ckpt.exe ----- Lead Programmer (okay ... yes, there was only one programmer)

    SC4Ckpt: Backup Checkpoint Tool

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
    Currently: Viewing Forums Index
     
    6 hours ago, MarkShot said:

    Or before tomorrow's session I could get rid of all but the last at the top left.

    I agree with this when all is going well and the multiple zips are day's safety net to allow going back in time to fix an oops which wasn't noticed until two or more saves ago.

    From my own personal experience, it'd also be good to keep a few more zips overall from previous days. What happened to me once was I'd played my massive city for an hour or so, saved, and quit for the day.

    Then the next time in the game I was working on a different city tile so I hadn't noticed that my massive city tile had a borked save. I didn't find this out for a couple of days until I tried to reload it. In my case, I was saved by Karen's Replicator copies, but Mark's zipping method will provide a similar safety net provided you hang on to the past couple or three day's zips, but also keep one that's a week old, two weeks old, and then maybe one that's a month old.

    That will take a bit of file management on your part, but does ensure recovery is possible even if trouble isn't noticed right away.

    Then another bit of advice for very important city tiles: Use the typical method of saving the city separately (no save and exit nor save and quit), then exit to the region. Once at the region, load the city tile once more checking that it's all fine. From there exit (or quit) without saving. Had I done this for the borked save I encountered, I'd've known right away rather than a few days later.

    • Like 1
    • Yes 1

    Chance favors the prepared mind. ― Louis Pasteur  
    Remember, a few hours of trial and error can save you several minutes of looking at the README. -- I Am Devloper (on Twitter)

    Clickable ---> The Best of Cori's Posts  (scroll down a wee bit there)    Something fun: MySimtropolis - Invitation to become a SimCity 4 MySim

    Are you new here? Check out the Introduction and Guide to Simtropolis.

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    I should have been clear; although I covered my background earlier. We have multiple backups to a RAID server during the day. My wife trades. Every recorded trade is flushed to disk. Nonstop backs up the database no longer than 10 minutes when files changes. Confirmations are, of course, still available via email records. So, in my mind, I had not considered any danger.

    HARDWARE AND SOFTWARE FAILS, PEOPLE!  NEVER LET ANYONE TELL YOU COMPUTERS DONT MAKE MISTAKES.

    I remember spending one week working with Mary-Anne, our CFO, recovering the payroll XLS she lost due to a crash. The hardest part was not finding each disk block, but pretending I was not reading the contents while recovering her data. :) I am happy to say, Mary-Anne did find religion. A 5 year warranty on your drive does not cover contents; only replacement of hardware. 

    So, listen to Cori.

    • Like 3

    SC4Ckpt.exe ----- Lead Programmer (okay ... yes, there was only one programmer)

    SC4Ckpt: Backup Checkpoint Tool

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    Cori makes a good point about checking backups. Corporations often do offsite backup rotation. I can use names as they are long gone. Chemical Bank found a vault for their tapes. But they failed to consider what was on the other side of this vault. THE NYC SUBWAY  Basic electronics:  current through a conductor induces a magnetic field. Yes, all their backup tapes had been erased when they needed them. :) 

    • Like 2

    SC4Ckpt.exe ----- Lead Programmer (okay ... yes, there was only one programmer)

    SC4Ckpt: Backup Checkpoint Tool

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    Released see Post #1 for link, #2 for change log, #3 FAQ.  Read the documentation.  We did our best to the get it to professional standards.  Thank you, CB, Editor-in-Chief!

    Again, Cori and CB, thank you for contributions and giving me this opportunity.

    Post any problems or thoughts in this thread.  Thanks.

    • Like 4

    SC4Ckpt.exe ----- Lead Programmer (okay ... yes, there was only one programmer)

    SC4Ckpt: Backup Checkpoint Tool

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    Our pleasure, and we thank you Mark for your diligence and expertise in seeing this project through to completion. There were a few technical hurdles along the way which needed pondering over. To solve those and discover the most suitable implementation to benefit the community, that makes the project a true accomplishment.

    We trust SC4Ckpt will come in useful for many mayors! *:thumb:

    -CB & Cori

    • Like 1
    • Yes 2

    Quick Links

    “SimCity 4 is not just a game, but a tool driven by our own imagination and creativity.”

    Buy me a coffee

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    Some thoughts beyond immediate concerns ...

    With regards to support.  I suspect most of this community is in North America.  I am offset by almost 12 hours.  So, it is quite possible that, you may need to wait 24 hours before you get to see an issue addressed.

    The USA is one of the biggest market for games on the planet.  I was the only non-French investor in a company called AGEOD, now owned (IP and the brand) by Matrix/Slitherine.  Our first titles were for the USA market Birth of America (the Revolution) and ACW:  The Blue and The Gray (no explanation needed).  Our third title NCP (Napoleon's Campaigns) by a French company to a French market did not sell as well.  We would revisit both of those first two titles with sequels:  Wars in America and ACW2.   So, the USA is a fat chunk of the games market (I also verified that share with Matrix's former owner).  Although I know Simtropolis members are global.

    ---

    Why do I thank Cori and CB so deeply?  Well, anyone can put anything up on STEX as long as it doesn't break some basic rules.  But I came to them with a "donation" and idea of promoting their brand.  Only 1 of 20 Windows does not have "Simtropolis" in the title and we spent about 5 days on the icon for the file/programs.  We found that simply shrinking the site logo looked terrible when you put this side by side with Chrome or Firefox icons.  It was a problem of mental perception involving size, contrast, colors, and saturation.  You will notice the ST file/EXE icon is a much squatter skyline than the the Web site.

    But to work with Cori and CB was unique.  First, they did not require a resume and references (despite their brand was to go on it).  They are not fools.  They both are technology smart and street smart.  Yet, they reflected the best instincts of trust which seems to be disappearing from modern society.  I lived through the USA's Watergate crisis and Nixon's resignation and Ford's immediate pardon, before any indictments, charges, and trial.  Watergate was a low point in the social mood of the USA, but the current atmosphere is far worse.  So, to trust those who are strangers is a big deal.  Further, to allow me autonomy was also a big deal.  Yes, in Asia, one can always play the Confucian age/seniority card, but this is not American culture.

    I think I mentioned I resigned in writing 20 years of being a Matrix/Slitherine Beta last year to the president and got a written acknowledgement back.  It was no longer a place I was proud to have my name associated with.  If Simtropolis is special, I do believe that begins at the top.  They went out on a limb and reminded me not only of legacy gaming, but when game forums were kinder and civil places.  The word "community" truly meant something in a USA small town sense; not in a sense used by the mental health workers today.  Well, I think I said enough.

    • Like 4

    SC4Ckpt.exe ----- Lead Programmer (okay ... yes, there was only one programmer)

    SC4Ckpt: Backup Checkpoint Tool

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    Dear Users (in the software sense; not substance abuse),

    For those who have left messages, you are very welcome.  I would be interested in how many are now running it when they play.  I did run with AUTOSAVE set to 10 minutes, but I am such a NAM neophyte that it only actually fired once in three hours as I was manually saving constantly.  :)

    There were two aspects to the absence of alpha/beta.  From my coding generation that every bug found reflects poorly on the programmer.  My first career manager, Ellen, wrote on my first annual performance review "Mark is a computer snob."  In the response section, I replied, "Right.  Thank you."  So, there was that.  This is not to say anyone codes without bugs.  It is more about when and how those bugs are found.  I was totally open here about a very serious bug one day before the release.  So, even though we called ourselves "software engineers", it was and continues to very much be a craft.  BTW, I believe "software engineer" was coined by Margaret Hamilton.  I should note a towering figure and woman, who was project lead for the LEM software which took the USA to the Moon in 1969.  She was on the cutting edge of "mission critical coding".

    https://en.wikipedia.org/wiki/Margaret_Hamilton_(software_engineer)

    And there was one other point, I was trying to make.  This was fully developed on a single PC (about 1100 lines code).  As users, we have become way too accepting of shoddy work; and this is not simply gamers, but as a society.  Now that coding goes far beyond gaming such acceptance means that people will be injured, maybe even killed by such programming.  This is just as unacceptable as a bridge collapse.

    ---

    Myself, I am off to play some war games.  I am not a war monger, nor a pacifist either.  I enjoy war games (not 4X grand strategy) with fixed resource as like chess they are interesting problem solving exercises.  Unlike sci-fi we can test if the game well models a closed system.  Since if it does, then fully researched real world tactics should prove effective.

    I will be back, at least, once per day to check for issues at least until 2023.  I had been on the site non-stop at the beginning working with Cori on the UI (she is the only reason you folks are not suffering from Tinnitus today), and at the end working with CB on documentation (he reduced storage requirements by 60X).

    Have fun gaming!  (SC4 is an impressive work as it spans an entire generation.)

    • Like 4

    SC4Ckpt.exe ----- Lead Programmer (okay ... yes, there was only one programmer)

    SC4Ckpt: Backup Checkpoint Tool

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     
    On 6/13/2022 at 3:15 PM, MarkShot said:

    When I have something to use, I will post it here.  We are not going through the 2022 software model of releasing 50 shades of crap.  What is released will work.  What is released will be what I am on, and my private version retired (this not marketing; it will feature more seamless integration).

    The above appeared on Page #1 here.

    Well, seemingly enough have downloaded that someone should have encountered problems.  Did we achieve a zero defect software?  That cannot be said, since no bug reports does not prove their absence; only that they have yet to be found.  But I am sure you have gotten something that CTD the first time you launched it.  I've had people bring stuff to my office that did so ... they never even tested it!!!  That didn't get you put on probation, but it did get you to the bottom tier of the annual performance salary increase.  And let me tell you, HR won't fight you on that, it is going the other direction which requires lots of paperwork and a fight with HR.

    But it would be unfair to say that this simply is a cultural issue among programmers.  There are concrete factors.

    #1)  In the 1980s, Japan became an economic powerhouse (feared like China is today; I kid you not, there were books 'The Coming War with Japan').  The Japanese pioneered something called JIT (just in time) production.  Things have a carrying cost.  This is why the builder is pushing to close on a new house before it is fully done.  The builder is paying taxes and loan interest.  The builder wants to transfer that to you, even though the irrigation system hasn't gone in; as the builder can still get a CO (certificate of occupancy) from the town.  So, since I started working, there has been a squeeze on all schedules in the workplace.

    #2)  The other major factor has been the Internet.  The cost of resolving software defects that make it to the field was far more expensive in the early days.  Gamers would have to mail their diskettes back to customer service, and they postal mailed you new diskettes.  In terms of businesses, we received quarterly patch tapes that was bundled into the contracts we signed with vendors.  It is a general principle that the earlier a defect is caught, the less expensive to correct.  I had told Cori and CB, I would do the README before the code.  If I could not explain it, then it could not be coded.  To correct a few sentences is way cheaper than code.  (Now, there are strong reasons to test new technologies or mission critical components at the very start.  I would have been a fool not to test WBT's zip library, but I had already done so in other coding projects.)  The Internet has made the correction of defects simply the price of little more bandwidth; that often falls into your tier level service anyway.  Except when you have a RELEASE DAY; I am talking to you EA.

    ---

    Now, you may say this is apples and oranges.  1,100 lines versus 250,000 for a game.  But remember the size of the staff on a AAA game title, and the various disciplines involved.  It is perfectly reasonable for you as consumers to demand zero defect code (at least, in terms of fatal flaws; as game balancing is a very hard discipline). 

    When you see what is possible, then you know what is reasonable as a consumer of software.


      Edited by MarkShot  

    correction of fact
    • Like 1

    SC4Ckpt.exe ----- Lead Programmer (okay ... yes, there was only one programmer)

    SC4Ckpt: Backup Checkpoint Tool

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    Cori and CB told me that I may post again without other posters if enough time has elapsed that my post may have been read.

    I want to be very clear that I am not accusing today's generation of software designers and developers of shoddy work.  I have no doubt they are skillful and well trained.  The real question are you the consumer going to incentivize their programming culture or are their marketing departments going incentivize your consumer culture.   Will you buy pre-release games?  Will you buy release day games?  Will you allow maintenance releases to be positioned as expansion DLCs?  Will you allow the hype of reviews to sell you from Web sites that are funded by advertising revenue from game franchises?

    I admit to despite being around the block a few times, falling victim myself to this.  Part of this was being naive.  Part of this was having more money than time.

    So, there is not about the skills of today's programmers.  It is how your purchasing habits get translated into the project management practices.

    In 1995, I went from Wall Street corporate to Internet start ups.  What used to be the garment district of NYC from above ChinaTown/Little Italy, the SOHO area had become "Silicon Alley".  Many of the new firms were up on 23rd. Street.  The culture was vastly different from Wall Street.  On Wall Street, terms were thrown about like ROI (return on investment) and TCO (total cost of ownership) ... these were considerations as to whether projects got funding ... and if you were wise like Master Tarkus ("Agile Development" or what we called the "Spiral Model" was the way to play the game) as funding could always be yanked.  Better to have something than nothing to show for the investment; unless you were ready to change jobs.  That was Wall Street.

    Silicon Alley was a whole different world.  Gamers have what we call "speed runs".  Well, every Internet Project was like a "speed run".  Sloppy coding was irrelevant; speed was everything.  Because market share was out there for who got there first; meaning the VC's with the deepest pockets and fastest coders you ever saw won big.  Expense was far less relevant than Wall Street.  Why?  VC backers saw revenue (market share) as the hard part, and expense was something you could always later get under control.  A different world, and a different programming culture.

    But the bottom line:  Is the culture of game companies does not exist independent of you.  Nor do their marketing departments create your identities.  You hold a great deal of power.  You have crushed some franchises and with others created dynasties.  So, deep in the development bowels, programmers are going to be responsive to your spending habits.  It depends greatly on what you think is reasonable and acceptable.  So, I hope you got more from SC4Ckpt's rollout and this thread than just a utility for your SC4 play.  Thank for reading my rant.

    • Like 1

    SC4Ckpt.exe ----- Lead Programmer (okay ... yes, there was only one programmer)

    SC4Ckpt: Backup Checkpoint Tool

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    07/07/2022 (MarkShot):  Possible bug for minzip time.  There may be a situation that results in a value of 0 which is possible since zero is generally used as a default value.  But here 0 will always beat any actual zip value, and updates with stop.  (Either the exact case needs to be found or 0 rewritten to the INI as the magic 123456789 which will clear the bug.)  Anyone who comes across this and notes the scenario, please feel free to add more detail.  (This first was seen with Zip Code return of 18 which was fixed prior to release.)

    123456789 is a magic value, because it is the initialized value during INI creation to force a new min update, but the program recognizes to display this as zero for readability.

    Status:  Unable to reproduce.  I may have mucked with the internals to have caused this, because I sometimes do as the developer.

    ---

    If we got bugs, we will collect them for a while until we get one that compromises actual usage.  Also, feel free to put "wishes" down as well.  But please make it relevant to CONFIG, CHECKPOINT, CONDENSE, and AUTOSAVE.  These are the scope of this utility.  Thank you.


      Edited by MarkShot  

    additional info
    • Like 1
    • Thanks 1

    SC4Ckpt.exe ----- Lead Programmer (okay ... yes, there was only one programmer)

    SC4Ckpt: Backup Checkpoint Tool

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    From time to time, I run across YouTube videos like this.  I have not watched this yet.

    But there was no download link in the description.  If anyone knows of such an example with a download link (plugins too).  NOTE:  Plugins will only be used in the ethical pursuit of science; no SIMs will be harmed in the process; compression is fully reversible.  Please advise me.  We know SC4Ckpt.exe handles the smallest of new regions at 500 msec and biggest we have was around 6000 msec from CB.  I would I love to get my hands on something of the above scope.

    We still have an outstanding question which is whether the STABILIZE delay of 3 seconds (added back in) resolved all zip timing problems which resulted in Zip Error 18 (=file cannot be read).  I think successful testing with something of this magnitude will pretty much mean the current architecture is bullet proof in design.  If not we need a graceful way to re-adust the the STABILIZE value; either repeated increased by a fixed constant or scale the constant by the region size (in disk storage; not population) to approach an appropriate value for STABILIZE.  In either case, the software should work without major user intervention or comprehension.  (Yes, Error 18, might not even result in a zip failure warning, but just an adjustment of STABILIZE until the error code is zero.  So, this would be built into a loop with the exit criteria be ZipErrorCode==0.  Thus, the only perception by the user might be one SAVE of heavy disk activity; let's make Dr. Magaret Hamilton proud.  We didn't get to the Moon with "LEM Computer Aborted:  Unexpected error at altitude 50M".

    So, if you know of such a city, please do your part for science.  THANK YOU.

    BTW, this is how you can get an MINZIP of 0.  The actual time is not calculated as zipping raises an error, forcing the time to be zero.  This is really a minor coding problem, handling Zip Error 18; either preventing it or recovering from it in all cases is far more mission critical.

    * Scaling up will also need some form of scaling down consideration.  TBD

     

    • Like 1

    SC4Ckpt.exe ----- Lead Programmer (okay ... yes, there was only one programmer)

    SC4Ckpt: Backup Checkpoint Tool

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    Need Data

    Now, if only someone would drop on me the mother of all megalopolises ...

    Because I have already worked out the design of dynamic STABILIZE computation.

    Assumptions

    Scaling STABILIZE increments is pointless.  Why?  Because everyone's hardware is different.  There cannot be a correlation between region storage and test increment.

    Scaling STABILIZE should be increase by powers of 2 starting at 2 seconds.  Professor Knuth Vol 3 proved a search using the power of two yields the fastest possible answer in random distribution of single answer within the search space.

    Initialize

    STABILIZE=2

    Stability Test (Calibrate Up)

    WHILE ZipErrorCode==18;  STABILIZE=2*STABILIZE; END WHILE

    Stability Test (Calibrate Down)

    WHILE ZipErrorCode==0 and STABILIZE>2; STABILIZE=STABILIZE/2; END WHILE; STABILIZE=2*STABILIZE

    Cases

    IF CurrentRegion<>PriorRegion THEN Set Default; Calibrate up; END IF

    IF CurrentRegion==PriorRegion and Storage change > (+|-) 20% Calibrate up/down respectively

    IF CurrentRegion==PriorRegion and Storage change < (+|-) 20% Do not calibrate

    IF ZipErrorCode==18 THEN Calibrate up

    Discussion

    The value of 20% is debatable.  It is hard to see what number optimal.

    This approach is:

    * Hardware independent.

    * Uses the fastest possible search.

    * Applies heuristics such that average STABILIZE times will adjust to the minimal values over time no matter how the program is used.  (leading to optimal program response)

    * The impact of disk caches could skew the results on the very first zip.

    ---

    I wrote above mainly to demonstrate that there is a solution to a variable stability problem that involves no user involvement.  Ultimately, we don't care how complex the program is.  Success is measured by how simple the program is to use.

    • Like 2
    • Thanks 1

    SC4Ckpt.exe ----- Lead Programmer (okay ... yes, there was only one programmer)

    SC4Ckpt: Backup Checkpoint Tool

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    I made an offer to someone a few minutes ago.  If English gives you problems.  Post a screenshot or text.  I will do my best to put it into the most basic English.  You may post here or PM me.  As you wish.  Do try to install on your own first.  Thanks.


    SC4Ckpt.exe ----- Lead Programmer (okay ... yes, there was only one programmer)

    SC4Ckpt: Backup Checkpoint Tool

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    I just wanted to show you folks an alternative to how games can be checkpointed.

    SC4 is the only one using ZIPs.  This is only because a region save involves so many files.  Otherwise, the standard approach is to take a fixed name file like QUICKSAVE.SAV and rename to some thing with the date time.  Now, that could be done with an external process.  (like we are doing here)  The problem is making sure the game has completed the save.  For City Skylines, I am not renaming (checkpointing) until I can get a write lock on the file, meaning the game is done creating save.  But there is a completely alternative approach.

    You modify the behavior which is associated with the save dialogue in the game.  First, you turn that into a quick save style function.  Second, you automate the creation of the save game name, to correspond to the check point.  One of the advantages of this approach is that it eliminates the whole timing problem, since you are not touching the save file externally.  You are letting the game do it all automatically for you.  I've uploaded a sample for Cori/CB to insert here.  This is from TF2.

    Unfortunately, we did not have the option as SC4 does not prompt for save game names.  Otherwise, we could have relied on player key strokes and not the file system communication.  I basically do this with most of my games along with a few other features, but it is generally much easier than SC4 and you can have it going in about in an hour.

    Add in something like Logitech programmable keyboard and mouse.  Then, you have 25 programmable keys to play with which can call code like you see below.  Work in www.autohotkey.com, you don't even need a gamer keyboard/mouse as you can redefine anything unused to whatever you want it to.  This can get very powerful.  OFP (Operation Flash Point) was one of the best FPS' made, but its key controls are from the stone age; its enough to cause carpal tunnel syndrome at any age.  Now ARMA2/ARMA3 had a far more friendly and intuitive keyboard control.  Throw, in some programming and you can mimic a modern ergonomic interface for a program 20 years old and was one of the first military FPS on the market.  Even 20 years older I was able to play with no carpal tunnel.  What got to me was aiming as I suffer from tremors (my hands shake), but I did have a few years of fun.  If you combine programing with gaming, the sky is the limit ... you can even fix bugs in games.  Like the Gary Grigsby games don't work for multiple displays, but it can be fixed with a 15 line AHK script.  (even though the publisher says it is beyond their technical skills to attempt)
     

     


      Edited by Cyclone Boom  

    Embedded video as requested.
    • Like 3

    SC4Ckpt.exe ----- Lead Programmer (okay ... yes, there was only one programmer)

    SC4Ckpt: Backup Checkpoint Tool

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    Doing the code for something like the above is really about 20 lines versus 900 (remove white space; mean comments).  It is so trivial that I would have been ashamed to call such "a project" here.  It mainly breaks down to UI manipulation/scripting, and formation of the unique checkpoint filename.  Even the whole CONFIGURATION Module doesn't exist, since TF2 or CS is going to manage all paths; there is nothing to prompt for.

    Fortunately, I got to contribute something due to SC4's design despite being an advanced-noob when it comes to the game (if you read the type of questions I ask here, you will know).

    Communities need all kinds to be vibrant.  I was on a team for 10 years for an operational war game.  We had people with history/scholar experience he taught at the US Army War College in Kansas; artillery gunners who also understood the comms, guns, and doctrines of WWII; and systems people like myself.  One of the systems types (System Admin) use to have the game running and logging battles across all his office PCs during the evening hours.  (This was before digital currency.)  So, if you love something, there are many ways to make a contribution.  You don't need to be a civil engineer to give something to the SC4 community.  :)

    • Like 2

    SC4Ckpt.exe ----- Lead Programmer (okay ... yes, there was only one programmer)

    SC4Ckpt: Backup Checkpoint Tool

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    Slowly our usage is growing. Still no bugs reported or questions. I am pleased. Since I know some saw the lack of Alpha or Beta as pompous and arrogant. In reality, every project should strive for this. Like every thing there is a technique to how it is done. 

    I recently acquired an interesting old program. It is so close to the days of DOS. It uses save slots. Unlike a City Skylines which supports infinite saves. Slots limit the file system by only providing so many saves in the UI. Ultimately, it is not that hard to make such a system do quick save time checkpoints and handle slots. 

    I will publish some sample code later. In case, you want to take on such a change to a game. Many early tycoon games had this approach. I would predict there was player overlap between the tycoon, SIMx, and city genre. It all comes down to understanding a basic computer science concept called a CYCLIC BUFFER. Just like any human language, you can teach yourself to program. As Cori says, ‘it only takes a desire to tinker’. I have seen her code she is a very talented tinkerer. Schools certification is necessary to get you in the door for a job.  But tinkering is fine if you want better games. In fact, I taught a 10 year old girl to code VB. Her first language was not even English, but Chinese.  

    So, don’t let code get in between you and your game fun. 

    • Like 2

    SC4Ckpt.exe ----- Lead Programmer (okay ... yes, there was only one programmer)

    SC4Ckpt: Backup Checkpoint Tool

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    Here is a game with save slots.  NOTE:  The save is already well checkpointed as it has the game date/time and the system date/time.  There are 49 such slots with the slot determined by filename.

    save???.bob

    62d23c244c06c_20220716121002.jpg.e289a02025c05cdeddeefcc05299c56f.jpg

    62d23c3e22b5f_20220716121328.jpg.3ed1f01ecca8508d222abe9c81bc2b67.jpg

    So, how do we turn this into a single key checkpoint?

    First, we assume that SLOT #1 will be treated at QUICKSAVE.

    They look like this on the disk.  SLOT #1 is always moved to the open SLOT #N.

    SNAG-0000.jpg.b8773259d107f5d01b84689bc392cd02.jpg

    Next, we write a keystroke/mouse script which always saves to SLOT #1.  With a single key press.

    Quicksave.ahk compiled to exe.  This may look complex, but it is really easy.  All I am doing is capturing the mouse x,y positions which I must click while running the game, and putting them into a script with delays to replay.  I could show you how to do this in 5 minutes.  The only trick is that all Xs must have 1920 pixels added as the game display is the right display.

      !q::
        MouseGetPos, OutputVarX, OutputVarY,
        Send ^s
        Sleep, 10000
        MouseMove,1960,299,0,
        Click
        Sleep, 3000
        MouseMove,1960,680,0,
        Click
        Sleep, 3000
        MouseMove, %OutputVarX%+1920, %OutputVarY%,
        Sleep, 1000
        Send {Escape Down}
        Sleep, 1000
        Send {Escape Up}
      Return

    Now I have other code just running as a script in WBT every second waking.  Whenever it find the QUICKSAVE, save001.bob, it moves it to the next free slot.  That's why you see all the other slots full.  When the slot used is #49, then the next slot is set to #2, and they being to overwrite.  The code looks like this.

              If FileExist(QuickSave1) Then
                RunWait(Delay250, "")
                FileHandle=FileOpen(QuickSave1, "APPEND", @TRUE, 60); stabilize
                RunWait(Delay250, "")
                FileClose(FileHandle)
                Slot=IniReadPvt("Wrapping", "Pointer1", "*UNDEFINED*", WITAINI)
                TargetFile=StrFixLeft(Slot, "0", 3)
                TargetFile=StrCat(GameSaveDir1, "save", TargetFile, ".bob")
                If FileExist(TargetFile) Then
                  FileDelete(TargetFile)
                End If
                FileRename(QuickSave1, TargetFile)
                If Slot==49 Then
                  Slot=2
                Else
                  Slot=Slot+1
                End If

                IniWritePvt("Wrapping", "Pointer1", Slot, WITAINI)
              End If

    Notice that we either advance to the next slot or go back to SLOT #2.  Finally, as we want it to work in between runs of the game, we always read/write our next slot to use to an INI file.  Thus, it gets remembered.

                Slot=IniReadPvt("Wrapping", "Pointer1", "*UNDEFINED*", WITAINI)
                IniWritePvt("Wrapping", "Pointer1", Slot, WITAINI)
     

    The script always starts by asking are you starting a fresh game?  If yes, we reset the slots, and do a wildcard delete of saves.

    ; ----- Reset Saves Cycle -----

            Notice=""
            Notice=Strcat(Notice, "YES:  Continue the quick save cycle.", @CR, @CR)
            Notice=Strcat(Notice, "NO:  Reset the quick save cycle.  ERASE!!!", @CR, @CR)
            Notice=Strcat(Notice, "CANCEL:  Immediately halt.", @CR, @CR)
            Beep
            UserResponse=AskYesNo('EDBTR Quick Saves', Notice)
            If UserResponse==@Yes Then
              Goto NoSaveReset
            EndIf
            If UserResponse==@No Then
              FileCopy(WITAINIReset, WITAINI, @FALSE)
              FileDelete(SaveTemplate1)
              FileDelete(SaveTemplate2)
            End If
            :NoSaveReset

    Well, this illustrates how to get a CHECKPOINT QUICKSAVE with older DOS and early Windows programs.  The group of save slots are used as a CYCLIC BUFFER.  BUFFER means to retain something in computer speak.  CYCLIC means that we reuse the oldest location in computer speak.  So, we write from start to end, and then jump back to the start.  We could dispense with the INI by using calculation, but the INI is simpler and more clear.

    Another example of how games can enhanced, and it does not need a PhD.  You just need to be a tinkerer like Cori.  Before I wrote SC4Ckpt.exe, Cori already had something she had coauthored in as BAT file, but they did not like the idea of BAT files being distributed and that the paths are hard code and not prompted.  (Mine are too in this; as it is just for my own use.)

    • Like 2

    SC4Ckpt.exe ----- Lead Programmer (okay ... yes, there was only one programmer)

    SC4Ckpt: Backup Checkpoint Tool

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    I am not regularly following posts.  But if you have a tech problem, the admins know how to reach me directly for tech support, and have instructions to do so.

    I am not sure if the project was a success.  Cori and CB said 100 downloads was the threshold.  To be hit soon.  Versus, the number of views, the conversion rate is below even 1% ... that is extremely low.

    On the other hand, I have rarely released gaming software, but am better known for thousands of pages of guides:  Air combat dog fighting, operational ground combat, and rail/business games (I am of the pre YouTube/Twitch generation).  But even with 50-100 users, I take it as a win to release something which was solely developed and released with not a single bug report; very rare these days.

    I hope for those who use it that it has improved your SC4 experience.  Although I plan to remain on WIN10 ... when the time finally comes to abandon WIN10, we will be going to LINUX.  Windows has ceased to be a tool, but rather a data aggregator and marketing facility.  However, I don't anticipate any problems with the utility under WIN11.  There is simply that general trend that small independent developers are being squeezed out of the development space versus large corporate entities that can get SECURE BOOT certificates from Microsoft.  (SECURE BOOT in principal is a good idea.  But the wolf has been left guarding the hen house.)

    Happy, SC4, everyone!

    • Thanks 3

    SC4Ckpt.exe ----- Lead Programmer (okay ... yes, there was only one programmer)

    SC4Ckpt: Backup Checkpoint Tool

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    6 minutes ago, MarkShot said:

    I am not regularly following posts.  But if you have a tech problem, the admins know how to reach me directly for tech support, and have instructions to do so.

    I am not sure if the project was a success.  Cori and CB said 100 downloads was the threshold.  To be hit soon.  Versus, the number of views, the conversion rate is below even 1% ... that is extremely low.

    On the other hand, I have rarely released gaming software, but am better known for thousands of pages of guides:  Air combat dog fighting, operational ground combat, and rail/business games (I am of the pre YouTube/Twitch generation).  But even with 50-100 users, I take it as a win to release something which was solely developed and released with not a single bug report; very rare these days.

    I have not had time to play SC4 for the past few months due to RL things, but I look forward to trying this out!

    6 minutes ago, MarkShot said:

    I hope for those who use it that it has improved your SC4 experience.  Although I plan to remain on WIN10 ... when the time finally comes to abandon WIN10, we will be going to LINUX.  Windows has ceased to be a tool, but rather a data aggregator and marketing facility.  However, I don't anticipate any problems with the utility under WIN11.  There is simply that general trend that small independent developers are being squeezed our the development space versus large corporate entities that can get SECURE BOOT certificates from Microsoft.  (SECURE BOOT in principal is a good idea.  But the wolf has been left guarding the hen house.)

    I'm still using Windows 7 :lol: and I'm happy with it. It's the latest (and last) Microsoft operating system that I will ever install on my personal devices. Which is fine by me - I prefer Linux anyways! Linux Mint and GalliumOS are my daily drivers.

    6 minutes ago, MarkShot said:

    Happy, SC4, everyone!

    You too! :thumb:

    • Like 3

    Once you play with NAM installed, one simply cannot go back!

    I'm waiting for the day when someone makes a Faber College lot for SimCity 4  :lol:

    IMG_3716.jpg.7fe0b78e164e258bac5afb32dc9f9588.jpg

     

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     
    On 9/2/2022 at 12:41 PM, TogaMasterJohn said:

    I have not had time to play SC4 for the past few months due to RL things, but I look forward to trying this out!

    I'm still using Windows 7 :lol: and I'm happy with it. It's the latest (and last) Microsoft operating system that I will ever install on my personal devices. Which is fine by me - I prefer Linux anyways! Linux Mint and GalliumOS are my daily drivers.

    You too! :thumb:

    We are on Win10 Pro 64; Builds 20H2 and 21H2.  I have a utility which can permanently shut down WU and I did so at 20H2.  But my wife just a got a new ASUS notebook for traveling and a replacement for 13 year old Media PC (drives her 63" 1080p TV).  ASUS put the Windows based hardware control panel in the ******!!! Microsoft Store, and I could not get the control panel without running WU.  Thus, her laptop ended up on Build 21H2.

    Here is the reason why I locked down WU.

    I found both WinXP Pro 32bit and Win7 Pro 32/64bit to be excellent and stable.  But it was very clear around the end of life cycle with WU, each became highly unstable (locks ups, graphic corruption, and blue screen of death).  I don't think this was accidental, I believe this was planned obsolescence to force upgrades to the next Windows.  So, I have locked WU before the cycle repeats itself.

    ---

    Many years ago, I ran a Quad Boot System.  WIN95/OS2/WINNT/LINUX ... OS/2 was at that time a far better OS than WIN95-98 and WINNT, but Microsoft had outmaneuver IBM and OS/2 would eventually be abandoned.  As for LINUX, I was really impressed; both powerful command line (remember I came from commercial computing) and XStation GUI.  I had a high end PC at the time, and an add-on board with serial ports could have powered a department or small office.

    ---

    For now, I am getting good game performance on a high end OC'd machine from 2015 an i7 @ 4.3GHz.  I am waiting for the i12 to hit 6.5GHz with Intel's Max Turbo Boost 3.0.  The last chip release on the i12 went from 5.2 -> 5.5GHz.  I will build a machine with OCing cooling and mobo, but I think, I prefer to stay in parameters and consider the OC as future proofing.  (Continuous heat output in the Summer here is a real problem with ACs sized base on historic weather.)  So, I figure if there is major economic downturn ... luxury items like gaming PCs will come down further.  Maybe a good time to buy.  Either this PC or the next will be my last; I think.  I am already done with new game titles.  So, a boost on existing titles should perfectly cap my gaming career.

    • Like 1
    • Thanks 1

    SC4Ckpt.exe ----- Lead Programmer (okay ... yes, there was only one programmer)

    SC4Ckpt: Backup Checkpoint Tool

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    Dear All,

    I see we are at about 120 users.  As long as someone finds it useful ...

    A reminder ... tech support and enhancement discussion was committed to for the calendar year of 2022.  We are now in Q4.

    Myself ... I have not been around much.  I am at heart a wargamer, but was taking a break with CS and SC4 kind of disgusted with the state of the world.  But it dawned on me playing war games is not being a war monger.  Being a war monger is being a war monger; playing an F1 simulator does not make me a reckless driver.

    I am once again back to my primary hobby.

    I hope this utility has helped you to enjoy yours and provided insight into programming development, and to those who are in the field ... part of the mindset of 70s/80s systems design --- zero defect development.

    • Like 1
    • Thanks 2

    SC4Ckpt.exe ----- Lead Programmer (okay ... yes, there was only one programmer)

    SC4Ckpt: Backup Checkpoint Tool

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    We've had our first bug report.  It is very rare situation that is most likely not to occur with consumer PCs, but more in office server environments.  I plan to produce a work around (it's only a single line of code) to resolve the issue.  As this is not really an evolutionary release or even a branch/fork, I have logged a question with CB how to make this available for future down loaders if it should occur again.

    ---

    In other news, I am about the repurpose all the effort that was put into this for something I am playing.  Silent Hunter 3  (WWII German Uboats) uses a save structure which is very similar to SC4.  Meaning it contains an unlimited number of directories and files in those directories.  I want to introduce check pointing and this code will be repurposed without all the bells and whistles which were produced here.  Why checkpoint a game that generates more than a single save?  The game has a history of load crashes and being very touchy.  But loading an older save deletes all later saves (you can easily trip over you own attempts to recover).  By checkpointing, the save (career) directories all saves will always be recoverable when trying to get a career loaded.  I doubt I would have coded this, but as I have the whole frame work.  Why not?

    ---

    I will let you know how CB wants to handle work around files.  But rest assured it is uncommon situation unless you are playing SC4 at the office.  Hmm...  we will assume it is your business and you design isometric cities as a consulting firm.  As we all know, isometric cities have a smaller carbon footprint than full 3D cities.  :)

    PS:  Mr. NOS the work arounds will be uploaded with EXE and source code; even though it is a single line work around.  The problem cannot be coded for as the WBT security DLLs are from the Windows XP days.

    • Like 1
    • Thanks 2

    SC4Ckpt.exe ----- Lead Programmer (okay ... yes, there was only one programmer)

    SC4Ckpt: Backup Checkpoint Tool

    Share this post


    Link to post
    Share on other sites

    Sign In or register to comment...

    To comment in reply, you must be a community member

    Sign In  

    Already have an account? Sign in here.

    Sign In Now

    Create an Account  

    Sign up to join our friendly community. It's easy!  

    Register a New Account


    ×

    Thank You for the Continued Support!

    Simtropolis depends on donations to fund site maintenance costs.
    Without your support, we just would not be in our 24th year online!  You really help make this a great community. *:thumb:

    But we still need your support to stay online. If you're able to, please consider a donation to help us stay up and running. This helps sustain a platform where we can share our community creations for years to come.

    Make a Donation, Get a Gift!

    Expand your city with the best from the Simtropolis Exchange.
    Make a Donation and get one or all three discs today!

    STEX Collections

    By way of a "Thank You" gift, we'd like to send you our STEX Collector's DVD. It's some of the best buildings, lots, maps and mods collected for you over the years. Check out the STEX Collections for more info.

    Each donation helps keep Simtropolis online, open and free!

    Thank you for reading and enjoy the site!

    More About STEX Collections