├── .gitignore ├── LICENSE ├── README.md ├── sat_py_icon.png ├── sav_cli.py ├── sav_data_free.py ├── sav_data_mercerSphere.py ├── sav_data_slug.py ├── sav_data_somersloop.py ├── sav_monitor.py ├── sav_parse.py ├── sav_stack_sizes.json ├── sav_to_html.py └── sav_to_resave.py /.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore pyc cache files 2 | /__pycache__ 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Satisfactory Save Parser 2 | 3 | Copyright (c) 2024 [GreyHak](https://github.com/GreyHak) 4 | 5 | A set of Python tools for parsing Satisfactory save files, and then displaying 6 | and manipulating the contents. 7 | 8 | [Satisfactory](https://www.satisfactorygame.com/) is a non-competitive, 9 | first-person, open-world, factory-building and exploration game produced by 10 | [Coffee Stain Studios](https://www.coffeestain.com/). 11 | 12 | ## sav_parse.py 13 | 14 | `sav_parse.py` will decode the save file. It can be used as either a library 15 | or a program. 16 | 17 | When used as a library, call `sav_parse.readFullSaveFile()` to 18 | parse the entire save file, or `sav_parse.readSaveFileInfo()` to 19 | parse just the header information. 20 | 21 | When used as a program, from the command line call `py sav_parse.py ` 22 | to generate a text file representation of the save file. 23 | 24 | ## sav_to_resave.py 25 | 26 | `sav_to_resave.py` will create a save file based on the data producted by 27 | `sav_parse.py` or a manipulated varient of that data. The interface is 28 | `sav_to_resave.saveFile(saveFileInfo, headhex, grids, levels, extraObjectReferenceList, outFilename)` 29 | where the first five parameters are the variables that `sav_parse.readSaveFileInfo` 30 | returns. 31 | 32 | ## sav_cli.py 33 | 34 | `sav_cli.py` makes use of `sav_parse.py` and `sav_to_resave.py` to either 35 | provide specific information from the save file or change data in a save file. 36 | 37 | Usage: 38 | - `py sav_cli.py --help` 39 | - `py sav_cli.py --info ` 40 | - `py sav_cli.py --to-json ` 41 | - `py sav_cli.py --from-json ` 42 | - `py sav_cli.py --set-session-name ` 43 | - `py sav_cli.py --find-free-stuff [item] [save-filename]` 44 | - `py sav_cli.py --list-players ` 45 | - `py sav_cli.py --list-player-inventory ` 46 | - `py sav_cli.py --export-player-inventory ` 47 | - `py sav_cli.py --import-player-inventory [--same-time]` 48 | - `py sav_cli.py --tweak-player-inventory [--same-time]` 49 | - `py sav_cli.py --rotate-foundations [--same-time]` 50 | - `py sav_cli.py --clear-fog [--same-time]` 51 | - `py sav_cli.py --export-hotbar ` 52 | - `py sav_cli.py --import-hotbar [--same-time]` 53 | - `py sav_cli.py --change-num-inventory-slots [--same-time]` 54 | - `py sav_cli.py --restore-somersloops [--same-time]` 55 | - `py sav_cli.py --restore-mercer-spheres [--same-time]` 56 | - `py sav_cli.py --export-somersloops ` 57 | - `py sav_cli.py --export-mercer-spheres ` 58 | - `py sav_cli.py --import-somersloops [--same-time]` 59 | - `py sav_cli.py --import-mercer-spheres [--same-time]` 60 | - `py sav_cli.py --remember-username ` 61 | - `py sav_cli.py --list-vehicle-paths ` 62 | - `py sav_cli.py --export-vehicle-path ` 63 | - `py sav_cli.py --import-vehicle-path [--same-time]` 64 | - `py sav_cli.py --blueprint --show ` 65 | - `py sav_cli.py --blueprint --sort [--same-time]` 66 | - `py sav_cli.py --blueprint --export ` 67 | - `py sav_cli.py --blueprint --import [--same-time]` 68 | - `py sav_cli.py --blueprint --add-category [--same-time]` 69 | - `py sav_cli.py --blueprint --add-subcategory [--same-time]` 70 | - `py sav_cli.py --blueprint --add-blueprint [--same-time]` 71 | - `py sav_cli.py --blueprint --remove-category [--same-time]` 72 | - `py sav_cli.py --blueprint --remove-subcategory [--same-time]` 73 | - `py sav_cli.py --blueprint --remove-blueprint [--same-time]` 74 | - `py sav_cli.py --blueprint --move-blueprint [--same-time]` 75 | - `py sav_cli.py --blueprint --reset [--same-time]` 76 | - `py sav_cli.py --resave-only ` 77 | 78 | If `--find-free-stuff` is used inconjunction with `sav_to_html.py` and a blank 79 | map, it will generate a map of all the locations for the specified item. 80 | 81 | With v1.0.0.4 release, there isn't much point to the `--blueprint --sort` 82 | operation since the game's reverse-sorting is performed on save-open time. 83 | 84 | ## sav_to_html.py 85 | 86 | `sav_to_html.py` can be used as either a library or a program. 87 | 88 | Command line: `py sav_to_html.py [output-html-file]` 89 | 90 | Library: `sav_to_html.generateHTML(str savFilePath, str outputDirectory, str htmlBaseName)` 91 | 92 | `sav_to_html.py` makes use of `sav_parse.py` to decode a save file and creates 93 | a save.html. The HTML page contains: 94 | - Session Name 95 | - Save Date 96 | - Play Time 97 | - Game Phase 98 | - Active Milestone 99 | - Mined Resource Count 100 | - Collected Power Slugs, Somersloops, and Mercer Sphere Counts 101 | - Unopened, Looted, and Opened/Unlooted Hard Drive Counts 102 | - Unlock Progress Counts 103 | - Sink Point Progress 104 | - Dimensional Depot Contains: List by item with quantity and percent full 105 | - Currently Built Items: List of items by quantity 106 | 107 | When a blank map, included in the release as `blank_map20.png`, 108 | is provided, this script also creates maps of: 109 | - The location of all the remaining power slugs. 110 | - The location of all the remaining somersloops. 111 | - The location of all the remaining mercer spheres. 112 | - The location of all the hard drives including which are opened, looted and 113 | opened/unlooted. 114 | - The power grid. 115 | - The resource nodes including their type, locations, purity, and usage. 116 | 117 | ## sav_monitor.py 118 | 119 | Usage: `py sav_monitor.py [save-directory] [html-output-directory] [monitor-period] [archive-directory]` 120 | 121 | `sav_monitor.py` will check for new save files, generate html/png summary of 122 | new save files, and optionally archive the save files. 123 | 124 | ## Credits 125 | 126 | The source code in this repo was developed by [GreyHak](https://github.com/GreyHak). 127 | 128 | Source code credit for the the quaternion/euler rotation conversions used by 129 | `sav_cli.py` goes to [**Addison Sears-Collins**](https://automaticaddison.com). 130 | 131 | Thanks go to **[AnthorNet](https://github.com/AnthorNet)** of [Satisfactory 132 | Calculator Interactive Map](https://satisfactory-calculator.com/en/interactive-map) 133 | fame. 134 | * The map used by `sav_to_html.py` is a modified version of the map extracted 135 | from Anthor's Interactive Map. 136 | * Resource purities, available in the `sav_parse.py` RESOURCE_PURITY variable, 137 | used by `sav_to_html.py`, were extracted from Anthor's Interactive Map. 138 | * Anthor's [pre-Update-8 JavaScript code](https://github.com/AnthorNet/SC-InteractiveMap/blob/dev/src/SaveParser/Read.js) 139 | was used as a reference. 140 | * Anthor's Interactive Map was also a great test tool to verify the save files 141 | produced by `sav_to_resave.py` and `sav_cli.py`. 142 | 143 | Thanks go to the Wiki authors who documented the old, but still very helpful, 144 | v0.6.1.3 version of the save file format at 145 | [Satisfactory GG Wiki Save Files](https://satisfactory.wiki.gg/wiki/Save_files#Save_file_format). 146 | I updated the Satisfactory GG Wiki for v1.0.0.4 based on the information I 147 | gained during creation of this tools. 148 | 149 | Thanks to 150 | [robison4th](https://github.com/robison4th), 151 | [JP Eagles and Katz](https://www.youtube.com/channel/UCgIwAJga0I6i68bWfwPdj1w), 152 | [Buggy](https://github.com/Buggy123), 153 | [Tomtores](https://github.com/Tomtores), 154 | [Mattigins](https://steamcommunity.com/profiles/76561198081088435), and 155 | [TheRealBeef](https://github.com/TheRealBeef) 156 | for sharing their save files to allow for expanded support. 157 | 158 | ## License 159 | 160 | This program is free software: you can redistribute it and/or modify 161 | it under the terms of the GNU General Public License as published by 162 | the Free Software Foundation, version 3. 163 | 164 | This program is distributed in the hope that it will be useful, but 165 | WITHOUT ANY WARRANTY; without even the implied warranty of 166 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 167 | General Public License for more details. 168 | 169 | You should have received a copy of the GNU General Public License 170 | along with this program. If not, see . 171 | -------------------------------------------------------------------------------- /sat_py_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreyHak/sat_sav_parse/78ac19594f1b46181a3b49bf0b443dec188d546a/sat_py_icon.png -------------------------------------------------------------------------------- /sav_data_somersloop.py: -------------------------------------------------------------------------------- 1 | # Exported from Satisfactory v1.0.0.3 2 | SOMERSLOOPS = { 3 | "Persistent_Level:PersistentLevel.BP_WAT110": ("9ZI97U85BHEMNEFSBAN8Q97HH", (-0.3479424715042114, -0.10763715952634811, -0.8222628235816956, 0.43730318546295166), (-25118.654296875, 267763.21875, -11490.32421875)), 4 | "Persistent_Level:PersistentLevel.BP_WAT11_1": ("6U6NNE5ECR2K71GNEDVZT12MT", (-0.0523388497531414, 0.029073888435959816, -0.11894277483224869, 0.9910943508148193), (-50928.3984375, 220008.609375, -3797.963134765625)), 5 | "Persistent_Level:PersistentLevel.BP_WAT13_3": ("661ZB7NBHJOV13FDKD7MLR8Y6", (-0.005528105888515711, 0.02266363799571991, -0.7909018397331238, 0.611498236656189), (-62127.30859375, 278743.09375, -800.6700439453125)), 6 | "Persistent_Level:PersistentLevel.BP_WAT19": ("5C4P2CT99FG4VOK0CKXE8GPV3", (0.014382581226527691, 0.027021614834666252, -0.8956738710403442, 0.4436567425727844), (-68180.8203125, 304184.5, -6019.46630859375)), 7 | "Persistent_Level:PersistentLevel.BP_WAT138": ("C5UNUIWQ1BGSGG9Y27426O9SN", (0.0, -0.0, 0.7175645232200623, 0.6964920163154602), (-112842.7734375, 200646.296875, 6687.0185546875)), 8 | "Persistent_Level:PersistentLevel.BP_WAT1_C_UAID_04421A9713F05F6901_1130070767": ("8GXUIQI242HY1FZA903L8CM7L", (0.0, 0.0, 0.0, 1.0), (-233103.0, 102345.0, -14.0)), 9 | "Persistent_Level:PersistentLevel.BP_WAT133": ("3QPH2QP37DJE7FL4IKZYY947L", (0.023111553862690926, -0.016132019460201263, -0.49836796522140503, 0.866507351398468), (-263369.125, -42597.73046875, 2114.7236328125)), 10 | "Persistent_Level:PersistentLevel.BP_WAT16": ("D95KDVDT5GFOHZE1OHCW48SFW", (-0.013735612854361534, -0.012449233792722225, 0.7408238053321838, 0.6714435815811157), (-232489.4375, -181844.296875, 5384.951171875)), 11 | "Persistent_Level:PersistentLevel.BP_WAT24": ("655A7IUW5FHON6N4WEQIT2BPM", (0.0, 0.0, 0.0, 1.0), (-230181.9375, -113829.390625, -660.75244140625)), 12 | "Persistent_Level:PersistentLevel.BP_WAT147": ("2IKT546XO9TX3096D92RH72KG", (-0.5081272125244141, 0.4780346751213074, -0.5210314989089966, 0.49174764752388), (-228736.453125, 48227.64453125, 14435.0595703125)), 13 | "Persistent_Level:PersistentLevel.BP_WAT1_C_UAID_04421A9713F022A401_1406932331": ("9A559UZQCLMBH0WVQU22ETSCY", (0.0, -0.02801019512116909, 0.0, 0.9996076226234436), (-139509.0, 139430.0, 15453.0)), 14 | "Persistent_Level:PersistentLevel.BP_WAT1_C_UAID_04421A9713F024A401_1924847685": ("2JNBDBX51W78PE3RP6RKVN24S", (-0.0, 0.0768161341547966, 0.0, 0.9970452785491943), (-154838.0, 91683.0, 21293.0)), 15 | "Persistent_Level:PersistentLevel.BP_WAT1_C_UAID_04421A9713F023A401_1359406508": ("AYGLQNU3ZR1Q1G7GMTNXOP87R", (0.42939281463623047, -0.4712642729282379, 0.4884137809276581, 0.5958051681518555), (-168309.6875, 63731.40625, 11052.7236328125)), 16 | "Persistent_Level:PersistentLevel.BP_WAT12_25": ("9T3US14CYWS7B8323CIT374LW", (0.0, -0.0, 0.2462000846862793, 0.9692190289497375), (-164980.90625, 40623.203125, 17845.29296875)), 17 | "Persistent_Level:PersistentLevel.BP_WAT17_30": ("1KT8ZTFVIXKFKMYRZ1IK5ZZTZ", (0.05621178075671196, -0.10993634909391403, 0.6356911063194275, 0.7620046138763428), (-164657.0, 21770.310546875, 21901.20703125)), 18 | "Persistent_Level:PersistentLevel.BP_WAT1_C_UAID_04421A9713F0C46101_1282102099": ("9OWXU7JD01UOUBNJUXYAKLM0W", (0.0, 0.0, 0.0, 1.0), (-158423.0, -55812.0, 954.0)), 19 | "Persistent_Level:PersistentLevel.BP_WAT15": ("3R376PHWWS8YKBRQ91PCVT4CE", (0.014694592915475368, -0.031430672854185104, 0.3403100371360779, 0.9396729469299316), (-150618.796875, -105222.34375, -2841.48681640625)), 20 | "Persistent_Level:PersistentLevel.BP_WAT13": ("5T2A90MFJW7DPVKJB0C2ZZMNG", (-0.11712288856506348, 0.22660349309444427, 0.30315202474594116, 0.9181677103042603), (-142453.0, -154271.890625, -1739.7607421875)), 21 | "Persistent_Level:PersistentLevel.BP_WAT5_2": ("C72BVQAMZTS0KG90R1PCSMQ9T", (-0.0168302059173584, -0.15446893870830536, -0.33891868591308594, 0.9278956055641174), (-78714.9765625, -190868.140625, 17541.232421875)), 22 | "Persistent_Level:PersistentLevel.BP_WAT7_3": ("78WOWCKRH48OGNK8WKKW5BSXI", (0.0386299304664135, -0.09291507303714752, 0.9739144444465637, 0.2033843845129013), (-75146.59375, -112862.8515625, 6096.64501953125)), 23 | "Persistent_Level:PersistentLevel.BP_WAT134": ("9PHBR4CXSLSCO69QLQUB48PH6", (-0.10275480151176453, -0.034271240234375, 0.6027470231056213, 0.7905460000038147), (-98596.734375, -72561.75, 7321.37646484375)), 24 | "Persistent_Level:PersistentLevel.BP_WAT19_39": ("07L1K4YHHUECRA3UK0QSMBGWD", (-0.04366800934076309, 0.02370844967663288, 0.4765484631061554, 0.8777428865432739), (-106650.2578125, -1537.1640625, 24246.947265625)), 25 | "Persistent_Level:PersistentLevel.BP_WAT137": ("9035PN0WV6AX27513QZLUU3T2", (0.011655771173536777, -0.22607456147670746, 0.5891585946083069, 0.7756587862968445), (-128378.703125, 73566.5078125, 4949.65087890625)), 26 | "Persistent_Level:PersistentLevel.BP_WAT18": ("40YUL6RFY0JT0NJGTQRSXJPRD", (-0.07875370234251022, -0.07920703291893005, 0.45780378580093384, 0.882008969783783), (-95236.96875, 184737.703125, 2787.7216796875)), 27 | "Persistent_Level:PersistentLevel.BP_WAT25_382": ("EBLW1W32WZXFGXW81BCL99R3I", (-0.0, 0.0, -0.7985123991966248, 0.6019783616065979), (-57955.10546875, 128067.7421875, 5069.8251953125)), 28 | "Persistent_Level:PersistentLevel.BP_WAT11_35": ("8N2VMA5OF6AFNVOK7EXFVL8AM", (-0.006806611083447933, -0.025986988097429276, 0.2532851994037628, 0.9670186042785645), (-29456.3359375, 81319.953125, 21328.41796875)), 29 | "Persistent_Level:PersistentLevel.BP_WAT110_47": ("480500QTXQZ43TVF4H7651HK9", (0.04718475416302681, -0.0892285481095314, 0.49518099427223206, 0.8629065155982971), (-44104.06640625, 31121.75, 23611.197265625)), 30 | "Persistent_Level:PersistentLevel.BP_WAT13_5": ("78LIX115PUIWUPGZJX0KA4SBG", (0.0023838914930820465, -0.02667524293065071, -0.08898051828145981, 0.9956732392311096), (-68106.75, 15570.2421875, 22881.126953125)), 31 | "Persistent_Level:PersistentLevel.BP_WAT15_13": ("BZFSOMYTKKSVVI1R618QPJYEH", (0.0, -0.0, 0.46923011541366577, 0.8830759525299072), (-16097.1484375, 29430.150390625, 24677.744140625)), 32 | "Persistent_Level:PersistentLevel.BP_WAT14_UAID_04421A9713F0E56401_1503060069": ("8E7005F5EOO8MBKCC0PKG5ETS", (0.08039356768131256, 0.02070532739162445, -0.8385493159294128, 0.5384637117385864), (-46914.44140625, -20742.03515625, 18663.11328125)), 33 | "Persistent_Level:PersistentLevel.BP_WAT19_14": ("9DDXZ423KQ2MY1QQ06OUAJY5F", (-0.03644397482275963, -0.059002652764320374, 0.22887270152568817, 0.9709829092025757), (-9338.6201171875, 192.09397888183594, 24136.544921875)), 34 | "Persistent_Level:PersistentLevel.BP_WAT14_2": ("0JMESHD2WUF1ZM0KQ6ON3JKG9", (0.0, 0.0, 0.0, 1.0), (-23497.416015625, -37126.64453125, 12691.1708984375)), 35 | "Persistent_Level:PersistentLevel.BP_WAT1_C_0": ("6JSYFN4F11W1FK8DBEL9MJKMC", (-0.026940209791064262, 0.09967633336782455, -0.25960373878479004, 0.9601795673370361), (-340.640625, -52405.43359375, 13702.3154296875)), 36 | "Persistent_Level:PersistentLevel.BP_WAT1_C_2": ("8HUPNBHBEVTTJ243KMRT34H79", (0.3734762966632843, 0.586980938911438, -0.4584342837333679, 0.5529980659484863), (-28430.12890625, -226424.84375, -1717.7353515625)), 37 | "Persistent_Level:PersistentLevel.BP_WAT1_C_3": ("7E6ZXF8PZ1T7OBGD2TC0SGYCP", (-0.05383703485131264, 0.04910329356789589, -0.0017431479645892978, 0.9973401427268982), (-62622.0, -243572.765625, 1998.336669921875)), 38 | "Persistent_Level:PersistentLevel.BP_WAT10": ("EF9SQDOUFQGSGW9HGMWVGYM4T", (0.013051614165306091, 0.043514031916856766, -0.9955460429191589, 0.08260904252529144), (20256.1796875, -250754.453125, 4921.62060546875)), 39 | "Persistent_Level:PersistentLevel.BP_WAT10_UAID_40B076DF2F79B75201_1879979970": ("A83ST7K8BTOU8Q9OKEMQIOSXE", (-0.1201808899641037, 0.2210843414068222, 0.4222892224788666, 0.8708329796791077), (26012.896484375, -232917.296875, -1782.5323486328125)), 40 | "Persistent_Level:PersistentLevel.BP_WAT4_8": ("CKREWOBFRNALUT4MOSK1J5V77", (0.013645914383232594, 0.032014936208724976, 0.6930902600288391, 0.7200102210044861), (28422.04296875, -130004.1640625, 16209.4560546875)), 41 | "Persistent_Level:PersistentLevel.BP_WAT1_C_4": ("169UXRGGIBMFWLDU2L97JF3C9", (-0.0, 0.021035127341747284, 0.0, 0.9997787475585938), (16984.89453125, -65298.7734375, 10249.3095703125)), 42 | "Persistent_Level:PersistentLevel.BP_WAT1_C_6": ("0TLB52EUQXD6VSQJ9FRYLHJGE", (-0.08930379897356033, 0.06319466233253479, 0.4740336835384369, 0.873683750629425), (44935.87890625, -12094.7353515625, 23272.84375)), 43 | "Persistent_Level:PersistentLevel.BP_WAT14_26": ("45UWPTO34PXL4KQTGRUE81XMI", (0.0, -0.0, 0.013544955290853977, 0.9999082684516907), (46215.8671875, 30078.55078125, 21985.072265625)), 44 | "Persistent_Level:PersistentLevel.BP_WAT1_C_UAID_04421A9713F0E87A01_1449703843": ("BBAP4L83UFHS4U08VLZ7YKB3W", (-0.0, 0.6706640720367432, 0.0, 0.7417612075805664), (63364.3671875, 29487.0, 22997.9453125)), 45 | "Persistent_Level:PersistentLevel.BP_WAT11_2": ("57DZUJI0BTI1QVIDG9YS5HGLI", (-0.0, 0.0, -0.41550102829933167, 0.9095926880836487), (24129.115234375, 74258.765625, 22864.162109375)), 46 | "Persistent_Level:PersistentLevel.BP_WAT14_18": ("6ZV5OUR3A4IUW8OYTZT32X7SP", (-0.12401751428842545, -0.14952853322029114, -0.1856459677219391, 0.9632219076156616), (21814.447265625, 126437.8359375, 13875.861328125)), 47 | "Persistent_Level:PersistentLevel.BP_WAT100_3119": ("A5MZ4ELKEXAYTDFLMKGMQZLMM", (-0.004039432387799025, 0.010704762302339077, -0.19070744514465332, 0.9815802574157715), (41149.625, 173525.421875, 1546.079833984375)), 48 | "Persistent_Level:PersistentLevel.BP_WAT92": ("7J7ZD9LDME6Y8QV9VYPX3QPRM", (0.023432651534676552, 0.0650370866060257, 0.5469914674758911, 0.8342790007591248), (60540.625, 231749.3125, -3434.06591796875)), 49 | "Persistent_Level:PersistentLevel.BP_WAT17_7": ("0C44TGT131O4WLXQMYKK61TPY", (-0.0361587218940258, 0.001385024981573224, 0.08071009814739227, 0.9960805773735046), (38424.98046875, 275787.125, 185.8475799560547)), 50 | "Persistent_Level:PersistentLevel.BP_WAT12_3": ("9A50O30DW1N4OMG4JBVKR8OUN", (0.0, -0.0, 0.3864714801311493, 0.9223013520240784), (121433.3203125, 192946.40625, -5000.52001953125)), 51 | "Persistent_Level:PersistentLevel.BP_WAT13_17": ("6ZVPF9UC2EKDMVRXH9PAUWUTQ", (-0.11228179931640625, 0.12720294296741486, 0.17269760370254517, 0.9702513813972473), (127042.6015625, 81369.765625, 17596.953125)), 52 | "Persistent_Level:PersistentLevel.BP_WAT1_C_UAID_04421A9713F0EE7A01_1306830904": ("51RJJ5B514PFPFP2MP7CJ7WY9", (-0.0, 0.6337786912918091, 0.0, 0.7735143899917603), (96387.0859375, 30292.0, 18323.51171875)), 53 | "Persistent_Level:PersistentLevel.BP_WAT2_C_UAID_04421A9713F0F27A01_1759969627": ("1B198QDSOEJ9XXTT8CAAJA7OA", (0.0, 0.0, 0.0, 1.0), (148750.0, 37026.0, 10848.0)), 54 | "Persistent_Level:PersistentLevel.BP_WAT1_C_UAID_04421A9713F0E57A01_1732622300": ("3AIP3ZQWAIB10GWEBRSJ0BIH3", (-0.0, 0.6945845484733582, 0.0, 0.7194111347198486), (143591.15625, 20011.0, 14860.890625)), 55 | "Persistent_Level:PersistentLevel.BP_WAT1_C_5": ("9QTJTPSW5RFGI60P4JCL21Z23", (-0.03083016164600849, 0.011917324736714363, -0.0020115079823881388, 0.9994515776634216), (78248.8203125, -45687.26953125, 6508.71044921875)), 56 | "Persistent_Level:PersistentLevel.BP_WAT1_C_10": ("11MSWN6NQ4TW6L7DRTKESBKZM", (0.0, -0.0, 0.6005493998527527, 0.7995876669883728), (127614.15625, -46788.09375, 13045.7548828125)), 57 | "Persistent_Level:PersistentLevel.BP_WAT1_C_7": ("5XHD5LD7LFXCYHGVP956D1C6E", (0.0, -0.0, 0.5373018383979797, 0.8433899879455566), (94021.0625, -55894.31640625, 16329.404296875)), 58 | "Persistent_Level:PersistentLevel.BP_WAT37_13": ("BM8QC947E1X7IGEV64CXDVT15", (0.010614846833050251, 0.026930805295705795, 0.1188562735915184, 0.9924893975257874), (151390.515625, -73481.5390625, 11314.8076171875)), 59 | "Persistent_Level:PersistentLevel.BP_WAT3_5": ("0OX6O83Q7SN4HUKQNYF26PUG1", (0.01430578250437975, -0.024778341874480247, -0.4997952878475189, 0.8656708598136902), (85522.6796875, -131861.375, 14976.6103515625)), 60 | "Persistent_Level:PersistentLevel.BP_WAT1_C_1": ("D9TRPKE33S98PUN1VEU3MM5MY", (-0.009589357301592827, -0.02914748154580593, -0.3477831184864044, 0.93707275390625), (87775.09375, -186079.359375, 10491.3974609375)), 61 | "Persistent_Level:PersistentLevel.BP_WAT1_C_12": ("5UAWB7QBPXMB9LX8AXJHVYASF", (0.5238499641418457, -0.2578495740890503, 0.5719733834266663, 0.5761434435844421), (137232.796875, -156060.375, 16118.0)), 62 | "Persistent_Level:PersistentLevel.BP_WAT1_C_11": ("8CYMZLYM4T5E2AA19O6K6GH0T", (0.31518957018852234, 0.5663198232650757, -0.2478928565979004, 0.7200600504875183), (112144.640625, -211342.390625, 1612.9814453125)), 63 | "Persistent_Level:PersistentLevel.BP_WAT1_C_UAID_04421A9713F0565301_1886270961": ("81JRN8EL56I1O9V4NB4Y7359I", (-0.0980171412229538, -4.252809491353993e-17, -3.123889355927443e-18, 0.9951847195625305), (171062.0, -266773.40625, 663.1013793945312)), 64 | "Persistent_Level:PersistentLevel.BP_WAT78_0": ("AUPCC2CRW843YTL7JGYXVGVRH", (0.11865341663360596, -0.3082224428653717, 0.45389890670776367, 0.8275845050811768), (211149.25, -259597.140625, -1601.0645751953125)), 65 | "Persistent_Level:PersistentLevel.BP_WAT83_2": ("0IRH6DGFR7LBSRJZSGQTC0OCN", (0.0027563420590013266, 0.25557053089141846, -0.001414195983670652, 0.9667854309082031), (223238.4375, -290110.375, 15266.328125)), 66 | "Persistent_Level:PersistentLevel.BP_WAT80_2": ("7350GF2H0RJTV1JNVAOSS3704", (0.08594966679811478, -0.06343391537666321, -0.7700580358505249, 0.6289669275283813), (190045.265625, -249791.6875, 13564.5908203125)), 67 | "Persistent_Level:PersistentLevel.BP_WAT121": ("2LUY6P7VRDU9JLGK9YCCZDWGT", (0.0, -0.0, 0.9142101407051086, 0.4052404761314392), (210229.0, -248867.0, 20268.0)), 68 | "Persistent_Level:PersistentLevel.BP_WAT123_1": ("16TS5SGLAB5OGQMHLQT1K027S", (-0.0, 0.0, -0.4713967442512512, 0.8819212913513184), (209893.0, -186445.0, 7430.0)), 69 | "Persistent_Level:PersistentLevel.BP_WAT1_C_20": ("74YY17GA236340LEPB7A0RCJ8", (0.0, 0.0, 0.0, 1.0), (202735.0, -161515.0, 30523.0)), 70 | "Persistent_Level:PersistentLevel.BP_WAT86": ("74YY17GA236340LEPB7A0RCJ8", (0.05459389090538025, 0.34054991602897644, -0.7578756213188171, 0.553777813911438), (195849.734375, -168881.640625, 15332.5439453125)), 71 | "Persistent_Level:PersistentLevel.BP_WAT35_7": ("2UBUQ11WG22HVCDJ8VGN2S2WZ", (-0.0, 0.0, -0.4244616627693176, 0.90544593334198), (194098.890625, -81818.8984375, 1415.9259033203125)), 72 | "Persistent_Level:PersistentLevel.BP_WAT70": ("9A1DJC9NFO49Q45LHQU1RKE1D", (0.11661437153816223, 0.6613563895225525, 0.1286652386188507, 0.7296945452690125), (213503.75, -45384.4609375, 15881.2509765625)), 73 | "Persistent_Level:PersistentLevel.BP_WAT1_C_UAID_04421A9713F0F27A01_1137768619": ("1LWB7EEW7VWM46JM7OXFQ4UH1", (-0.22831499576568604, -0.5918843746185303, -0.278202623128891, 0.721213161945343), (189071.0, 7849.0, 19716.0)), 74 | "Persistent_Level:PersistentLevel.BP_WAT41_6362": ("D2U6VEGID4QK8XYHA1P94YXFP", (-0.5097691416740417, 0.43634453415870667, 0.5714386105537415, 0.4724369943141937), (159440.53125, -10152.38671875, 20169.61328125)), 75 | "Persistent_Level:PersistentLevel.BP_WAT12_1": ("AWMSV1XNEUXQXNWYWI76PKKAM", (0.0, -0.0, 0.08358673006296158, 0.9965004920959473), (178589.796875, 57809.18359375, 4282.29443359375)), 76 | "Persistent_Level:PersistentLevel.BP_WAT1_C_UAID_04421A9713F0F57A01_1575931164": ("04HYN5W55FAATI40HRK7JCCK7", (0.02471868321299553, 0.02028609998524189, -0.6340688467025757, 0.7726151347160339), (147900.40625, 66474.796875, -211.84173583984375)), 77 | "Persistent_Level:PersistentLevel.BP_WAT1_C_UAID_04421A9713F0F37A01_1079321804": ("04HYN5W55FAATI40HRK7JCCK7", (0.26304540038108826, -0.3370615243911743, 0.7126567363739014, 0.5561627745628357), (138397.0, 61287.0, 20000.0)), 78 | "Persistent_Level:PersistentLevel.BP_WAT1_2": ("1HV28XR4NNA4Z5C08E7LC6S1M", (-0.03961498290300369, 0.003968772012740374, 0.6409125924110413, 0.7665807008743286), (182498.234375, 107567.765625, 12254.0)), 79 | "Persistent_Level:PersistentLevel.BP_WAT12_16": ("5UF96OL8F0YYFCNY82DC5HAOE", (-0.012733476236462593, 0.02560647763311863, 0.9883500337600708, 0.14948686957359314), (151406.125, 96198.375, 25683.361328125)), 80 | "Persistent_Level:PersistentLevel.BP_WAT1_C_UAID_04421A9713F0416401_2093804204": ("8Z3WQ3R9YJEN573SFVF28IKKT", (-0.08118105679750443, 0.01363412570208311, -0.396447092294693, 0.9143595695495605), (212099.78125, 111434.625, -5163.43408203125)), 81 | "Persistent_Level:PersistentLevel.BP_WAT17_8": ("6H66RI7OBR6IWMW9YZ96MANGZ", (-0.03434962034225464, 0.036507852375507355, 0.7273910045623779, 0.6843899488449097), (161888.28125, 158080.265625, 10189.1318359375)), 82 | "Persistent_Level:PersistentLevel.BP_Crystal_mk3_C_36": ("9ESMK9H2QEDHJ9A5S015TJ0TP", (-0.024093998596072197, -0.011952818371355534, 0.006905551999807358, 0.9996143579483032), (206595.125, 171284.75, 22366.71484375)), 83 | "Persistent_Level:PersistentLevel.BP_WAT2_C_24": ("4U9TA1DBVMVT2L2U8CTNXDC05", (-0.03772430866956711, -3.753519038452249e-16, 3.8891732178395974e-16, 0.9992882013320923), (216781.734375, 145682.171875, 7984.388671875)), 84 | "Persistent_Level:PersistentLevel.BP_WAT1_C_15": ("4U9TA1DBVMVT2L2U8CTNXDC05", (0.049052894115448, 0.02451166696846485, 0.001204180996865034, 0.9984946250915527), (232575.21875, 135845.984375, -11330.91796875)), 85 | "Persistent_Level:PersistentLevel.BP_WAT16_7": ("B7IC3GZ9K7T6D4PNRRTZGKM7D", (-0.044204797595739365, -0.004196574445813894, -0.09441666305065155, 0.9945420026779175), (204083.1875, 195093.46875, 17625.857421875)), 86 | "Persistent_Level:PersistentLevel.BP_WAT15_6": ("B7IC3GZ9K7T6D4PNRRTZGKM7D", (-0.06311371922492981, -0.1971389353275299, 0.0017539006657898426, 0.9783403277397156), (194968.078125, 199950.09375, -4851.64599609375)), 87 | "Persistent_Level:PersistentLevel.BP_WAT11_0": ("ACPR6AYP6K6QNWA52I94OZEFI", (-0.03780991584062576, -0.04469054937362671, 0.6447831988334656, 0.7621206045150757), (170052.140625, 232325.1875, -8566.578125)), 88 | "Persistent_Level:PersistentLevel.BP_WAT14_5": ("DEJKE104EL5ZVDR1H6UQCPPXL", (0.21710793673992157, 0.15991391241550446, -0.6861617565155029, 0.6756284236907959), (135358.328125, 263050.84375, 5220.626953125)), 89 | "Persistent_Level:PersistentLevel.BP_WAT2_C_22": ("4L5W3OPPMIN8IKH7VGL7XJYFB", (0.0, 0.0, 0.0, 1.0), (249320.0, 148540.0, 14872.0)), 90 | "Persistent_Level:PersistentLevel.BP_WAT1_C_16": ("BZMDUF5VSYMR7KN629KNH1CKL", (0.0, 0.0, 0.0, 1.0), (273060.78125, 81578.703125, -1571.0120849609375)), 91 | "Persistent_Level:PersistentLevel.BP_WAT1_C_18": ("6LM457N0FPZ2S25SLLGCLDSPT", (-0.009343069046735764, 0.021464699879288673, -0.7044739723205566, 0.709343671798706), (218362.46875, 53798.953125, -1361.8114013671875)), 92 | "Persistent_Level:PersistentLevel.BP_WAT1_C_UAID_04421A9713F0F57A01_1942877174": ("36Y6EBK5ARXAZ8VXV7RR1SH9A", (0.0, 0.0, 0.0, 1.0), (238635.0, -21507.0, -195.0)), 93 | "Persistent_Level:PersistentLevel.BP_WAT66": ("0Y65ZWH4U5LIQZ0W3QGPOFZDS", (-0.04892335459589958, -0.010678349994122982, 0.9987349510192871, 0.004575984086841345), (293392.71875, -164435.3125, 1423.0413818359375)), 94 | "Persistent_Level:PersistentLevel.BP_WAT57": ("EJCXTTREYCFD0KNJWI0ARFQYI", (-0.312551349401474, -0.41637739539146423, 0.03478088974952698, 0.8530719876289368), (261873.4375, -194228.21875, 3963.80126953125)), 95 | "Persistent_Level:PersistentLevel.BP_WAT58": ("BF15AQ1KJCL19W9YP52HSKDUR", (0.12443539500236511, 0.5964450836181641, -0.07369906455278397, 0.7895172834396362), (295658.4375, -237690.5, 5419.564453125)), 96 | "Persistent_Level:PersistentLevel.BP_WAT64": ("9FHXKO90N85VOFVSW61TDZOH3", (0.02276008389890194, 0.09041953086853027, 0.6160387992858887, 0.7821780443191528), (242952.359375, -257677.40625, -323.9428405761719)), 97 | "Persistent_Level:PersistentLevel.BP_WAT52": ("8V2S7IJRF1X66U2PPNU3LQ6H5", (-0.0111359478905797, -0.02894696034491062, 0.9445721507072449, 0.32683566212654114), (264968.4375, -259564.6875, 17590.37890625)), 98 | "Persistent_Level:PersistentLevel.BP_WAT74": ("7WP5162UQFDTL52KOO9KJTAOE", (-0.057617902755737305, -0.043396156281232834, 0.042584795504808426, 0.9964855909347534), (264715.625, -288363.875, 22833.044921875)), 99 | "Persistent_Level:PersistentLevel.BP_WAT55": ("9SQGN46B78LMSDVYH635YJ6GM", (0.15604820847511292, -0.07231499999761581, 0.7121942043304443, 0.6805871725082397), (280620.9375, -308274.6875, 3041.115234375)), 100 | "Persistent_Level:PersistentLevel.BP_WAT18_1": ("29BXB577SDZK5OPP3KIWKLD1Y", (0.5609597563743591, -0.375842422246933, 0.6475864052772522, 0.3531267046928406), (331660.28125, -222661.1875, 4584.39404296875)), 101 | "Persistent_Level:PersistentLevel.BP_WAT1_C_UAID_04421A9713F0B36201_2077013154": ("DLAE066U88DGNZ7CU6J65THSX", (-0.047076623886823654, -0.08182407915592194, -0.6441251039505005, 0.7590727210044861), (370156.0, -211385.0, 5163.0)), 102 | "Persistent_Level:PersistentLevel.BP_WAT49": ("6EZ8OPSNH33JVBXTSR3WG46IV", (-0.20983828604221344, 0.13841235637664795, 0.8747422695159912, 0.414289653301239), (378306.5625, -120583.2109375, 7257.98828125)), 103 | "Persistent_Level:PersistentLevel.BP_WAT62": ("68MHEYBMF0F2EG5AGYKNGP7EG", (-0.06358005851507187, 0.16425256431102753, 0.34439897537231445, 0.9221540093421936), (311246.75, -89880.734375, 8315.33984375)), 104 | "Persistent_Level:PersistentLevel.BP_WAT17_6": ("4P5GAUADJ4T13LMJ6IRNWHNBD", (0.024541229009628296, 0.0, 0.0, 0.99969881772995), (314591.1875, -59777.72265625, 5927.86474609375)), 105 | "Persistent_Level:PersistentLevel.BP_WAT3": ("5BNGT9DFF02Q8PCF6ZBKP658S", (-0.18588675558567047, -0.0414661206305027, -0.9302468299865723, 0.3136359453201294), (329081.125, -12866.23046875, -1105.557861328125)), 106 | "Persistent_Level:PersistentLevel.BP_WAT1_C_21": ("7FWXJNKAT1JDCKOG7KGN4FSI5", (-0.07727840542793274, -0.04003586620092392, 0.600260853767395, 0.7950547337532043), (309568.40625, -8915.484375, 5572.76953125)), 107 | "Persistent_Level:PersistentLevel.BP_WAT45": ("ADBYB08LJ17EVC7XRIMFQ6CPC", (0.020540010184049606, 0.042749542742967606, -0.9900215268135071, 0.13269497454166412), (405743.21875, -161307.765625, 5525.1123046875)), 108 | "Persistent_Level:PersistentLevel.BP_WAT19_3": ("47RQINNJWGEHX3TKQC5CZ66GS", (-0.04704856872558594, -0.0005107559263706207, 0.7126995325088501, 0.6998896598815918), (391493.09375, -241467.125, 5424.0625)), 109 | } 110 | -------------------------------------------------------------------------------- /sav_monitor.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # This file is part of the Satisfactory Save Parser distribution 3 | # (https://github.com/GreyHak/sat_sav_parse). 4 | # Copyright (c) 2024 GreyHak (github.com/GreyHak). 5 | # 6 | # This program is free software: you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation, version 3. 9 | # 10 | # This program is distributed in the hope that it will be useful, but 11 | # WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | # General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | 18 | import os 19 | import sys 20 | import time 21 | import glob 22 | import shutil 23 | import sav_to_html 24 | import sav_parse 25 | 26 | if __name__ == '__main__': 27 | 28 | if (len(sys.argv) <= 1 or len(sys.argv[1]) == 0) and os.path.isdir(".config/Epic/FactoryGame/Saved/SaveGames/server"): 29 | savePath = ".config/Epic/FactoryGame/Saved/SaveGames/server" 30 | elif (len(sys.argv) <= 1 or len(sys.argv[1]) == 0) and "LOCALAPPDATA" in os.environ and os.path.isdir(f"{os.environ['LOCALAPPDATA']}/FactoryGame/Saved/SaveGames"): 31 | savePath = f"{os.environ['LOCALAPPDATA']}/FactoryGame/Saved/SaveGames/*" 32 | elif len(sys.argv) > 1 and os.path.isdir(sys.argv[1]): 33 | savePath = sys.argv[1] 34 | else: 35 | print("ERROR: Please supply save file path/name to perform parsing.", file=sys.stderr) 36 | exit(1) 37 | 38 | htmlOutputDir = "." 39 | if len(sys.argv) > 2: 40 | htmlOutputDir = sys.argv[2] 41 | if not os.path.isdir(htmlOutputDir): 42 | print(f"ERROR: HTML output folder does not exist: '{htmlOutputDir}'") 43 | exit(1) 44 | 45 | sleepTimeInSeconds = 1.0 * 60 # 1 minute 46 | if len(sys.argv) > 3: 47 | sleepTimeInSeconds = float(sys.argv[3]) 48 | 49 | archivePath = None 50 | if len(sys.argv) > 4: 51 | archivePath = sys.argv[4] 52 | if not os.path.isdir(archivePath): 53 | print(f"ERROR: Archive folder does not exist: '{archivePath}'") 54 | exit(1) 55 | 56 | if archivePath == None: 57 | print(f"Monitoring {savePath}") 58 | else: 59 | print(f"Monitoring {savePath} and archiving to {archivePath}") 60 | 61 | priorSavFilename = None 62 | while True: 63 | allSaveFiles = glob.glob(f"{savePath}/*.sav") 64 | try: 65 | savFilename = max(allSaveFiles, key=os.path.getmtime) 66 | except FileNotFoundError: 67 | next 68 | 69 | if savFilename != priorSavFilename: 70 | priorSavFilename = savFilename 71 | savBasename = os.path.basename(savFilename) 72 | print(f"Found new file {savBasename}") 73 | 74 | print(f"Generating HTML in {htmlOutputDir}") 75 | sav_to_html.generateHTML(savFilename, htmlOutputDir) 76 | 77 | if archivePath != None: 78 | saveFileInfo = sav_parse.readSaveFileInfo(savFilename) 79 | archiveFilePath = os.path.join(archivePath, f"{saveFileInfo.sessionName}_{saveFileInfo.saveDatetime.strftime('%Y%m%d-%H%M%S')}.sav") 80 | if not os.path.exists(archiveFilePath): 81 | print(f"Archiving save to {archiveFilePath}") 82 | shutil.copy2(savFilename, archiveFilePath) 83 | 84 | print() 85 | time.sleep(sleepTimeInSeconds) 86 | -------------------------------------------------------------------------------- /sav_stack_sizes.json: -------------------------------------------------------------------------------- 1 | { 2 | "Copper Sheet": 200, 3 | "Steel Beam": 200, 4 | "Steel Pipe": 200, 5 | "Wire": 500, 6 | "Rotor": 100, 7 | "Encased Industrial Beam": 100, 8 | "Cable": 200, 9 | "Iron Plate": 200, 10 | "Nobelisk": 50, 11 | "Motor": 50, 12 | "Concrete": 500, 13 | "Reinforced Iron Plate": 100, 14 | "Solid Biofuel": 200, 15 | "Plastic": 200, 16 | "Rubber": 200, 17 | "Beryl Nut": 100, 18 | "Iron Rod": 200, 19 | "Quickwire": 500, 20 | "Packaged Fuel": 100, 21 | "Quartz Crystal": 200, 22 | "Screw": 500, 23 | "Circuit Board": 200, 24 | "Black Powder": 200, 25 | "Steel Ingot": 100, 26 | "Computer": 50, 27 | "Stator": 100, 28 | "Modular Frame": 50, 29 | "SAM Ingot": 100, 30 | "Paleberry": 50, 31 | "Leaves": 500, 32 | "Heavy Modular Frame": 50, 33 | "SAM Fluctuator": 100, 34 | "Sulfur": 100, 35 | "Polymer Resin": 200, 36 | "Petroleum Coke": 200, 37 | "Smokeless Powder": 100, 38 | "Packaged Turbofuel": 100, 39 | "Plasma Spitter Remains": 50, 40 | "Wood": 200, 41 | "Mycelia": 200, 42 | "Coal": 100, 43 | "Limestone": 100, 44 | "Caterium Ore": 100, 45 | "Iron Rebar": 100, 46 | "Aluminum Casing": 200, 47 | "AI Limiter": 100, 48 | "Power Shard": 100, 49 | "Gas Nobelisk": 50, 50 | "High-Speed Connector": 100, 51 | "Electromagnetic Control Rod": 100, 52 | "Biomass": 200, 53 | "Portable Miner": 50, 54 | "Alclad Aluminum Sheet": 200, 55 | "SAM Ore": 100, 56 | "Hard Drive": 100, 57 | "Somersloop": 50, 58 | "Mercer Sphere": 50, 59 | "Gas Filter": 50, 60 | "Alien Protein": 100, 61 | "Parachute": 1, 62 | "Xeno-Basher": 1, 63 | "Bacon Agaric": 50, 64 | "Medicinal Inhaler": 50, 65 | "Hog Remains": 50, 66 | "Stinger Remains": 50, 67 | "Raw Quartz": 100, 68 | "Yellow Power Slug": 50, 69 | "Hatcher Remains": 50, 70 | "Packaged Liquid Biofuel": 100, 71 | "Purple Power Slug": 50, 72 | "Heat Sink": 100, 73 | "Blue Power Slug": 50, 74 | "Alien DNA Capsule": 50, 75 | "Stun Rebar": 100, 76 | "Iron Ore": 100, 77 | "Silica": 200, 78 | "Compacted Coal": 100, 79 | "Caterium Ingot": 100, 80 | "Fabric": 100, 81 | "Shatter Rebar": 100, 82 | "Rifle Ammo": 500, 83 | "Explosive Rebar": 100, 84 | "Cluster Nobelisk": 50, 85 | "Copper Ore": 100, 86 | "Crystal Oscillator": 100, 87 | "Turbo Motor": 50, 88 | "Rifle": 1, 89 | "Aluminum Ingot": 100, 90 | "Empty Fluid Tank": 100, 91 | "Homing Rifle Ammo": 500, 92 | "Turbo Rifle Ammo": 500, 93 | "Radio Control Unit": 50, 94 | "Fused Modular Frame": 50, 95 | "Bauxite": 100, 96 | "Cooling System": 100, 97 | "Supercomputer": 50, 98 | "Iron Ingot": 100, 99 | "Assembly Director System": 50, 100 | "Copper Ingot": 100, 101 | "Iodine Infused Filter": 50, 102 | "Smart Plating": 50, 103 | "Thermal Propulsion Rocket": 50, 104 | "Adaptive Control Unit": 50, 105 | "Automated Wiring": 50, 106 | "Magnetic Field Generator": 50, 107 | "Nuclear Pasta": 50, 108 | "Versatile Framework": 50, 109 | "Dark Matter": 200, 110 | "Empty Canister": 100, 111 | "Superposition Oscillator": 100, 112 | "Hover Pack": 1, 113 | "Dark Matter Crystal": 200, 114 | "Diamonds": 200, 115 | "Ficsite Ingot": 100, 116 | "Ficsite Trigon": 200, 117 | "Neural-Quantum Processor": 100, 118 | "Packaged Rocket Fuel": 100, 119 | "Time Crystal": 200, 120 | "Blade Runners": 1, 121 | "Chainsaw": 1, 122 | "Gas Mask": 1, 123 | "Hazmat Suit": 1, 124 | "Jetpack": 1, 125 | "Nobelisk Detonator": 1, 126 | "Modular Engine": 50, 127 | "AI Expansion Server": 50, 128 | "Ballistic Warp Drive": 50, 129 | "Biochemical Sculptor": 50, 130 | "Singularity Cell": 50 131 | } -------------------------------------------------------------------------------- /sav_to_html.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # This file is part of the Satisfactory Save Parser distribution 3 | # (https://github.com/GreyHak/sat_sav_parse). 4 | # Copyright (c) 2024 GreyHak (github.com/GreyHak). 5 | # 6 | # This program is free software: you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation, version 3. 9 | # 10 | # This program is distributed in the hope that it will be useful, but 11 | # WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | # General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | 18 | import os 19 | import glob 20 | import sys 21 | import sav_parse 22 | import sav_data_slug 23 | import sav_data_somersloop 24 | import sav_data_mercerSphere 25 | import json 26 | 27 | try: 28 | from PIL import Image, ImageDraw, ImageFont 29 | pilAvailableFlag = True 30 | except ModuleNotFoundError: 31 | pilAvailableFlag = False 32 | 33 | DEFAULT_OUTPUT_DIR = "." 34 | DEFAULT_HTML_BASENAME = "save.html" 35 | FONT_FILENAME = "/usr/share/fonts/truetype/dejavu/DejaVuSerif.ttf" # The library automatically adjusts to "C:\Windows\Fonts\DejaVuSerif.ttf" on Windows. 36 | 37 | MAP_DESCALE = 20 38 | MAP_BASENAME_BLANK = f"blank_map{str(MAP_DESCALE).zfill(2)}.png" 39 | MAP_BASENAME_SLUGS = "save_slug.png" 40 | MAP_BASENAME_HARD_DRIVES = "save_hd.png" 41 | MAP_BASENAME_SOMERSLOOP = "save_somersloop.png" 42 | MAP_BASENAME_MERCER_SPHERE = "save_mercer_sphere.png" 43 | MAP_BASENAME_POWER = "save_power.png" 44 | MAP_BASENAME_RESOURCE_NODES = "save_nodes.png" 45 | 46 | MAP_FONT_SIZE = 760/MAP_DESCALE 47 | MAP_TEXT_1 = (4400/MAP_DESCALE, 4300/MAP_DESCALE) 48 | MAP_TEXT_2 = (4400/MAP_DESCALE, 5400/MAP_DESCALE) 49 | CROP_SETTINGS = (4096/MAP_DESCALE, 4096/MAP_DESCALE, 36864/MAP_DESCALE, 36864/MAP_DESCALE) 50 | def adjPos(pos, yFlag): 51 | newPos = (pos / 22.887 + (18282.5,20480)[yFlag]) / MAP_DESCALE 52 | return newPos 53 | 54 | def addSlugs(slugDraw, slugs, fill): 55 | for slug in slugs: 56 | coord = slugs[slug] 57 | posX = adjPos(coord[0], False) 58 | posY = adjPos(coord[1], True) 59 | slugDraw.ellipse((posX-2, posY-2, posX+2, posY+2), fill=fill) 60 | 61 | def chown(filename): 62 | try: 63 | if os.path.isfile(filename): 64 | fid = os.open(filename, os.O_RDONLY) 65 | os.fchown(fid, 1000, 1000) 66 | os.close(fid) 67 | except Exception as error: 68 | pass 69 | 70 | CURRENT_DEPOT_STACK_LIMIT = 5 71 | ITEM_STACK_SIZE_FILENAME = "sav_stack_sizes.json" 72 | itemStackSizes = {} 73 | VALID_STACK_SIZES = (500, 200, 100, 50) # In reducing order 74 | def getStackSize(itemName, itemCount): 75 | global itemStackSizes 76 | if len(itemStackSizes) == 0 and os.path.isfile(ITEM_STACK_SIZE_FILENAME): 77 | with open(ITEM_STACK_SIZE_FILENAME, "r") as fin: 78 | itemStackSizes = json.load(fin) 79 | 80 | derivedStackSize = None 81 | if itemCount != 0: 82 | itemCount = itemCount / CURRENT_DEPOT_STACK_LIMIT 83 | for validStackSize in VALID_STACK_SIZES: 84 | if (itemCount % validStackSize) == 0: 85 | derivedStackSize = validStackSize 86 | break 87 | 88 | knownStackSize = None 89 | if itemName in itemStackSizes: 90 | knownStackSize = itemStackSizes[itemName] 91 | else: 92 | itemStackSizes[itemName] = None 93 | 94 | if derivedStackSize == None and knownStackSize == None: 95 | return None 96 | 97 | if knownStackSize != None: 98 | if derivedStackSize == None or knownStackSize > derivedStackSize: 99 | return knownStackSize 100 | 101 | itemStackSizes[itemName] = derivedStackSize 102 | with open(ITEM_STACK_SIZE_FILENAME, "w") as fout: 103 | json.dump(itemStackSizes, fout, indent=2) 104 | return derivedStackSize 105 | 106 | def generateHTML(savFilename, outputDir=DEFAULT_OUTPUT_DIR, htmlBasename=DEFAULT_HTML_BASENAME): 107 | htmlFilename = f"{outputDir}/{htmlBasename}" 108 | try: 109 | (saveFileInfo, headhex, grids, levels, extraObjectReferenceList) = sav_parse.readFullSaveFile(savFilename) 110 | #htmlFilename = f"save_{saveFileInfo.sessionName}_{saveFileInfo.saveDatetime.strftime('%Y%m%d-%H%M%S')}.html" 111 | 112 | uncollectedPowerSlugsBlue = sav_data_slug.POWER_SLUGS_BLUE.copy() 113 | uncollectedPowerSlugsYellow = sav_data_slug.POWER_SLUGS_YELLOW.copy() 114 | uncollectedPowerSlugsPurple = sav_data_slug.POWER_SLUGS_PURPLE.copy() 115 | uncollectedSomersloops = sav_data_somersloop.SOMERSLOOPS.copy() 116 | uncollectedMercerSpheres = sav_data_mercerSphere.MERCER_SPHERES.copy() 117 | 118 | activeSchematic = None 119 | activeSchematicShortName = None 120 | activeSchematicDescription = None 121 | numBuildables = 0 122 | buildablesMap = {} 123 | minerInstances = [] 124 | minerTypesInstanceAndPositions = [] 125 | minedResourceActors = {} 126 | numCollectedSlugsMk1 = 0 127 | numCollectedSlugsMk2 = 0 128 | numCollectedSlugsMk3 = 0 129 | crashSiteInstances = {} 130 | numCreaturesKilled = 0 131 | creaturesKilled = [] 132 | gamePhase = "Default" 133 | pointProgressLines = "" 134 | unlockCount_hardDrives = 0 135 | unlockCount_awesomeShop = 0 136 | unlockRemaining_awesomeShop = list(sav_parse.UNLOCK_PATHS__AWESOME_SHOP) 137 | unlockCount_mam = 0 138 | unlockRemaining_mam = list(sav_parse.UNLOCK_PATHS__MAM) 139 | unlockCount_hubTiers = 0 140 | unlockCount_special = 0 141 | dimensionalDepotContents = [] 142 | powerLines = {} 143 | wireLines = [] 144 | for (levelName, actorAndComponentObjectHeaders, collectables1, objects, collectables2) in levels: 145 | for actorOrComponentObjectHeader in actorAndComponentObjectHeaders: 146 | if isinstance(actorOrComponentObjectHeader, sav_parse.ActorHeader): 147 | typePath = actorOrComponentObjectHeader.typePath 148 | if "/Buildable/" in typePath or "/Build_" in typePath: # "/Buildable/" ensures vehicles are included. "/Build_" ensures FICSMAS buildables are included. 149 | numBuildables += 1 150 | if typePath in buildablesMap: 151 | buildablesMap[typePath] += 1 152 | else: 153 | buildablesMap[typePath] = 1 154 | if typePath in sav_parse.MINERS: 155 | minerInstances.append(actorOrComponentObjectHeader.instanceName) 156 | minerTypesInstanceAndPositions.append((typePath, actorOrComponentObjectHeader.instanceName, actorOrComponentObjectHeader.position)) 157 | if typePath in sav_parse.MINED_RESOURCES: 158 | resourceType = None 159 | purity = None 160 | if actorOrComponentObjectHeader.instanceName in sav_parse.RESOURCE_PURITY: # Won't be found for BP_FrackingCore_C 161 | (resourceType, purity) = sav_parse.RESOURCE_PURITY[actorOrComponentObjectHeader.instanceName] 162 | minedResourceActors[actorOrComponentObjectHeader.instanceName] = (actorOrComponentObjectHeader.position, resourceType, purity) 163 | elif typePath == sav_parse.CRASH_SITE: 164 | crashSiteInstances[actorOrComponentObjectHeader.instanceName] = actorOrComponentObjectHeader.position 165 | elif typePath == sav_parse.POWER_LINE: 166 | powerLines[actorOrComponentObjectHeader.instanceName] = actorOrComponentObjectHeader.position 167 | for object in objects: 168 | if object.instanceName == "Persistent_Level:PersistentLevel.StatisticsSubsystem": 169 | creaturesKilledCount = sav_parse.getPropertyValue(object.properties, "mCreaturesKilledCount") 170 | if creaturesKilledCount != None: 171 | for creature in creaturesKilledCount: 172 | (levelPathName, killCount) = creature 173 | creaturesKilled.append((levelPathName.pathName, killCount)) 174 | numCreaturesKilled += killCount 175 | elif object.instanceName == "Persistent_Level:PersistentLevel.GamePhaseManager": 176 | currentGamePhase = sav_parse.getPropertyValue(object.properties, "mCurrentGamePhase") 177 | if currentGamePhase != None: 178 | if currentGamePhase.pathName == sav_parse.FINAL_PROJECT_ASSEMBLY_PHASE_7: # mTargetGamePhase will be phase 1 179 | gamePhase = "Project Assembly Completed." 180 | else: 181 | gamePhase = f"{sav_parse.pathNameToReadableName(currentGamePhase.pathName)}" 182 | targetGamePhase = sav_parse.getPropertyValue(object.properties, "mTargetGamePhase") 183 | if targetGamePhase != None: 184 | targetGamePhase = targetGamePhase.pathName 185 | if targetGamePhase == sav_parse.FINAL_PROJECT_ASSEMBLY_PHASE_6: 186 | gamePhase = "Project Assembly Complete[ing]" 187 | else: 188 | gamePhase += f" toward {sav_parse.pathNameToReadableName(targetGamePhase)}" 189 | targetGamePhasePaidOffCosts = sav_parse.getPropertyValue(object.properties, "mTargetGamePhasePaidOffCosts") 190 | if targetGamePhasePaidOffCosts != None: 191 | gamePhase = f'{gamePhase}. Already supplied:\n
    \n' 192 | cost = targetGamePhasePaidOffCosts 193 | alreadySupplied = {} 194 | for costItem in cost: 195 | itemCostClass = sav_parse.getPropertyValue(costItem[0], "ItemClass") 196 | if itemCostClass != None: 197 | amountSupplied = sav_parse.getPropertyValue(costItem[0], "Amount") 198 | if amountSupplied != None: 199 | itemName = itemCostClass.pathName 200 | itemName = sav_parse.pathNameToReadableName(itemName) 201 | alreadySupplied[itemName] = amountSupplied 202 | if targetGamePhase not in sav_parse.PROJECT_ASSEMBLY_COSTS: 203 | gamePhase = f"{gamePhase}
  • ERROR: {targetGamePhase} not in PROJECT_ASSEMBLY_COSTS
  • \n" 204 | else: 205 | for itemName in sav_parse.PROJECT_ASSEMBLY_COSTS[targetGamePhase]: 206 | totalCost = sav_parse.PROJECT_ASSEMBLY_COSTS[targetGamePhase][itemName] 207 | if itemName in alreadySupplied: 208 | amountSupplied = alreadySupplied[itemName] 209 | else: 210 | amountSupplied = 0 211 | gamePhase = f"{gamePhase}
  • {amountSupplied}/{totalCost} x {itemName} ({round(amountSupplied/totalCost*100,1)}% complete)
  • \n" 212 | gamePhase = f"{gamePhase}
\n" 213 | elif object.instanceName == "Persistent_Level:PersistentLevel.ResourceSinkSubsystem": 214 | totalPoints = sav_parse.getPropertyValue(object.properties, "mTotalPoints") 215 | if totalPoints != None: 216 | if len(totalPoints) == 2: 217 | (totalPointsFromItems, totalPointsFromDna) = totalPoints 218 | pointProgressLines += f"
  • Total Points: {totalPointsFromItems} from items, {totalPointsFromDna} from DNA
  • \n" 219 | currentPointLevels = sav_parse.getPropertyValue(object.properties, "mCurrentPointLevels") 220 | if currentPointLevels != None: 221 | if len(currentPointLevels) == 2: 222 | (pointsEarnedFromItems, pointsEarnedFromDna) = currentPointLevels 223 | pointProgressLines += f"
  • Total Coupons Earned: {pointsEarnedFromItems + pointsEarnedFromDna}
  • \n" 224 | numResourceSinkCoupons = sav_parse.getPropertyValue(object.properties, "mNumResourceSinkCoupons") 225 | if numResourceSinkCoupons != None: 226 | pointProgressLines += f"
  • Number of coupons available in sink: {numResourceSinkCoupons}
  • \n" 227 | elif object.instanceName == "Persistent_Level:PersistentLevel.schematicManager": 228 | activeSchematic = sav_parse.getPropertyValue(object.properties, "mActiveSchematic") 229 | if activeSchematic != None: 230 | activeSchematic = activeSchematic.pathName 231 | activeSchematicShortName = sav_parse.pathNameToReadableName(activeSchematic) 232 | activeSchematicDescription = f"{activeSchematicShortName}." 233 | purchasedSchematics = sav_parse.getPropertyValue(object.properties, "mPurchasedSchematics") 234 | if purchasedSchematics != None: 235 | for purchasedSchematic in purchasedSchematics: 236 | if purchasedSchematic.pathName in sav_parse.UNLOCK_PATHS__HARD_DRIVES: 237 | unlockCount_hardDrives += 1 238 | elif purchasedSchematic.pathName in sav_parse.UNLOCK_PATHS__AWESOME_SHOP: 239 | unlockCount_awesomeShop += 1 240 | unlockRemaining_awesomeShop.remove(purchasedSchematic.pathName) 241 | elif purchasedSchematic.pathName in sav_parse.UNLOCK_PATHS__MAM: 242 | unlockCount_mam += 1 243 | unlockRemaining_mam.remove(purchasedSchematic.pathName) 244 | elif purchasedSchematic.pathName in sav_parse.UNLOCK_PATHS__HUB_TIERS: 245 | unlockCount_hubTiers += 1 246 | elif purchasedSchematic.pathName in sav_parse.UNLOCK_PATHS__SPECIAL: 247 | unlockCount_special += 1 248 | elif object.instanceName == "Persistent_Level:PersistentLevel.CentralStorageSubsystem": 249 | storedItems = sav_parse.getPropertyValue(object.properties, "mStoredItems") 250 | if storedItems != None: 251 | for storedItem in storedItems: 252 | itemClass = sav_parse.getPropertyValue(storedItem[0], "ItemClass") 253 | if itemClass != None: 254 | amount = sav_parse.getPropertyValue(storedItem[0], "Amount") 255 | if amount != None: 256 | itemName = sav_parse.pathNameToReadableName(itemClass.pathName) 257 | dimensionalDepotContents.append((amount, itemName)) 258 | elif object.instanceName in powerLines: 259 | wireInstances = sav_parse.getPropertyValue(object.properties, "mWireInstances") 260 | if wireInstances != None: 261 | for (name, position) in wireInstances[0][0]: 262 | if name == "Locations": 263 | wireLines.append((powerLines[object.instanceName], position)) 264 | if collectables1 != None: 265 | for collectable in collectables1: # Quantity should match collectables2 266 | if collectable.pathName in uncollectedPowerSlugsBlue: 267 | numCollectedSlugsMk1 += 1 268 | del uncollectedPowerSlugsBlue[collectable.pathName] 269 | if collectable.pathName in uncollectedPowerSlugsYellow: 270 | numCollectedSlugsMk2 += 1 271 | del uncollectedPowerSlugsYellow[collectable.pathName] 272 | if collectable.pathName in uncollectedPowerSlugsPurple: 273 | numCollectedSlugsMk3 += 1 274 | del uncollectedPowerSlugsPurple[collectable.pathName] 275 | if collectable.pathName in uncollectedSomersloops: 276 | del uncollectedSomersloops[collectable.pathName] 277 | if collectable.pathName in uncollectedMercerSpheres: 278 | del uncollectedMercerSpheres[collectable.pathName] 279 | 280 | crashSitesOpenWithDrive = [] 281 | crashSitesUnopenedKeys = list(crashSiteInstances.keys()) 282 | numOpenAndEmptyCrashSites = 0 283 | numOpenAndFullCrashSites = 0 284 | crashSiteInventoryPathName = {} 285 | 286 | numMinedResources = 0 287 | minedResources = [] 288 | for (levelName, actorAndComponentObjectHeaders, collectables1, objects, collectables2) in levels: 289 | for object in objects: 290 | if object.instanceName in minerInstances: 291 | if sav_parse.getPropertyValue(object.properties, "mExtractableResource") != None: 292 | numMinedResources += 1 293 | extractableResource = sav_parse.getPropertyValue(object.properties, "mExtractableResource") 294 | if extractableResource != None: 295 | minedResources.append(extractableResource.pathName) 296 | elif object.instanceName in crashSiteInstances: 297 | hasBeenOpened = sav_parse.getPropertyValue(object.properties, "mHasBeenOpened") 298 | if hasBeenOpened != None and hasBeenOpened: 299 | crashSitesUnopenedKeys.remove(object.instanceName) 300 | hasBeenLooted = sav_parse.getPropertyValue(object.properties, "mHasBeenLooted") 301 | if hasBeenLooted == None: 302 | crashSiteInventoryPathName[f"{object.instanceName}.Inventory2"] = object.instanceName # v1.0 doesn't use the "mInventory" property anymore. Any any open, but unlooted droppods from Update 8 will be empty in v1.0. 303 | hasBeenLooted = True # If inventory isn't found, the droppod has been looted, so assuming that here. 304 | if hasBeenLooted: 305 | numOpenAndEmptyCrashSites += 1 306 | else: # This case has not been observed 307 | numOpenAndFullCrashSites += 1 308 | crashSitesOpenWithDrive.append(crashSiteInstances[object.instanceName]) 309 | elif object.instanceName == "Persistent_Level:PersistentLevel.schematicManager": 310 | paidOffSchematics = sav_parse.getPropertyValue(object.properties, "mPaidOffSchematic") 311 | if paidOffSchematics != None: 312 | for paidOffSchematic in paidOffSchematics: 313 | paidOffSchematic_schematic = sav_parse.getPropertyValue(paidOffSchematic[0], "schematic") 314 | itemCostForActiveSchematic = sav_parse.getPropertyValue(paidOffSchematic[0], "ItemCost") 315 | if paidOffSchematic_schematic != None and itemCostForActiveSchematic != None and paidOffSchematic_schematic.pathName == activeSchematic: 316 | activeSchematicDescription = f'{activeSchematicDescription} Already supplied:\n
      \t\n' 317 | if activeSchematicShortName not in sav_parse.MILESTONE_COSTS: 318 | activeSchematicDescription = f"{activeSchematicDescription}
    • ERROR: {activeSchematicShortName} not in MILESTONE_COSTS
    • \n" 319 | else: 320 | alreadySupplied = {} 321 | for itemCost in itemCostForActiveSchematic: 322 | itemClass = sav_parse.getPropertyValue(itemCost[0], "ItemClass") 323 | if itemClass != None: 324 | amountSupplied = sav_parse.getPropertyValue(itemCost[0], "Amount") 325 | if amountSupplied != None: 326 | itemName = itemClass.pathName 327 | itemName = sav_parse.pathNameToReadableName(itemName) 328 | alreadySupplied[itemName] = amountSupplied 329 | for itemName in sav_parse.MILESTONE_COSTS[activeSchematicShortName]: 330 | totalCost = sav_parse.MILESTONE_COSTS[activeSchematicShortName][itemName] 331 | if itemName in alreadySupplied: 332 | amountSupplied = alreadySupplied[itemName] 333 | else: 334 | amountSupplied = 0 335 | activeSchematicDescription = f"{activeSchematicDescription}
    • {amountSupplied}/{totalCost} x {itemName} ({round(amountSupplied/totalCost*100,1)}% complete)
    • \n" 336 | activeSchematicDescription = f"{activeSchematicDescription}
    \n" 337 | elif activeSchematicDescription != None: 338 | activeSchematicDescription = f"{activeSchematicDescription}

    \n" 339 | 340 | for (levelName, actorAndComponentObjectHeaders, collectables1, objects, collectables2) in levels: 341 | for object in objects: 342 | if object.instanceName in crashSiteInventoryPathName: 343 | inventoryStacks = sav_parse.getPropertyValue(object.properties, "mInventoryStacks") 344 | if inventoryStacks != None: 345 | item = sav_parse.getPropertyValue(inventoryStacks[0][0], "Item") 346 | if item != None: 347 | if len(item) == 2 and isinstance(item[0], str): 348 | if item[0] == "/Game/FactoryGame/Resource/Environment/CrashSites/Desc_HardDrive.Desc_HardDrive_C" and item[1] != 0: 349 | numOpenAndEmptyCrashSites -= 1 350 | numOpenAndFullCrashSites += 1 351 | # Use inventory object to get droppod object to get location 352 | crashSitesOpenWithDrive.append(crashSiteInstances[crashSiteInventoryPathName[object.instanceName]]) 353 | 354 | creatingMapImagesFlag = pilAvailableFlag and os.path.isfile(MAP_BASENAME_BLANK) 355 | 356 | lines = "\n" # This allows the font setting to apply to the table 357 | lines += "\n" 358 | lines += f"Save file details: {saveFileInfo.sessionName}\n" 359 | lines += "\n" 360 | lines += "\n" 361 | lines += "\n" 362 | lines += "
    \n" 363 | 364 | lines += f"Session Name: {saveFileInfo.sessionName}
    \n" 365 | lines += f"Save Date: {saveFileInfo.saveDatetime.strftime('%m/%d/%Y %I:%M:%S %p')}
    \n" 366 | 367 | SECONDS_IN_MINUTE = 60 368 | SECONDS_IN_HOUR = 60 * SECONDS_IN_MINUTE 369 | playTimeHours = int(saveFileInfo.playDurationInSeconds / SECONDS_IN_HOUR) 370 | playTimeMinutes = (saveFileInfo.playDurationInSeconds - playTimeHours * SECONDS_IN_HOUR) / SECONDS_IN_MINUTE 371 | lines += f'Play Time: {playTimeHours} hours, {round(playTimeMinutes,1)} minutes

    \n' 372 | if len(sav_parse.satisfactoryCalculatorInteractiveMapExtras): 373 | lines += f'File suspected of having been saved by satisfactory-calculator.com/en/interactive-map for {len(sav_parse.satisfactoryCalculatorInteractiveMapExtras)} reasons.

    \n' 374 | 375 | lines += f'Game Phase: {gamePhase}

    \n' 376 | 377 | if activeSchematicDescription != None: 378 | lines += f'Active Milestone: {activeSchematicDescription}' 379 | 380 | lines += f'Mining {numMinedResources} of {len(minedResourceActors)} resources' 381 | if creatingMapImagesFlag: 382 | lines += f' (map).\nMap of Power Lines.

    \n' 383 | else: 384 | lines += ".

    \n" 385 | 386 | TOTAL_NUM_SLUGS = len(sav_data_slug.POWER_SLUGS_BLUE) + len(sav_data_slug.POWER_SLUGS_YELLOW) + len(sav_data_slug.POWER_SLUGS_PURPLE) 387 | totalNumCollectedSlugs = numCollectedSlugsMk1 + numCollectedSlugsMk2 + numCollectedSlugsMk3 388 | lines += f"{totalNumCollectedSlugs} of {TOTAL_NUM_SLUGS} slugs collected.\n" 389 | lines += f"{numCollectedSlugsMk1} of {len(sav_data_slug.POWER_SLUGS_BLUE)} blue.\n" 390 | lines += f"{numCollectedSlugsMk2} of {len(sav_data_slug.POWER_SLUGS_YELLOW)} yellow.\n" 391 | lines += f"{numCollectedSlugsMk3} of {len(sav_data_slug.POWER_SLUGS_PURPLE)} purple." 392 | if creatingMapImagesFlag: 393 | lines += f'\nMap of remaining slugs.' 394 | lines += "

    \n" 395 | 396 | lines += f"{len(uncollectedSomersloops)} Somersloops remaining ({round(len(uncollectedSomersloops)/len(sav_data_somersloop.SOMERSLOOPS)*100,1)}% of {len(sav_data_somersloop.SOMERSLOOPS)})." 397 | if creatingMapImagesFlag: 398 | lines += f' map' 399 | lines += "
    \n" 400 | 401 | lines += f"{len(uncollectedMercerSpheres)} Mercer Spheres remaining ({round(len(uncollectedMercerSpheres)/len(sav_data_mercerSphere.MERCER_SPHERES)*100,1)}% of {len(sav_data_mercerSphere.MERCER_SPHERES)})." 402 | if creatingMapImagesFlag: 403 | lines += f' map' 404 | lines += "

    \n" 405 | 406 | numCrashSitesNotOpened = len(crashSiteInstances) - numOpenAndEmptyCrashSites - numOpenAndFullCrashSites 407 | lines += f"Of {len(crashSiteInstances)} crash sites, {numOpenAndEmptyCrashSites} {('have','has')[numOpenAndEmptyCrashSites == 1]} been looted, {numCrashSitesNotOpened} {('have','has')[numCrashSitesNotOpened == 1]} not been opened, {numOpenAndFullCrashSites} {('are','is')[numOpenAndFullCrashSites == 1]} open with a drive available.\r\n" 408 | if creatingMapImagesFlag: 409 | lines += f'Map of hard drives.' 410 | lines += '

    \n' 411 | 412 | lines += "Unlock Progress:\n" 413 | lines += '

      \n' 414 | lines += f"
    • HUB Tiers: {unlockCount_hubTiers} of {len(sav_parse.UNLOCK_PATHS__HUB_TIERS)}
    • \n" 415 | lines += f"
    • MAM: {unlockCount_mam} of {len(sav_parse.UNLOCK_PATHS__MAM)}
    • \n" 416 | #lines += str(unlockRemaining_mam) # Research_AO_Hog and Research_AO_Spitter remain, but they're clearly unlocked 417 | lines += f"
    • Awesome Shop: {unlockCount_awesomeShop} of {len(sav_parse.UNLOCK_PATHS__AWESOME_SHOP)}
    • \n" 418 | #lines += str(unlockRemaining_awesomeShop) # TODO: Why ResourceSink_Checkmark??? My calculation is the same as satisfactory-calculator, but not the game 419 | lines += f"
    • Hard Drives: {unlockCount_hardDrives} of {len(sav_parse.UNLOCK_PATHS__HARD_DRIVES)}
    • \n" 420 | lines += f"
    • Special: {unlockCount_special} of {len(sav_parse.UNLOCK_PATHS__SPECIAL)}
    • \n" 421 | lines += "
    \n" 422 | 423 | if len(pointProgressLines) > 0: 424 | lines += "Sink Point Progress:\n" 425 | lines += '
      \n' 426 | lines += pointProgressLines 427 | lines += "
    \n" 428 | 429 | if len(dimensionalDepotContents) > 0: 430 | lines += "Dimensional Depot Contains:\n" 431 | lines += '
      \n' 432 | dimensionalDepotContents.sort(key=lambda x: x[1]) 433 | for (itemCount, itemName) in dimensionalDepotContents: 434 | stackSize = getStackSize(itemName, itemCount) 435 | if stackSize == None: 436 | lines += f"
    • {itemCount} x {itemName}
    • \n" 437 | else: 438 | lines += f"
    • {itemCount} x {itemName} ({round(itemCount/(stackSize*CURRENT_DEPOT_STACK_LIMIT)*100,1)}%)
    • \n" 439 | lines += "
    \n" 440 | 441 | if len(buildablesMap) > 0: 442 | lines += f"{numBuildables} current built items:\n" 443 | lines += '
      \n' 444 | buildables = [] 445 | for buildable in buildablesMap: 446 | buildables.append((buildablesMap[buildable], buildable)) 447 | buildables.sort(reverse=True, key=lambda x: x[0]) 448 | for buildable in buildables: 449 | shortName = sav_parse.pathNameToReadableName(buildable[1]) 450 | lines += f"
    • {buildable[0]} x {shortName}
    • \n" 451 | lines += "
    \n" 452 | 453 | if numCreaturesKilled > 0: 454 | lines += f"{numCreaturesKilled} creatures killed:\n" 455 | lines += '
      \n' 456 | creaturesKilled.sort(reverse=True, key=lambda x: x[1]) 457 | for creature in creaturesKilled: 458 | shortName = sav_parse.pathNameToReadableName(creature[0]) 459 | lines += f"
    • {creature[1]} x {shortName}
    • \n" 460 | lines += f"
    • Flying Crab Hatchers not tracked as of v1.0.0.4
    • \n" 461 | lines += "
    \n" 462 | 463 | lines += "
    \n" 464 | lines += "\n" 465 | lines += "\n" 466 | 467 | with open(htmlFilename, "w") as fout: 468 | fout.write(lines) 469 | chown(htmlFilename) 470 | 471 | if creatingMapImagesFlag: 472 | Image.MAX_IMAGE_PIXELS = 1700000000 473 | 474 | try: 475 | imageFont = ImageFont.truetype(FONT_FILENAME, MAP_FONT_SIZE) 476 | # Testing has shown that, if this font load fails, imageFont is None 477 | # which cases the drawn text to be present, just with a tiny font. 478 | # User feedback has reported that it threw OSError. 479 | except: 480 | imageFont = None 481 | 482 | if imageFont == None: 483 | print("CAUTION: An error occured loading the font file. Please update the FONT_FILENAME variable to point at a font installed on your system. If you need a .ttf file, can you can get from https://github.com/kiwi0fruit/open-fonts") 484 | 485 | origImage = Image.open(MAP_BASENAME_BLANK) 486 | 487 | slugImage = origImage.copy() 488 | slugDraw = ImageDraw.Draw(slugImage) 489 | addSlugs(slugDraw, uncollectedPowerSlugsBlue, (0,0,255)) 490 | addSlugs(slugDraw, uncollectedPowerSlugsYellow, (255,255,0)) 491 | addSlugs(slugDraw, uncollectedPowerSlugsPurple, (192,0,192)) 492 | slugDraw.text(MAP_TEXT_1, saveFileInfo.saveDatetime.strftime("Slugs from save %m/%d/%Y %I:%M:%S %p"), font=imageFont, fill=(0,0,0)) 493 | slugDraw.text(MAP_TEXT_2, saveFileInfo.sessionName, font=imageFont, fill=(0,0,0)) 494 | imageFilename = f"{outputDir}/{MAP_BASENAME_SLUGS}" 495 | slugImage.crop(CROP_SETTINGS).save(imageFilename) 496 | chown(imageFilename) 497 | 498 | hdImage = origImage.copy() 499 | hdDraw = ImageDraw.Draw(hdImage) 500 | for key in crashSiteInstances: 501 | coord = crashSiteInstances[key] 502 | posX = adjPos(coord[0], False) 503 | posY = adjPos(coord[1], True) 504 | hdDraw.ellipse((posX-2, posY-2, posX+2, posY+2), fill=(255,255,255)) 505 | for key in crashSitesUnopenedKeys: 506 | coord = crashSiteInstances[key] 507 | posX = adjPos(coord[0], False) 508 | posY = adjPos(coord[1], True) 509 | hdDraw.ellipse((posX-2, posY-2, posX+2, posY+2), fill=(0,0,255)) 510 | for coord in crashSitesOpenWithDrive: 511 | if coord != None: 512 | posX = adjPos(coord[0], False) 513 | posY = adjPos(coord[1], True) 514 | hdDraw.ellipse((posX-2, posY-2, posX+2, posY+2), fill=(0,255,0)) 515 | hdDraw.text(MAP_TEXT_1, saveFileInfo.saveDatetime.strftime("Hard drives from save %m/%d/%Y %I:%M:%S %p"), font=imageFont, fill=(0,0,0)) 516 | hdDraw.text(MAP_TEXT_2, saveFileInfo.sessionName, font=imageFont, fill=(0,0,0)) 517 | imageFilename = f"{outputDir}/{MAP_BASENAME_HARD_DRIVES}" 518 | hdImage.crop(CROP_SETTINGS).save(imageFilename) 519 | chown(imageFilename) 520 | 521 | ssImage = origImage.copy() 522 | ssDraw = ImageDraw.Draw(ssImage) 523 | for instanceName in uncollectedSomersloops: 524 | (rootObject, rotation, position) = uncollectedSomersloops[instanceName] 525 | posX = adjPos(position[0], False) 526 | posY = adjPos(position[1], True) 527 | ssDraw.ellipse((posX-2, posY-2, posX+2, posY+2), fill=(244,56,69)) 528 | ssDraw.text(MAP_TEXT_1, saveFileInfo.saveDatetime.strftime("Somersloops from save %m/%d/%Y %I:%M:%S %p"), font=imageFont, fill=(0,0,0)) 529 | ssDraw.text(MAP_TEXT_2, saveFileInfo.sessionName, font=imageFont, fill=(0,0,0)) 530 | imageFilename = f"{outputDir}/{MAP_BASENAME_SOMERSLOOP}" 531 | ssImage.crop(CROP_SETTINGS).save(imageFilename) 532 | chown(imageFilename) 533 | 534 | msImage = origImage.copy() 535 | msDraw = ImageDraw.Draw(msImage) 536 | for instanceName in uncollectedMercerSpheres: 537 | (rootObject, rotation, position) = uncollectedMercerSpheres[instanceName] 538 | posX = adjPos(position[0], False) 539 | posY = adjPos(position[1], True) 540 | msDraw.ellipse((posX-2, posY-2, posX+2, posY+2), fill=(78,16,113)) 541 | msDraw.text(MAP_TEXT_1, saveFileInfo.saveDatetime.strftime("Mercer Spheres from save %m/%d/%Y %I:%M:%S %p"), font=imageFont, fill=(0,0,0)) 542 | msDraw.text(MAP_TEXT_2, saveFileInfo.sessionName, font=imageFont, fill=(0,0,0)) 543 | imageFilename = f"{outputDir}/{MAP_BASENAME_MERCER_SPHERE}" 544 | msImage.crop(CROP_SETTINGS).save(imageFilename) 545 | chown(imageFilename) 546 | 547 | plImage = origImage.copy() 548 | plDraw = ImageDraw.Draw(plImage) 549 | for (src, dst) in wireLines: 550 | possX = adjPos(src[0], False) 551 | posdX = adjPos(dst[0], False) 552 | possY = adjPos(src[1], True) 553 | posdY = adjPos(dst[1], True) 554 | plDraw.line(((possX, possY), (posdX, posdY)), fill=(22,47,101), width=2) 555 | plDraw.text(MAP_TEXT_1, saveFileInfo.saveDatetime.strftime("Power Lines from save %m/%d/%Y %I:%M:%S %p"), font=imageFont, fill=(0,0,0)) 556 | plDraw.text(MAP_TEXT_2, saveFileInfo.sessionName, font=imageFont, fill=(0,0,0)) 557 | imageFilename = f"{outputDir}/{MAP_BASENAME_POWER}" 558 | plImage.crop(CROP_SETTINGS).save(imageFilename) 559 | chown(imageFilename) 560 | 561 | rnImage = origImage.copy() 562 | rnDraw = ImageDraw.Draw(rnImage) 563 | for instanceName in minedResourceActors: 564 | (position, type, purity) = minedResourceActors[instanceName] 565 | posX = adjPos(position[0], False) 566 | posY = adjPos(position[1], True) 567 | 568 | sz = 3 569 | if instanceName in minedResources: 570 | sz = 2 571 | 572 | purityColors = { 573 | sav_parse.Purity.IMPURE: (210,52,48), 574 | sav_parse.Purity.NORMAL: (242,100,24), 575 | sav_parse.Purity.PURE: (128,177,57), 576 | } 577 | if purity in purityColors: 578 | rnDraw.ellipse((posX-sz, posY-sz, posX+sz, posY+sz), fill=purityColors[purity]) 579 | 580 | sz -= 1 581 | 582 | typeColors = { 583 | None: (255,255,255), 584 | "Desc_Coal_C": (80,80,80), 585 | "Desc_Geyser_C": (192,192,255), 586 | "Desc_LiquidOil_C": (20,20,20), 587 | "Desc_LiquidOilWell_C": (20,20,20), 588 | "Desc_NitrogenGas_C": (232,229,196), 589 | "Desc_OreBauxite_C": (200,140,114), 590 | "Desc_OreCopper_C": (149,93,87), 591 | "Desc_OreGold_C": (210,188,150), 592 | "Desc_OreIron_C": (111,80,93), 593 | "Desc_OreUranium_C": (94,141,82), 594 | "Desc_RawQuartz_C": (221,154,201), 595 | "Desc_SAM_C": (110,46,169), 596 | "Desc_Stone_C": (191,178,168), 597 | "Desc_Sulfur_C": (205,191,102), 598 | "Desc_Water_C": (165,204,223), 599 | } 600 | if type in typeColors: 601 | rnDraw.ellipse((posX-sz, posY-sz, posX+sz, posY+sz), fill=typeColors[type]) 602 | rnDraw.text(MAP_TEXT_1, saveFileInfo.saveDatetime.strftime("Resource Nodes from save %m/%d/%Y %I:%M:%S %p"), font=imageFont, fill=(0,0,0)) 603 | rnDraw.text(MAP_TEXT_2, saveFileInfo.sessionName, font=imageFont, fill=(0,0,0)) 604 | imageFilename = f"{outputDir}/{MAP_BASENAME_RESOURCE_NODES}" 605 | rnImage.crop(CROP_SETTINGS).save(imageFilename) 606 | chown(imageFilename) 607 | 608 | except Exception as error: 609 | with open(htmlFilename, "w") as fout: 610 | fout.write(f"Error parsing save{error}") 611 | raise Exception(f"ERROR: While processing '{savFilename}': {error}") 612 | 613 | if __name__ == '__main__': 614 | 615 | if len(sys.argv) <= 1 or len(sys.argv[1]) == 0: 616 | allSaveFiles = [] 617 | if "LOCALAPPDATA" in os.environ: 618 | allSaveFiles = glob.glob(f"{os.environ['LOCALAPPDATA']}/FactoryGame/Saved/SaveGames/*/*.sav") 619 | if len(allSaveFiles) == 0: 620 | print("ERROR: No .sav file specified.") 621 | exit(1) 622 | savFilename = max(allSaveFiles, key=os.path.getmtime) 623 | else: 624 | savFilename = sys.argv[1] 625 | 626 | if not os.path.isfile(savFilename): 627 | print(f"ERROR: Save file does not exist: '{savFilename}'", file=sys.stderr) 628 | exit(1) 629 | 630 | outputDir = DEFAULT_OUTPUT_DIR 631 | if len(sys.argv) > 2: 632 | outputDir = sys.argv[2] 633 | 634 | htmlBasename = DEFAULT_HTML_BASENAME 635 | if len(sys.argv) > 3: 636 | htmlBasename = sys.argv[3] 637 | 638 | generateHTML(savFilename, outputDir, htmlBasename) 639 | 640 | exit(0) 641 | -------------------------------------------------------------------------------- /sav_to_resave.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # This file is part of the Satisfactory Save Parser distribution 3 | # (https://github.com/GreyHak/sat_sav_parse). 4 | # Copyright (c) 2024 GreyHak (github.com/GreyHak). 5 | # 6 | # This program is free software: you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation, version 3. 9 | # 10 | # This program is distributed in the hope that it will be useful, but 11 | # WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | # General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | 18 | import sys 19 | import struct 20 | import zlib 21 | import sav_parse 22 | 23 | def addInt8(val): 24 | if isinstance(val, bytes): 25 | return struct.pack(" len(rdata): 820 | chunkSize = len(rdata) - dataOffset 821 | 822 | cdata = zlib.compress(rdata[dataOffset:dataOffset+chunkSize]) 823 | 824 | sdata.extend(addUint32(0x9e2a83c1)) 825 | sdata.extend(addUint32(0x22222222)) 826 | sdata.extend(addUint8(0)) 827 | 828 | sdata.extend(addUint32(MAXIMUM_CHUNK_SIZE)) 829 | sdata.extend(addUint32(0x03000000)) 830 | sdata.extend(addUint64(len(cdata))) 831 | sdata.extend(addUint64(chunkSize)) 832 | sdata.extend(addUint64(len(cdata))) 833 | sdata.extend(addUint64(chunkSize)) 834 | sdata.extend(cdata) 835 | 836 | dataOffset += chunkSize 837 | progressBar.set(dataOffset) 838 | progressBar.complete() 839 | 840 | with open(outFilename, "wb") as fout: 841 | fout.write(sdata) 842 | 843 | if __name__ == '__main__': 844 | 845 | if len(sys.argv) != 3: 846 | print("USAGE: sav_to_resave.py ") 847 | exit(1) 848 | 849 | inFilename = sys.argv[1] 850 | outFilename = sys.argv[2] 851 | 852 | print("Parsing save file") 853 | (saveFileInfo, headhex, grids, levels, extraObjectReferenceList) = sav_parse.readFullSaveFile(inFilename) 854 | 855 | print("Recreating save file") 856 | saveFile(saveFileInfo, headhex, grids, levels, extraObjectReferenceList, outFilename) 857 | 858 | exit(0) 859 | --------------------------------------------------------------------------------