Conversation
… Add error outputs for more config parsing
…cities from building wonders they dont have terrain for
… of naval unit production; first attempts at prevent wonder creation if city set to build it as fallback
…lay_name prop for c3x-script.txt district entries
…into ports Merging
…coloring around great barrier reef
…g; Simplify Energy Grid to only show first energy plant found
…ensure green pixels are removed
Contributor
Author
|
Brief update: I had to make a few changes to get the day-night cycle to work again. That's all done and good to go. I'm also done with all light annotations for everything but the last 2 districts' art, which I'm waiting for ZergMazter on. So no further code changes planned, just art from here, and minor. |
…eat Wall) vs those that require an overlay, with updates to config; Fix Great wall only on other civ border territory id bug; Allow AI workers to replace a district if another district can require replacing it
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hey @maxpetul,
I hope things are going well. I've been hard at work on the new additions to districts. As seems to be my MO these days, I set out with a very specific set of goals and a relatively narrow scope. That lasted about ... 2 weeks. As I reworked things and added new features, those in turn inspired me to add more ... and more. I also have gotten a lot of feedback from modders and so on on CivFanatics and did my best to add straightforward features that weren't much of a lift, or seemed worth it.
Anyway, the PR has become quite big (again), for which I can only apologize for asking you to do yet another huge code review. Thank you very much, as always.
After this gets merged and any outstanding bugs get worked out, I plan to go quiet for a while and take a break. At this point I have no intended major additions I want to do to districts - this PR is kind of the kitchen sink. After this I think districts will actually be very mature, in terms of features and robustness. So I can't make any promises, but at this point the only remaining dev I intend to do is adding a seasonal cycle, which will mostly be art anyway.
Changelog
Here's a reasonably exhaustive list of changelog items:
scenario.districts.txt)Current issues need advice on
I'm making the PR now as (1) I don't anticipate any other major changes to the codebase unless you request it, and (2) I've basically hit a wall on a few items I don't know how to resolve and need your help. Most of these are related to unit movement, which I think you understand much better than I do.
Those are:
patch_Unit_can_move_to_adjacent_tileandpatch_Unit_move_to_adjacent_tile.patch_Unit_can_perform_commandandpatch_Leader_can_do_worker_job, but those seemed to have no effect and I think for naval units they perhaps aren't checked at all? Not completely sure. As a workaround, I patchedpatch_Main_GUI_set_up_unit_command_buttonsand put the check there, BUT the code I got working to actually enable the button is ugly and took a lot of poking around the source to understand the offsets and get the right images. I hate it but couldn't figure out a better way. This works but I would love suggestions for a better way to do it.patch_Leader_get_attitude_toward. The relation penalty in the config is calledper_extraterritorial_colony_relation_penalty. I couldn't figure out how to actually loop over colonies directly though, so as a workaround loop over every tile on the map. In the source code I was able to find and addp_coloniesto civ_prog_objects.csv, but don't quite understand how to loop over it. This is probably really dumb but I could not quite figure out why this works for p_cities and not p_colonies.buildable_by_civschecks civ names by strings. I really wanted to do this by just figuring out the civ_id and indexing that on start/load, but as configs are loaded before civs are decided, I couldn't do my typical approach. If you're ok with this I am too, but just wanted to point that out.I think the code is relatively clean, and I worked hard to incorporate your feedback from the first districts PR and keep everything tight. Overall I think it is solid. As you review the code though, you will probably come across
align_variant_and_pixel_offsets_with_coastlineand a few other functions which handle rendering maritime district stuff. I'll just say I hated putting specific if/else statements there to try to handle pixel offsets for specific terrain tile sheets and sprites, but it really looked bad without it and I couldn't find any cleaner way. In terms of how far beach/coast/land is on the coastal terrain art, it really is wacky and all over the place. Without handling that, ports and so on often appear way out in the water and look stupid. Anyway long-story-short: I know the code there is ugly and am very open to feedback. But the game looks much better because of it.Remaining stuff to do
Like I said the code is basically done, besides refinement based on feedback and thie issues I need help on above.
I'm planning to refactor and add a(this is done)buildable_on_overlaysproperty for districts that is distinct frombuildable_on, and should be done with that in a day or two.There is still some art to finish as well. ZergMazter is doing the art for Central Rail Hub and Municipal District, and probably needs a couple more weeks. I'm working on the light annotations for the new districts as well. So let's wait to actually merge this in until after those are done, but I saw no need to wait for that in order to start code reviews.
Phew! Sorry for the super long explanation. Thank you for your help. I'm very heartened by how many people have reached out and said how happy they are with the new stuff we're adding. A number of people have told me details about custom districts and scenarios they are working on, which makes it all worth it.