event language compiler/decompiler

The role-playing games (I-X) that started it all and the various spin-offs (including Dark Messiah).
zipi
Peasant
Peasant
Posts: 50
Joined: 27 May 2008

event language compiler/decompiler

Unread postby zipi » 28 May 2008, 12:18

hello
i'm interested in making a compiler/decompiler for the mm7 event language. my goal is to revert back the hex data to some readable (writable) format. i have some progress. unfortunately i need more information on the event opcodes (commands). please look and read what i've written so far in the specification, and if you have some additional information send it to me. the decompiler transforms hex to literal text only yet (code taken from mm8leveleditor). any comments, suggestions or questions are welcome. this msg, the specification and the code are written in a haste and the files are in constant update:
specification
files
Last edited by Anonymous on 02 Jul 2008, 07:59, edited 1 time in total.

User avatar
motter28218
Pixie
Pixie
Posts: 118
Joined: 30 Sep 2007

Unread postby motter28218 » 30 May 2008, 21:37

This sounds like a good idea, have you looked on BDJ's blog? He has some tutorials that may help you, I am currently doing a mod for MM6 and I can send you Global.evt that I have parsed out in text and have left notes on the lines of code explaining what they do. There is a slight diff in the op code between 6+7 however, but I'm sure you could figure it out. Let me know.

zipi
Peasant
Peasant
Posts: 50
Joined: 27 May 2008

.

Unread postby zipi » 31 May 2008, 13:13

yes, i've already read the tutorials and extracted the useful information from it. I would be grateful if you would send the global.evt file :)
The most important would be to contact BDJ, but i couldn't. i think he knows a lot. i decompiled the event files from the mod and saw a lot of still unknown (for me atleast) commands, that are not in the original game.

User avatar
motter28218
Pixie
Pixie
Posts: 118
Joined: 30 Sep 2007

Re: .

Unread postby motter28218 » 01 Jun 2008, 02:17

zipi wrote:yes, i've already read the tutorials and extracted the useful information from it. I would be grateful if you would send the global.evt file :)
The most important would be to contact BDJ, but i couldn't. i think he knows a lot. i decompiled the event files from the mod and saw a lot of still unknown (for me atleast) commands, that are not in the original game.
Just PM me with your E-mail and I will send it to you, and yeah, BDJ is definitely the man to talk to, he's helped me alot.

zipi
Peasant
Peasant
Posts: 50
Joined: 27 May 2008

.

Unread postby zipi » 16 Jun 2008, 10:28

just a quick post.
i'm still working on this, but moved a bit into the source code of mm7 so i can understand how the yet unknown events work
stay tuned for some update soon

zipi
Peasant
Peasant
Posts: 50
Joined: 27 May 2008

.

Unread postby zipi » 17 Jun 2008, 08:29

found something very, very interesting: probably a level editor/viewer built ingame! but it is not yet possible to use it, just found a way to peek in :) here is a screenshot: Image

edit: i've managed to start it, looks like it's just a mapviewer...

User avatar
vladimir-maestro
Genie
Genie
Posts: 1033
Joined: 19 Jun 2008

Unread postby vladimir-maestro » 22 Jun 2008, 04:47

Interesting...
As i can understand, with this one we can install our own language in the game with easy?

zipi
Peasant
Peasant
Posts: 50
Joined: 27 May 2008

Unread postby zipi » 23 Jun 2008, 06:31

with the decompiler you can make the *.EVT files readable.
with the compiler you can make EVT files.
the language is not defined yet, but it can be any language, you can define your own language if you want.

zipi
Peasant
Peasant
Posts: 50
Joined: 27 May 2008

.

Unread postby zipi » 23 Jun 2008, 13:08

updated the decompiler, and put up some new files here: files
in decompiler_orig you find the evt, str, some txt files from the original events.lod and in the dec directory the decompiled files
in decompiler_bdj the same files from BDJ's mod events.lod and the decompiled files

the decompiler works this way: it need some txt files from the events.lod copied into /txt dir, evt files to /evt, and str files to /str. run the compiler with the command java -jar decevt.jar and it puts decompiled files to /dec

there are some errors in BDJ's mod, these errors are fixed and the fixed evt files are in decompiler_bdj directory, and an 'errors' file containing the errors and how to fix them

User avatar
GrayFace
Round Table Hero
Round Table Hero
Posts: 1660
Joined: 29 Nov 2005

Unread postby GrayFace » 29 Jun 2008, 08:15

Here are 010Editor files with command I've figured out and some other stuff: http://www.grayface.nm.ru/MMFiles.rar
MMevtInclude.bt - file with all commands definitins.
MM8evtInclude.bt (the most full one), MM7EvtInclude.bt, MM6evtInclude.bt - files with variables definitions.
MMevt.bt - template for .evt files editor
MMevtInLod.bt - template to edit a .evt file inside a .lod. It requires a bit of manual work to place the needed file extracted in the end of .lod archive. The trick allows editing this file right in the .lod without a need to restart the game. Just reload savegame and the new script version will be used. I can explain how to use it if you want.
MMlod.bt - template for .lod files
MMstr.bt - template for .str files
My patches: MM6 MM7 MM8. MMExtension. Tools. Also, I love Knytt Stories and Knytt Underground. I'm also known as sergroj.

User avatar
vladimir-maestro
Genie
Genie
Posts: 1033
Joined: 19 Jun 2008

Unread postby vladimir-maestro » 29 Jun 2008, 17:54

Russian too ;)

zipi
Peasant
Peasant
Posts: 50
Joined: 27 May 2008

Unread postby zipi » 29 Jun 2008, 21:24

grayface
thanks that was exactly what i was looking for.
may i ask how do you get that information?
i think i can use it in the decompilation too :)

User avatar
GrayFace
Round Table Hero
Round Table Hero
Posts: 1660
Joined: 29 Nov 2005

Unread postby GrayFace » 30 Jun 2008, 08:32

vladimir-maestro wrote:Russian too ;)
Yeap :)
zipi wrote:grayface
thanks that was exactly what i was looking for.
may i ask how do you get that information?
i think i can use it in the decompilation too :)
I just extracted events from MM6-8 and inspected them all. At first, I listed all commands that there are, their default parameters and aproximate structure. There's "Errors" field in the template for this. Then I looked, made experiments etc. Also used information from mm8leveleditor and a few BDJ examples. I haven't inspected BDJ mod yet, only took the way to make a character expert in some skill. I'm sure there are other interesting things in it.
And I forgot to tell you how files can be edited with these templates. In 010Editor edit a line and replace it with a space to delete it. Replace it with +12 to add a command number 12. Values in strings can be edited too. Or click on cross and edit the fields there, but note that the string then won't be updated automatically, only when you press F10.
I haven't tried to find the place in disassembly, I'm interested about things you've found.
My patches: MM6 MM7 MM8. MMExtension. Tools. Also, I love Knytt Stories and Knytt Underground. I'm also known as sergroj.

zipi
Peasant
Peasant
Posts: 50
Joined: 27 May 2008

Unread postby zipi » 30 Jun 2008, 12:57

are you interested in the decompilation process? i'm using ida pro and hex-rays. already found the function responsible for interpreting the evt files. but without knowing the correct structures in the memory, it isn't good for anything.
found an ingame level-debugger (see above).
found some other debugging information:
you can make an mm6.ini file in the game's dir, containing these lines (these are the default values):

[screen]
vx1=8
vy1=8
vx2=468
vy2=351

[settings]
mixerchannels=16
nointro=0
nosound=0
nowalksound=0
nologo=0
nointro=0

[debug]
nomonster=0
startinwindow=0
showFR=0
nodamage=0
nodecoration=0
walkspeed=384

[file]
startmap=out01.odm

[outdoor]
RGBDayTop.r=81
RGBDayTop.g=121
RGBDayTop.b=236
RGBDayBottom.r=153
RGBDayBottom.g=193
RGBDayBottom.b=237
RGBNightTop.r=0
RGBNightTop.g=0
RGBNightTop.b=0
RGBNightBottom.r=11
RGBNightBottom.g=41
RGBNightBottom.b=129
noMist=0
nosky=0
nodecorations=0
nowavywater=0
gridband1=10
gridband2=15
gridband3=25
ter_gamma=0
bld_gamma=0

[mipmapping]
ter_mm1=2048
ter_mm2=4096
ter_mm3=8192
bld_mm1=1024
bld_mm2=2048
bld_mm3=4096

[shading]
dist_shade=2048
dist_shademist=4096
dist_mist=8192

[textures]
sky=plansky1
default=dirt

[debug]
recmod1=1.0
recmod2=1.0

[texmapping]
terrain_subdivsize=16
terrain_subdivpow2=4
building_subdivsize=32
building_subdivpow2=5

[party]
eyelevel=160
height=192

zipi
Peasant
Peasant
Posts: 50
Joined: 27 May 2008

Unread postby zipi » 30 Jun 2008, 20:44

MM7 debug mode: MM7_debug.zip
to use it, click on credits and open a blv or odm file.

zipi
Peasant
Peasant
Posts: 50
Joined: 27 May 2008

Unread postby zipi » 02 Jul 2008, 08:08

some very good news!! with the help of mm8leveleditor, BDJ and GrayFace the commands are 99% translated (soon i will post the new version).

the two next steps are these:
-make a compiler so modders can make their own events
-prepare the next project MM7editor

MM7editor will be an environment for making MM7 mods (and a whole game ofcourse). This is the concept: an interface combining:
-a map viewer (like mm_mapviewer by angel-death, if anyone has some contact with this person please send it to me), for editing the terrain and combine facets with events
-an event editor/compiler (that is not ready yet)
-properties editor (like mm8leveleditor)

i'm looking for some help too, if you have programming skills and interested in this please pm me.
if you have any ideas, opinions or thoughts please post

User avatar
vladimir-maestro
Genie
Genie
Posts: 1033
Joined: 19 Jun 2008

Unread postby vladimir-maestro » 03 Jul 2008, 13:18

If you can add please the ability to export\import all game files like LOD, XML format.

zipi
Peasant
Peasant
Posts: 50
Joined: 27 May 2008

Unread postby zipi » 03 Jul 2008, 14:04

good news, i found the author of mm_mapviewer and he sent me the source code of the program. so the time of modding the whole game is near :)

vladimir-maestro
can you please describe a little bit more, what you would like, because i don't understand it. do you want lod=> xml and xml=>lod? cause i think that's not possible

User avatar
vladimir-maestro
Genie
Genie
Posts: 1033
Joined: 19 Jun 2008

Unread postby vladimir-maestro » 03 Jul 2008, 21:45

No, no!

I want to be able fully edit this both formats.
to open LOD file -> extract some files, change them -> import back in LOD. But be able to import\export all kind of files.

The same for XML format. Open it -> extract some files -> import some files.

It is all about monster's sprites!! With 3D acceleration game use sprites from XML file and with programm only - use bitmaps only from LOD file.

User avatar
GrayFace
Round Table Hero
Round Table Hero
Posts: 1660
Joined: 29 Nov 2005

Unread postby GrayFace » 04 Jul 2008, 16:38

Oh, it's about HWL, not XML :) There is a description of format in Russian, but there seem to be no editors for it yet.

I'm very interested in helping you on these tools, but I'm developing WoG, so I don't know.
My patches: MM6 MM7 MM8. MMExtension. Tools. Also, I love Knytt Stories and Knytt Underground. I'm also known as sergroj.


Return to “Might and Magic”

Who is online

Users browsing this forum: cthscr, Google [Bot] and 72 guests