Clutter in cfgs Slow Down the engine?

The place to post your WML questions and answers.

Moderator: Forum Moderators

Forum rules
  • Please use [code] BBCode tags in your posts for embedding WML snippets.
  • To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Post Reply
User avatar
LordAwsomeness
Posts: 203
Joined: August 12th, 2013, 2:20 pm
Location: U.S.A.

Clutter in cfgs Slow Down the engine?

Post by LordAwsomeness »

Hi I was just wondering if leaving text that the engine wont read slows the game down. Ive been experiencing exponential amounts of engine slowdown and I know it's not my computer since I can run games like pubg and ark at full graphical settings and have 0 issues. But I was wondering if things such as the following slow the engine down from processing as fast

Code: Select all

#	{LA_DISPLAY_ITEM_OPTION "attacks/bolas.png" bolas_1 1 impact ranged lob}
#	{LA_DISPLAY_ITEM_OPTION "attacks/bolas.png" bolas_2 1 impact ranged lob}
#	{LA_DISPLAY_ITEM_OPTION "attacks/bolas.png" bolas_3 1 impact ranged lob}
#	{LA_DISPLAY_ITEM_OPTION "attacks/bolas.png" bolas_4 1 impact ranged lob}
#	{LA_DISPLAY_ITEM_OPTION "attacks/bolas.png" bolas_5 1 impact ranged lob}
I know the engine doesn't read these but I still wonder if I actually went through all of the files if maybe it would speed up just a bit because ive hit a point where at the start of every turn it freezes the game for a full 15-20 seconds and if you click once or twice it will make windows think the game is crashing. I just want to speed up my add-on..
- Been playing Wesnoth since 2004 and the 1.0.x versions.
- Creator of Undead Invasion MP Scenario Pack.
- Creator of Valeria MP Adventure
- Creator of LA_RPG ERA
User avatar
Ravana
Forum Moderator
Posts: 3000
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Clutter in cfgs Slow Down the engine?

Post by Ravana »

Comments have minimal influence. Unless you have megabytes of them, do not worry.
User avatar
LordAwsomeness
Posts: 203
Joined: August 12th, 2013, 2:20 pm
Location: U.S.A.

Re: Clutter in cfgs Slow Down the engine?

Post by LordAwsomeness »

what could be causing such obscene waittimes then? Could it be all of the variables that I am setting? Would they potentially slow the game down?
- Been playing Wesnoth since 2004 and the 1.0.x versions.
- Creator of Undead Invasion MP Scenario Pack.
- Creator of Valeria MP Adventure
- Creator of LA_RPG ERA
gnombat
Posts: 706
Joined: June 10th, 2010, 8:49 pm

Re: Clutter in cfgs Slow Down the engine?

Post by gnombat »

LordAwsomeness wrote: February 29th, 2020, 11:21 pm at the start of every turn it freezes the game for a full 15-20 seconds and if you click once or twice it will make windows think the game is crashing
It sounds like it could be taking 15-20 seconds to create the auto-save?
User avatar
LordAwsomeness
Posts: 203
Joined: August 12th, 2013, 2:20 pm
Location: U.S.A.

Re: Clutter in cfgs Slow Down the engine?

Post by LordAwsomeness »

gnombat wrote: March 1st, 2020, 12:25 am It sounds like it could be taking 15-20 seconds to create the auto-save?
how would I disable it? just slide it to 0? or do I need to toggle something so that it doesn't take forever?

EDIT: OMG it was the autosaves!!! It literally goes next turn immediately now!
- Been playing Wesnoth since 2004 and the 1.0.x versions.
- Creator of Undead Invasion MP Scenario Pack.
- Creator of Valeria MP Adventure
- Creator of LA_RPG ERA
User avatar
LordAwsomeness
Posts: 203
Joined: August 12th, 2013, 2:20 pm
Location: U.S.A.

Re: Clutter in cfgs Slow Down the engine?

Post by LordAwsomeness »

What could I do to speed up how fast it loads into the multiplayer lobby? it takes a whole minute or 2 to do that. My add-on is currently at 32 MB... is there something I could do to make it load after clearing the cache faster?
- Been playing Wesnoth since 2004 and the 1.0.x versions.
- Creator of Undead Invasion MP Scenario Pack.
- Creator of Valeria MP Adventure
- Creator of LA_RPG ERA
User avatar
Pentarctagon
Project Manager
Posts: 5564
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Clutter in cfgs Slow Down the engine?

Post by Pentarctagon »

Using lua instead of (I'm assuming) boatloads of WML macros would help.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
User avatar
LordAwsomeness
Posts: 203
Joined: August 12th, 2013, 2:20 pm
Location: U.S.A.

Re: Clutter in cfgs Slow Down the engine?

Post by LordAwsomeness »

Pentarctagon wrote: March 1st, 2020, 12:36 am Using lua instead of (I'm assuming) boatloads of WML macros would help.
guess after 9 years of fiddling with wml I should actually try and learn lua...
- Been playing Wesnoth since 2004 and the 1.0.x versions.
- Creator of Undead Invasion MP Scenario Pack.
- Creator of Valeria MP Adventure
- Creator of LA_RPG ERA
gfgtdf
Developer
Posts: 1432
Joined: February 10th, 2013, 2:25 pm

Re: Clutter in cfgs Slow Down the engine?

Post by gfgtdf »

You can also open one of these savefiles with a text editor and see why they are so big ( the time really depends nails on the size of these (uncompressed) files), it's probably just a handful, macros that are expanded too often that you could then replace with something more efficient. Before doing that you might want to switch the safefile format in the wesnoth settings to disable compression to be able to open them.
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
LordAwsomeness
Posts: 203
Joined: August 12th, 2013, 2:20 pm
Location: U.S.A.

Re: Clutter in cfgs Slow Down the engine?

Post by LordAwsomeness »

gfgtdf wrote: March 1st, 2020, 2:19 pm You can also open one of these savefiles with a text editor and see why they are so big ( the time really depends nails on the size of these (uncompressed) files), it's probably just a handful, macros that are expanded too often that you could then replace with something more efficient. Before doing that you might want to switch the safefile format in the wesnoth settings to disable compression to be able to open them.
Wow I did that but I have no idea where to start... the savefile is 119 MBs uncompressed...
- Been playing Wesnoth since 2004 and the 1.0.x versions.
- Creator of Undead Invasion MP Scenario Pack.
- Creator of Valeria MP Adventure
- Creator of LA_RPG ERA
User avatar
Ravana
Forum Moderator
Posts: 3000
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Clutter in cfgs Slow Down the engine?

Post by Ravana »

Save it before it gets that large, 4-10MB should be enough to find repeating patterns.
User avatar
LordAwsomeness
Posts: 203
Joined: August 12th, 2013, 2:20 pm
Location: U.S.A.

Re: Clutter in cfgs Slow Down the engine?

Post by LordAwsomeness »

Ravana wrote: March 1st, 2020, 5:19 pm Save it before it gets that large, 4-10MB should be enough to find repeating patterns.
like cut the file down? and what am I looking for exactly?
- Been playing Wesnoth since 2004 and the 1.0.x versions.
- Creator of Undead Invasion MP Scenario Pack.
- Creator of Valeria MP Adventure
- Creator of LA_RPG ERA
User avatar
Ravana
Forum Moderator
Posts: 3000
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Clutter in cfgs Slow Down the engine?

Post by Ravana »

Not cut, but save it some turns earlier. And looking for repeating parts of code.
gfgtdf
Developer
Posts: 1432
Joined: February 10th, 2013, 2:25 pm

Re: Clutter in cfgs Slow Down the engine?

Post by gfgtdf »

LordAwsomeness wrote: March 1st, 2020, 4:49 pm Wow I did that but I have no idea where to start... the savefile is 119 MBs uncompressed...
yes thats exactly the problem, and you ahewv to find out whats makes it so big, what i reccomend is to just pick maybe 10 positions inside that file at random look at them and two of them looks similar there is alorady a huge chance that you have found the code that ameks it so big.
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