eeerrrr Posted Wednesday at 01:00 PM Posted Wednesday at 01:00 PM Yo! I'm very interested in being able to open the levels from "Aggressive Inline" into Blender, to port them for use in a mod for Tony Hawk's American Wasteland called reTHAWed. I have a link to the level folders for the 3 versions of the game here: https://mega.nz/folder/kA02iSRb#jJpv4dU5SJsBIM3x7zVPFA There does exist a tool (ZAxisLevelTool - seems to be uploaded on here) that can do this, and there is source code for the tool available on Github (https://github.com/Morten1337/ZAxisLevelTool). There are a few issues with it; it can miss textures (some use a .ZMP format instead of a .BMP format), it misses some objects on conversion (some objects that appear multiple times in the level are defined differently in the .INS file to the .GEO file), no vertex colours (consequence of the OBJ format apparently), and many of the objects that appear multiple times are all rotated the same way. If anyone can help out in making an import script for Blender for these levels, that would be awesome; Dave Mirra 2 and BMX XXX both use the same engine but I don't have the files for those handy. Here's a link to the old thread I made on ZenHAX if it's any help: https://www.zenhax.com/viewtopic.php@t=8657.html
Engineers shak-otay Posted Wednesday at 11:07 PM Engineers Posted Wednesday at 11:07 PM 10 hours ago, eeerrrr said: it misses some objects on conversion (some objects that appear multiple times in the level are defined differently in the .INS file to the .GEO file), no vertex colours (consequence of the OBJ format apparently), and many of the objects that appear multiple times are all rotated the same way. You should give more details. Quote If anyone can help out in making an import script for Blender for these levels, I'd be surprised if someone would. Form1.cs has 49 kB, the utils folder around 53 kB. You seem to underestimate the efforts to recreate this as a python script.
eeerrrr Posted Wednesday at 11:23 PM Author Posted Wednesday at 11:23 PM (edited) I included some more details on the linked ZenHAX thread, but the long and short of it is that many objects in the INS file reference meshes in the GEO file and then place them into the level - these instances use names that are different to the meshes' names in the GEO file. If you use a hex editor and change the names of those particular instances to the names of the meshes in the GEO file, you can get the level tool to import them. They are all, however, rotated the same way, and some objects even have pieces missing in the actual game (for example, in the Movie Lot level, there is a curved dolly track that is used in two areas of the level - same mesh - but in one place the track itself is shorter) so I'm assuming the information regarding their orientation as well as some other stuff is stored elsewhere. Apparently the tool does import the vertex colors, but they are lost in the conversion to OBJ. And in relation to converting the tool to a python script, I wasn't expecting a 1-to-1 conversion, however the creator of the tool did at least begin work on writing a script of his own: https://github.com/Morten1337/io_thps_scene/blob/zaxis-importer/_zaxis_notes.txt https://github.com/Morten1337/io_thps_scene/blob/zaxis-importer/import_zaxis.py Not sure how much help that is, but there you go anyway 😛 Edited yesterday at 12:54 AM by eeerrrr
Engineers shak-otay Posted yesterday at 06:47 AM Engineers Posted yesterday at 06:47 AM 7 hours ago, eeerrrr said: https://github.com/Morten1337/io_thps_scene/blob/zaxis-importer/import_zaxis.py Not sure how much help that is, but there you go anyway 😛 256 python lines where 100 of them are enums? Surely not.
eeerrrr Posted yesterday at 11:18 AM Author Posted yesterday at 11:18 AM Well, worth a shot lol. I don't know anything about coding.
Engineers shak-otay Posted yesterday at 12:23 PM Engineers Posted yesterday at 12:23 PM 36 minutes ago, eeerrrr said: I don't know anything about coding. Too bad. Looking at the projects the C# one is from 5 years ago and the py one from 7 years ago. The import_zaxis.py is part of the Tony Hawk's Pro Skater scene import/export. Or is it meant to work standalone? Quote many objects in the INS file reference meshes in the GEO file and then place them into the level - these instances use names that are different to the meshes' names in the GEO file. If you use a hex editor and change the names of those particular instances to the names of the meshes in the GEO file, you can get the level tool to import them. My time is limited but if you gave more details what you did exactly (including the names of the geo/ins files) I could try to add changing the names to the code.
eeerrrr Posted yesterday at 12:32 PM Author Posted yesterday at 12:32 PM (edited) It is too bad! I really should've learned... I could've solved my own problem years ago, heh. I believe the import_zaxis is meant to be part of the THPS tools; having said that, that plugin is built for an older version of Blender. It might not be doable on the current version, but again, I don't know - the more current Blender plugin is called NXTools. And, as an example, the Movie Lot level (MOVIE.GEO/INS) has various geometry instances such as "prop_islandplanter02", "prop_islandplanter03" etc. in the .INS which all refer to "propdef_islandplanter" in the .GEO file. This seems to be the case for every object that appears multiple times in the level; perhaps the PropDef has an ID which the .INS calls, I'm not sure. I'd have to take a closer look in a hex editor to be certain. If you change those instances to "propdef_islandplanter", the level tool will import them successfully. Would it be at all possible to retain the vertex colors and object rotation? Edited yesterday at 12:49 PM by eeerrrr 1
Engineers shak-otay Posted 23 hours ago Engineers Posted 23 hours ago (edited) 5 hours ago, eeerrrr said: Would it be at all possible to retain the vertex colors and object rotation? Depends on. ObjectGeometry has m__colors and m__positions but no m__rotations. (You should be glad to have objects at their correct positions and not clumped together, btw. ) edit 2: vertex colors is a hurdle with wavefront obj edit: inserted a Console.WriteLine() in read_instances() which is called for .ins afaics and got a log (using pipe with the exe since it's a GUI, not a console program): (Little bit confusing why there's a "def" inserted before "islandplanter" - somehow the program must do this.) Quote VertexDataHeader propdef_islandplanter m__num_meshes = 4 VertexDataHeader terrain_bldgB01 m__num_meshes = 2 VertexDataHeader terrain_plazaback01 VertexDataHeader DynamicsDef_cardreader m__num_meshes = 2 VertexDataHeader ScriptObj_stoplight_largearmA23 m__num_meshes = 5 ... Quote Morton1337: "Most of the levels have dynamic and interactable objects. I have not really looked into this, but my guess is that there is scripting going on here." If only interactable objects suffer from the rotation problem of the tool chances are high that they're rotated by script (just a wild guess). Edited 19 hours ago by shak-otay
eeerrrr Posted 20 hours ago Author Posted 20 hours ago (edited) I'm very glad the objects are in the right place, heh. Ninja ripper was quite helpful but piecing together a level with thousands of meshes by hand... I'd prefer not to! 😄 although the more recent versions of it seem to be able to rip stuff in the right place.... I don't get paid for a few weeks otherwise I'd try that lol. At that point I'd rather pay someone to write me a blender import script. 😛 I'll have to give that plugin a look... I did try getting vertex colours with meshlab but couldn't really get anywhere with that. It's not only the interactive objects that need rotating; for example the island planters are all rotated the same way, if I recall each one makes up half of the full planter; not difficult to rotate those into position, but inside the movie lot itself are a boatload of spotlights which all have their own unique rotation. I would get a screenshot but I'm at work at the minute, maybe when I get home. Thanks for your help on this btw. Edited 20 hours ago by eeerrrr
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now