1. Firaxis celebrates the "Asian American and Pacific Islander Heritage Month", and offers a give-away of a Civ6 anthology copy (5 in total)! For all the details, please check the thread here. .
    Dismiss Notice
  2. Old World has finally been released on GOG and Steam, besides also being available in the Epic store . Come to our Old World forum and discuss with us!
    Dismiss Notice

What I'm Up To

Discussion in 'Civ3 Future Development' started by Puppeteer, Jan 14, 2021.

  1. Puppeteer

    Puppeteer Emperor

    Joined:
    Oct 4, 2003
    Messages:
    1,687
    Location:
    Silverdale, WA, USA
    Mac export is sort-of working now. I have to xattr -cr the ..app once I dig down to it, and then I can launch it and get the main menu screen with graphics if CIV3_HOME is set. It crashes to desktop when trying to go into the game, but I have no error messages. I'm guessing it's not finding the json save, but I tried stuffing that inside the app next to the PCK and it still crashes.

    I guess I need to figure out how to make the export throw errors. And I think what I need to do for Mac is just build the zip from Godot and upload that as the artifact. For some reason the layers of zips on Mac just break my brain. I think you're supposed to download a zip, click on it, and then you have an .app which looks like a program icon but is either a zip file itself or a file hierarchy...maybe both. But then the download puts the zip in a zip, and clicking down through the zips just does not behave the way I expect. a C7 just just appears beside the zip instead of under a subfolder like everything else.

    And I don't know the non-command-line way to tell the Mac it's ok to run...I thought it was option-clicking and getting to some dialog, but I couldn't find that this late afternoon.


    Also, I removed the default "-dev-build" text from the folder names. Since that was default, it would throw that in when I emptied the field manually...oops. But you can presumably still add something there if you want.

    Edit: Ok, I think I understand .app ...things now. It's just a folder named .app that MacOS treats differently. And its popping up beside the archive makes sense now because it's the folder name, and that's where the folder would appear.
     
    Last edited: Nov 28, 2021
  2. Puppeteer

    Puppeteer Emperor

    Joined:
    Oct 4, 2003
    Messages:
    1,687
    Location:
    Silverdale, WA, USA
    The build script can now make debug builds and does by default. (First checkbox.) But it still doesn't throw errors, at least not on Mac. It does say "C7 (DEBUG)" at the top, so yay.

    I'm getting pretty frustrated with building for the Mac as there doesn't seem to be a reliable way to stuff the "static" json file into the .app folder and/or determine how to find it from a non-Objective-C/Cocoa app. :p Pulling from the local working directory isn't ideal in Windows and Linux, but it's working well enough for now.

    There must be a way, though; there are plenty of non-Mac apps with .ini and other config files. I'll try to let it go for now, and maybe it will make sense later.

    Actually, maybe I'm just upset with Google. It keeps wanting to show me what everyone else is searching for instead of what I want.

    As far as the double-zip problem, I think even if I only upload the zip the artifact host will zip it again like it does for the tgz, so I'm not going to fight that anymore. The artifacts download is not the "right" place; the releases page is, and we can get the exact files we want there.
     
  3. Quintillus

    Quintillus Archiving Civ3 Content Supporter

    Joined:
    Mar 17, 2007
    Messages:
    7,166
    Location:
    Ohio
    Made a build to try it out. Worked great. The arrow-filled screenshot of what to do made it easy to figure out even though I'd never done it before. Commit spam is pretty much inevitable when trying out these sort of build systems, particularly when it requires the work be done on the default branch. I wouldn't worry about that.

    It does sound like it may be a good idea to punt on the remaining Mac build gremlins and revisit it later. I'm reminded of the times that I'll be trying to figure out why something isn't working for 2 hours in the late afternoon, decide to throw in the towel for the day, and have a solution working in 15 minutes in the morning, when I've given my brain a break (or perhaps more accurately, a chance to get out of its rut). And that's as very much not a morning person.

    If need be, I can fire up my MacMini running High Sierra at some point and try things out; I do that a couple times a year for my editor. It's not as efficient as firing up a VM, though, and my Mac knowledge is less than my Linux knowledge (which is less than my Windows knowledge) so I'll default to being a Bionic verifier unless otherwise requested.
     
    Puppeteer likes this.
  4. Puppeteer

    Puppeteer Emperor

    Joined:
    Oct 4, 2003
    Messages:
    1,687
    Location:
    Silverdale, WA, USA
    An acceptable (to me, for now) solution has emerged for Mac. After adding load game functionality to the main menu, the Mac can now work as long as it doesn't try to 'create game' with the default save. As for how to add the save to the downloadable and avoid whatever was bending my brain, I'm just stuffing the json file into the zip folder that contains C7.app and uploading that zip. I think that's what a Mac user expects: download zip, double-click, there's the app icon. And now a json file beside it because there isn't currently a sane place to put it.

    In the longer term I'm wondering if avoiding the Mac binary export and just tossing the redistributable binary in with a PCK file will work like it does on the other platforms. I think it will, and *maybe* it will then load the json file with a current directory pathing. Or not. It's not urgent, and really the long-term solution is to enable terrain generation.

    Also, once we get the package into some Mac user's hands we'll hear what they expect and what surprised them. Learning by f'ing up is powerful.

    Edit: I do plan on changing the build script to stuff the json file in the zip next to C7.app quite soon. I did it manually for the Aztec draft release, and I like how that presents.
     
    Quintillus likes this.
  5. Puppeteer

    Puppeteer Emperor

    Joined:
    Oct 4, 2003
    Messages:
    1,687
    Location:
    Silverdale, WA, USA
    This was manually done for the Aztec download, and now the build script puts it in there.

    The build script also now raises a warning in the job screen if it fails to copy the json save into the build, but the build succeeds and the artifact is attached. It also names the Mac distributable zip with the suffixes specified.

    So, as a summary, the artifact items to be attached to releases:
    • Windows - The whole artifact as-is
    • Linux - The .tgz file inside the artifact's zip
    • Mac - The .zip file inside the artifact's .zip
    The reason these are different is because Mac export builds its own zip (in which the build script is now adding the json save) and the Linux export is explicitly tarred into a .tgz archive to preserve the executable permission. (Apparently contrary to my earlier assertion, zip *can* store unix permissions, but the way the files are uploaded to the artifact strips their permissions, so we have to bundle it before uploading it to the artifact.)

    At some point I'll probably either add a flow or add a checkbox to this flow to create a release and attach the right files to it.
     
  6. Puppeteer

    Puppeteer Emperor

    Joined:
    Oct 4, 2003
    Messages:
    1,687
    Location:
    Silverdale, WA, USA
    I feel the urge to try to force myself to use Mono command line tools, and I'm going to babble about it here.

    After some Googling, I don't see an equivalent of "dotnet new" for Mono; you seem to have to make it by hand or use another tool. I'm wondering if dotnet can be used to compile against Mono, but I kind of doubt it. Mono uses MSBuild to manage compiling against .csproj files, but MSBuild doesn't seem to *make* .csproj files.

    https://www.mono-project.com/docs/getting-started/mono-basics/ - Shows using `csc` to compile a one-file "hello world" which outputs an .exe even on Mac (& presumably Linux), and then you use `mono HelloWorld.exe` to run it.

    And now that I think about it...that works for me, actually. I recall being frustrated at first with dotnetcore because there seemed to be literally no way to do hello world without a .csproj file. But I'm mostly wanting to run 'one file'ers from command line to use the libraries we've built to test them or use them. I'm not sure why I let myself get frustrated that I can't figure out csproj files in mono when I'm not sure I wanted them in the first place.

    On the other hand, I'll have to see how to reference other local packages and nuget packages.

    https://www.codeproject.com/Articles/9407/Introduction-to-Mono-Your-first-Mono-app#MonoToolset - This list of command line tools might be a handy reference...or maybe I'll never use any of that besides mono and csc...unsure yet. (Edit: This post is from 2004 or 2005; no idea if it's been updated.)

    Ok, now I'm going to go try to recreate the console app with mono tools and SDK.

    Edit: A more up-to-date command-line tools list: https://www.mono-project.com/docs/tools+libraries/tools/

    That said, if Google is any indication, almost nobody uses mono on the command line much. It's all about IDEs and XSP and other ready-made environments.

    Edit *: `mcs`, not csc...csc is the MS compiler, but I think I used it earlier and ran the result with mono and it worked, but I guess that's expected.
     
    Last edited: Nov 29, 2021
  7. Vuldacon

    Vuldacon Dedicated to Excellence Supporter

    Joined:
    Nov 14, 2001
    Messages:
    7,025
    Gender:
    Male
    Location:
    USA
    Puppeteer... I have been having some problems with the First Lens Implant and it all has been causing me headaches and very distorted vision.
    I hope it will heal better and my Left Eye Lens Implant does not do the same thing... I see the edge of the Lens and it flashes light and flutters. There are reasons for that but as it turns out, I am among the 20% that experience "Negative Dysphotopsia".
    My Left Eye will be laser adjusted for Astigmatism the 8th of December and then Get the New Lens Implant the 15th of December.

    I am at least managing to Play Test and try to keep up with posts here.

    Images from left to right, I adjusted to show my vision with Cataracts, after Lens Implant and how I saw after the edge of the Lens. I now see about 1/3rd of how the last image shows to Edge of the Lens so I hope it continues to get better because it is driving me insane :crazyeye:

    Cataract Before After_ND with Lens.png
     
    Quintillus, WildWeazel and Puppeteer like this.
  8. Puppeteer

    Puppeteer Emperor

    Joined:
    Oct 4, 2003
    Messages:
    1,687
    Location:
    Silverdale, WA, USA
    Hope things continue to approve, Vuldacon!

    More on mono...

    I tried using a call from System.Json.Text and compiling with a reference to a dll for it `mcs -r /path/to/System.Json.Text.dll HelloWorld.cs`, and it compiled, but it throws exceptions on running, even after copying the dll to the local folder.

    So I tried figuring out how to use csproj (or anything) to get this done. I'm realizing more and more that dotnetcore was made by people who actually like the command line, and apparently most people who code in C# don't and are using a full-featured IDE. And Google hasn't been literal for years, so I search for csproj command line, and Google is like, "oh, he must be talking about Visual Studio or MonoDevelop like everyone else is! Here ya go."

    https://docs.microsoft.com/en-us/vi...sbuild-project-file-from-scratch?view=vs-2022 - I found this post which is pretty thorough about creating a csproj from scratch, no tools. Buuuutttt...it looks nothing like *any* of the csproj files I have access too. I mean, they're XML and have ItemGroups and PropertyGroups, but the things the link says are important (targets, csc sources, files to compile) just flat don't exist in my csproj files. So I'm very confused.
     
  9. Puppeteer

    Puppeteer Emperor

    Joined:
    Oct 4, 2003
    Messages:
    1,687
    Location:
    Silverdale, WA, USA
    Aha! I cracked the mono command-line code I think. I tried copying over the csproj and changing the TargetFramework to net472, adjusted packages and referenced based on the needs, and got it working.

    It's `nuget restore <filename>.csproj` as nuget apparently will look for sln but not csproj without prodding. And then just `msbuild`. I seem to be using an msbuild from a mono source, so I don't know if that makes a difference.

    It still builds an exe (if that's specified in the csproj), but it's in the bin folder.

    It's probably possible to rig up command lines and/or batch/shell files to make things work, but nuget + msbuild is probably easier even if it's not the all-in-one dotnet command.

    I made two programs work...a copy of BuildDevSave, and a HelloWorld modified to use System.Text.Json so I could prove nuget packages are working.
     
  10. Quintillus

    Quintillus Archiving Civ3 Content Supporter

    Joined:
    Mar 17, 2007
    Messages:
    7,166
    Location:
    Ohio
    Good to hear the update, Vuldacon, even though it is taking longer than hoped. I can imagine that would be gradually driving you crazy. I hope the subsequent operations are a success and that by Christmas you're well on the road to full recovery.
     
  11. Puppeteer

    Puppeteer Emperor

    Joined:
    Oct 4, 2003
    Messages:
    1,687
    Location:
    Silverdale, WA, USA
    Oh, here's another link that sheds light on this: https://docs.microsoft.com/en-us/visualstudio/msbuild/how-to-use-project-sdk?view=vs-2022

    The Sdk attribute in the Project element makes msbuild behave differently. I was trying to figure out what effect changing it does and what to change it to, then I just took it out entirely. *Then* OmniSharp (the IntelliSense provider) complained about there not being a "Compile" target in the csproj.

    More on Sdk specifiers, and what I was looking for when I stumbled on the above: https://docs.microsoft.com/en-us/dotnet/core/project-sdk/overview
     
  12. Puppeteer

    Puppeteer Emperor

    Joined:
    Oct 4, 2003
    Messages:
    1,687
    Location:
    Silverdale, WA, USA
    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.

    What's funny is I was trying to figure out a Lua thing, and I ran into a couple of mentions of the Unity platform requiring lua files to be named .txt ... then I started connecting dots and realized renaming it for Godot might help. And then the user:// thing just kinda jumped at me when I was looking into how to read text files the Godot way.

    Some links on that topic for me to look at later as I'm in the middle of something else now:

    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
     
  13. Puppeteer

    Puppeteer Emperor

    Joined:
    Oct 4, 2003
    Messages:
    1,687
    Location:
    Silverdale, WA, USA
    I'm just gonna copy this post from another thread to hopefully make it easier to find later.

     
  14. Puppeteer

    Puppeteer Emperor

    Joined:
    Oct 4, 2003
    Messages:
    1,687
    Location:
    Silverdale, WA, USA
    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.
     
    Quintillus likes this.
  15. Puppeteer

    Puppeteer Emperor

    Joined:
    Oct 4, 2003
    Messages:
    1,687
    Location:
    Silverdale, WA, USA
    I worked around that by just checkout patching my changes to a branch forked from Development. Not a thing anymore.

    Edit: More random info found about SMAC cvr format:

    https://forum.xentax.com/viewtopic.php?f=18&t=21948

    https://alphacentauri2.info/wiki/Caviar - The best source so far

    Edit 2: Found the terrain for SMAC. It's all in one image. Square upright tiles, interesting. In-game they're isometric and have 3d hight, to the terrain is, as it says, just textures for the tile shapes.

    An interesting sidebar...Civ3 has several terrain types with FoP features. SMAC kind a has just one terrain type, but moisture, rockiness, and elevation impact the food, mineral (shield), and energy (commerce) the tile produces. Being really rocky negates some of the high-moisture productivity, though. The terrain is generally earthy browns mixed with green, the moister the greener. The rockier, the more rocky overlay.

    Then there are forests and xenofungus, each of which can propagate on their own to unimproved land. There are also several named many-tile terrain features...the volcano fragments are prominent in the texture file, and I think of the two types of forests, one is exclusive to a named feature. These have varying production bonuses.

    It's an interesting thought to take the emphasis away from terrain type and just turn up or down the greenery or rock size per tile.
     
    Last edited: Dec 1, 2021
  16. Vuldacon

    Vuldacon Dedicated to Excellence Supporter

    Joined:
    Nov 14, 2001
    Messages:
    7,025
    Gender:
    Male
    Location:
    USA
    That is an interesting Graphics approach that is worth experimenting with.
     
  17. Ozymandias

    Ozymandias Archivist, redux Supporter

    Joined:
    Nov 5, 2001
    Messages:
    10,133
    Gender:
    Male
    Location:
    The lone and level sands
  18. Puppeteer

    Puppeteer Emperor

    Joined:
    Oct 4, 2003
    Messages:
    1,687
    Location:
    Silverdale, WA, USA
    You're welcome. Now I want to play some SMAC again :lol:

    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.


    :hmm: 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?
     
  19. Puppeteer

    Puppeteer Emperor

    Joined:
    Oct 4, 2003
    Messages:
    1,687
    Location:
    Silverdale, WA, USA
    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.
     
  20. Vuldacon

    Vuldacon Dedicated to Excellence Supporter

    Joined:
    Nov 14, 2001
    Messages:
    7,025
    Gender:
    Male
    Location:
    USA

Share This Page