Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArchitectureCraft objson format description #46

Closed
noobanidus opened this issue Sep 29, 2018 · 5 comments
Closed

ArchitectureCraft objson format description #46

noobanidus opened this issue Sep 29, 2018 · 5 comments

Comments

@noobanidus
Copy link

Hi there!

I wasn't able to find any other way of contacting you. My apologies for creating a new issue for this. I was wondering what file format ArchitectureCraft's models are using? I was curious about trying out new models, but they didn't appear to be manually generated but crafted using some program.

None of the documentation that I could see seemed to indicate what program was or could be used to modify/create new models.

@Xenoamor
Copy link
Contributor

Xenoamor commented Oct 4, 2018

The only info I can find is they used to have the file extension .smeg

@darkevilmac
Copy link
Contributor

darkevilmac commented Oct 4, 2018

They previously had the extension .smeg, I couldn't find any information on them when I took up the mod.

I know how they work though, it's just a json file containing a few variables. Here's a brief rundown.

OBJSONModel

bounds is an array of doubles containing 6 values used to determine the bounding box of the model.
boxes is a 2D array containing collision boxes for the model, each entry is formatted the same way as bounds.
faces gets more complicated, each entry in the faces array contains data to create triangles on a given face.

Face

texture specifies the texture to use for the face, just says whether or not it uses cladding.
vertices specifies a list of vertices available to draw for the face, this includes the normals and uvs.
triangles specifies a list of indexes in vertices to use to create a triangle.

Unfortunately I don't have tools to make these models at this point, it seems likely that it was made by programming it into the game and then dumping the model to JSON. Tooling could probably be made to convert an obj file but I honestly want to get rid of the files at some point.

@noobanidus
Copy link
Author

I've sent a communication to the original author of the mod, Greg Ewing, to see if they can provide any more information about the system. I'll keep you updated!

@noobanidus
Copy link
Author

I've been in contact with Greg Ewing and managed to determine that the original .SMEG files were created using a custom exporter for an older version of Sketchup (7 or 8) using his SuPy framework. I've yet to test if this system works in more recent versions of Sketchup (that'll be my next test).

As it stands, the exporter is: https://gist.github.com/duely/53d8392119b8ad684ad14cfaec9d3685

I specifically inquired and he has happily licensed the exporter as MIT, similar to the project's current license, so this code can be included & perhaps expanded upon (if there is a desire to do so).

I've also inquired as to obtaining the original Sketchup models used so the correct dimensions, etc, can be ascertained when creating new models.

As it stands, getting the system to work requires locating version 8 of Sketchup, correctly installing SuPy and then properly flagging the entity for export (inserting a * at the start of the name). This is obviously quite painful. The default Sketchup extension system uses Ruby, so it's possible that this exporter could simply be rewritten in Ruby.

However, while Python is my "native" language and I can tell from an initial glance that the only Python-specific code it uses is a simple floor function, thus it should be relatively easy to concert to an actual Ruby extension for Sketchup, my knowledge of Ruby is non-existent so I'm unable to offer to do such a thing.

While you mentioned an interest in moving away from this system, hopefully I've managed to provide some useful information! If I do gain access to the original Sketchup model files, I'll pass them your way.

@JetFlightGit
Copy link

Did you get it to work in the meanwhile?
I want to add some more blocks, but dont know how / where to start since i am not the best programer.
Thought about starting with the blocks them self but that seems to be hard aswell :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants