cbhacks / CrashEdit

Unofficial Crash Bandicoot 1/2/3 Level Editor
https://www.cbhacks.com/tools/crashedit/
Other
135 stars 25 forks source link

Crash 2 Model Export #67

Open NetyashaRoozi opened 9 years ago

NetyashaRoozi commented 9 years ago

I looked into a entity entity and am trying to rip ripper roo and it said obj but no save feature Idk if this is technically a issue for me or is not implemented yet ALSO I saw in screenshots that there is a model viewer but I cant find such viewer I can only view the scenery :\ I still love this program and hope someday there will be a update :)

warenhuis commented 8 years ago

It is not easy to remove a face, because that will mess up the drawing order of the model.

Consider the entire model like a 'tower' of blocks stacked on top of each other. Every triangle in the model is like a building block for the next and is essential to shape of the tower.

What you can do, is change the textureinfo of some triangles to a fully transparent segment. You're going to have to identify all the triangles (item 1 in items 0 to 4, or the second one if you will) on the box manually (for example, by changing the textureinfo or the colors and see the changes) and find the ones that you want to change.

Every 4 byte-structure that is not a colorslot in item 1 defines a triangle (see my documentation for knowing when it is a colorslot or not). The first byte of such a structure refers to an index in item 3 (the textureinfo's, in 12 byte structures) ranging from 1 to 255, 0 = no texture.

If it is possible to change the size of entries in CrashEdit, eventually it will be possible to develop a model importer, making things much easier (like a ply to nsfmodel converter).

ManDude commented 8 years ago

CrashEdit has a "Replace Item" button (right-click). You cam add an "Add Item" button too.

Thanks though, but I want to actually remove the polygons because I wanted to save some polygons in an area to reduce lag.

warenhuis commented 8 years ago

Minor update: The first steps have been made to decompressing the animationvertices from the 6-item models. Below you can see a primitive example, the letter G from the titlescreen: untitled (The tiny yellow pixels are the vertices)

The '4 dimensional delta's' are stored within the 6th item of the model. The compressed animation frames seem to contain a bitstream of 3-bit structures (xzy). It is unclear as of yet how many different offsets they are capable of indicating (the first stream does an increment of 255).

The frame and model are interwoven in making the final shape of the model, but the 'temporal' dimension seems to do a lot of work in all 3 dimensions as well as in different frames. So that is where the next focus will be on.

NetyashaRoozi commented 8 years ago

Nice, we are so close to finally be able to rip all the models from Crash 2

ManDude commented 8 years ago

How high do you have to be to come up with such complex compression.

warenhuis commented 8 years ago

Minor update: Ok I think I now fully understand the compression format. Everything makes sense now, at least. If everything goes right, I'll have the first implemented rip soon.

ManDude commented 8 years ago

i lovyou

warenhuis commented 8 years ago

Ladies and gentlemen... untitled4 A fully clean decompression of Crash Bandicoot

Some more characters: untitled5

I'll still be working on some rough edges.

ManDude commented 8 years ago

Holy fucking SHIT. YOU DID IT. THIS IS BEYOND AWESOME.

I see you are using Blender... How are you displaying the textures and colors at the same time?

warenhuis commented 8 years ago

You can view the textures and colors in textureview, next to the menu for 'object mode', 'edit mode' etc.. Don't forget to remove lights from the scene + Uncheck mipmaps in User Preferences > System > Mipmaps to get accurate representation.

NetyashaRoozi commented 8 years ago

Ohmy..... This is amazing OMG! I AM SO HAPPY! We can finally get the best ripper roo!

ughman commented 8 years ago

Damn, guess I need to actually get to work.

warenhuis commented 8 years ago

https://github.com/warenhuis/Crash-Bandicoot-2-Modelexport

The tool now has 100% CB2 and CB3 model support. There are still some scaling issues between the two, I think (https://youtu.be/g7ByLSotvNo?t=2m10s). The proportions are correct though.

I've also written about the compression in 'item 5' and the 'frame' section of the documentation. Hopefully this will be enough for implementation in CrashEdit.

Enjoy!

ManDude commented 8 years ago

Have you thought about porting the project to GameMaker Studio?

I think the reason Crash 3 models are too small is because of the 0x30E property in entities, which determines scale (usually set to 1 in Crash 3, making objects 4x bigger).

warenhuis commented 8 years ago

So with these object entities, the final scale must be context-based? In that case this can only be solved in CrashEdit.

I can port to GameMaker Studio in an instance, but I don't see significant advantages of Studio over 7.

ManDude commented 8 years ago

Compatibility, maybe even speed? It lags a lot.

warenhuis commented 8 years ago

The tool is purely experimental. It lags mostly because of my horribly rushed coding style (there is a separate draw call for every number, even the off-screen ones). I can improve all that, but I think it would be much better if this gets implemented in CrashEdit right away.

NetyashaRoozi commented 8 years ago

tiny I thought this guy was a 6 item guy ends up he isn't, Going to get a better frame with him since this one just looks awful

NetyashaRoozi commented 8 years ago

Btw, Tiny is under TZ for Taz tiger

ManDude commented 8 years ago

Ya we kinda know. ;)

NetyashaRoozi commented 8 years ago

I know, Just putting that information for anyone else trying to rip tiny

warenhuis commented 8 years ago

This is an important thing for scaling compatibility: Is there a way to know how big the wooden boxes are in absolute units? In CrashEdit they are 100 x 100 x 100 and 400 x 400 x 400 for CB2 and CB3 respectively, but the modeldata prescribes: 254 x 254 x 254, scaled x 1606 for CB2 and 254 x 254 x 254, scaled x 201 for CB3?

How would this translate into the proper units?

ManDude commented 8 years ago

The scale changes a lot. In Crash 1 their animation is 64x64x64, their collision box is 102400x102400x102400 (roughly 102.4x102.4x102.4 in zone units), and they are 400x400x400 in-game (since zone units are in-game units divided by 4).

supermariosunshine2002 commented 6 years ago

I really want to know how to export a good model from warped. can someone help me?

AraHaan commented 6 years ago

Dam I wish I had the source code to their model export for porting it to c++ and opengl or c# woth opengl. :thinking:

ManDude commented 6 years ago

soon