| 07-10-2005, 06:33 AM | #1 |
All of my abilities that require large amounts of variables always lag pretty badly the first time someone uses them, but not after that. I was wondering if there was any way to get it to not lag on the first use. I don't like having to put warnings in my spells about how badly it will lag the first time and to watch out :\\ . I've tried placing units in WE before the game begins, then ordering them to cast the high lag spells when the game starts, but that doesn't seem to help. In fact, I'm not even sure if they're casting the spells. Anyways, thanks for any help you can give me. |
| 07-10-2005, 06:39 AM | #2 |
Did you use them at map Init or after x seconds? |
| 07-10-2005, 06:53 AM | #3 |
I believe it was at map init. Should I try after X seconds? |
| 07-10-2005, 07:39 AM | #4 |
Variables are somewhat slow to begin with... perhaps try to create a dummy unit to cast the spells beforehand? |
| 07-10-2005, 11:00 AM | #5 |
The lag experienced this way is because a game has to load all the spell and unit data, it has nothing to do with the variables. When the game creates a dummy caster for the first time, when it gives him an ability for the first time, when it creates an effect for the first time, loading that stuff is what lags. Only way to get around it is to pre-place a unit on the map that has all the support abilities your dummy casters use, so all those abilities will be already loaded at map initialization and not when the hero first uses a triggered spell. Also, create all effects and dummy units you will use in your map the same way (you can remove them just after you create them), so the game won't have to load a new model and texture the first time you use a spell with triggered special effects. |
| 07-10-2005, 05:53 PM | #6 |
I've already done this, and it works with most of my spells. However there are a couple that still lag a ton. The worst of these is a shapeshifting spell that uses a lot of variables, and it lags a ton the first time they switch to the alternate form, and the first time they switch back. I'm not really sure how to fix this, I've put both the alternate form and the main form on the map beforehand(with all the abilities on them) but it still lags just as much. I'll keep messing around and see if I can get anything to work. Edit: Just realized that some of the abilities were added to the alternate form through triggers, and it didn't start out with them. I put those on a dummy unit and put him on the map before it started. Now I'm still getting a bit of lag, but it's not bad at all and if I keep looking I'll probly be able to fix it. |
| 07-10-2005, 06:27 PM | #7 |
Good, I never really did understand the Shapeshifting Ability, I'll have to look at it. |
| 07-10-2005, 08:54 PM | #8 |
Does the Trigger Action Preload - Actually work? Ive never really tested it but in theory it could be useful in situations like this. |
| 07-11-2005, 12:50 AM | #9 |
PReload the models, and have a unit preplaced in your map that has every ability that is added to dummy casters, remove it at map initialization |
