Sonic and Sega Retro Message Board: SADX/SA1 Hacking/Modding - Sonic and Sega Retro Message Board

Jump to content

Hey there, Guest!  (Log In · Register) Help
  • 146 Pages +
  • ◄ First
  • 140
  • 141
  • 142
  • 143
  • 144
  • Last ►
    Locked
    Locked Forum

SADX/SA1 Hacking/Modding Now with more research and development!

#2116 User is offline BlazeHedgehog 

Posted 26 May 2014 - 04:45 PM

  • A "Community Enigma"?
  • Posts: 1314
  • Joined: 23-January 05
  • Gender:Male
  • Wiki edits:51
Oh yeah, I've been meaning to say this for a couple days now, but that alternate EXE worked!

Mushroom Hill's pretty cool! Definitely feels like it could've been a lost level.

#2117 User is offline MainMemory 

Posted 26 May 2014 - 04:47 PM

  • Every day's the same old thing... Same place, different day...
  • Posts: 3369
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339

View Postevilhamwizard, on 26 May 2014 - 03:22 PM, said:

Might want to move this discussion to the SADX Mod topic, but a few things.

I made the changes and it still crashes when I try to load the level. I'm not sure if there's something else that needs to be changed too. The mod's directory has the PVM for the level (from the original prs), a modified SET file to coincide with object numbers in the final, and the camera data. Here's my source code:

https://gist.github....a3899a5d68a5ba9

I still don't understand why the ENUM stuff isn't working. I changed it so that it'll compile, but I probably broke something intended in the process. Here's what the output looked like initially:

enum TWINKLE01.pvmTexName
{
	TWINKLE01.pvmTexName_m64_tp2_014,
	TWINKLE01.pvmTexName_m64_tp2_025,
	TWINKLE01.pvmTexName_m128_tp3_021,
	TWINKLE01.pvmTexName_m128_tp2_014,
	TWINKLE01.pvmTexName_m32_tp3_004,
	TWINKLE01.pvmTexName_m64_tp2_015,
	TWINKLE01.pvmTexName_tp2_11,
	TWINKLE01.pvmTexName_tp2_4,
	TWINKLE01.pvmTexName_tp1_1,
	TWINKLE01.pvmTexName_tp1_11,
	TWINKLE01.pvmTexName_tp1_12,
	TWINKLE01.pvmTexName_tp1_13,
	TWINKLE01.pvmTexName_tp1_14,
	TWINKLE01.pvmTexName_tp1_15,
	TWINKLE01.pvmTexName_tp1_16,
	TWINKLE01.pvmTexName_tp1_17,
	TWINKLE01.pvmTexName_tp1_18,
	TWINKLE01.pvmTexName_tp1_19,
	TWINKLE01.pvmTexName_tp1_2,
	TWINKLE01.pvmTexName_tp1_20,
	TWINKLE01.pvmTexName_tp1_21,
	TWINKLE01.pvmTexName_tp1_22,
	TWINKLE01.pvmTexName_tp1_23,
	TWINKLE01.pvmTexName_tp1_24,
	TWINKLE01.pvmTexName_tp1_3,
	TWINKLE01.pvmTexName_tp1_4,
	TWINKLE01.pvmTexName_tp1_5,
	TWINKLE01.pvmTexName_tp1_6,
	TWINKLE01.pvmTexName_tp1_7,
	TWINKLE01.pvmTexName_tp1_8,
	TWINKLE01.pvmTexName_tp1_9,
	TWINKLE01.pvmTexName_tp2_21,
	TWINKLE01.pvmTexName_m128_tp2_009,
	TWINKLE01.pvmTexName_m32_tp2_002,
	TWINKLE01.pvmTexName_m64_tp2_024,
	TWINKLE01.pvmTexName_tp2_10,
	TWINKLE01.pvmTexName_tp2_18,
	TWINKLE01.pvmTexName_tp2_25,
	TWINKLE01.pvmTexName_tp2_28,
	TWINKLE01.pvmTexName_tp2_29,
	TWINKLE01.pvmTexName_tp2_30
};

NJS_MATERIAL matlist_00056EF4[] = {
	{ { 0xFFB2B2B2 }, { 0x00000000 }, 0, TWINKLE01pvmTexName_tp1_1, NJD_D_100 | NJD_FLAG_CLAMP_V | NJD_FLAG_USE_TEXTURE | NJD_DA_INV_SRC | NJD_SA_SRC },
	{ { 0xFFB2B2B2 }, { 0x00000000 }, 0, TWINKLE01pvmTexName_tp1_22, NJD_D_100 | NJD_FLAG_FLIP_V | NJD_FLAG_FLIP_U | NJD_FLAG_USE_TEXTURE | NJD_DA_INV_SRC | NJD_SA_SRC },
	{ { 0xFFB2B2B2 }, { 0x00000000 }, 0, TWINKLE01pvmTexName_tp1_5, NJD_D_100 | NJD_FLAG_CLAMP_V | NJD_FLAG_FLIP_U | NJD_FLAG_USE_TEXTURE | NJD_FLAG_DOUBLE_SIDE | NJD_FLAG_IGNORE_LIGHT | NJD_DA_INV_SRC | NJD_SA_SRC }
};


EDIT: Noticed I made a slight error in the spelling of one of the entries in the TWINKLE01Entries array. I fixed it and still no change.

It definitely isn't supposed to be including the file extension in the enum definition. I've fixed that now.

Your other problem is that you seem to be confused about which section of the ModInfo struct to put things in. A jump is a place in the game's code where you want the execution to be diverted to a function you provide. When you want to divert a data reference from SADX's data to your data, that is a pointer.
This post has been edited by MainMemory: 26 May 2014 - 04:48 PM

#2118 User is offline evilhamwizard 

Posted 26 May 2014 - 05:54 PM

  • Posts: 1158
  • Joined: 16-June 04
  • Gender:Male
  • Wiki edits:109
Ack, I just realized that too. I used your CharacterRandomizer project as a base for the new project to see if maybe my set up was causing errors with the enums, so I forgot to change it.

The level still crashes upon load for me though. I'm wondering if maybe it was an error in the struct conversion or something. It makes me wonder since the first act had problems in SALVL. I know the other two acts render under SALVL, so maybe I'll give those a shot.

#2119 User is offline Dude 

Posted 27 May 2014 - 01:59 AM

  • 3ds MAX Help Desk
  • Posts: 3026
  • Joined: 11-September 04
  • Gender:Male
  • Location:Southbridge, MA
  • Project:Sonic Adventure Generations
  • Wiki edits:43
For anyone who is using SADXLVL2 or SALVL, I've changed the camera controls to behave like SonicGLVL. This means that all camera movement is bound to the middle mouse wheel + modifier keys + mouse movement

Normal camera mode:
middle mouse button: pan camera
middle mouse button + ctrl: zoom camera
middle mouse button + alt: rotate camera (the same way you'd rotate your head)

Orbit camera mode:
middle mouse button: pan camera (kind of broken - lets you pan it once, successive pans start at previous focal point)
middle mouse button + ctrl: zoom camera
middle mouse button + alt: rotate camera (orbiting around the focal point)

In orbit camera mode, the focal point will automatically move to the center of the selected items when the selection changes. It does not auto-zoom yet. I might add that feature.

This new configuration makes it harder to get the editor 'stuck' trying to process all of your camera movements, as It reduces the incidence of multiple drawcalls per-frame.

I have yet to add a 'jump to selection' button, but you can emulate that effect in normal mode by selecting something, switching to orbit mode and then immediately switching back.
This post has been edited by Dude: 27 May 2014 - 02:04 AM

#2120 User is offline evilhamwizard 

Posted 27 May 2014 - 11:50 AM

  • Posts: 1158
  • Joined: 16-June 04
  • Gender:Male
  • Wiki edits:109
Posted Image

Trying a different level. Windy Valley Act 3 from the AutoDemo.

What I did was just import DaGuAr's obj rip of Windy Valley Act 3 into 3ds Max 2015, selected all the individual objects and set "Affect Pivot Only" and "Center to Object" under the Hierarchy tab and pressed "Transform" under "Reset:" to calculate the pivots for each object. I then used Dude's sadxNodetable1_6 and sadxCompiledMeshExporter script to get the nodetable.txt, and loaded it up under SADXLVL2 while Emerald Coast 1 was open (I tried to use Windy Valley 3 but it doesn't want to load under the latest version afaik). Saved it, took the land table sa1lvl file from the Levels folder, opened that up in SA1LVL, converted the struct to C, included the file in my project, replaced the address that loaded the landtable for Emerald Coast 1, ran the mod and that's what you get.

Of course, this just ported over the mesh and doesn't have the objects set, the camera, path, textures, adjusted death zone, starting position coords, etc. But at least something loaded up that relates to the level, and I can walk all over the place too.

So I know the code itself can work, but it looks like the struct conversion for Twinkle Park 1 might've been bad all along?

#2121 User is offline Dude 

Posted 27 May 2014 - 12:32 PM

  • 3ds MAX Help Desk
  • Posts: 3026
  • Joined: 11-September 04
  • Gender:Male
  • Location:Southbridge, MA
  • Project:Sonic Adventure Generations
  • Wiki edits:43
Yeah, ever since I added the nodetable 1.6 import/export to SADXLVL2, I've known you could do it this way. I just haven't done it yet.

I don't know why you ran into those issues using structconverter with twinkle park. I guess I'll add that to the list.

#2122 User is offline evilhamwizard 

Posted 27 May 2014 - 05:28 PM

  • Posts: 1158
  • Joined: 16-June 04
  • Gender:Male
  • Wiki edits:109
The method I mentioned seems to work pretty well for getting the level mesh in the game. Here's the first act of Windy Valley from the AutoDemo in Emerald Coast (I also tested it with Twinkle Park Act 1, and that works as well):

Posted Image

I threw in the SET/CAM files to see what the game does with them. Obviously the objects are all wrong (even the common ones), but they're at least being placed in the right spot. I'd imagine a lot of the stuff being loaded on the side of the ledges are static objects, so porting those over could be simple. I could also double check to see if the starting position coordinates for Sonic that I found a few months a go in the AutoDemo were really for the prototype Windy Valley, and it turns out that they are for sure. This means the PATH data for Act 1/3 probably still exist in the prototype somewhere (1ST_READ?). Maybe we can easily port that over too.

I tried to move the ocean/bluish bottom skybox down, but I can't seem to figure out where the pointer that points to the object struct for it. Without pushing it down half the level is cut in half, but everything can be explored. I was able to at least move the death zone so you can roam about without dying.

The only thing about the method though is it doesn't seem to carry the texture id's over. You'd have to go back and change the texture IDs for each material, but in the case for Windy Valley we needed to make brand new textures anyway.

Also, can anyone else load the retail Windy Valley in SADXLVL2? Loading any of the acts keep crashing.

EDIT: Here's another snapshot of an area in Act 1. I cleaned up the set file to only have common objects. Basically, just rings and two springs.

Posted Image

The prototype version seems to have a lot of these little crevices that exist in case you fall from a higher level. The ring placement is pretty odd too. Beside the usual circle/arc of rings, there are some spots where there are only two rings in an entire area. I also want to mention that with Act 1 and 3, the texturing for a lot of the terrain is really shoddy (see the above screenshot). The terrain is also pretty rough in some spots. The people who were modeling the level were probably trying to figure things out as they crafted the mesh and left things like that behind. Just wanted to mention that, heh.
This post has been edited by evilhamwizard: 27 May 2014 - 08:40 PM

#2123 User is offline Dude 

Posted 27 May 2014 - 09:19 PM

  • 3ds MAX Help Desk
  • Posts: 3026
  • Joined: 11-September 04
  • Gender:Male
  • Location:Southbridge, MA
  • Project:Sonic Adventure Generations
  • Wiki edits:43
Oh also, another one of the reasons I haven't used your obj export method yet for porting the stage is because it will lose any of the vertex colors, since obj doesn't support them. It also loses strip data, but that isn't very important considering the low polycount of the levels. The vertex colors contribute greatly to the apparent lighting of the level. Oh question, you said you ported over the cam files. How well do they work?

Could you send me the CAM/SET files? I'm working on getting this done myself.

Also:
Posted Image

New material editor for SA models.
This post has been edited by Dude: 27 May 2014 - 09:39 PM

#2124 User is offline evilhamwizard 

Posted 27 May 2014 - 11:29 PM

  • Posts: 1158
  • Joined: 16-June 04
  • Gender:Male
  • Wiki edits:109
Yeah, you'd definitely be losing some detail if you try it with the method. It'll also treat everything as a solid, afaik. You'd have to manually edit surface flags where necessary, all kinds of stuff. The vertex colors are probably the biggest bummer. But I guess if you were ever concerned with getting any kind of land table mesh to load in game, it's a relatively decent method. It's just strange how direct struct conversion doesn't work for a lot of these though...

The cam file for the first act seems to work as far as being properly aligned with the land mesh (the other two acts seem blank), and they do seem to do things. But unfortunately, the camera is still a big pain in the ass, especially when trying to navigate the beginning part of the first act (the camera likes to sink into the floor a lot). I'm not familiar with how CAM files are structured and how to interpret them, but I took a look at the file for the first act in CAMSet, and this is what the beginning area looks like:

Posted Image

The SET file for the first act is gigantic. SADXLVL2 seems to have a problem loading my work on Emerald Coast when using the set file from the prototype. When the game loads with the original set file from the prototype, I noticed that it seems that it doesn't load all the objects. Upon loading Emerald Coast with the set file, a ton of Kiki's and those rhino badniks spawn all over the place, but I didn't see any rings and such for some reason. It was only until I modified the SET file to have only rings and springs that those common objects actually loaded up (maybe the game has a max limit on the number of entries you can have in a SET file?). They must've used a ton of foliage and environmental objects, because that's pretty much all the file consists of (the stage itself has a ton of objects too). Surprisingly, within the first 20 objects (the common ones), it only uses the rings and springs. No rockets, speed boosters, goal posts and the like.

I'll give you all I have on Windy Valley. The text file I included should tell you where most of the things are in the stage binary. I included my old disassembly of 1ST_READ, in case you want to go hunting for things (like the path data, etc). The original set file as well as my modified set file are in there along with the CAM files.

EDIT: Quick question. How does the game pick it's initial camera position upon loading a level? I want to get the camera to face the right way upon loading the stage.
This post has been edited by evilhamwizard: 27 May 2014 - 11:34 PM

#2125 User is offline Dude 

Posted 28 May 2014 - 12:47 AM

  • 3ds MAX Help Desk
  • Posts: 3026
  • Joined: 11-September 04
  • Gender:Male
  • Location:Southbridge, MA
  • Project:Sonic Adventure Generations
  • Wiki edits:43
I've personally run into the game's SET limits before. I have no idea if it's a hard limit or not, but it does like to stop working if you go crazy with the object layout. That was probably one of the major reasons they re-designed the level. After looking at part 1 from an overhead view I can safely say that the final version is spiritually the same layout, just with massive reductions in size and detail. Part 2 looks like it got an upgrade in the final, being kind of empty in the autodemo.

I'm not surprised the camera is a pain seeing as how very different the camera behavior is between the autodemo and the final, but I am glad that the volumes are the same. That should make it easy to get something similar to what the original designers had in mind.

#2126 User is offline MainMemory 

Posted 28 May 2014 - 01:11 AM

  • Every day's the same old thing... Same place, different day...
  • Posts: 3369
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
The SET items are loaded into a statically allocated array, so there is a hard maximum, it might be 512 objects?

Edit: The limit is 1023 in SADX, 1535 in SA2.
This post has been edited by MainMemory: 28 May 2014 - 09:20 AM

#2127 User is offline Dude 

Posted 30 May 2014 - 01:39 PM

  • 3ds MAX Help Desk
  • Posts: 3026
  • Joined: 11-September 04
  • Gender:Male
  • Location:Southbridge, MA
  • Project:Sonic Adventure Generations
  • Wiki edits:43
More neat features for you guys:
Posted Image

I added this preferences dialog. If the editors are running slowly now (happens the most with sadxlvl2 while SET editing), you can turn the draw distance down. It updates immediately, so you can play with the slider and get instant feedback. You can also enable backface culling, so you can see collision problems with your meshes (this is assuming you're writing an import/export tool, say a stripifier or scene tool), or switch to wireframe mode (although you could do that before with the N key and still can). I also added a standard 3-point light system for the default lighting because I was getting tired of staring at that ugly flat-white. You can still re-enable the flat-white if you need to using the preferences dialog.

#2128 User is offline Dude 

Posted 03 June 2014 - 08:34 PM

  • 3ds MAX Help Desk
  • Posts: 3026
  • Joined: 11-September 04
  • Gender:Male
  • Location:Southbridge, MA
  • Project:Sonic Adventure Generations
  • Wiki edits:43
I applied some lighting and started converting the object list:
Posted Image
Posted Image

The rest of the screenshots I took can be found here

#2129 User is offline Irixion 

Posted 03 June 2014 - 11:32 PM

  • Posts: 1414
  • Joined: 30-December 04
  • Gender:Male
  • Location:Ontario, Canada
  • Project:Life
  • Wiki edits:152
So how many objects are there in the list that aren't in SADX? I'm assuming most of the objects were just flowers or scenery..

#2130 User is offline Dude 

Posted 03 June 2014 - 11:36 PM

  • 3ds MAX Help Desk
  • Posts: 3026
  • Joined: 11-September 04
  • Gender:Male
  • Location:Southbridge, MA
  • Project:Sonic Adventure Generations
  • Wiki edits:43
There's 114 objects in the beta list, and 79 in the final. I am probably going to make some custom objects to fill in many of the decoration slots, especially since there are clear screenshots of some of these objects that have no final equivalent.

If someone here can read Japanese and can translate these names, you'll help out immensely: http://pastebin.com/18V8223n
This post has been edited by Dude: 03 June 2014 - 11:36 PM

  • 146 Pages +
  • ◄ First
  • 140
  • 141
  • 142
  • 143
  • 144
  • Last ►
    Locked
    Locked Forum

3 User(s) are reading this topic
0 members, 3 guests, 0 anonymous users