Register - Login
Views: 86580019
Main - Memberlist - Active users - Calendar - Wiki - IRC Chat - Online users
Ranks - Rules/FAQ - JCS - Stats - Latest Posts - Color Chart - Smilies
10-22-17 01:20:56 AM

Jul - SM64 Hacking - M64Tool - Level exporter (+ documentation) New poll - New thread - New reply
Pages: 1 2Next newer thread | Next older thread
MarIO0
Member
Level: 15


Posts: 34/43
EXP: 15368
For next: 1016

Since: 09-03-09


Since last post: 4.0 years
Last activity: 4.0 years

Posted on 08-06-11 01:42:21 PM (last edited by MarIO0 at 01-27-13 05:20:00 AM) Link | Quote
M64Tool is a level exporter. It wasn't meant to be a level exporter, but that's another story and part of the reason I have lost my interest on Mario 64 modifications.

Right now, it doesn't work *really* well. Most levels and platforms export correctly, but many of the moving/alive objects don't render too well (I suspect this may have to do with some unimplemented stuff like scaling, but behaviour scripts may also play a part). Sometimes huge chunks of the levels are missing (this is probably caused by the objects which are inserted with ID=0, which I don't know what it means... any information about this will be great).

And of couse, since I'm exporting to .OBJ, there are many things that can't work, like billboards.

Anyway, if you want to use it to export levels, the usage is:


./m64tool ROM.z64



If you don't know how to use the command line, just drag&drop the ROM to the program.
You can use a normal ROM or a extended ROM. I have only tested it with a original (unmodified) ROM, but it should work with any ROM as long as it doesn't use any feature not used in the original ROM.

It will create two folders, called "M64_Levels" and "M64_Exports". "levels" will contain the whole levels (note that it will create some duplicate ones, since it'll export the whole level for any reference to it, and some are refered multiple times). "exports" will contain all textures and all collision data found.

Other random things:
- It's cross platform (tested on Windows and Linux).
- I may post an update in some days.
- I will try to implement a viewer or switch to another format to support more things.

DOWNLOAD CURRENT r3.2
download old r3
download old r3 (link broken)
download old r2 (link broken)
download old r1 (link broken)

--- *** --- *** --- *** ---

Anyway, another use you can give to this program is as documentation, as in MAME. There's not really any updated or complete documentation available, and most programs posted here don't come with source. And the ones that do (I'm talking about MariOZMAV) aren't really clean.

The source code is written in the D programming language.

My source code may not be the best, but:
- It works.
- It's pretty complete (can parse level scripts, geometry layout, display lists, animation data, behaviour scripts, collision data and textures).
- It's not really hacky (no special cases).
- It hardly uses any hardcoded data. The only hardcoded offsets are the ones of the entry point banks and the preset models table, all pretty essential in order to get level exporting working.
- It doesn't have too many boilerplate code. I (ab)used D templates in order to auto-generate most parts that would require it.
- It's pretty commented/documented, and includes references to sources and relevant documentation/discussion.

--- *** --- *** --- *** ---

This program is pretty much based on all documentation that I've found around, which is very sparse. Credits go (in no specific order) to messiaen, Nagra, VL-Tone, Cellar Dweller, dudaw, Twili, yoshiman, xdaniel, Michael Tedder and everyone else I'm probably missing.

EXTRA: Download Cellar Dweller's ROM Extender (original host is down)
Cajetan
Member
Level: 20


Posts: 1/86
EXP: 37984
For next: 4455

Since: 08-06-11
From: Binary

Since last post: 2.0 years
Last activity: 362 days

Posted on 08-06-11 03:29:18 PM (last edited by Cajetan at 02-23-12 05:33 AM) Link | Quote
Cool Virus, bro.
My Anti virus is reporting this program would be a virus.


(USER WAS WARNED FOR THIS POST)

I hate that post! Im so an idiot!
Lyskar
12210
-The Chaos within trumps the Chaos without-
Level: 182


Posts: 9889/12211
EXP: 82782466
For next: 122169

Since: 07-03-07
From: 52-2-88-7

Since last post: 2.0 years
Last activity: 2.0 years

Posted on 08-06-11 03:44:27 PM (last edited by Metal_Man88 at 08-06-11 09:38 PM) Link | Quote
Antiviruses often get false positives. If you want to be banned, keep letting your crummy virus scanner run your life.
MarIO0
Member
Level: 15


Posts: 35/43
EXP: 15368
For next: 1016

Since: 09-03-09


Since last post: 4.0 years
Last activity: 4.0 years

Posted on 08-06-11 06:05:17 PM Link | Quote
Not a virus. Checked with VirusTotal and also nothing, not even a false positive.
Apache Thunder
User
Level: 11


Posts: 13/20
EXP: 5338
For next: 647

Since: 01-20-08
From: Interdimensional Spy Headquarters

Since last post: 4.0 years
Last activity: 2.0 years

Posted on 08-06-11 10:10:45 PM (last edited by Apache Thunder at 08-06-11 10:12 PM) Link | Quote
No problems with my virus scanner so I can attest that it is clean.

Ok tried it and it failed to extract anything.

Here's the error I got:

"object.Exception@m64\binarystream.d(154): Casting failed; probably some limit has been broken."

Here's the error I got when I tried the extended rom instead:

"object.Exception@m64\polygon.d(204): Polygon vertex: Unexpected byte count."


I'm using the US version of the rom (tried both untouched rom and extended rom) and am using this on Windows XP 64-Bit Edition.

So that is my "constructive" feedback on the editor.
MarIO0
Member
Level: 15


Posts: 36/43
EXP: 15368
For next: 1016

Since: 09-03-09


Since last post: 4.0 years
Last activity: 4.0 years

Posted on 08-07-11 01:32:23 PM (last edited by MarIO0 at 08-07-11 01:32 PM) Link | Quote
Originally posted by Apache Thunder
No problems with my virus scanner so I can attest that it is clean.

Ok tried it and it failed to extract anything.

Here's the error I got:

"object.Exception@m64\binarystream.d(154): Casting failed; probably some limit has been broken."

Here's the error I got when I tried the extended rom instead:

"object.Exception@m64\polygon.d(204): Polygon vertex: Unexpected byte count."


I'm using the US version of the rom (tried both untouched rom and extended rom) and am using this on Windows XP 64-Bit Edition.

So that is my "constructive" feedback on the editor.


Thanks for your feedback.

I have found that the first problem is caused because you have a swapped ROM (extension N64). I've uploaded a version that fixes this.

However, I cannot reproduce your second problem. What kind of extended ROM you have? I have only tried using a ROM extended with VL-Tone's/Cellar Dweller's extender, not the OBJ importer patches or anything.
Apache Thunder
User
Level: 11


Posts: 14/20
EXP: 5338
For next: 647

Since: 01-20-08
From: Interdimensional Spy Headquarters

Since last post: 4.0 years
Last activity: 2.0 years

Posted on 08-07-11 01:56:11 PM (last edited by Apache Thunder at 08-07-11 02:17 PM) Link | Quote
I'm not sure actually. It's been sitting in my Project64 folder for a long time now. I'm pretty sure I have extended it with one of VL-Tones programs as I recall working with Toads Tool when it first came out and such. I'll try the new version and see if it fixes the first error.

EDIT:

Alright looks like it's working now. It's extracting stuff to the locations you mentioned. I'm getting a lot of "Warning: Model with ID=0 Not Found" messages. But I think that may be one of the expected behaviors. I'll check out what it's extracted but it looks like it works as advertised now. Great work!

EDIT:

Level ID 13 I think? That's the folder name it had anyway.

Here's the result: (click to enlarge)



Pyramid boss fight room. Looks great in 3DS Max. I added a light source to make it look extra nice. So far so good!

Also, I noticed that a good number of these have upwards of 200+ materials on them. Anyway on condensing that down? I want to enable textures in the 3DS Viewport but clicking through 200+ materials to do it is a big pain.
MarIO0
Member
Level: 15


Posts: 37/43
EXP: 15368
For next: 1016

Since: 09-03-09


Since last post: 4.0 years
Last activity: 4.0 years

Posted on 08-07-11 07:52:54 PM Link | Quote
The "model with ID=0 not found" message is expected. There are many level script commands which try to insert a model with ID 0, which does not seem to be defined anywhere... probably it means something special. Some parts of some levels are missing and I expect this to be the cause, but I don't know what it actually means.

Anyway, I solved the material problem. I was creating a material each time a texture was selected. Now I reuse them and it looks like the boss battle has gone down to only 7 materials.

Thanks for testing my program, and that image looks great!
Apache Thunder
User
Level: 11


Posts: 15/20
EXP: 5338
For next: 647

Since: 01-20-08
From: Interdimensional Spy Headquarters

Since last post: 4.0 years
Last activity: 2.0 years

Posted on 08-07-11 09:50:00 PM Link | Quote
Tried the r3 version and now the materials are at a reasonable count and not many duplicates spotted thus far.

No other problems encountered thus far. Only suggestion at this point is to perhaps somehow link the level names to each folder number so we can sift through the extracted content easier, but that's one of those optional things you can undertake if you have the time to do so.
Cajetan
Member
Level: 20


Posts: 2/86
EXP: 37984
For next: 4455

Since: 08-06-11
From: Binary

Since last post: 2.0 years
Last activity: 362 days

Posted on 08-08-11 01:21:03 PM Link | Quote
Sorry, for my first negative post. It just reported it as virus i removed my old anti virus and downloaded Avast.
Also, The Program work's very good. Keep it up.
MarIO0
Member
Level: 15


Posts: 38/43
EXP: 15368
For next: 1016

Since: 09-03-09


Since last post: 4.0 years
Last activity: 4.0 years

Posted on 08-08-11 07:37:17 PM Link | Quote
I think that I figured out what the objects with ID=0 mean. Since there are consecutive objects with ID=0 and different behavior addresses, I can only assume that ID=0 means that drawing is handled by the behavior script. And unfortunately, pretty much every single behaviour script is just a call to the game code, which means that those objects will never be rendered.
Yoshi Party
User
Level: 9


Posts: 14/14
EXP: 2797
For next: 365

Since: 12-31-09


Since last post: 6.0 years
Last activity: 6.0 years

Posted on 08-10-11 07:02:28 AM Link | Quote
Great tool

Are the exported maps compatible to the level importer? I want to change the maps only a little(!) to keep the lakitu camera working

Have to try it anyway, thank you
MarIO0
Member
Level: 15


Posts: 39/43
EXP: 15368
For next: 1016

Since: 09-03-09


Since last post: 4.0 years
Last activity: 4.0 years

Posted on 08-10-11 03:16:54 PM Link | Quote
The maps should be compatible with the level importer, since I'm just generating a .OBJ file. However, I've never used the level importer, so I have no idea on how easy it'll be to get everything working like in the original again.

(For example, I don't export the terrain types (which are part of the colision map, not of the models). I'm not sure how the OBJ importer handles this).
Vinnyboiler
Catgirl
Level: 62


Posts: 831/1028
EXP: 1973869
For next: 10817

Since: 12-27-07
From: London, England

Since last post: 108 days
Last activity: 3 hours

Posted on 08-11-11 10:37:48 AM Link | Quote
Originally posted by MarIO0
The maps should be compatible with the level importer, since I'm just generating a .OBJ file. However, I've never used the level importer, so I have no idea on how easy it'll be to get everything working like in the original again.

(For example, I don't export the terrain types (which are part of the colision map, not of the models). I'm not sure how the OBJ importer handles this).


The OBJ importer just assigns collisions to textures so that wouldn't be too hard of a problem.

By the way, does this programme rip stuff like crates and enemy's along with the geometry, or is it just the geometry by itself?
MarIO0
Member
Level: 15


Posts: 41/43
EXP: 15368
For next: 1016

Since: 09-03-09


Since last post: 4.0 years
Last activity: 4.0 years

Posted on 08-11-11 12:28:50 PM Link | Quote
It rips both. However, it creates a different object name for each model, so if you only want the level geometry, you can use a 3D editor and remove all objects except the first.
Rena

Star Mario
Fennel
Level: 127


Posts: 4255/5239
EXP: 23204646
For next: 521920

Since: 07-22-07
From: RSP Segment 6

Since last post: 64 days
Last activity: 22 days

Posted on 08-12-11 12:48:16 AM Link | Quote
Originally posted by MarIO0
I think that I figured out what the objects with ID=0 mean. Since there are consecutive objects with ID=0 and different behavior addresses, I can only assume that ID=0 means that drawing is handled by the behavior script.
Or does it just represent an invisible object? (Which could still have its script drawing things, I suppose.)
MarIO0
Member
Level: 15


Posts: 42/43
EXP: 15368
For next: 1016

Since: 09-03-09


Since last post: 4.0 years
Last activity: 4.0 years

Posted on 08-13-11 11:43:30 AM Link | Quote
Originally posted by Rena
Originally posted by MarIO0
I think that I figured out what the objects with ID=0 mean. Since there are consecutive objects with ID=0 and different behavior addresses, I can only assume that ID=0 means that drawing is handled by the behavior script.
Or does it just represent an invisible object? (Which could still have its script drawing things, I suppose.)


Doh, I didn't think that they could be *really* invisible objects. Though that would be a lot of invisible objects. Time to test it, I guess...
Dudaw
Member
Level: 16


Posts: 36/49
EXP: 17081
For next: 3175

Since: 01-06-11


Since last post: 4.0 years
Last activity: 1.0 years

Posted on 08-14-11 05:49:25 PM (last edited by Dudaw at 08-14-11 05:51 PM) Link | Quote
Originally posted by MarIO0
Originally posted by Rena
Originally posted by MarIO0
I think that I figured out what the objects with ID=0 mean. Since there are consecutive objects with ID=0 and different behavior addresses, I can only assume that ID=0 means that drawing is handled by the behavior script.
Or does it just represent an invisible object? (Which could still have its script drawing things, I suppose.)


Doh, I didn't think that they could be *really* invisible objects. Though that would be a lot of invisible objects. Time to test it, I guess...


"[22] [08] 00 [00] [?? ?? ?? ??]" = No results found.

1-2: Geo layout pointer script command
3: Model ID
4: Segmented pointer to geo layout.

Yes, model ID 0 is always used for invisible objects (warps, object groups, special function, etc).
XerX
Random nobody
Level: 4


Posts: 3/3
EXP: 232
For next: 47

Since: 04-28-12


Since last post: 5.0 years
Last activity: 5.0 years

Posted on 05-26-12 01:03:05 PM Link | Quote
The download links are broken.
Kenshi
Member
Level: 20


Posts: 63/75
EXP: 39451
For next: 2988

Since: 09-15-07
From: NY

Since last post: 2.0 years
Last activity: 1.0 years

Posted on 08-07-12 12:03:16 PM Link | Quote
Yeah, I hate to bump an old thread but, the download links are broken for all Revisions including 3.

Anyone who has downloaded any of them or at least R3 can you post a link up for it?
Pages: 1 2Next newer thread | Next older thread
Jul - SM64 Hacking - M64Tool - Level exporter (+ documentation) New poll - New thread - New reply




Rusted Logic

Acmlmboard - commit 2f1bc75 [2017-08-27]
©2000-2017 Acmlm, Xkeeper, Inuyasha, et al.

34 database queries, 10 query cache hits.
Query execution time: 0.136767 seconds
Script execution time: 0.021149 seconds
Total render time: 0.157916 seconds