R28 animations#36
Open
instafluff0 wants to merge 87 commits into
Open
Conversation
…; Add Seasons to folder structure
…invalidation bug when loading save or starting new game
…al of old wave files
…ort for multiple terrains in single #Animation entry
…lue under Aesthetics in default config
# Conflicts: # injected_code.c
# Conflicts: # C3X.h # default.districts_natural_wonders_config.txt # injected_code.c
Contributor
Author
|
Update: after more testing I've found I'm getting an inconsistent infinite loop at the start of some games with the current branch, typically after a turn or two but sometimes not at all. I checked the RET values in Ghidra for the 5 functions added to civ_prog_objects.csv: ...And the signatures/args all look correct to me. As best I can tell from the debugger I think I am seeing After adding some more logging, I see: On and on, still trying to figure out what is calling it. I'd say this happens 10-20% of the time on the 2nd turn of the game. |
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.
PR three of three for R28. This PR is less dramatic in terms of changes than it seems, as most of the 7.8k line additions are INI, config, and Python files for processing animations outside of the game. About 2.5k lines are in injected_code.c (and much of that is config parsing).
The general approach is to piggyback on Civ3’s existing tile-effect machinery instead of creating a new animation workflow from scratch. When a tile matches a configured ambient animation rule, we use
Tile_spawn_animated_effectto spawn a normal built-in tile effect (AE_Disorder) as a carrier. So we use a vanilla animated effect path that already knows how to allocate, position, update, and draw an effect. While AE_Disorder is being loaded, I set a temporary override soUnits_Image_Data_load_animated_effectignores the AE_Disorder’s normal art and instead loads the configured custom Art\Animations...*.INI. After vanilla finishes constructing the effect, we rewrite the effect id back to the custom id and apply per-animation direction and pixel offsets. So just as with smolder & disorder, the native animation system still owns lifetime, frame advancement, AMB/FLC handling, and rendering; we just swap in an INI and decide which tiles should spawn or clear those effects.Here are the main features:
#Animationentries, for example:Note that natural wonders can have multiple animation entries.
pick_tile_animation_winner_for_tileandget_tile_animation_type_priority) for tiles with multiple matching candidate animations, using this priority order:If still tied, animations with day/night or season filters take precedence, then the later config entry wins.