| 11-18-2007, 07:15 AM | #1 |
Here's a from scratch and (intended to be, at least) compatible implementation of the JassVM. Enter it through JASS:call Cheat("funcname") It supports enough JASS to run the constraints demo map I posted recently. In a silly benchmark of adding and multiplying in a loop, it was 3.3 times faster than the blizzard VM. Notes/Limitations:
Source is in the grimoire SVN |
| 11-21-2007, 09:56 AM | #2 |
From what I understand the "funcname" must not take any arguments or return a value. And by replacing call MyFunc() with call Cheat("MyFunc") all code inside the function and calls spawning from there will be executed in your faster VM. I'd say it can be quite useful for heavy initialization functions and mathematical calculations (eg physics engines ...). Input/output would have to be passed via globals? However, I couldn't quite get it to run. The log says the Op signature couldn't be found. Here's the log. Code:
symtable offset: 2854 War3_497: 4400c0 SMemAlloc: 15027db0 SStrHashHT: 1503bfa0 NativeStrGet: 6f2b0b30 strget: 6f6a2000 getnativestruct: 6f6a2030 jString_of_char: 6f6b1ca0 nstr_of_jString: 6f6b1c80 nativename: Cheat hooknative: 8ef4510 hooknativedata: 57e58955 nativenameaddr: 6f815630 regaddr: 6f2b036a war3_native: 8e44a1c Error: Op signature not found Since this is supposedly part of the warmachine initialization I guess details about the map/code that i used won't matter. I have 1.21, no cracks, etc... I'm impressed anyway. |
| 11-21-2007, 11:22 PM | #3 |
I forgot to mention you need to disable war3err. I don't intend to support jumping to functions with args because the goal is to have all code run under it. Since you always start with an empty stack... We do have the description of the blizzard stack though so it could be done. |
| 11-28-2007, 09:22 AM | #4 |
Thanks. Without war3err the error goes away. |
| 12-02-2007, 02:12 AM | #5 |
Step 2, transparency. It now runs your code with out intervention. Assorted bug fixes, most importantly TriggerEvaluate(). There's still _something_ broken since it can't run <init>, config, or main, but I have yet to find out why. To try, place dll in grimoire/bin. Disable war3err in newgenpack menu. Add line to ongameload.lua: loaddll("bin\\warmachine.dll"). Watch as your code runs faster or, preferably, crashes so that I have a test case to figure out what is still wrong. |
| 12-02-2007, 11:07 PM | #6 |
it's fucking awesome ! I was right than i decided to expand TcX to a mod. so i can use all advantages of Grimoire (load mpq JAPI) and here the new imba =) a new MV so the map will run awesome smootly. (btw it's possible alsmot completly to replace the blizz one ? (yes config and main may by runed under default VM) but the rest ? i mean use some more advanced vars/arrays...) but well :'( currently it doesnt work on my sys =( it's simply doesnt happen anything. here the log. (i use call Cheat("myfunctocall") and for test i call a echo to display message and nothing happens.) if this will work stable enough i will completely move to mod development so i could use the full potential of this fucking awesome features ^^. omg... Bryan you are BEYOND GODLIKE ! ^^ :beer: |
| 12-02-2007, 11:40 PM | #7 |
In the last DLL posted, Cheat() just logs. All code except that spawned from <init>, config and main runs under the new VM. If warmachine.txt appears and map code is running, then it's working. |
| 12-02-2007, 11:49 PM | #8 |
omg i am confused >.<. ok 1) i am included warmachine into ongameload.txt (or lua =\) 2) i am run war3 with grimoire and it works well 3) DO I NEED TO CALL Cheat ? O_o ? or does it simple work from begin ? (the new VM) hmm ok i will test. (yes how you can see it create a warmachine.txt file ^^) !!! yeah ^^ it does work ! AND I CAN CONFIRM what it does call functions ~3x times faster !!! but the vars are not get pushed ? =( it's possible to increase var,array speed ? and yeah maybe a lil bug report =) save the game and load it ^^ (the VM will strike) aka nothing will work (jass) anyway it PAWNZ ! hmmm =( it does crash the game =\ here (also it seems to don't like Multiboards) (Press Esc to run test (push it several times)) |
| 12-03-2007, 12:48 AM | #9 | ||
Quote:
Quote:
Thanks for the map. |
| 12-04-2007, 10:01 PM | #10 | |||
Quote:
Quote:
Code:
globals x integer myint=0 // ? or something. so it would have a back compability with the standart globlas and this would be the faster one. endglobals well anyway global arrays are keeping the important data ^^ // btw is math faster ??? (in your VM) // also i will check now your "No limits" it sounds awesome. // btw it would be possible to log (save into a file) the values of globals vars or ? (i think about "Custom Save/Load"...) jass have on save load events. save runs BEFORE the map get saved. and load event runs before the map starts (at the end of loading) so it could be used... // can't wait to use this features in practise :P btw Quote:
|
| 12-04-2007, 11:05 PM | #11 |
one question, im not sure what this is about. but i like the word faster :D so i wanna know will this "whatever it is" work on bnet. if it does, then i would like to learn more what we are talking about here, and how to use :) |
| 12-05-2007, 01:26 AM | #12 |
My VM replaces a method on the blizzard class. It's intended that the state when the method exits be identical to what it would be if Blizzard ran. Save game and BNet should just work because they happen between JASS executions where the game has no idea that anything different happened. I'm not sure what you mean by new globals type. If you are only concerned with optimizing, don't worry about it. They are only slow because I haven't rewritten blizzard's routines for setting global variables. Yes, math should be fast. Save globals: If you want to save them for debugging purposes, you can do this with war3err: Cheat("Dump_GlobalHT") or something like that. Check the manual. If it's a suggestion for how to get save/load working, I will probably have to go at a lower level. But I think save/load should just work, the problem right now is that the map code doesn't get recompiled. BNet: I was worried about multiplayer period because of issues like globals synchronizing. |
| 12-05-2007, 09:40 AM | #13 |
oh, so this means only the people using ur VM will have the advandtage of this? Example in a bnet game, only players who use ur VM will get better performance (on somethings)? Or is this a global thing, that u can implement into a map and everyone become faster when playing tat map |
| 12-05-2007, 10:27 PM | #14 | |
Quote:
well anyway Grimoire rules ! MaD[Lion] this stuff is only for true fathers xD so go away Simple war3 map creator :P well it's a joke but it's true. this makes only sense in a war3 mod. no there else. so say "bye bye" or do you have decide to make a mod ? =) well if yes so you can use it. (//btw it's a Grimoire "addon") |
| 12-06-2007, 12:01 AM | #15 |
Mad: The VM does the actual JASS execution, so it only helps you if you are running it to play the map. If you're making a mod I would suggest writing everything in C++, or through C++ any other language. |
