Scripting question

Tom_Kazansky

--- wraith it ! ---
Reaction score
157
Actually it's about loading time.
I don't think my map has too many doodads, pre-placed units are not many either.
But it has a pretty long loading time, more than 5 minutes :banghead:, after I use Vexorian's wc3mapoptimizer4.7c, the loading time decreased to.... 40 seconds (well, around that)
so I think maybe because of the script, the loading time is long.
---
Among the functions that I use:
JASS:
function GetPPX takes real x, real dist, real angle returns real
    return x + dist * Cos(angle * bj_DEGTORAD)
endfunction

function GetPPY takes real y, real dist, real angle returns real
    return y + dist * Sin(angle * bj_DEGTORAD)
endfunction

function AngleLocXY takes real x1, real y1, real x2, real y2 returns real
    return bj_RADTODEG * Atan2(y2 - y1, x2 - x1)
endfunction

function DistanceLocXY takes real x1, real y1, real x2, real y2 returns real
    return SquareRoot( (x2-x1) * (x2-x1) + (y2-y1) * (y2-y1))
endfunction


they are "BJ-type", right ? I use them a alot

my question is, if I directly calculate instead of using the above functions, will my map load faster ?
( if it load faster, I don't mind if I have to do direct calculation :) )

EDIT: I have:
5772 doodads ( not too many, right :D, or it is ? )
142 units
0 items
 

Azlier

Old World Ghost
Reaction score
461
I don't see why using 5 extra functions would increase loading time. Think about it, those functions use less than 1 kb of space. It could, in extreme cases, affect in-game performance but not loading time...
 

Tom_Kazansky

--- wraith it ! ---
Reaction score
157
hmm.... but why does the loading time decrease so much after I use optimizer ?

I have:
5772 doodads ( not too many, right :D, or it is ? )
142 units
0 items
 

Azlier

Old World Ghost
Reaction score
461
Have you tried widgetizing then optimizing? The optimizer speeds up loading time by cleaning SLK's made by the widgetizer.
 

Tom_Kazansky

--- wraith it ! ---
Reaction score
157
well, I want to decrease the loading time before otpimizing. you know, editing with such a long loading time, it's very.... (what should I write here ?) :banghead:
---
>Have you tried widgetizing then optimizing? The optimizer speeds up loading time by cleaning SLK's made by the widgetizer.

if I use (widgetizer + optimizer), the size of my map will decrease less than I only use optimizer
 

saw792

Is known to say things. That is all.
Reaction score
280
if I use (widgetizer + optimizer), the size of my map will decrease less than I only use optimizer

You said nothing about map size. Map size is not equivalent to loading time. Widgetizer + Optimizer WILL decrease loading time more than just using Optimizer. The file size of the map actually increases when you use the Widgetizer as changes the data structure of the map.
 

Tom_Kazansky

--- wraith it ! ---
Reaction score
157
>You said nothing about map size. Map size is not equivalent to loading time
oh, my bad.

But anyways, I sastified with the loading time after optimizing. I still need a way to decrease loading time before optimizing so the editing+testing will be faster

EDIT: or maybe because my map size is big, it's 4.6MB :(
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top