HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Some questions.

03-04-2008, 03:38 PM#1
Vexorian
- Have you ever seen a map with more than 8190 functions?
- Has a map ever survived with more than 60000 handle ids?

- Has anyone actually successfully used MagicTimers? I plan to make a tutorial on them (which will mostly be about vJass' awesomeness (accept it)) but I first need to know if they are stable.

- I was thinking on using {} for inline syntax, dunno if it is too lame of an idea.

For example:

Collapse JASS:
function A takes integer level returns integer
    return 2*level
endfunction

//...
   set x = A{ GetUnitAbilityLevel(u,s) } 
//->
   set x = 2*GetUnitAbilityLevel(u,s)

- Also, next jasshelper version is going to be the last one that will bring more features to vJass, after that I am going to begin work on another (cross platform) compiler and there will be plenty of time before it hits stability, I will only add features to vJass after this compiler is released and 'kind of' stable. So, if you need to remind me of a very important feature that's missing, this may actually be your last chance in a long time. (I'll still fix bugs in jasshelper while making the new compiler though)
03-04-2008, 04:55 PM#2
Anitarf
Well, we all use the map optimizer so having inline syntax on the jasshelper level might not be neccessary; it's not a bad idea, though.

I just noticed vJass globals get declared prior to some map-specific handles, like bj_mapInitialPlayableArea. I tried doing this:
Collapse JASS:
    globals
        private real minX = GetRectMinX(bj_mapInitialPlayableArea)
        private real maxX = GetRectMaxX(bj_mapInitialPlayableArea)
        private real minY = GetRectMinY(bj_mapInitialPlayableArea)
        private real maxY = GetRectMaxY(bj_mapInitialPlayableArea)
    endglobals
It's not a big issue, I just moved the definitions to my init function, and for all I know there might be good reasons for things to be like this, but I just thought I'd mention it anyway.
03-04-2008, 09:29 PM#3
Vexorian
Quote:
I just noticed vJass globals get declared prior to some map-specific handles, like bj_mapInitialPlayableArea. I tried doing this:

No.

bj_mapInitialPlayableArea is declared before such globals.

But initBlizzard initializes it.

There is no way to have map bounds in a rect just during globals declarations, so you are forced to init variables dependant on bj_mapInitialPlayeableArea manually.

Quote:
Well, we all use the map optimizer so having inline syntax on the jasshelper level might not be neccessary
The optimizer sucks for this, a lot .
03-04-2008, 10:08 PM#4
cohadar
Quote:
Originally Posted by Vexorian
- Have you ever seen a map with more than 8190 functions?
Pyramidal has 1530... I really doubt someone would break 8190 limit

Quote:
Originally Posted by Vexorian
- Has a map ever survived with more than 60000 handle ids?
Yes pyramidal has survived torment test with 300000 handles.
(It was actually playable after that... )

Quote:
Originally Posted by Vexorian
- Has anyone actually successfully used MagicTimers? I plan to make a tutorial on them (which will mostly be about vJass' awesomeness (accept it)) but I first need to know if they are stable.
Did you actually ever posted that somewhere, I don't see it in your signature.

Quote:
Originally Posted by Vexorian
- I was thinking on using {} for inline syntax, dunno if it is too lame of an idea.
Well auto optimization would be better but I guess {} is better than nothing.

Quote:
Originally Posted by Vexorian
- Also, next jasshelper version is going to be the last one that will bring more features to vJass, after that I am going to begin work on another (cross platform) compiler and there will be plenty of time before it hits stability, I will only add features to vJass after this compiler is released and 'kind of' stable. So, if you need to remind me of a very important feature that's missing, this may actually be your last chance in a long time. (I'll still fix bugs in jasshelper while making the new compiler though)

I'm quite satisfied with what I got now.
03-05-2008, 12:36 AM#5
PipeDream
more than 8190 functions: no
more than 60000 handle ids: potentially bad if you're I2Sing them but I have no data
{}: Any progress/anything you can implement on the inlining front is not lame.
03-05-2008, 04:05 AM#6
Jazradel
more than 8190 functions: no
more than 60000 handle ids: only on cohadar's test maps.

I've done a couple of test spells with magic timers, but I haven't used them for anything serious.

Don't have any opinions about using {} other than I would prefer using for control statements, as in void test() { if (true) {} }
But I'm fairly sure that wouldn't be worth the effort.
03-05-2008, 05:41 AM#7
zen87
8190 functions : how we count the number of function in the map anyway... -.-"

Well for the magic timer, it just don't works as expected in my map (maybe is my fault anyway) but thanks to its idea of using linked list, i got a pretty good idea of doing things in the data structure way :)

and the {} syntax... well i think it is okay... looks cool and C++-ish...
03-05-2008, 07:08 AM#8
midiway
what about

Collapse JASS:
globals
    integer array MyArray = { 2, 5, 8, 5}
endglobals
03-05-2008, 08:03 AM#9
cohadar
Quote:
Originally Posted by zen87
8190 functions : how we count the number of function in the map anyway... -.-"

Extract war3map.j from your map (with mpqmaster)
then you open it in some text editor and do a global replace of keyword function with something else.

After it is done the editor says: "replaced 1530 instances of function"...
03-05-2008, 12:34 PM#10
Vexorian
Quote:
Originally Posted by zen87
8190 functions : how we count the number of function in the map anyway... -.-"

Well for the magic timer, it just don't works as expected in my map (maybe is my fault anyway) but thanks to its idea of using linked list, i got a pretty good idea of doing things in the data structure way :)

and the {} syntax... well i think it is okay... looks cool and C++-ish...
I can't fix stuff without actual bug reports.
03-05-2008, 01:00 PM#11
moyack
Quote:
Originally Posted by cohadar
Extract war3map.j from your map (with mpqmaster)
then you open it in some text editor and do a global replace of keyword function with something else.

After it is done the editor says: "replaced 1530 instances of function"...
Actually it's innacurate :P

I suggest to do it with "takes" or "returns" because function can be used in timers for instance.

I'll do my test with my map to see how much code it has.
03-05-2008, 01:14 PM#12
Rising_Dusk
Hey, 647 functions in DoE. I wouldn't worry about 8190, I'd bet any map with that many functions has more problems than worrying about its function count. :p

I actually like what Midiway suggested, although I use programming at my job more in engineering applications, so I have different requirements, so maybe it wouldn't be useful in WC3. I'd probably use square brackets.
Collapse JASS:
globals
    real Test = 12.934
    integer array Numbers = [2, 4, 6, 8]
    real array Numbers2 = [Test, 2*Test, 4., Test/2]

    //Maybe some array multiplication!
    //The dot signifies all matrix elements get multiplied by corresponding ones in second matrix.
    real array Numbers3 = Numbers.*Numbers
    //Numbers3 would now be [4, 16, 36, 64]

    //Conversely, division and stuff would work with the dot-syntax.
    real array Numbers4 = Numbers3./Numbers
    //Numbers 4 should now equal Numbers, [2, 4, 6, 8]

endglobals

struct MyStruct
    //Actual matrix multiplication, inversion, etc. would be useless because jass only supports 1-D arrays, so no need for that.
    //But this notation might also have applications in structs too.
    real a = 12.
    real b = 4.
endstruct

function ObligatoryFunction takes nothing returns MyStruct
    local MyStruct data1 = MyStruct.create()
    local MyStruct data2 = MyStruct.create()

    return data1.*data2
    //This would return a MyStruct with a = 144 and b = 16
endfunction
Although honestly, I doubt many people would appreciate that kind of stuff built into vJass, so meh. Just a random idea I suppose.
03-05-2008, 02:53 PM#13
vesuvan doppleganger
I oftentimes wish it was easier to manipulate things like structs on a lower level. what If I wanted to insert code into the struct algorithm itself, or to make code that directly changes a value of one of the variables used in the struct system? I understand that I could just do this myself, but if it wouldn't be too difficult, an option for viewing the variable and function names used for VJASS syntax would be very convenient.
03-05-2008, 03:36 PM#14
Vexorian
Dusk, that's hard mostly because it happens during globlas declarations.

It is possible I would add operator declaring for +,*,-,/ which in a way would allow you to do that stuff. But I may not do it. There's a little problem right now with my Jass grammar in which it totally ignores operator precendence...

I actually have made a matrix struct which supports adition, product and power, totally out of boredom, when I go back to home I might find my .j file and try to release it...
03-05-2008, 08:08 PM#15
Toadcop
add ++,-- += -= etc ? ^^

and imho the func body could looks like in C/C++ etc.

integer MyFunc (integer lol,string xD){
...
call doingmyshithere()
...
}

but well it's a suggestion if you not have what to do xD

60000 handles may happen... 8K is a bit too much imho. (so "it's save")
~10K of vars/arrays is possible =)