The Ultimate WA Editor Hex-Editing Topic! Take A Look!
Hmm, I'm starting to think that we're littering too many topics now. And if you want to know, there's still no progress with that tutorial.
Skype wrote:[7:23:42 AM] Darx: Click here to give me an internet!
[7:23:57 AM] 'a'a: *clicks here*
Cbloopy, just wondering, which program did you use to make the converters with???
If it was Visual Basic, send me the .vb files and let me take over for a while.
 
Once again...
EDIT2: You would have to e-mail me more than just the vb files!
			
									
									
						If it was Visual Basic, send me the .vb files and let me take over for a while.
I agree with mqdar. Really, cbloopy take a break.mqdar wrote:Oh Cbloopy, take your time. You've done more than enough for us all. We should be giving you a break.cbloopy wrote:FYI, I do have a way that will one day let you make use of all the new MOFI objects. I just need to write a program, and I don't have a lot of free time right now. Please be patient.![]()
Once again...
EDIT: If their too big, e-mail me them. You should know my e-mail from when you sent me wg.exe.I wrote:If it was Visual Basic, send me the .vb files and let me take over for a while.![]()
EDIT2: You would have to e-mail me more than just the vb files!
Sorry, I used C++ for this. Visual Basic might've been easier in some respects but I haven't used it in a long time. Thanks for the offer to take over though.Clifford wrote:Cbloopy, just wondering, which program did you use to make the converters with???
If it was Visual Basic, send me the .vb files and let me take over for a while.![]()
To be clear, it's not like I'm working on this non-stop 24 hours a day, since I do have a life outside of Wonderland even if it doesn't seem like it.
So in short, it'll be done when it's done. In the meanwhile please don't let that stop people from making more adventures!
cbloopy wrote:To be clear, it's not like I'm working on this non-stop 24 hours a day, since I do have a life outside of Wonderland even if it doesn't seem like it.And some of the complications have little to do with the actual programming aspects (things like what models to substitute for, and figuring out the correct scalings to use in the WOPs [and therefore the corrections to perform in the converter program] so that the substituted models look roughly the same size in the Editor as the intended model, etc.) There's also the fact that every time I add something new, I'll have to update the documentation on the adjusters for the new object (eg. what does DataX mean for such and such?)
Skype wrote:[7:23:42 AM] Darx: Click here to give me an internet!
[7:23:57 AM] 'a'a: *clicks here*
I was just thinking now from seeing AJ's avatar...
What if we could convert levels from WA into the WA Beta or vice versa?
 
I'm not suggesting cbloopy should go and try making a converter for it right this minute or directly after finishing the MoFI converter, but it's still a pretty cool thought, right?
 
			
									
									
						What if we could convert levels from WA into the WA Beta or vice versa?
I'm not suggesting cbloopy should go and try making a converter for it right this minute or directly after finishing the MoFI converter, but it's still a pretty cool thought, right?
Well, we can get some information from MS on how to operate WA Beta. 
Perhaps he will even provide us a "newer" version of WA Beta.
  Who knows? 
			
									
									
						Perhaps he will even provide us a "newer" version of WA Beta.
Yeah, it seems like a pretty good idea, but...Qloof234 wrote:I was just thinking now from seeing AJ's avatar...
What if we could convert levels from WA into the WA Beta or vice versa?![]()
I'm not suggesting cbloopy should go and try making a converter for it right this minute or directly after finishing the MoFI converter, but it's still a pretty cool thought, right?
Since this is a beta, you know, it probably has extremely limited features and very little flexibility, because the programming would most likely be quick, messy, and very inefficient.
It still seems like it would be a good idea to try modifying some wop data in the wlv files. Who knows what else could've been snuck in there?
Patrick must've had a lot of fun doing all this.
Skype wrote:[7:23:42 AM] Darx: Click here to give me an internet!
[7:23:57 AM] 'a'a: *clicks here*
- jozsefkoma
 - Rainbow Star
 - Posts: 1460
 - Joined: Tue Dec 23, 2008 5:45 pm
 
New wop
Adventure restart is a new object. The new object restart adventures in wa editor, but in mofi not function.
			
						You do not have the required permissions to view the files attached to this post.
			
									
						Re: New wop
I looked at the WOP data, this is not a new object. It's just the Adventure Star object with Data0 set to 0, and the standard model replaced with the generic square. It works as a restart in in WA Editor because when you select standalone adventures to play, the game basically acts like you've gone to adventure #0.jozsefkoma wrote:Adventure restart is a new object. The new object restart adventures in wa editor, but in mofi not function.
A BREAKTHROUGH!
(explanations in following post...)

			
													
					Last edited by cbloopy on Fri May 01, 2009 12:12 pm, edited 1 time in total.
									
			
									
						A BREAKTHROUGH! (cont'd)
[EDIT: as of May 2nd 2009, you should use MOFILevelConverter version 0.1.2.0 or higher if you want to convert levels made with the hacked Editor.  You can get the latest version of MOFILevelConverter here]
So......
Well, I got fed up with the model substitution approach. It's just too much work and complications. I decided to finally attempt hacking new code (ie. programming) into the Editor. It took some work but as you can see from that glorious screenshot above, I finally got it to load new objects that uses "!ObstacleXX" for model names. They are basically all the decorative objects in the game. Yep, the Editor just took one big step closer to being a MOFI level editor!
But don't throw away MOFILevelConverter.exe just yet. It's not going away anytime soon. For the changes I made here, it's not even really new code, just copies of existing code modified to load the additional objects. In general, the kind of hacking needed to add truly new code is kinda like trying to dig to the center of the Earth with a spoon. It may be theoretically possible, but very impractical. In other words, there are still many things that will be easier to implement in MOFILevelConverter than the hacking route.
You can download the modified Editor.exe and the MOFI WOPs here:
http://www.geocities.com/cbloopy/HackedEditor.zip
(I can't attach here because it's too big. I tried MediaFire but it's broken.)
But before doing so, make sure to copy the data\models folder from MOFI/demo MOFI into WA Editor v096. The hacked Editor now expects the new MOFI model files to be present, and will not run if they aren't.
I purposely named the hacked editor with the same name of Editor.exe. While you can keep the original file, you should rename the original file to something else. Because the new MOFI WOPs uses !ObstacleXX models that the old Editor doesn't understand, the old Editor will MAV if you accidentally go to one of the new MOFI objects while browsing objects in the editor. By making my hacked version be Editor.exe, you are less likely to accidentally run the old unhacked version.
And remember that you still need MOFI demo to actually play any levels using the new MOFI models.
			
													So......
Well, I got fed up with the model substitution approach. It's just too much work and complications. I decided to finally attempt hacking new code (ie. programming) into the Editor. It took some work but as you can see from that glorious screenshot above, I finally got it to load new objects that uses "!ObstacleXX" for model names. They are basically all the decorative objects in the game. Yep, the Editor just took one big step closer to being a MOFI level editor!
But don't throw away MOFILevelConverter.exe just yet. It's not going away anytime soon. For the changes I made here, it's not even really new code, just copies of existing code modified to load the additional objects. In general, the kind of hacking needed to add truly new code is kinda like trying to dig to the center of the Earth with a spoon. It may be theoretically possible, but very impractical. In other words, there are still many things that will be easier to implement in MOFILevelConverter than the hacking route.
You can download the modified Editor.exe and the MOFI WOPs here:
http://www.geocities.com/cbloopy/HackedEditor.zip
(I can't attach here because it's too big. I tried MediaFire but it's broken.)
But before doing so, make sure to copy the data\models folder from MOFI/demo MOFI into WA Editor v096. The hacked Editor now expects the new MOFI model files to be present, and will not run if they aren't.
I purposely named the hacked editor with the same name of Editor.exe. While you can keep the original file, you should rename the original file to something else. Because the new MOFI WOPs uses !ObstacleXX models that the old Editor doesn't understand, the old Editor will MAV if you accidentally go to one of the new MOFI objects while browsing objects in the editor. By making my hacked version be Editor.exe, you are less likely to accidentally run the old unhacked version.
And remember that you still need MOFI demo to actually play any levels using the new MOFI models.
					Last edited by cbloopy on Sat May 02, 2009 8:24 am, edited 2 times in total.
									
			
									
						Re: A BREAKTHROUGH! (cont'd)
WHAT!!! SO IT'S PROGRAMED IN THE EDITOR!?!cbloopy wrote:So......
Well, I got fed up with the model substitution approach. It's just too much work and complications. I decided to finally attempt hacking new code (ie. programming) into the Editor. It took some work but as you can see from that glorious screenshot above, I finally got it to load new objects that uses "!ObstacleXX" for model names. They are basically all the decorative objects in the game. Yep, the Editor just took one big step closer to being a MOFI level editor!
But don't throw away MOFILevelConverter.exe just yet. It's not going away anytime soon. For the changes I made here, it's not even really new code, just copies of existing code modified to load the additional objects. In general, the kind of hacking needed to add truly new code is kinda like trying to dig to the center of the Earth with a spoon. It may be theoretically possible, but very impractical. In other words, there are still many things that will be easier to implement in MOFILevelConverter than the hacking route.
You can download the modified Editor.exe and the MOFI WOPs here:
http://www.geocities.com/cbloopy/HackedEditor.zip
(I can't attach here because it's too big. I tried MediaFire but it's broken.)
But before doing so, make sure to copy the data\models folder from MOFI/demo MOFI into WA Editor v096. The hacked Editor now expects the new MOFI model files to be present, and will not run if they aren't.
I purposely named the hacked editor with the same name of Editor.exe. While you can keep the original file, you should rename the original file to something else. Because the new MOFI WOPs uses !ObstacleXX models that the old Editor doesn't understand, the old Editor will MAV if you accidentally go to one of the new MOFI objects while browsing objects in the editor. By making my hacked version be Editor.exe, you are less likely to accidentally run the old unhacked version.
And remember that you still need MOFI demo to actually play any levels using the new MOFI models.
Re: A BREAKTHROUGH! (cont'd)
No, I think cbloopy programed them in the editorClifford wrote:WHAT!!! SO IT'S PROGRAMED IN THE EDITOR!?!
Uijt jt nz tjhobuvsf.
						Re: A BREAKTHROUGH! (cont'd)
Now it is. I added the programming necessary in Editor.exe for the Editor to load the new MOFI models, at least for the decorative objects. It still doesn't have any programming to handle non-decorative object models like !Kaboom or what-not.Clifford wrote:WHAT!!! SO IT'S PROGRAMED IN THE EDITOR!?!
Hey Qloof234, I have good news on that front! In the course of the work needed to hack Editor.exe to support the new MOFI decorative models, I've also figured out how to change the MOFI map screen so black is transprent. You need a hex editor for this, as we're changing wg.exe.Qloof234 wrote:Okay, neither black or white are transparent on the map screen. I have one last idea but it's likely not going to work because I have to hack Photoshop as well to get it going.
1) Open wg.exe from demo MOFI in a hex editor.
2) Use the hex editor's search feature to search for the following sequence of bytes (in hex):
Code: Select all
89 5C 24 04 E8 FC FF FF FF 89 04 24 C7 44 24 04 30 00 00 004) Change the byte that's "30" in hex to "34" in hex.
5) Save your changes.
Voila! Now the game will display the map with black being transparent. To revert, just repeat the above steps with "30" and "34" reversed.
You do not have the required permissions to view the files attached to this post.
			
									
						- 
				Emerald141
 - Rainbow AllStar
 - Posts: 4548
 - Joined: Fri Dec 26, 2008 4:56 pm
 
Epic. Thank you so much for this, I'm going to try it soon.cbloopy wrote:Hey Qloof234, I have good news on that front! In the course of the work needed to hack Editor.exe to support the new MOFI decorative models, I've also figured out how to change the MOFI map screen so black is transprent. You need a hex editor for this, as we're changing wg.exe.Qloof234 wrote:Okay, neither black or white are transparent on the map screen. I have one last idea but it's likely not going to work because I have to hack Photoshop as well to get it going.
1) Open wg.exe from demo MOFI in a hex editor.
2) Use the hex editor's search feature to search for the following sequence of bytes (in hex):3) Check that the hex editor finds exactly one place in wg.exe where that sequence of bytes is found (so that if you make it search from past the first occurrence, it doesn't find a second occurrence in the file). If it manages to find more than one occurrence of the bytes in your copy of wg.exe, stop and don't attempt the rest of the instructions below. Let me know if you hit that problem.Code: Select all
89 5C 24 04 E8 FC FF FF FF 89 04 24 C7 44 24 04 30 00 00 00
4) Change the byte that's "30" in hex to "34" in hex.
5) Save your changes.
Voila! Now the game will display the map with black being transparent. To revert, just repeat the above steps with "30" and "34" reversed.
There's a reason I bolded this line:Emerald141 wrote:Whenever I try to open the new editor I get the error message:Code: Select all
Couldn't Load Mesh:data\models\Other\volcano01.b3d
The new editor requires the files from MOFI for the new models be present.cbloopy wrote:But before doing so, make sure to copy the data\models folder from MOFI/demo MOFI into WA Editor v096. The hacked Editor now expects the new MOFI model files to be present, and will not run if they aren't.
Oh, and while I'm at it, let me remind you of this line also:
cbloopy wrote:And remember that you still need MOFI demo to actually play any levels using the new MOFI models.
But, how would that do anything, and how did you figure out that it would?cbloopy wrote:4) Change the byte that's "30" in hex to "34" in hex.
Skype wrote:[7:23:42 AM] Darx: Click here to give me an internet!
[7:23:57 AM] 'a'a: *clicks here*
This came about because in copying and adjusting the programming for !ObstacleXX models and textures, at first the transparency thing didn't work as expected, and then at a closer look I found that the model textures that require the black transparency thing, when the texture is loaded the code uses particular options represented by a number passed into the programming that handles texture loading (which ultimately likely passes into Blitz3D's build-in texture handling code).mqdar wrote:But, how would that do anything, and how did you figure out that it would?
I don't know what exactly the hex 30 means, but the 4 seems to represent the option to use black as transparent in a texture (because that's the number I found and needed to get the transparency thing working for my !ObstacleXX editor hack), hence the hex 34.
As for figuring out which bytes to change, well that come about roughly the same way as how I figured out what I need to add the new programming for the hacked Editor. Basically you use a debugger. A debugger is like a more powerful version of Cheat Engine. You can set it up to pause a program when it hits a certain line of code, or when it access a certain memory address. So I use the debugger's search capabilities to search for the memory addresses of the various text for the paths to models and textures (eg. "data\models\blah"), and then I set it up to watch for memory accesses of those addresses to determine where the code is for loading a certain file the game/editor uses. Then I examine the code (I know assembly language so that's not a problem) to get a rough idea of what it's trying to do.
So, with the help of a debugger, you didn't look for it yourself, you got the game to 'tell you' where it was. 
You know assembly code? But the instruction "89 5C 24 04 E8 FC FF FF FF 89 04 24 C7 44 24 04 30 00 00 00", whatever it is, isn't assembly code, is it? If it is, then tell me, what does it mean exactly?
			
									
									You know assembly code? But the instruction "89 5C 24 04 E8 FC FF FF FF 89 04 24 C7 44 24 04 30 00 00 00", whatever it is, isn't assembly code, is it? If it is, then tell me, what does it mean exactly?
Skype wrote:[7:23:42 AM] Darx: Click here to give me an internet!
[7:23:57 AM] 'a'a: *clicks here*
That's right. This is also why some things will still be very difficult to discover. For example it'll probably be difficult to figure out where MOFI has the programming for, say, the 1.wlv (37,8 ) starting location, because unlike the name of a file, there could be tons of places where the program happens to use the numbers 37 or 8, so I won't have a single specific memory address to watch for.mqdar wrote:So, with the help of a debugger, you didn't look for it yourself, you got the game to 'tell you' where it was.
Well assembly code is just machine code translated into a more human-readable form. I don't remember exactly what it means, I just pick a snippet of the bytes making up the machine code in question so you can search for them in the hex editor.You know assembly code? But the instruction "89 5C 24 04 E8 FC FF FF FF 89 04 24 C7 44 24 04 30 00 00 00", whatever it is, isn't assembly code, is it? If it is, then tell me, what does it mean exactly?
And even if I tell you what it means it won't tell you much. Machine code is very low level and mostly boils down to things like load/store X bytes from such and such memory location, arithmetic, and conditionals (skip ahead or back to some instruction if result of computation is greater than/less than such and such). Without any context, the code in question basically would be like "pass in mystery value X and value hex 30 to mystery code at address Y". The only way to figure out what "mystery code" does and what "mystery value" means would be to either drill in further by diassembling more machine code (this is how it becomes "use a spoon to dig to the center of the Earth"), or by noticing that the sequence of code is similar to some other sequence of code whose purpose you have an idea of (this is how I figure it out--the sequence of code above is similar to the code for loading !ObstacleXX textures that I found from watching memory access).
I know what assembly code is.  Interestingly, it was explained to me in a C++ tutorial (I'm trying out C++ to see if I like it).
			
									
									Skype wrote:[7:23:42 AM] Darx: Click here to give me an internet!
[7:23:57 AM] 'a'a: *clicks here*
Okay, I've figured that out finally:Clifford wrote:I'm going on holiday and'll be back 2 weeks later. Do you think you could also release a patch for wg.exe so that:
<snip>
It doesn't show the volcano on the title screen.
1) open demo MOFI's wg.exe in a hex editor.
2) use the hex editor's search feature to find the following sequence of bytes (in hex):
Code: Select all
81 EC 08 00 00 00 B8 03 00 00 00 C1 E0 02 03 05 00 00 00 003) You might want to make a note of the address/file location where the hex editor found the byte sequence in your copy of wg.exe. I don't give out exact addresses because that may differ between versions of demo MOFI (yes, there are at least 2 known versions of wg.exe even for demo MOFI, v1.00 and v1.02). That way if you want to change it back or change it to something else, you can just go directly to where the bytes are in your particular copy of wg.exe.
4) change only the first "03" in the sequence (the one that comes after "B8") to "2E". Leave all other bytes alone.
5) save the changes and try it out!
The "03" is what makes the game looks for !Obstacle03 for the model to use on the title screen. !Obstacle03 is the volcano model. The change above causes the game to look for !Obstacle46 instead, which is the model for the MOFI bridge, so we substituted the MOFI bridge for the volcano just for the title screen. And the MOFI bridge model is apparently small enough that it is invisible when shown on the title screen.
You can try out other values in place of using "2E" (although if you use a value that doesn't correspond to an !ObstacleXX MOFI knows about, the game MAVs). "2C" for example will show the ship model instead.
Oh, and while we're at it, changing the music on the title screen is even easier.  Just open up wg.exe the hex editor and look for occurrences of the following text:
Data\music\8.ogg
I found 2 occurrences in my copy of demo MOFI's wg.exe. Changing the "8" in the text to something else will change the music it plays. I don't know yet why there are two occurrences and what happens if you make them different, but feel free to experiment.
			
									
									
						Data\music\8.ogg
I found 2 occurrences in my copy of demo MOFI's wg.exe. Changing the "8" in the text to something else will change the music it plays. I don't know yet why there are two occurrences and what happens if you make them different, but feel free to experiment.
Re: A BREAKTHROUGH! (cont'd)
cbloopy wrote:So......
Well, I got fed up with the model substitution approach. It's just too much work and complications. I decided to finally attempt hacking new code (ie. programming) into the Editor. It took some work but as you can see from that glorious screenshot above, I finally got it to load new objects that uses "!ObstacleXX" for model names. They are basically all the decorative objects in the game. Yep, the Editor just took one big step closer to being a MOFI level editor!
But don't throw away MOFILevelConverter.exe just yet. It's not going away anytime soon. For the changes I made here, it's not even really new code, just copies of existing code modified to load the additional objects. In general, the kind of hacking needed to add truly new code is kinda like trying to dig to the center of the Earth with a spoon. It may be theoretically possible, but very impractical. In other words, there are still many things that will be easier to implement in MOFILevelConverter than the hacking route.
You can download the modified Editor.exe and the MOFI WOPs here:
http://www.geocities.com/cbloopy/HackedEditor.zip
(I can't attach here because it's too big. I tried MediaFire but it's broken.)
But before doing so, make sure to copy the data\models folder from MOFI/demo MOFI into WA Editor v096. The hacked Editor now expects the new MOFI model files to be present, and will not run if they aren't.
I purposely named the hacked editor with the same name of Editor.exe. While you can keep the original file, you should rename the original file to something else. Because the new MOFI WOPs uses !ObstacleXX models that the old Editor doesn't understand, the old Editor will MAV if you accidentally go to one of the new MOFI objects while browsing objects in the editor. By making my hacked version be Editor.exe, you are less likely to accidentally run the old unhacked version.
And remember that you still need MOFI demo to actually play any levels using the new MOFI models.
I don't seem to quite understand.
Can we use the adventures made from this new Editor directly (with all the MoFI models and objects), or must they only be run in MoFI?
Re: A BREAKTHROUGH! (cont'd)
How did you do this? Using a decompilier???cbloopy wrote:So......
Well, I got fed up with the model substitution approach. It's just too much work and complications. I decided to finally attempt hacking new code (ie. programming) into the Editor. It took some work but as you can see from that glorious screenshot above, I finally got it to load new objects that uses "!ObstacleXX" for model names. They are basically all the decorative objects in the game. Yep, the Editor just took one big step closer to being a MOFI level editor!
But don't throw away MOFILevelConverter.exe just yet. It's not going away anytime soon. For the changes I made here, it's not even really new code, just copies of existing code modified to load the additional objects. In general, the kind of hacking needed to add truly new code is kinda like trying to dig to the center of the Earth with a spoon. It may be theoretically possible, but very impractical. In other words, there are still many things that will be easier to implement in MOFILevelConverter than the hacking route.
You can download the modified Editor.exe and the MOFI WOPs here:
http://www.geocities.com/cbloopy/HackedEditor.zip
(I can't attach here because it's too big. I tried MediaFire but it's broken.)
But before doing so, make sure to copy the data\models folder from MOFI/demo MOFI into WA Editor v096. The hacked Editor now expects the new MOFI model files to be present, and will not run if they aren't.
I purposely named the hacked editor with the same name of Editor.exe. While you can keep the original file, you should rename the original file to something else. Because the new MOFI WOPs uses !ObstacleXX models that the old Editor doesn't understand, the old Editor will MAV if you accidentally go to one of the new MOFI objects while browsing objects in the editor. By making my hacked version be Editor.exe, you are less likely to accidentally run the old unhacked version.
And remember that you still need MOFI demo to actually play any levels using the new MOFI models.


