Skip to content

R28 seasonal cycle no cache#46

Open
instafluff0 wants to merge 2 commits into
maxpetul:masterfrom
instafluff0:r28-seasonal-cycle-no-cache
Open

R28 seasonal cycle no cache#46
instafluff0 wants to merge 2 commits into
maxpetul:masterfrom
instafluff0:r28-seasonal-cycle-no-cache

Conversation

@instafluff0

@instafluff0 instafluff0 commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

As discussed, here is the no-cache version of seasonal + day-night cycle, mostly Codex on this one.

I've tested with all varieties of settings, including going to main menu and starting new games or loading saves, etc.

One other thing to mention: after the initial pass, I observed mem usage going up ~20MB per turn when every-turn was true for either cycle. After poking around Ghidra, it turns out that adding the line:

if (img->JGL.Image != NULL)
    img->vtable->clear_JGL (img);

in read_in_dir() is critical, as otherwise we would have had a major memory leak. Looking at this more deeply, I think we actually had this before as well, it just wasn't apparent because (1) loading of images was generally a 1-time thing and (2) we knew those images took a lot of memory, so this additional unnecessary usage was not apparent. It became obvious though when we stopped caching.

Anecdotally, that background processing I mentioned after closing the game? Seems to be gone, or at least ends very quickly, after adding this.

@instafluff0

instafluff0 commented Jun 21, 2026

Copy link
Copy Markdown
Contributor Author

As an aside, I have a branch (instafluff-current) which includes my PRs with the main repo merged, for testing and fun. I also had time to finally put my long-intended scenario together, which is basically the standard game, but with districts, tile animations, seasons, some additions to the modern tech tree & units (adds silicon wafers & other resources, AGI as a tech & Wonder, autonomous drones, space elevator etc.) and some extra wonders added in for flavor:

image image test2

Anyway I'm somewhat amazed that it all works and came together - and so much of this is thanks to you. I've got to say it feels like a whole different game. I know I've said it before and we still have a couple PRs to get through, but seriously, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant