- Joined
- Mar 17, 2007
- Messages
- 9,305
I'm back on C7 stuff (while using my newly discovered mono tools), and I realized I've probably been pretty dumb. We don't have to name the C7 file .json, especially for the static "new game" save. I think if we name it something Godot recognizes, like .gd or .gdscript, it will throw it into the PCK file and we can find it reliably on any platform. (Possible complications, but I think it's doable.) It shouldn't try to run the .gd file because it won't be assigned to any nodes.
Also, I just stumbled on the user:// file reference in Godot. That is probably where we'll want natively saved files to go. In Windows this goes to the user's roaming AppData folder, and in other platforms it may go to a .godot folder in the home directory, or wherever user data is supposed to go on that platform
....
https://godotengine.org/qa/52307/can-you-read-a-textfile-resource-with-gdscript
https://github.com/godotengine/godot/blob/master/scene/resources/text_file.cpp
https://www.google.com/search?q=godot+load+text+resource
You're probably right about this, but it seems a bit odd that you can't throw just any old file in a PCK bundle. Doesn't that limit Godot's flexibility a bit? Oh well, it's no more of a hack than renaming .exe files to .zzz files so you can GMail them to your friends (something I used to do all the time).
Thoughts on the user:// and where to save natively supported files. It's a mess on Windows as to where games put their saves. Locations I have seen many games use include:
- Their own save folder, within their install folder; Civ 3 is such a game. Officially discouraged by Microsoft, has been for decades, but never really caused any problems until Windows Vista, where it caused a lot of headaches. The obvious appeal was it was easy to find the saves if you knew where the game was installed.
- C:\Users\<username>\AppData\Local - Cities: Skylines, Burnout Paradise, etc. use this location
- C:\Users\<username>\AppData\LocalLow - A ton of games use this location. Offworld Trading Company (from Soren's company Mohawk Games) is one example
- C:\Users\<username>\AppData\Roaming - Not as many games as the above, but still a good amount. Factorio being one example. Godot also uses this location for its local configuration.
- My Documents - A whole bunch of games. Empire Earth II, all Paradox games since Victoria II, etc. IMO this is not a great option as it clutters up the My Documents folder which is intended to be used for storing the user's documents. IMO, a save game folder does not belong at the top level here. I no longer store my documents in the My Documents folder as it got overrun with game-specific folders.
- My Documents\My Games - A bunch of games, such as Civ IV through Civ VI, Galactic Civilizations II, etc. IMO this is the best option, as it makes it easy to find the save games/mod files/etc., but doesn't take over the top-level My Documents folder if the user installs a bunch of games.
- C:\Users\<username>\Documents, or C:\Users\<username>\Documents\My Games - A few games such as Van Helsing, plus a few tools such as Visual Studio 2010. These games don't use the system variable for referencing where My Documents lives, although they do for the user folder. Don't be one of those developers (looking at you, Microsoft!).
- C:\Users\<username> - Really it's development tools and cross-platform, Linux-first programs such as GIMP that put their config here, i.e. C:\Users\<username>\.gimp-2.8 . IMO, while not "native", this is preferable to having to dig through the AppData folders. Few users know to check here, but fewer still know to check in AppData, let alone its various sub-folders.
From a user standpoint, I have no idea what should be in Local/LocalLow/Roaming, and there seems to be no rhyme or reason as to what goes in each location. MyDocuments\My Games makes sense from a user standpoint.
From a developer standpoint, I don't know what Local/LocalLow/Roaming should be used for either. I could probably look it up, but I don't think that would help our users figure out where their save files are.
Does it show that I find AppData, and how it's used inconsistently by third-party (and sometimes even first-party) developers, to be one of the most annoying parts of the Windows platform?
Oops, I branched my current feature branch from MountainsAndHills I just noticed.
17f3bed5f45172f4a43a942c5e0ea104b2ad81be in particular. Hopefully that's going to get merged in the not too distant future. It looks like it's working to me, and it looks good.
I started off just making a console app for Lua to drive QueryCiv3 against a number of files, but now I'm taking what I'm learning and modifying QueryCiv3 some, but nothing we're currently using.
I was searching hard for a byte that tells me if the bic has custom rules and/or a custom map, then I realized I'm a dummy and am now just keying on whether BLDG or WCHR exist, respectively.
That can pretty much be merged at any time. I'd been keeping it open as I (slowly, due to moving plans coming together this afternoon and recovery from my booster shot's side effects on Monday) work on the finer points of mountainous terrain. But you're right, it's not so much a half-baked cake as a cake that doesn't have the icing yet, but would still taste fine and have a good texture.
You are correct that there are no bytes for custom rules/map/player data, it's just based on whether those sections of the file exist. I thought those bytes existed too, but that's because I added flags for them in my editor code for ease of reference. I just read the first header, and if it's BLDG, there's custom rules. If it's not, I check if it's WCHR, etc.
You're welcome. Now I want to play some SMAC again
It's got me comparing the two. Jungles in civ3 are always worthless as a jungle. In SMAC, xenofungus is a huge PITA early game not unlike jungles, only it's worse as the "barbs" native life in SMAC use xenofungus like roads and are more or less invisible in them until they're in your zone of control. But you can follow a tech tree route (and societal choices analogous to government type or the multi-option stuff you have in Civ4) that makes xenofungus very productive late game.
I like that compared to civ3 jungles and marshes. You can still clear xenofungus and terraform like crazy, but it tends to make the native life more aggressive when you do that. Interesting mechanics.
Having visible terrain elevation is interesting, too.
Some of you seem to have networks of games-knowledgeable people. Aside from the name recognition of the Civilization series, I think a huge part of Civ3's resurgence is that it's available on Steam. Sure, SMAC is on GoG and cheap, but I think if it were on Steam at the same price, more people would notice it and pick it up. It doesn't have "Civilization" in the name, but it is branded "Sid Meier's". Does anyone have a chain of friends that could poke someone to see about putting SMAC on Steam?
You're making me want to dive into SMAC. Which might endanger my progress on C7. Then again, I've also been pondering jumping into Call to Power 2 in recent days. Maybe C7 is making me think more about other 4X games.
I don't have such friends, but I do suspect Civ III's availability on Steam at prices lower than the average game on GOG, couple with regular sales, has likely provided a significant boost to its user base over the past decade.
Looking at the publishers, I see:
- CivIII and later are Infogrames Interactive/Atari/2K, which all roles up to 2K today. 2K doesn't have its own game store, and puts its stuff on Steam, and a good chunk of its older stuff on GOG.
- SMAC is published by Electronic Arts. They want you to buy on Origin, although they put some stuff on Steam as well. They also are pretty decent about putting older stuff on GOG, if it still runs okay on modern systems. They don't seem to put their own older stuff on Origin for some reason. Maybe GOG gives them a higher cut if it's only on GOG, and they figure their old-school game audience is more likely to be on GOG than Origin?
- Civ II is published by Microprose, which I believe rolled up into Atari/2K. But on PS/2, it was published by Activision, so maybe it would up with Activision/Blizzard, which has their own store as well. AFAIK you can't legally buy it anywhere other than a disc on eBay/your local secondhand store.
- Call to Power II is published by Activision, and is on GOG, which suggests Activision is not opposed to GOG as a venue for their old games. So where did Civ II fall through the cracks?
Perhaps a relevant question is does the CD version of SMAC/CTP II work on modern systems as-is? If GOG did some work to iron out gremlins on modern systems, that could be why they are only on GOG. I know they do such work on some older games.
But yes, it does seem reasonable that if Electronic Arts wanted to maximize their SMAC revenue, it would make sense to have it on Steam and Origin in addition to GOG. Whether that's enough of a drop to register on their bucket... I wouldn't guess so, but I'm not sure I would have guessed GOG sales would have either. Maybe the GOG release was part of their PR department's initiatives to make them seem less evil.
A random idea immediately relevant to C7: We could allow comment-only lines in JSON. This just occurred to me. Comments aren't allowed in JSON proper, but what's to prevent us from running a C7 save through a "remove comment lines" filter? To allow a comment header.
On the other hand, maybe we can just lay out the JSON in a way that's self-documenting, with the map tiles near the bottom and the player count, game settings, number of human players, and such near the top of the file. Maybe have a field for player notes or just some sort of freeform text in case the player wants to put a note in the game to remind them of what it is about in the future. HoF run or something, not that I expect a C7 HoF anytime soon.
This makes me ponder, what is the main point of having the save be in a human readable format? Is it for humans to manually fiddle with the save? Or for third party tools to be able to make use of it easily, and without relying on Apolyton documentation from 2004 that covers a binary format?
I'm sure there's some people who will want to do it manually, and that could be really useful if you accidentally made the Medieval Infantry have an attack of 44 instead of 4 in your mod, and only realize it when one shows up at your border. But thinking about the times I've opened a Europa Universalis IV save and realized the enormity of the data, maybe the latter is at least as relevant? I think I did try to manually modify things once or twice (probably ending a permanent war in EU3, before automatic white peaces were implemented), but never with a lot of confidence.