eeerrrr Posted May 28 Posted May 28 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 May 28 Engineers Posted May 28 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 May 28 Author Posted May 28 (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 May 29 by eeerrrr
Engineers shak-otay Posted May 29 Engineers Posted May 29 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 May 29 Author Posted May 29 Well, worth a shot lol. I don't know anything about coding.
Engineers shak-otay Posted May 29 Engineers Posted May 29 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 May 29 Author Posted May 29 (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 May 29 by eeerrrr 1
Engineers shak-otay Posted May 29 Engineers Posted May 29 (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 May 29 by shak-otay
eeerrrr Posted May 29 Author Posted May 29 (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 May 29 by eeerrrr
eeerrrr Posted May 30 Author Posted May 30 (edited) OK, having looked into it a little more, I believe all the "prop"s refer to "propdef"s in the GEO file. This also applies to some other object types, for example "dynamics" (these are objects you can knock around the level), "car"s, "Glass" and other types of props - "AnimProp"s and "ScriptProp"s. There may be other examples of these types of objects in other levels, I'm just going off of the Movie Lot for the time being. The rotation thing doesn't seem exclusive to these props either; I'm just now noticing that there are some 'terrain' objects which also have this problem. It may be scripts that are doing this after all, I'm not sure. One other thing I noticed, looking through the .TXT file in the level folder (which seems to be an export file from the tool the developers were using), there are also "collision" meshes that aren't listed in the .GEO or .INS file; my guess is that either the .BIN file, .DAT file or MOTIONS.ZAL are involved somehow. The tool also misses "AnimObj"s and "panorama" - the skybox. Here's an example though. These are the prop_planterA's (not the islandplanters as I first thought) that are all oriented the same way. And this wooden ramp (not a prop) is supposed to be facing towards the canopy (so you can jump up to it). And the hundreds of ceiling scenery objects which are completely out of whack... Edited May 31 by eeerrrr 1
Engineers shak-otay Posted Sunday at 11:10 AM Engineers Posted Sunday at 11:10 AM I don't see prop_planterA's in the exported obj file (only in Movie GEO/INS).
eeerrrr Posted Sunday at 11:44 AM Author Posted Sunday at 11:44 AM Yep, that's because I edited the .INS file to include all the props.
Engineers shak-otay Posted Sunday at 12:32 PM Engineers Posted Sunday at 12:32 PM (edited) Wouldn't it be easier to edit the geo file, i.e. remove the def from propdef_planterA? There's 43 propdef strings and 9 dynamicsdef strings. edit: still confused with the names, how the app does the comparison "def" is cut off but prop_islandplanter (see below) not selected for vertex logging # 18 VertexDataHeader propdef_planterA <def_planterA> prop_planterA # 29 VertexDataHeader propdef_streetlight <def_streetlight> prop_streetlight # 38 VertexDataHeader propdef_longplanter <def_longplanter> prop_longplanter # 106 VertexDataHeader propdef_islandplanter <def_islandplanter> prop_islandplanter ---------------------- # 101 <> terrain_perimeterwall01 # 102 <> terrain_planter44 # 103 <> PropDef_FernC (upper case Def not handled) # 104 <> PropDef_FernD # 105 <> terrain_skyscraper01 # 106 <> prop_islandplanter no vertices logged # 107 <> terrain_bldgB01 # 108 <> terrain_plazaback01 # 109 <> DynamicsDef_cardreader # 110 <> ScriptObj_stoplight_largearmA23 # 111 <> terrain_bldgE # 112 <> terrain_qpipeprop06 # 113 <> terrain_gateqpipe04 # 114 <> terrain_flagpole01 # 115 <> terrain_busstoprail # 115 terrain_oilstain02 # 0x61 v 159,21 0,23 -120,69 v 166,65 0,23 -113,87 v 152,38 0,23 -113,23 Edited Sunday at 07:14 PM by shak-otay
eeerrrr Posted Sunday at 09:18 PM Author Posted Sunday at 09:18 PM (edited) I wish it were that easy, each geometry instance is suffixed with a number, so "prop_planterA01", 02, 03 etc. It seems like only terrain and ScriptObj stuff is named the same way in both the GEO and the INS. Edited Sunday at 09:19 PM by eeerrrr
Engineers shak-otay Posted Monday at 05:54 AM Engineers Posted Monday at 05:54 AM 8 hours ago, eeerrrr said: I wish it were that easy, each geometry instance is suffixed with a number, so "prop_planterA01", 02, 03 etc. It seems like only terrain and ScriptObj stuff is named the same way in both the GEO and the INS. So removing the suffixes before comparison should do the trick? There's 1440 instances in the Movie INS file but only 569 objects are logged to the obj file.
eeerrrr Posted Monday at 12:08 PM Author Posted Monday at 12:08 PM Could be. I'm not sure if all the instances always have the same name as the prop def itself. As far as I can see they do. 1
Engineers shak-otay Posted Tuesday at 09:57 PM Engineers Posted Tuesday at 09:57 PM (edited) Rotations not handled so far but finally I made some progess with missing objects though I didn't really understand the underlying problem with suffixes in geomObject = ObjectGeometry.GetObjectByName(_tempName, gGeometry); (Some worked, some did not). Now I got 1252 rdmobjxxx objects (need to check why it's 1121 # objects only in the Movie obj from the tool): Still missing Car_TransitBus01, ScriptProp_barricade07, Car_RoachCoach01, etc islandplanter Edited Wednesday at 05:31 AM by shak-otay
eeerrrr Posted Tuesday at 10:47 PM Author Posted Tuesday at 10:47 PM Oh, awesome. Thanks again for helping out with this. If you can get this and the vertex colours working properly I will owe you big time, heh. (I couldn't get vertex colours to appear even with that .OBJ importer you linked, which is a shame.)
Engineers shak-otay Posted Wednesday at 06:27 AM Engineers Posted Wednesday at 06:27 AM (edited) Here's the patched ZAxisLevelTool exe (original from morton1337). 2 out of 72 virustotal scanners report a virus so please decide whether to use the exe on your own risk or not. (Maybe compare to the scanning results for the original exe if you have.) Tested with Movie .geo/.ins files only. Others may crash the tool without being noted on the screen (but if the created obj file is small there was a crash probably), (Starting from command line ZAxisLevelTool > test.txt will create a log file which might give some details on names' scanning. Just in case.) ZAxisLevelTool.zip Edited Wednesday at 10:32 AM by shak-otay
eeerrrr Posted Wednesday at 12:32 PM Author Posted Wednesday at 12:32 PM (edited) Awesome! Movie Lot's import is looking a lot better now, thanks for that. The others are pretty much still the same but you mentioned it was only tested with Movie, so I can understand that. It still seems to miss the AnimObjs but I truly have no idea how they work. They seem to be made up of several sub-meshes. One other thing - I noticed that all the normals on every mesh are inverted; I don't think this is a problem with the level tool since every other method I've used to rip models from the game results in the same thing, perhaps it's an engine quirk. There is a Blender plugin that can invert all the normals in the scene though. Edited Wednesday at 12:59 PM 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