this game basic problems and someone deleting my questions about making this better wtf

General feedback and discussion of the game.

Moderator: Forum Moderators

gfgtdf
Developer
Posts: 1433
Joined: February 10th, 2013, 2:25 pm

Re: bug: takes a really long time for a map / game to be created

Post by gfgtdf »

Atreides wrote: December 2nd, 2023, 5:03 pm
Yes I've got loads of warning preprocessor: Redefining macro caused by various add-ons I've installed. I've had them always. I do know what causes them and how to get rid of them but since they're all in addons maintained by others any fix would only last until it got updated.

Do these cause the cache to be cleared right away? I also do purge the cache a lot (because of the note I read that it can be corrupted since 1.14) so I may not be getting much if any benefit from caching.
No they don't but getting an error from preproceccor implied that the preproceccor is run (and it isn't run when the game just loads a file from the cache), so these erropr prove that the cache was not used that time.
Atreides wrote: December 2nd, 2023, 5:03 pm Update: How odd. I ran the debug config again and this time it loaded unusually quickly and the times are all much less. Ageless went from 7.8s to 1.1s. I looked at the cached files just before doing this and the ageless was indeed cached (about 2 MB). Maybe the cache was empty when I first tried it.
I looked at the code and it seems like the game always clears the complete cache, when any modifications of the gamedata files are done (especially by updating/installing/uninstalling) and addon, but also when modifying a file manually.
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.
User avatar
Atreides
Posts: 1079
Joined: March 30th, 2019, 10:38 pm
Location: On the 2nd story of the centre village of Merwuerdigliebe turning the lights on and off

Re: bug: takes a really long time for a map / game to be created

Post by Atreides »

gfgtdf wrote: December 2nd, 2023, 6:27 pm
Atreides wrote: December 2nd, 2023, 5:03 pm
Yes I've got loads of warning preprocessor: Redefining macro caused by various add-ons I've installed. I've had them always. I do know what causes them and how to get rid of them but since they're all in addons maintained by others any fix would only last until it got updated.

Do these cause the cache to be cleared right away? I also do purge the cache a lot (because of the note I read that it can be corrupted since 1.14) so I may not be getting much if any benefit from caching.
No they don't but getting an error from preproceccor implied that the preproceccor is run (and it isn't run when the game just loads a file from the cache), so these erropr prove that the cache was not used that time.
Atreides wrote: December 2nd, 2023, 5:03 pm Update: How odd. I ran the debug config again and this time it loaded unusually quickly and the times are all much less. Ageless went from 7.8s to 1.1s. I looked at the cached files just before doing this and the ageless was indeed cached (about 2 MB). Maybe the cache was empty when I first tried it.
I looked at the code and it seems like the game always clears the complete cache, when any modifications of the gamedata files are done (especially by updating/installing/uninstalling) and addon, but also when modifying a file manually.
Oh wow, OK so I look at the stderr log almost every time after I run Wes and 95% of the time I see the warning preprocessor which tells me that my cache is barely ever being used. I was in fact puzzled by the few times when I didn't see the "usual" prepro warnings and wondered what had "gone wrong". Must have been the few times I didn't edit anything.

Since I am constantly "modifying a file manually" it would seem that is the reason the cache keeps getting cleared. That is very helpful thank you for that info! (Also I now am aware of how much the cache speeds things, when it is active so I'll also lay off the purging of it I do at times as that just makes things worse)

I just ran a scenario 3 times without editing anything and indeed the 2nd and 3rd time the log showed no warnings and the loading was quick those times.

Well that seems to explain what is going on. : )
User avatar
Ravana
Forum Moderator
Posts: 3069
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: bug: takes a really long time for a map / game to be created

Post by Ravana »

Preferably cache of not-modified addon would stay.
gfgtdf
Developer
Posts: 1433
Joined: February 10th, 2013, 2:25 pm

Re: bug: takes a really long time for a map / game to be created

Post by gfgtdf »

It doesn't. I suspect that they reason is that in theory on addon can use another addon via {/other_addon/...}
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.
User avatar
Atreides
Posts: 1079
Joined: March 30th, 2019, 10:38 pm
Location: On the 2nd story of the centre village of Merwuerdigliebe turning the lights on and off

Re: bug: takes a really long time for a map / game to be created

Post by Atreides »

Did a little test and shockingly even copying a non-wesnoth related text file into the addons dir causes it to recache. So that's apparently not a good place to store extra wesnoth related files...
User avatar
Ravana
Forum Moderator
Posts: 3069
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: bug: takes a really long time for a map / game to be created

Post by Ravana »

gfgtdf wrote: December 2nd, 2023, 11:50 pm It doesn't. I suspect that they reason is that in theory on addon can use another addon via {/other_addon/...}
I agree this could be the thought process, but I think as optimization, wesnoth could assume that is not the case, and if user really needs he will delete cache manually.
gfgtdf
Developer
Posts: 1433
Joined: February 10th, 2013, 2:25 pm

Re: bug: takes a really long time for a map / game to be created

Post by gfgtdf »

The user doesn't know whether an addond that he has installed does this.
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.
User avatar
Ravana
Forum Moderator
Posts: 3069
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: bug: takes a really long time for a map / game to be created

Post by Ravana »

I mean in case of manual edits, not when user uses addon manager.
gfgtdf
Developer
Posts: 1433
Joined: February 10th, 2013, 2:25 pm

Re: bug: takes a really long time for a map / game to be created

Post by gfgtdf »

The config loading code doesn't differ between manual edits and addon updates though.
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.
Post Reply