R28 animations#36
Conversation
…; Add Seasons to folder structure
…invalidation bug when loading save or starting new game
|
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. |
…re animations run on first turn
|
There are some addresses for you. Would you say this PR is ready for review? I started looking into it a few weeks ago but got distracted with other things (many such cases) and since then more commits have trickled in. |
|
No problem at all. I was going to wait to resolve the merge conflicts until after the day-night/seasonal cycle no-cache branch was merged in. Are you ok with merging that first? Else I can go ahead and fix the merge conflicts first, either way is fine. |
|
I'd assumed the no-cache branch was supposed to come after this one, but there's no reason I couldn't merge it first. I'll do that and maybe merge some other things too in the near future. |
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.