Dynamic JASS hardcoding: Need Testers.

Jesus4Lyf

Good Idea™
Reaction score
397
Don't get too excited, this is too fragile for general use.

This is a timer system that executes JASS code created dynamically as it runs. Currently it is similar to TT. It is theoretically the fastest timer system ever written, and I have it running on my computer successfully. However, even declaring globals or adding functions in some places can utterly break this timer system, replacing it by a fatal error.

What I'd like to know is... Does this even work on anyone elses computer except mine?

Please open the map, and WITHOUT OPENING THE CODE OR SAVING THE MAP, click test map and try it. It is critical that you don't recompile it for the first test. After that, you can check out the code and save it and see if it still works (if it ever did). Please report your findings here. Don't be suprised by fatal errors, they're very likely.

I'd like to hand out a big thankyou to TheDamien for finding that you can actually execute bytecode out of arrays. I've been studying bytecode ever since to see if this is actually at all feasible.

I'm happy to explain things further. This thread can become just as interesting as people are curious. :D
 

Attachments

  • Bytecode.w3x
    15.8 KB · Views: 802

Jesus4Lyf

Good Idea™
Reaction score
397
Bah. It doesn't work then, unless someone randomly finds it works for them. :(

So basically what I did there was, I made it attach this to a timer:
JASS:
function ? takes nothing returns nothing
endfunction

Then it actually EXPANDS that AFTER it's attached. Like quite literally... To:
JASS:
function ? takes nothing returns nothing
call SomeFunc(1)
endfunction

Then...
JASS:
function ? takes nothing returns nothing
call SomeFunc(1)
call SomeFunc(1337)
endfunction

Then...
JASS:
function ? takes nothing returns nothing
call SomeFunc(1)
call SomeFunc(1337)
call SomeOtherFunc(577)
endfunction

Yes, I created a JASS compiler within WC3 that runs during the map. But since it relies on real memory locations to actually call the code, this can vary from computer to computer. I tried to make it safe by making it relative to BJ stuff, but it seems it has all fallen through. :( Oh well.

I was probably taking things a bit too far anyway. :p
And that's probably the biggest understatement of the century.

PS. Thanks for testing.

I'd still like to hear from others to see if this actually works for anyone!! :D
 

Romek

Super Moderator
Reaction score
963
Fatal Error.
Also, don't you think the current systems are fast enough? :p
They execute extremely quickly, and have certainly evolved over the years.

Faster, and extremely unsafe (making a map only work on certain computers) is pretty useless.
 

Jesus4Lyf

Good Idea™
Reaction score
397
Mmm... well, that really wasn't the point.

I was doing something original and generic, if it worked this could've had all kinds of applications.

That Bytecode map you downloaded actually has a real-time JASS compiler written entirely in JASS. Doesn't that make you pause and go "wait, what?"... :p

Anyway, no more tests required now really. Thanks everyone. I suppose I'll abandon this. :)

But any discussion about the concept is welcome! :D
 

saw792

Is known to say things. That is all.
Reaction score
280
It worked for me. No crashes at all first run without saving it. All messages were displayed.
 

Jesus4Lyf

Good Idea™
Reaction score
397
Wow! This is amazing news!

Errm so. Which version of WC3 did everyone test it on? This may give some hints as to why it crashed. Also, what operating system, and any modifications to WC3... like Grimoire... or JAPI...

This is crazy! :eek:

Keep the tests coming, if we may. But please state operating system, use the latest version of WC3, and don't use any modifications to it like JAPI or Grimoire.

I use Windows XP.
 

Romek

Super Moderator
Reaction score
963
Windows XP

> use the latest version of WC3
No can do. ;)
1.21b.

> JAPI or Grimoire.
Crashed even without.
 

Jesus4Lyf

Good Idea™
Reaction score
397
>1.21b.
That's the culprit. If blizzard.j is changed AT ALL basically, then my JASS based JASS compiler needs values changed because the pointer will be offset. :thup:

So we know that this will only work on the latest version of WC3. :D

saw792, did you manage to still have it run after saving the map? And if not, what version of JassHelper do you use? ;)

This is soooooo cool. Lol.

Has anyone figured out what this does yet?
 

UndeadDragon

Super Moderator
Reaction score
447
Crashed on mine, with Windows XP and latest version of WC3.
 

Builder Bob

Live free or don't
Reaction score
249
SomeFunc
1
SomeFunc
1337
SomeOtherFunc
577

I get all that output and no fatal error when testing the map without saving.

After saving the map I stop getting the output and get a fatal error on:
Adding call SomeOtherFunc(577)


Windows XP
Warcraft 3 version 1.23
JassHelper 0.9.G.0
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
Lol RoC? Not in a hurry to do that... Especially without it working on at least more than one person's computer on FT... So far it's still completely unfeasible.
Its just temporal, i will get back TFT in few days/weeks.
Anyway i think you simply use script, probably vJass so you can easily make it for ROC, or you use more than a script ?!
I just want to test it now, but will live with that if i can't now ...
 

Prometheus

Everything is mutable; nothing is sacred
Reaction score
589
Mine worked, latest New Gen and Windows Service Pack 3. Using what ever Jasshelper that came w/ latest NewGen.

Though I saved and it crashed.
 

Jesus4Lyf

Good Idea™
Reaction score
397
Right, that's the version of JassHelper adding different functions and such, changing the ID of the SomeFunc and SomeOtherFunc functions. I use 0.9.E.0 off memory.

So basically after saving you point to random functions because JassHelper compiles differently (as it is a different version).

>Anyway i think you simply use script, probably vJass so you can easily make it for ROC, or you use more than a script ?!
Erm. It's really not that simple. =X
Sorry, but you'll have to wait. :)

This is brilliant feedback. Thanks everyone so far. Lol, I've run out of ability to +rep for now...
 

Azlier

Old World Ghost
Reaction score
461
Huh. Worked fine for me. Displayed some calls, 1, 1337, and 577(?). No crash.

Windows XP SP2, latest Warcraft version

EDIT: Ooh... oops. I saved the map before testing, which apparently I wasn't supposed to do. It worked either way.

As for making it RoC, I think removing the Phoenix would do it. Hopefully.
 
Reaction score
333
Works for me (Windows XP SP 3). Displays "SomeFunc:" with numbers 1, 1337, 577, then it started displaying "SomeOtherFunc:" with a number as well, as far as I can remember.

After I saved the map with JassHelper 0.9.G.1, the numbers stopped working but multiple phoenixes started spawning at the position of the original. It eventually crashed. I attached the new map to this post.
 

Attachments

  • Bytecode(2).w3x
    15.7 KB · Views: 351
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top