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
    I have at least a noise generator wrapping in one or both axes now. I temporarily have Game.cs using the new noise instead of the Godot noise, so the latest HEAD will generate terrain that wraps in both axes.

    I figure on using the new noise field in C7GameData to make a "C7 native" map.
     
  2. Puppeteer

    Puppeteer Emperor

    Joined:
    Oct 4, 2003
    Messages:
    1,687
    Location:
    Silverdale, WA, USA
    Wow. I had the idea of putting values on a map before, but somehow it never occurred to me to just look at a value map (heat map? histogram? something) of map values. This is cool!

    I'll have to get the Windows machine up again and open a save on it to help me figure out what some of these really are. But the patterns really help clue me in on what they might be for.

    I'm guessing the first one has to do with mountains and hills. The second one? Very odd. Also, that seems to be a 32-bit value that's mostly -1 but sporadically 25 or less. These are very early in the TILE section which leads me to believe it was a value probably present. Wonder what needs an apparent 32-bit counter on each map tile? Guess I'll go find out.
     

    Attached Files:

    Quintillus likes this.
  3. Quintillus

    Quintillus Archiving Civ3 Content Supporter

    Joined:
    Mar 17, 2007
    Messages:
    7,166
    Location:
    Ohio
    That is looking pretty good. I see the wrapping, and you have more terrains now. It looks like an actual Civ III map!

    The value map is also pretty cool. I've thought before, for the unknown values in BIQs and SAVs, having a tool that would search across a bunch of them and point out differences would be helpful for gaining insight into what they mean. I've yet to extend my editor to do that, however. I hadn't thought of visualizing map tiles like what you have done, though - but that might be even more likely to be informative.
     
  4. Puppeteer

    Puppeteer Emperor

    Joined:
    Oct 4, 2003
    Messages:
    1,687
    Location:
    Silverdale, WA, USA
    Exactly. I've done some of that, and I'm on the verge of being able to mass produce it. And better yet, it's Lua-scriptable.

    I made a bunch of notes based on the...texture viewer? not sure what to call it still...and now I have a much better idea of what I want to search for programmatically.

    Offsets that are all 0s or all -1s, or crazy ones where everything is 6 and another where everything is an odd number...I can mass-search saves and find if and where the pattern breaks.

    I'm pretty sure I have overlay terrain tile info narrowed down to about 3 bytes, and I know where the overlay terrain ID is, and yesterday I found a "resource" associated with volcanoes. (Yeah, apparently a volcano is a resource? At least draw-order-wise.) So I can look for bit patterns for how those 3 bytes associate with overlay terrain.

    I also don't think I've taken a look at format since I figured learned from you how tile graphic selection is handled. Now I kind of know what patterns to look for.

    Oh yeah, I can and should also correlate the unknown bytes with surrounding overlay terrain IDs. Or maybe it will be more obvious now that I know how base terrain IDs work.


    On a different note, I was getting a bit unhappy at how jagged-looking my generated maps look. Then I realized the loaded maps look the same! Because when you're zoomed out more than the game usually lets you, the diamond-shaped tiles really jump out at you.

    I have some ideas on that, too. (Procedural tile...edges, I guess. Not even fancy, just a not-as-jaggy edge where it pretty much goes from one color to another. And possibly applies to a future C7 native tile image format that doesn't rely on per-tile editing.)
     
  5. WildWeazel

    WildWeazel Carthago Creanda Est

    Joined:
    Jul 14, 2003
    Messages:
    7,206
    Location:
    %CIV3%\Conquests\Scenarios\
    dunno how useful this is, but at some point in my brainstorming I wrote down a model of how I think map layers work in Civ3:

    Code:
    One of: "base" (required)
    Desert
    Plains
    (Bonus) Grassland
    Tundra
    Coast
    Sea
    Ocean
    LM *
    
    One of: "relief" (base is assumed Grassland)
    Hill
    Mountain
    Volcano
    
    One of: "surface"
    Forest (G/P/T)
    Jungle (G)
    Marsh (G)
    Irrigation
    Mine
    Outpost
    Fort
    Radar tower
    Airbase
    City
    Colony
    Ruins
    Camp
    Goody hut
    
    One of: "border" (per edge)
    River
    
    One of: "transport"
    Road
    Railroad
    
    One of: "asset"
    Any Resource
    Craters ? 
    
    One of: "effect"
    Pollution
    
     
  6. Puppeteer

    Puppeteer Emperor

    Joined:
    Oct 4, 2003
    Messages:
    1,687
    Location:
    Silverdale, WA, USA
    FYI, I'm in my new apartment, have Internet, and am tired. I'll probably be moving and arranging stuff for a few days. Not sure how much "work" I'll be doing.

    Yesterday I did briefly start on an experimental scene to scale the popup UI elements as mentioned in another thread, but that got not-simple pretty quickly. Or at least not appropriately simple for a pre-move train of thought.
     
    Quintillus and WildWeazel like this.
  7. Vuldacon

    Vuldacon Dedicated to Excellence Supporter

    Joined:
    Nov 14, 2001
    Messages:
    7,025
    Gender:
    Male
    Location:
    USA
    Puppeteer... Best to get situated and reacclimate in order to rest and be able to focus better.

    There are many "Irons in the Fire" at this point and no doubt there will be many more... Over All Great Start :clap:

    Edit... I am having Cataract Surgery, getting new lenses and also Laser adjustments for my Corneas for Astigmatism... twice this month starting Monday the 15th and 17th in two different locations and twice next month so I will be dealing with it all. Long Trips to and from the procedures because I live outside a very small town out in the country with other wild animals :lol:

    I am sure I will not like having to wait a month apart to have both eyes corrected and then also waiting for New Glasses. If my vision is too distorted before both eyes are corrected, I may just wear an eye patch.
     
    Last edited: Nov 13, 2021
  8. WildWeazel

    WildWeazel Carthago Creanda Est

    Joined:
    Jul 14, 2003
    Messages:
    7,206
    Location:
    %CIV3%\Conquests\Scenarios\
    Vuldacon, if you don't "see" us before then, best wishes for your procedures and I hope it doesn't interfere with your computing. :cooool:
     
  9. Vuldacon

    Vuldacon Dedicated to Excellence Supporter

    Joined:
    Nov 14, 2001
    Messages:
    7,025
    Gender:
    Male
    Location:
    USA
    Thanks WildWeazel... it has been rather tough the past few years without being able to see clearly. My eye sight was always extremely Good, in fact, Great. Now cannot see well even with glasses.
    I hope I will see much better in the next couple of months... it is the between surgical procedures for about a month that concerns me as I cannot tolerate the distortion with one eye OK and the other not.

    The Pandemic has slowed appointments and Hospital procedures for most people. Normally I would not have to wait a month between the eye surgeries but it is what it is.

    I just finished 13 hours of Game testing EFZI2 Elite and plan to finish testing while traveling back and forth to the Hospitals and Clinic within a week.

    Hope you have some Good Days and Relaxation but what ever you do, prevent "Burnout". These Pandemic days have taken a Toll on on most people so take it easy and keep your motivation and interests.
     
  10. Puppeteer

    Puppeteer Emperor

    Joined:
    Oct 4, 2003
    Messages:
    1,687
    Location:
    Silverdale, WA, USA
    Not sure where to put this info, so I'll put it here. It's also scattered in Kanban and comments.

    In the map-tile-overhaul branch I have somewhat out of necessity combined:
    • Migrating to the Civ3Map (renamed from LegacyMap) display code (supports all base terrain graphics including mods, uses the file & index references Civ3 uses instead of bitmasking tile selection)
    • Creating a serialized save format
    • Importing map data from a Civ3 save
    • Making a "static" or loaded-by-default JSON save file
    • Reading the JSON save file into GameData
    The good news is that the pieces are all there to save and load GameData, and import a Civ3 save directly into that format (as a GameData instance which of course is now serializable to JSON).

    But it's been quite a journey, and it's not done. For the import I'm mocking two dummy players and reading in the data needed to display the map, but nothing else (yet). It also needs to be integrated into what Flintlock has done with scrolling and layers. Right now I'm just adding the Civ3Map which lays on top of the old map, and the new one doesn't pan or zoom (yet). Also, the old map is now all plains because I had to comment references out to mapgen stuff to prevent runtime errors.

    I'm loading the JSON file in the create game entry point which is not the right place, but I just got it to display the map without runtime errors, so that's coming.

    Other oddities: I may have changed some fields to getter/setters or vice versa while troubleshooting because at times it made a difference in whether serialization/deserialization worked, but I understand now you need to have the right JSON de/serializer options configured on both ends. I also definitely opened up some setters because the serializer needs to be able to write, and it needs a no-parameter constructor. We can start locking that down again I think once code migrates to where it belongs, and we can then use protected or protected internal to lock it back down again.

    It's a bit of a pain, but coding a bridge between the serializer and game data would almost certainly be an even bigger pain to maintain over time.

    Oh, and the save format right now is just a child of GameData with a version string added in. We can add other metadata that way, too.

    It's obviously not ready to merge, but it's late, and I have 3 or so hours of meetings in the morning, so not sure how derailed I am for now.

    Edit: My strategy has been to get us onto what is now the Civ3Map code and then integrate better with the current state of things, and then look at optimizing away from TileMap. I kinda think that last part will be easy as I'm already making my own tile reference index, so it seems like it should be trivial just to use that to grab individual sprites instead of from a TileMap. But first I gotta make it and MapView get along. (I also want to refactor TempTiles to keep up with Civ3Map...TempTiles is a very handy tool for me still.)
     

    Attached Files:

    Last edited: Nov 27, 2021
    Quintillus likes this.
  11. Puppeteer

    Puppeteer Emperor

    Joined:
    Oct 4, 2003
    Messages:
    1,687
    Location:
    Silverdale, WA, USA
    Apparently very little. Jumped on the forums before meetings this morning, and poking at C7 after them.

    I was initially perplexed at how to get LegacyMap/Civ3Map working with Flintlock's MapView, but I see the interface now, and the two pieces I need are the same as the old code, a TileSet and an int[,] map of which tiles to place. All I had to do was pass those from Civ3Map instead, and boom, zooming/scrolling Civ3Map! So exited I came here to post before I even tried the X wrapping (edit: it works) and delete probably half the Game.cs code (the parts which were generating the 3-terrain maps).

    Edit: I'm probably going to break out TempTiles into a different project instead of keeping it and Civ3Map+C7Game in sync.
     
    Last edited: Nov 27, 2021
  12. Puppeteer

    Puppeteer Emperor

    Joined:
    Oct 4, 2003
    Messages:
    1,687
    Location:
    Silverdale, WA, USA
    I kind of want to merge this into Development now, but the downside that there are no units. I guess I'll go poke at adding those into the save and maybe adding the import save file browser in the "load game" action.

    Oh, I may also slightly refactor the save format. Instead of serializing a child of GameData I think I just need a save object with a GameData field. Because the way I've done it now doesn't really allow a direct save of a hypothetical new game.

    Ok, I have some tinkering to do before I merge, but I don't want to wait too long as I feel like both the old map code and waiting for the new map code are becoming road blocks.

    Edit: <sigh>, I probably should also see about locking down some of those setters I opened up, too, by moving the load code into GameData and using `protected internal`.
     
  13. Vuldacon

    Vuldacon Dedicated to Excellence Supporter

    Joined:
    Nov 14, 2001
    Messages:
    7,025
    Gender:
    Male
    Location:
    USA
    Puppeteer... well, Great Wok you are doing and it seems there is a momentum happening :thumbsup:
     
    Puppeteer likes this.
  14. Puppeteer

    Puppeteer Emperor

    Joined:
    Oct 4, 2003
    Messages:
    1,687
    Location:
    Silverdale, WA, USA
    Thanks!

    I've been struggling with protected and internal, not understanding why they aren't working as I expect. Then it finally hit me: while my loader code is now in the same assembly, the JSON serializer is NOT, and it is what needs to access the setters. D'oh!

    I'm sure there is a way around that–perhaps painful–but for now I'm going to leave all the GameData hierarchy with fully open setters.

    The save format is altered as I said, with a save object that has a GameDat, a Rules (a placeholder for a BIC analog), and a Version. Not sure how useful the version is going to be, but it just seems like something a save or any JSON store should have.

    I'm *not* going to put the civ3 importer in the "Load Game" code because we now have native load game and save game code! (Not yet hooked up to the button.) So I'll probably add an import button. I suppose it's worth considering auto detecting / auto importing, but I haven't given that much thought.
     
  15. Puppeteer

    Puppeteer Emperor

    Joined:
    Oct 4, 2003
    Messages:
    1,687
    Location:
    Silverdale, WA, USA
    Some notes before they leak out of my head:

    MacOS exports need an application/identifier before they'll export. It *looks* like "com.example.game" is filled in there, but no it isn't...that's a tool tip, not actual text :p . Learned from https://github.com/abarichello/godot-ci/issues/62#issuecomment-968295813 while trying to figure out why the automated Windows build failed.

    I haven't figured out quite why the GitHub Actions Windows build is failing yet. I mean I know where the error is, but I can't find what the root of the problem is yet. I think I will, but I'm tired and unable to keep focus on topic very well just now.

    Right now the build is manually triggered only, but we could trigger it on all sorts of things once it's ready. The action script *has* to be in the default branch to be manually triggered, so that's why I'm working in there...I can't test otherwise. I think we can build against any branch, and we can trigger on events in other branches, but for manual the definition has to be in default. There is an Actions tab alongside code, issues, pull requests, and such tabs where you can dig into job run results and trigger new runs.

    I did a manual export on the Windows box for Windows, and sure enough it crashes because the default json save file doesn't get bundled. I need to stuff it in the C7 folder for it to be exported. I mean there is probably another way, but putting it in C7 is the most simple thing for now, and it will eventually go away entirely with map generation or if we just decide to force folks to load files to start "playing".

    We're probably going to want to start handling exceptions soon, even if only at a very rudimentary level just to present a useful message instead of apparent/actual CTD. Windows loves to write its crash message to the console then disappear, and we'll probably end up hiding the extra console window, anyway.

    The export is very configurable, but I'm not even touching any settings yet. I figure hiding the Windows extra console and assigning the right icon are fairly high priorities when we start doing that. Not sure if that has to be in the export commands or if there is an export config we can stuff in the Godot project folder.
     
  16. Puppeteer

    Puppeteer Emperor

    Joined:
    Oct 4, 2003
    Messages:
    1,687
    Location:
    Silverdale, WA, USA
    I'm probably doing something dumb here. The tar command is running, but it can't find the archive when trying to upload the artifact. Can you spot the problem? I haven't yet, but I'm guessing it has something to do with interpreting the environment variables.

    Code:
          - name: Create Tar Archive
            run: |
              tar -zcvf build/${EXPORT_NAME}.tgz build/linux
          - name: Upload  Artifact
            uses: actions/upload-artifact@v2
            with:
              path: build/${EXPORT_NAME}.tgz
              name: C7-Linux-x86_64
    
    Edit: Apparently double braces are needed in the yaml file...trying that now.
     
  17. Puppeteer

    Puppeteer Emperor

    Joined:
    Oct 4, 2003
    Messages:
    1,687
    Location:
    Silverdale, WA, USA
    @Quintillus can you try the Linux artifact, please? https://github.com/C7-Game/Prototype/actions/runs/1513415575#artifacts

    I expect it to work, although I think I want to get rid of the build/linux hierarchy inside the tar file. The Mac version still isn't working, but I'm reasonably sure it's some setting in the export template and/or some sort of Mac security.

    Edit: Single braces are optionally used in the shell scripts, but when using an env var in an action parameter it's {{ env.ENVVARIABLE }}
     
  18. Puppeteer

    Puppeteer Emperor

    Joined:
    Oct 4, 2003
    Messages:
    1,687
    Location:
    Silverdale, WA, USA
    @Vuldacon great to see you back! Hope all is going well!
     
  19. Quintillus

    Quintillus Archiving Civ3 Content Supporter

    Joined:
    Mar 17, 2007
    Messages:
    7,166
    Location:
    Ohio
    @Puppeteer - That worked! No more chmod necessary!
     
    Puppeteer likes this.
  20. Puppeteer

    Puppeteer Emperor

    Joined:
    Oct 4, 2003
    Messages:
    1,687
    Location:
    Silverdale, WA, USA
    https://github.com/C7-Game/Prototype/actions/runs/1513921261#artifacts

    So I've been banging away at making inputs work and adding info to the zip/tgz folders so once we start having more than one build around, they aren't all in C7 folders leaving us wondering which is which. I may have overdone it, though. There is a custom field when triggering the build which defaults to "-dev-build" and then checkboxes defaulted to checked to append your github username and the date/time. So the archive/folder names are then like "C7-dev-build-myjimnelson-2021-11-29T00-33-Windows", with the -Windows only being on the top archive level.

    You can clear the field and uncheck the boxes and get C7-Windows again. Give it a try and let me know what you think, or if there are better defaults.

    How to run it is screenshotted below. It takes about two minutes to queue, spool up, run, and finish, but it does all three at the same time. (Parallel jobs.) That last arrow shows you can click on the most recent one at the top which should be the one you just ran, and at the bottom are the artifacts (downloadables).

    I did all that before trying to fix the Mac build.

    Edit: Sorry about the commit spam, but there wasn't really a way to test it because of inputs and needing to be in the default branch.
     

    Attached Files:

Share This Page