taxing events and variables

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
Azeal
Posts: 97
Joined: July 24th, 2012, 8:19 am

taxing events and variables

Post by Azeal »

I have noticed my era is a bit slower on my laptop, and I am currently trying to rewrite some code to speed it up a bit. I use a lot of events and variables (including unit variables), as well as some menu items and was wondering if there are any events or variables that are particularly taxing on wesnoth. Thank you.
Max
Posts: 1449
Joined: April 13th, 2008, 12:41 am

Re: taxing events and variables

Post by Max »

what exactly is slow? does it take long to load? or maybe the AI is slow?
User avatar
Azeal
Posts: 97
Joined: July 24th, 2012, 8:19 am

Re: taxing events and variables

Post by Azeal »

loading speed is a little slow, but that is not big deal. turns ending/starting, recruiting, attacks. That does give me a clue for what events to look through, however I'm not sure what kind of content may be slowing the game. Is it likely just too many events? or may there be particular wml fragments that are slow to process?
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: taxing events and variables

Post by zookeeper »

I think [terrain] and [terrain_mask] cause a slight delay when the new terrain is redrawn. Also, naturally if you have several large loops (like iterate over all units, doing something to each one) then that can take a perceivable amount of time too, especially if they contain a lot of costly operations like [filter_wml] (?). And the more animations and halos and such there are on-screen, the laggier everything gets, so the number of units can also be a thing.
User avatar
Azeal
Posts: 97
Joined: July 24th, 2012, 8:19 am

Re: taxing events and variables

Post by Azeal »

thank you. I have several filter_wml but no large loops. I think the problem may just be many events and an old laptop.
Post Reply