simple machines forum

Please login or register.

Login with username, password and session length
 

News:

Remember to make your own backup of posts before submitting.

 
 
Pages: [1] 2 3

Author Topic: STICKY: 2020 King's Field II port progress report  (Read 2726 times)

Holy Diver

  • Website System
  • Administrator
  • *****
  • Offline Offline
    • MaleView Profile
    • About/Support Me/Sword of Moonlight
look out honey, 'cause I'm using technology
Holy Diver says,
« on: July 30, 2018, 04:42:51 AM »

I'm officially doing this :biggrin:

Update: Here (www.swordofmoonlight.net/holy/KING'S%20FIELD%20II.zip) is a verbatim copy of my working project. It's primarily for safe keeping on my webhost's server, but you can see it for yourself. I will announce future updates in this topic/thread. They will be regular unceremonious posts. Not regularly, just quiet posts.

ZIP update: http://www.swordofmoonlight.net/bbs2/index.php?topic=286.msg2679#msg2679

EDITED: For the record, I found out that SOM_MAP's arrow icon, which I based this image on, is backward, pointing north, when it should point south. After the fix, the arrows in the image flow naturally like a race course along the walls. This backward arrow long gave me a misunderstanding of SOM_MAP's directions. I realized today that they default to south, not because of 2D, but because in the 3D view, south facing, seems to be looking toward the monitor, at us, because we think of down as facing us, and up as facing away... possibly because we (I) see the map laid out like a table top.
« Last Edit: November 27, 2018, 12:17:16 PM by Holy Diver »

Holy Diver has 2189 posts

Holy Diver

  • Website System
  • Administrator
  • *****
  • Offline Offline
    • MaleView Profile
    • About/Support Me/Sword of Moonlight
look out honey, 'cause I'm using technology
Holy Diver says,
« Reply #1 on: August 02, 2018, 12:30:40 AM »

EDITED: I discovered how sub-layers are encoded into each level. I thought it would shed light on the "mystery" level that this post mentions. Especially because it seems to have models that are not used. However, its sub-layer is a blank. It also occurred to me that it could be a moat or some other feature not meant to be traversed, but I struggle to think of a place for it in the game. My memory of the game is pretty fuzzy though.

As a test case I've reconstituted (in SOM) a 9th/mystery level on the disc, both because it was smallest, and I was curious about what it could be. I still don't know what it could be, but as proof of concept, I have recreated a section of the game in SOM.

I will probably make everything without textures first, because the PlayStation basically only has one texture (its video memory) and how it is addressed is understandably anachronistic. So basically manual model work is required to apply the textures. At the same time I will likely consolidate many of the profiles (the squares in the palette area of the original picture/post) since they are duplicated for each level... although it's very possible that there are subtle differences in the duplications, as is often the case for SOM's stock art work, and so great care must be paid to not destroy any information in the consolidation process.

KF2 poses many challenges for SOM, that boil down to necessitating new features that must be added to SOM in order to faithfully recreate its experience. That's going to be the bulk of the work for this project.

While this is a devlog, I am not withholding the product itself; for its duration, I will periodically make demos available in various stages of undress, until one day it will get to the point where only fine polishing touches are required. It's up to individual interest in KF2/SOM as to when to engage with snapshots of the incomplete product.

P.S. As for the "mystery" level, I'm skeptical its purpose will ever be known. Perhaps if it is populated with "objects" etc. something of its purpose will be revealed... perhaps not. It doesn't seem to be part of the game, because it runs the full width of the level, which seems like too far of a trek even for many of Melanat's long corridors. I don't think the game's designers ever meant to subject its audience to it.

There is a doorway toward one end, and beyond it a side exit into a 2 tile wide (3.5m) hallway that ends in a very small chamber. I also developed 20x20 icons for this level, and selected 3x3 icons for SOM's auto-map function. I could share a screenshot, but it's really not very interesting. I would prefer to let downloaders explore it when a demo appears later.
« Last Edit: August 02, 2018, 03:04:06 AM by Holy Diver »

Holy Diver has 2189 posts

Holy Diver

  • Website System
  • Administrator
  • *****
  • Offline Offline
    • MaleView Profile
    • About/Support Me/Sword of Moonlight
look out honey, 'cause I'm using technology
Holy Diver says,
« Reply #2 on: August 02, 2018, 06:33:55 AM »

Here's a fun screenshot on the sub layer of Guyra's level. I am hopeful that the MPX format might have facilities for two layers... because I've seen code inside of SOM that looks like it is processing multiple layers or simultaneously loaded maps (connecting corridors) and I know where the jumping off point is in the internal structure of the MPX file in memory, and I know that this memory is reset when a level is loaded, and so it reasons that if the feature extends to the file format, that there is a field in the file format for at least one additional layer.

At the very least, I won't be surprised if the MPX file has a field that mirrors this field that it has in the program's memory.

The scale factors are pretty weird. A tile is 2068x2068. That means if it maps to 2 meters (as SOM does) that 10341024 is 1 meter. On the other hand, the elevation units, are 128 apart. This means that tiles go up and down by 128 at a time. To make this work in SOM without changing anything, the vertical dimension (Y) needs to scale by 0.1/128 instead of 1/10341024. It's possible this distorts the final experience. Especially because the horizontal and vertical dimensions differ. It's also possible that the game in the PlayStation compensates for this. It will become apparent when furnishings are added since the difference is almost 80%. (EDITED: 128 is actually 0.125 meters, which works out to 0.5 most of the time, which is SOM compatible, because elevation changes tend to be 4 at a time. I'm looking into modifying SOM_MAP for the other cases.)

If the vertical dimension were subjected to the same scale factor, the elevation values will be even weirder than 0.128, 0.256, etc. It might make more sense to tweak all of the tiles by hand, in order to find a balance.

Strikeout: I now think 1034 is a strategy to overlap tiled polygons so that cracks appear less after they are rotated into place, since the vertices lose precision. It will be a lot of work to remove all of this, so I might stick with 1034, and fix the problems that emerge from it instead. It does make a difference. I will decide when I start looking at UV maps. EDITED: I noticed this because the water tiles don't seem to use 1034, so I'm assuming 1000 like SOM uses. If they overlapped it would double the transparency effect.

Strike 2: turns out it's 1024, like PlayStation uses. Or 1 meter in SOM is 0.25 in PlayStation fixed-pont.
« Last Edit: August 03, 2018, 01:53:04 AM by Holy Diver »

Holy Diver has 2189 posts

Holy Diver

  • Website System
  • Administrator
  • *****
  • Offline Offline
    • MaleView Profile
    • About/Support Me/Sword of Moonlight
look out honey, 'cause I'm using technology
Holy Diver says,
« Reply #3 on: August 03, 2018, 02:05:39 AM »

Upon further work, it turns out that the "1034" overhanging tiles were only a difference of 10, because the tile unit is 1024, or 2048 from -1024 to +1024. I should've seen this coming really. Just for lack of imagination.

This works out well for elevation, because 128 is really 0.125, which sums to 0.5 every 4 units. I honestly don't know why I didn't see this. Mixing 128 with 1000 was really a red flag. I can be a real ditz sometimes. It's the dumb blonde in me. (Is dumb blonde still politically correct?)

I opted to bake in the conversion from 1034 to 1, because the game's art applies this to climbing pieces (e.g. staircases) but doesn't apply the same transformation to the vertical dimension, therefor the seams are thrown off. The conversion negatively effects diagonal walls, because it pinches them in. But they are fewer, and will be easier to fix later on.

Luckily there doesn't seem to be problems in the caves. Or not the ones I've looked at. In fact, they are seemingly airtight. Which bodes well for the conversion itself. I was worried that their many faceted walls would be more difficult to repair, but they seem to avoid the full extents of the tiles.

P.S. I'm inclined to look at the layering problem next. Wouldn't it be wonderful if MapComp.exe would produce a layered MPX file if it is given 2 MAP files?! That's the dream scenario anyway. I have a feeling it might accept multiple MAP files, but will probably just spit out multiple MPX files if so.

Holy Diver

  • Website System
  • Administrator
  • *****
  • Offline Offline
    • MaleView Profile
    • About/Support Me/Sword of Moonlight
look out honey, 'cause I'm using technology
Holy Diver says,
« Reply #4 on: August 15, 2018, 12:29:21 AM »

Here is a triumphant two story false color tweaked rendering of KF2's opening level. You can see the lighthouse on the left, and the waterfall in the back.

In the last week or two I've worked almost nonstop on adding multi-layer functionality to SOM so that it can entertain its maps. Funnily, SOM has multi-layer code and provisions within its file formats. Unfortunately, From Software either did not complete these facilities or disabled them. It's not as simple as flipping a switch back on (or it wouldn't have taken me multiple full time workweeks to pull it off.)

The layer stuff is halfway finished. This is the first image of a full map. It has only a test pattern for "texture" at this stage, so I inverted the image, to create the appearance of a white fog instead of the customary black. And I thought a white background would be more striking. However, I couldn't resist adding some color, and arguably I may have gone overboard with it, but I think this treatment brings out some details lost in the haze, although, it washes others out, in the more boxy rooms, that are overpowered by the stripes. The stripes are enhanced by the saturation enhancements that give it its color. Slight sampling errors become colorful highlights through successive saturation enhancements.

I could somewhat guide the coloration, and chose a combination most befitting this zone. If it's harsh, it was my desire to eliminate dull grays from the final image, especially in the very back in the effervescent waterfall area.

Two strange sections appear in the foreground, and there is a third in the back left corner that got lost in the brightness/contrast enhancement. I think these must have some purpose. I wonder if they are parts of the corridors that appear between zones. Even Guyra's zone has some like them. Their inward facing walls are not visible.

Holy Diver

  • Website System
  • Administrator
  • *****
  • Offline Offline
    • MaleView Profile
    • About/Support Me/Sword of Moonlight
look out honey, 'cause I'm using technology
Holy Diver says,
« Reply #5 on: September 11, 2018, 12:09:58 AM »

A section of KF2 in SOM without any lighting or decoration. It's just the first such image so far. The fog is not meant to match the game's.

EDITED: Here is another, in 16-bit color. I usually prefer this mode for screenshots, but wasn't thinking about it when I took the picture. The AA is better (although it looks very good in the other) and it has a more retro feel, and the colors seem to be less overcast. On the other hand, the stipple effect can be a little too obvious on the PlayStation VR display.
« Last Edit: September 11, 2018, 01:17:28 AM by Holy Diver »

Holy Diver has 2189 posts

Holy Diver

  • Website System
  • Administrator
  • *****
  • Offline Offline
    • MaleView Profile
    • About/Support Me/Sword of Moonlight
look out honey, 'cause I'm using technology
Holy Diver says,
« Reply #6 on: September 14, 2018, 11:46:02 PM »

A teaser after 3 days of hand editing the shore/cliff tiles, including the sky. I faked the moon. I think maybe one of the models is the moon itself, but SOM will not apply lighting to the model if so.

I haven't worked on any of the cave entrances, the lighthouse, or the bridges. The water interfacing tiles often come in sets of 4, so that the water flows in a different direction in each one. I just grin and bore the preparation of the copies, not wanting to give it a thought, so that the job was in many ways more like doing 3 zones than 1, and I have a feeling its shore is a lot more varied than other level geometry.

I wanted to go ahead and develop the water area so I can figure out how to get SOM to make the water transparent. It's the next programming job ahead. I think I want it to be more rewarding, to see all of the water become transparent at once. So the water in this screenshot is not see-through. It should look exactly as it would if was however... I believe.

It's funny to see it this way. I won't lie, it isn't the same. Something will have to be done to summon something approaching the PlayStation's charm, but without trying to emulate the past.

Holy Diver

  • Website System
  • Administrator
  • *****
  • Offline Offline
    • MaleView Profile
    • About/Support Me/Sword of Moonlight
look out honey, 'cause I'm using technology
Holy Diver says,
« Reply #7 on: September 16, 2018, 08:03:00 PM »

SPOOKY STORY

I made this latest screenshot after having spent a lot of time trying to figure out what decides the order of the sky's layers in the MDO file. After I succeeded in getting everything to look right (the glow behind the moon was being animated) I made this screen, and didn't want to go so far as to fire up a game of KF2 to confirm the position of the moon in the sky.

I was just looking for a nice view of the moon, that also included the water (and no unfinished tiles) and liked this one... wanting to incorporate a familiar location if possible.

I didn't think this was where the moon was supposed to be (edited: I just chose this position in the sculpting software, having to pick a side.) But I liked the shot anyway. But I was just now in the emulator and it occurred to me to check... and as it just so happens this is the moon's position in the sky!

I kind of expected it to be on the opposite side, because I can now see that there is zone-wide directional lighting (which I've attempted to reproduce) and if the light was the result of the moon, then it would make more sense for the moon to be on the opposite side, or actually, now that I look again, on the SW side.

Strikeout: Maybe there are lights shining from both SE and SW so that more or less it is from the south. But also the lights point up at the ceiling, and so it's not cut and dry that the moon can be a source of the light... obviously not indoors. I think the moon is in the north.


I might move it to the south side yet, so that the light sides of the cliffs line up with moon's position.

The glow in the emulator seems much fainter. And the moon is smaller, but looks very similar. I thought the circle would have a 3D highlight, but it doesn't actually. It looks like the screenshot. Except it seems a little oval... which might back up my impression that the horizontal/vertical FOV is not in line with the aspect ratio... or it might be because it's said that old televisions would make the picture wider for Super Nintendo games, and so it might be the same for PlayStation... but if so, the emulator isn't simulating this.


EDITED: For what it's worth, I've left the sky model so that the stars actually move like the clouds in SOM's skies. I think I may leave it this way. The PlayStation's stars twinkle as you move, so something like movement in the stars is a substitute. Although, what I find funny is that the stars closer to the ground seem to not move at all. I can't understand why not. It likely means that the sky effect must not be so straightforward.
« Last Edit: September 16, 2018, 08:19:18 PM by Holy Diver »

Holy Diver has 2189 posts

Holy Diver

  • Website System
  • Administrator
  • *****
  • Offline Offline
    • MaleView Profile
    • About/Support Me/Sword of Moonlight
look out honey, 'cause I'm using technology
Holy Diver says,
« Reply #8 on: September 17, 2018, 10:18:38 AM »

This screenshot has a color function I cooked up that while not based on SOM's classic gamma ramp, is doing something like it. I think a normal gamma function just makes all of the colors progressively darker, but I don't know if that has effect of bringing out mid-range colors by pushing light and dark colors to the margin, but that is what I've attempted to do here.

It makes the picture look like KF2 on the PlayStation. I don't have the foggiest idea why it does. The colors are very dingy without being transformed. If I didn't know the PlayStation only has 32 shades to work with, I'd guess that KF2 modifies the palettes at run-time so that colors become more vibrant like this. It's possible it does so despite its limited number of shades.

The sky texture is much brighter than it appears in the game. Oddly the stars appear much larger than in SOM. There are two potential sky model files, one of which I couldn't successfully export/import. It is green for some reason. It might have a different UV map.

The next release will probably have a gamma_function extension for injecting arbitrary code into the effects shader, and something for stereo (PSVR) in case it requires a different function.

EDITED: The image looks kind of dark against a light frame. It looks just right on back bordered display. The textures look a little crumbier. I think higher resolution textures will help.

Holy Diver

  • Website System
  • Administrator
  • *****
  • Offline Offline
    • MaleView Profile
    • About/Support Me/Sword of Moonlight
look out honey, 'cause I'm using technology
Holy Diver says,
« Reply #9 on: September 28, 2018, 02:27:33 PM »

This screenshot is the first zone with textures. The image is processed to make it easier to read. Midtones are inverted to make the outlines. The color is adjusted for better visibility.

Interactive doors and other elements are missing. The textures are assigned by hand. It took me several days to do ever tile's. The water tiles come in groups of four, so that the workload is quadrupled. I'm going to reduce everything down in time.

The section over the waterfall with the wind crystal is green, because it's actually identical to the cave areas. At some point the images in the PlayStation's memory are simply replaced. I am generating the MAP files right now, so it isn't worthwhile to edit them. I have a feeling the tiles are identical to some other section of the game's. It will be easier to replace them after the MAP files are finalized.

EDITED: A month later I'm now noticing things I missed, like the green cave floor is usually a different texture, and caves (which I couldn't readily access then) are identical to the polished stone walls, with sand floors. I guess the stone is carved out of the mountainside. (BTW: I didn't say so before, but the area across the bridge is actually identical to the green caves. The texture just gets swapped. The same happens to the floor texture of the green caves with the save point inside. Oh, and the stairs in the caves are green.)
« Last Edit: November 03, 2018, 10:22:22 PM by Holy Diver »

Holy Diver has 2189 posts

Holy Diver

  • Website System
  • Administrator
  • *****
  • Offline Offline
    • MaleView Profile
    • About/Support Me/Sword of Moonlight
look out honey, 'cause I'm using technology
Holy Diver says,
« Reply #10 on: October 01, 2018, 06:42:51 PM »

A backup of my project is now here (www.swordofmoonlight.net/holy/KING'S%20FIELD%20II.zip) on this website. You can play with it. Included is a program for using your PlayStation VR set, with instructions.

There are colorless versions of most if not all of the zones, however only the first zone has color, and it has no exits into the other zones. There is only level geometry. The water is inert. If you walk slowly it feels like it's moving... but I did not want to work on an animation feature before backing up my work for the first time. I may be taking a break from it. If I don't it's because I cannot peel myself away! I may put a little time aside to look at position tracking for the PlayStation VR, but don't expect anything too miraculous.

There is a sky and BGM, but nothing else. The FOV setting is higher than the highest setting I've allowed for the F3 function. It is 60, which is closer to the PS game's, however the PS game's picture does not appear to be square. Alt+F3 changes the FOV, but if it's taken off 55 or 60 then the INI file must be hand edited to restore the unnaturally high setting. (NOTE: 50 is SOM's default. 60 is nowhere near as high as VR mode, but higher setting don't translate to flat pictures.)

There are holes where doors go. They can be jumped over, or flown over with F4. I am most interested in getting doors in place before anything further.

Holy Diver

  • Website System
  • Administrator
  • *****
  • Offline Offline
    • MaleView Profile
    • About/Support Me/Sword of Moonlight
look out honey, 'cause I'm using technology
Holy Diver says,
« Reply #11 on: October 12, 2018, 08:43:32 PM »

Just posting an image to hotlink elsewhere. Figuring out the coordinate system of these things was tricky. (The up direction is negative. The origin is in the corners of the tiles, instead of their center. The 16-bit values are signed, and the divisor is 1024 instead of 4096.)

UPDATE: I'm replacing this image 1mo later. The old image had unfinished lamps and crystal with a test pattern texture. It's just better to look at. At this stage all of the "objects" are finished for this zone. And I'm considering doing more items before updating the ZIP project file again. (In case you're wondering, the flames are fully animated :batman:)
« Last Edit: November 14, 2018, 04:11:18 PM by Holy Diver »

Holy Diver has 2189 posts

Holy Diver

  • Website System
  • Administrator
  • *****
  • Offline Offline
    • MaleView Profile
    • About/Support Me/Sword of Moonlight
look out honey, 'cause I'm using technology
Holy Diver says,
« Reply #12 on: October 20, 2018, 10:11:20 AM »

I was able to use my PS3 memory card adapter to make an emulation friendly save file. I'm attaching it for safe keeping. I realized the backup computer I use to test Windows XP and other things might be 32-bit. And it was. The adapter only talks to 32-bit PCs from what I can understand. It doesn't have its own mass-storage drivers (why the hell not!?) but it's not even recognized on 64-bit systems. I don't know why.

I used a funny little program called MCRWwin to interface with/dump the card in the adapter, and another called MemcardRex to convert it to an emulator friendly format.

P.S. I'm adding a feature to let the name of "objects" be used to generate captions. KF2 has many things that show real-time messages when pressing the O/X button (depending on region/convention.) I reckon this is the easiest way. It just adds a checkbox style button to SOM_PRM that overrides SOM_SYS's real-time messages.

Holy Diver

  • Website System
  • Administrator
  • *****
  • Offline Offline
    • MaleView Profile
    • About/Support Me/Sword of Moonlight
look out honey, 'cause I'm using technology
Holy Diver says,
« Reply #13 on: October 21, 2018, 08:04:39 AM »

Here is "objects" integrated into the level geometry. Even though, really these two objects are more like tiles, and at some point I will probably look at converting parts of them into tiles, since that's more in keeping with SOM's way.

I'm using 16-bit screenshots from now on I think, because I checked and they are 1/3rd the size of full color PNG images produced by my software.

The process is very slow going... I really feel for anyone who tries to make a game from scratch with SOM (Moratheia is one such example, although incomplete.) KF2 is especially difficult because so many of the textures are tiny things. It's really hard to find the right ones, even if you know what you're doing. I don't know that I'll ever arrive at a better system.

(EDITED: I've gotten pretty good at locating the files by their VRAM addresses and UVs. I certainly don't have to guess, but the process is still a little on the slow/work intensive side. I could automate a lot, but I think I prefer doing it slow, by hand, since it helps to notice details, and is more endearing. I will only get to do this once after all.)
« Last Edit: November 03, 2018, 10:05:15 PM by Holy Diver »

Holy Diver has 2189 posts

Holy Diver

  • Website System
  • Administrator
  • *****
  • Offline Offline
    • MaleView Profile
    • About/Support Me/Sword of Moonlight
look out honey, 'cause I'm using technology
Holy Diver says,
« Reply #14 on: October 25, 2018, 12:55:20 PM »

I've come quite close (close enough) to correct colors. I don't know how the PlayStation produces these colors, however NTSC (composite or component) encoding is pretty weird.

The reference (pictured) is an emulator with an NTSC filter, which I assume is pretty well tested. It certainly appears much more authentic than the textures on the disc do... which come out nothing at all like this image, but are very gray and muted.

I'm partly sharing this to save the image since it has the lighting set up and hack color function I cooked up in short order, in case I go and lose these settings somehow. I don't know if every zone uses the same lighting, however this lighting can be produced with only 1 light instead of 3 with subtractive lighting, so I think I'm going to add that option. If I had to guess it is subtractive lighting in the game, since I have feeling the PlayStation probably only has one light source. I've added a Subtract checkbox to SOM_MAP's layout to remind myself to implement it.

I think there may be black fog in the back corner in the emulated image that isn't quite right yet... that can explain why it appears darker. The port's fog is going to be distance based, whereas the original fog appears to be a straight line/plane instead of a sphere.

I had to modify the water fountain, only temporarily because it fights with the ground, and the well in the middle goes underground. That's not a problem for the PlayStation because it doesn't have a depth-buffer, so the pixels behind it just get clobbered. It must be hell to sort its triangles.

NOTE-TO-SELF
The yellow tint is not necessary (it's built into the texture) once the brightness lines up. 1.4 is a better value for "gamma"  and "gamma2" here drops out of the equation. There's no reason for "gamma,gamma" both values are just very close together. Increasing roughly increases brightness, but also contrast/vibrancy.
« Last Edit: October 27, 2018, 11:32:34 AM by Holy Diver »

Holy Diver has 2189 posts
Pages: [1] 2 3