|
Post by reaccount on Feb 10, 2016 23:00:47 GMT 10
So I've used Son of Persia's tool to extract camera info from the .cci file, and I'm trying to see (just as a test) whether or not I could recreate Room 118 (the east wing save room) in Blender. It says that the FOV is 55, and that seems to be right, but I was wondering if the other information could be helpful as well. Since I'm working in Blender, I don't know of an easy way to get things like collision data that can help orient what I'm doing, so I'm just trying to do it by eye using this method cgi.tutsplus.com/tutorials/modeling-a-modern-interior-scene-in-blender--cg-15294. (EDIT: Actually, the .mod file in the shd folder seems helpful enough, but no matter how much I play with the camera I can't get the model to even closely line up with the background.) So for example I get: Camera 0 Information : Camera Position = (-132.137604, 182.521591, -288.915619) Target Position = (-50.652100, 150.698410, -76.638702) Unknown Position = (0.000000, 0.000000, 0.000000) Roll = 0.000000 FOV = 55.000000 What's the unit of measurement for camera position? What does target position refer to? Am I on a fool's errand and these numbers only make sense in 3DS Max? Alternatively, how does one use this data in 3DS Max? If I can figure out how to make a room there, I should be able to do it in Blender I think.
|
|
✫Advanced Coder✫
First, I was known as Sectus. And then, well, I ended up here.
Posts: 2,811
Original Join Date: Aug 31 2009
|
Post by FluffyQuack on Feb 11, 2016 3:59:58 GMT 10
I'm assuming target position is there to calculate the angle of the camera.
|
|
|
Post by reaccount on Feb 11, 2016 4:17:38 GMT 10
Yeah, that's probably it. Looking up what a "target camera" is in 3DS Max suggests as much as well. Just putting in the numbers for the camera's position and its angle, however, causes it to be completely off. Part of the problem, too, is that importing the .mod file results in a super huge model in Blender. I saw that Bunny mentioned something about dividing the numbers by 100, and I tried that for both the model's scaling and the camera positions, but it's still goofed. (Not as goofed if you inverse the -288.91 to a positive, but still wrong.) Even just playing around with the .mod file and the camera in free cam doesn't do much. Mostly I can't get the camera to "fan out," if that makes any sense, even if I do play with the FOV. (Notice the right wall.) I may just be in over my head, but I'll keep messing around with it.
|
|
✫Advanced Coder✫
First, I was known as Sectus. And then, well, I ended up here.
Posts: 2,811
Original Join Date: Aug 31 2009
|
Post by FluffyQuack on Feb 11, 2016 5:09:53 GMT 10
I imagine you'll need to figure out what the coordinates 0,0,0 corresponds to in the ingame model. I have no idea what a good way to do that is, but hopefully bunny or someone else can help out.
|
|
|
Post by reaccount on Feb 13, 2016 10:51:20 GMT 10
Okay, so, update: After much weeping and gnashing of teeth, as well as pestering Bunny (sorry/thank you Bunny), I think I finally figured out what's up. "Camera position" is just, well, the camera's position, but in Blender the Y and Z coordinates are flipped. "Target camera" is a function in 3DS that can be replicated easily enough in Blender (easy to YouTube), and its coordinates are listed in the .cci. Okay, so I figure: All I gotta do is plug them up! Still doesn't work! And so now I'm positive that it either is Blender importing the .mod file wrong (as an .obj) or the .mod file itself is messed up. That's when I remember that Codeman had previously taken the .sbc data from R112 (one of the 3D rooms) and made that into a big .obj. So I figure, let's see if I can accurately replicate a camera angle with it: After all, while the .mod file might for whatever reason be inaccurate, the .sbc absolutely should be. And after plugging in camera 0's and its target's coordinates, it's still messed up. But, it's messed up in an easily recognizable way: The camera just seems to be on the opposite side of the map along one dimension. It turns out that all I had to do was make the Y coordinate negative (or positive if already negative). Why this is the case, I don't know; but it worked! Also of note: In Blender, there are two settings for FOV, the focal length in mm and, uh, the same measured in "Field of View." You'd think the latter would be what corresponds to the .cci, but actually it's the former. So that was probably throwing me off, too.I'm going to try to get R118 to line up again, and if I can't, I'm just going to chalk it up to the .mod file being inaccurate. If that's the case, though, I'm not really sure what to use as a template. I think the Max Script by Codeman is able to convert .sbc data to .obj somehow, but as I don't have 3DS Max, I may be in a pickle. Also, I'm not really sure why the window and the window alone is slightly off to the left in the .obj; maybe it's a texture on the wall that makes the pane look like it extends further to the right? Update: Following the very same procedure as above, with one important caveat, I was able to get this: Once again, not everything is perfectly aligned. Take, for example, the toolbox. But it's exceedingly close! So what's the deal? The FOV. Neither plugging in 55 in mm or Field of View results in an accurate rendering. Actually, both were way too far zoomed in. Whatever "FOV" means in the game's engine or whatever must be measured in a third, different way. Just playing around with the number gets me the above, so it's not a huge issue, but it was still throwing me off.
|
|
|
Post by reaccount on Feb 23, 2016 14:57:47 GMT 10
So: (Ignore the ladder, I forgot it was in the way before I started rendering, and I am entirely too lazy to go back and fix it.) So plus side: Adding in backgrounds is easy enough. Problem: Shadows. They're all messed up, although this was expected. I don't know what controls shadows: Is it r11801_000_z.tex? Some other file? Can this even be edited? And if it can, how would I possibly go about doing that? The mysteries deepen. EDIT: You know what, that .mod file I've been using from the shd folder? Duh, it's for shadows. The end table is off because I moved it to the right. The hand cart doesn't look great but it's aligned, I'll have to mess around with it. You could probably very easily change shadow placement assuming you could convert .obj to .mod. Which I believe you can with 3DS Max. Unfortunately, the export function for the Blender script is broke, and probably wasn't intended to handle REmake data anyway. (At this point I don't even use it to load the maps, I use Noesis for that anyway.) Still, maybe useful to know for other people out there. EDIT #2: Or not. Moving it over to the left to where the model in the .mod file was moves it too far left. So maybe it is that z texture file, but I read elsewhere that that's only for controlling fog. Blah.
|
|
✫Advanced Coder✫
First, I was known as Sectus. And then, well, I ended up here.
Posts: 2,811
Original Join Date: Aug 31 2009
|
Post by FluffyQuack on Feb 23, 2016 22:53:16 GMT 10
I'm pretty sure the z texture behaves as z buffer for the background so it clips correctly with real-time rendered models.
Looking in r10a.arc there's a couple of files which might be related to lighting: r10a_light.sbc - Has light in the name. I think SBC are collision files? r10a.sst - Contains an array of items with position, colour, and other variables. Maybe those are lights for the room? It also has effect reference ids, so this might just be for adding effects to a room.
But there has to be something for each room which defines the position of lights which would correspond to position of lights in the background.
|
|
|
Post by reaccount on Feb 24, 2016 5:15:34 GMT 10
I'm thinking it has to be a collision issue, since the light source behaves as though the original end table is still there with its exact same position and dimensions. Looking at the R112 model, it's far more complete than the .mod file in shd, although it still lacks some details (such as the chains hanging from the ceiling which do cast shadows). As far as I know, Nevertheless, codeman here seemed to think that collision data is responsible for the casting of real time shadows. (And here is where he confirms that the room he created was composed of .sbc file data.) Later, however, he concluded that the .mod file in shd was responsible for shadows (which again, I can open, but cannot replace due to an inability to export .mod files). Also, weirdly, R118 lacks a "light"-designated .sbc file. I'm not sure what R10a's refers to. Maybe it's for when lightning strikes? (That's the room that leads to the painting room and to the courtyard, right?) In any event, simply deleting or replacing these files with another room's causes a crash, so I can't really test it either way. Meanwhile, even if I bit the bullet and bought 3DS Max, it sounds like a) 2016 doesn't work with codeman's .mod import/export Maxscript, and b) I'm not really sure how the .mod file functions anyway. As I mentioned, I tried lining up the models I made with the .mod file, and that was a no-go. But maybe that was itself the wrong thing to try. After all, the models in the .mod file aren't completely built (the end table lacks a leg, for example). This also explains why despite trying to line up the camera as precisely as possible, objects are still shifted weirdly around. Even so, there's got to be a better way to do this than sort of guessing by eye. (Probably: Import both the .mod file and the .sbc and see how they interact.) I don't want to bug bunny again, but like the camera data issue, I may be pounding my ahead against the wall to no avail until I do so. On the other hand, without 3DS Max, I don't think I can do anything more. (Something interesting: R112, one of the 3D built models, lacks a shd folder altogether.)
|
|
✫Advanced Coder✫
First, I was known as Sectus. And then, well, I ended up here.
Posts: 2,811
Original Join Date: Aug 31 2009
|
Post by FluffyQuack on Feb 24, 2016 5:39:17 GMT 10
I'd just ask bunny if I were you. It's possible there's an easy way to figure out the exact positioning for the lights.
|
|
Posts: 121
|
Post by classicbiohazard on Feb 25, 2016 3:57:15 GMT 10
Which 3dsmax versions are compatible with codeman's plugins? All you are saying are interesting, there are things that I didn't know.
|
|
|
Post by reaccount on Feb 25, 2016 4:12:02 GMT 10
My understanding from various threads is that they work with 3DS Max 2012, but again, I don't have a way to verify that. I'm also not sure if they can import .sbc files or not, I just know that codeman was somehow able to extract the collision data about a year back.
Anyway, I talked to Bunny, and it doesn't sound like he's editing any of those things. Which is fine, since it can still be done by eye, and it's good to know that there isn't something obvious I'm missing. That said, it'd still be good to look into these things: If we could re-position lights and stuff, that'd be of course very helpful for creating custom backgrounds and the like.
|
|
✫Advanced Coder✫
First, I was known as Sectus. And then, well, I ended up here.
Posts: 2,811
Original Join Date: Aug 31 2009
|
Post by FluffyQuack on Feb 25, 2016 8:58:41 GMT 10
I believe the script works for versions 2009 to 2012. I can confirm it does not work with latest version of 3dsmax unfortunately.
The lights definitely has to be defined somewhere in the files. It could be in the sst files but I'm not sure.
|
|
|
Post by reaccount on Feb 25, 2016 9:34:35 GMT 10
I've done a little hex editing in the past for DMC4 and music files, but I'm pretty much clueless outside of that. Is there a way one would go about checking to see if it affects light sources? I could try messing around with the sst files in my spare time.
|
|
✫Advanced Coder✫
First, I was known as Sectus. And then, well, I ended up here.
Posts: 2,811
Original Join Date: Aug 31 2009
|
Post by FluffyQuack on Feb 25, 2016 12:54:46 GMT 10
A lot of the files are in XFS format which can be converted to and from XML with newest version of arctool. So you wouldn't need to do hex editing for many of the interesting files. I was curious about this, so I started doing some experimentation. First of all, this is how the room looks by default: abload.de/img/bhd2016-02-2503-17-534wsji.jpgSST: I removed all the entries, and I got this result: abload.de/img/bhd2016-02-2503-19-21c4si9.jpg - Notice how the lantern doesn't look as "bloomy" anymore. I think this file defines effects and extra elements to render in a room. RTP: No idea. Almost no information in the file. FSP: One 3D volume in the file. I changed it and I couldn't tell any difference. CCI: We already know this contains the camera locations. For the heck of it, I changed the FOV to 105, and you get the expected result: abload.de/img/bhd2016-02-2503-21-398fs5s.jpgCCH: This contains the position triggers for camera changes. I changed the volume coordinates to 0, and then the current camera would never change. ADR: This contains information about doors: where they are, and where they lead you if you interact with them. AEV: This contains information about things you can interact with the room (a lot of volumes defining the "hitbox" for items). Changing all the coordinates to 0 made it impossible to interact with anything in the room (besides the door, which is defined in ADR). And that's it for the XFS files in the room. I tried replacing item_r118.sdl with the file from another stage, and I couldn't see any difference. Maybe it defines item glints or item positions? I tried replacing r118.sdl (in scheduler\filter) and that seems to be what we're looking for. Changing it gave me this result: abload.de/img/bhd2016-02-2503-34-29qzs6p.jpgAs you can see, Chris' shadow is now in a different position. So that file defines the position and other information related to lights. The annoying thing is that we have no convertor for SDL files (as far as I know, the file format is similar to XFS but I suspect it's simpler in that all the information is in a list). I spent a lot of time on my XFS convertor so I'm not feeling motivated right now to start working on the SDL format. But maybe it would be possible to find the exact position of lights by looking at the file in a hex editor and finding all the instances of 3 floats in a row (which would correspond to XYZ coordinates).
|
|
|
Post by reaccount on Feb 25, 2016 13:43:20 GMT 10
Nice! Being able to reduce the amount of bloom is a big deal by itself, at least for me. One of the things I really disliked about the remaster was how intense some of the lights are. I can also play around with the SDL file you mentioned. Just to clarify, when you say 3 floats in a row, does that mean something like 00 XX XX XX 00 (the Xs being the numbers in question)? (Again, extremely minimal experience using a hex editor.) I'm going to try changing some of these three in a rows in the meanwhile. It may also be worthwhile posting this information in the tutorial section or somewhere else for reference. Line 110: Changing 0b 03 2a to 44 44 44 causes a crash, as does 0a 04 2c. (For reference, changing other three XX strings like this hasn't done obviously done anything, and didn't cause crashes.) Line 1080: 60 ea 46, seems to control fog color/transparency/depth? Pics: i.imgur.com/UZSQ20z.png, i.imgur.com/fgVVURO.pngLine 5b0: Related? Changing 0c 02 01 to various different values results in no shadows. (Changing to 0b 01 01 crashes. Changing to 0c 02 02 or 44 44 44 eliminates shadows.) i.imgur.com/F36itOH.pngCorrection: Changing 5b0 to 0c 02 02 moves the light source, it seems. i.imgur.com/NPQsz4b.png (A little hard to tell, but it looks like changing the last value to 02 raised the light. Jill does not case shadows against the wall and such as she normally does. Or maybe it was lowered, hard to tell.)
|
|