simple machines forum

Sword of Moonlight => Devs => Topic started by: Holey Moley on October 30, 2017, 01:07:35 PM

Title: EXIT: Let there be light
Post by: Holey Moley on October 30, 2017, 01:07:35 PM
Quote from: http://www.swordofmoonlight.net/archives/sword-of-moonlight/2017/10/let-there-be-light/
October was a good month for Sword of Moonlight. It started with an unscheduled release that turned into possibly the most consequential yet, and because of it I was able to really dig in to Mortheia’s 2.1 demonstration (pictured) resulting in a string of “patch” alerts on the back of the new release, the likes that can only come about from many hours of genuine, uninterrupted play.

(http://www.swordofmoonlight.net/wp-content/uploads/2017/10/Moratheia9.png)

Combined with the first surprise release from late this year, in Moratheia’s project Sword of Moonlight appears able to make a fully professional showing. The earlier release removes pixellation from detailed images that form cutout shapes that are applied to two-sided paper thin polygon shapes. It sounds like a cheap effect, but Moratheia makes use of this to great effect, as can be seen in its many fine tree limbs (pictured) and grasses. The second surprise release is more or less an omnibus that started with the simple objective of extending the kind of geometry that can be walked over without encountering glitches, but would snowball to enhance and make perfect the solidity of Sword of Moonlight’s artistic worlds.

Furthermore, in this process, insidious, showstopping bugs were isolated and eliminated from Mortheia’s demo.

I believe that very soon Sword of Moonlight will be suitable to stage a competitive commercial offering. Moratheia appears poised to be the first such offering. That said, that Moratheia exists at all is nothing to sneeze at. Sword of Moonlight is very user-friendly, but also many parts of it are strictly off limits to users, and so I cannot endorse its fitness as a complete product at this time, and do not expect to be able to do so any day soon. Nevertheless, Moratheia is living proof that with enough patience and know-how, Sword of Moonlight can deliver very impressive results.

Read more about Moratheia here (http://www.swordofmoonlight.net/bbs2/index.php?topic=154.0)
Title: Re: EXIT: Let there be light
Post by: Holey Moley on May 19, 2018, 06:29:22 PM
Quote from: http://www.swordofmoonlight.net/archives/sword-of-moonlight/2018/05/let-there-be-light-2/
Here’s an interesting stopgap release — it’s not what I’d planned, and it’s a demonstration first-and-foremost — but it’s also an official release, because it includes some of the best performance enhancements for Windows 7 and later Windows, and fixes some bugs that had arrived too late to be patched. I’ve been hard at work ever since I acquired a PlayStation VR in order to apply it to Sword Of Moonlight, but got taken off guard by the headset’s enchanting home-theater mode. (More on it later.)

There are so many possible releases, all up in the air, right now, never mind VR; Nevertheless, in the last several days it’s been the only thing I can think about. I expected to release a full PlayStation VR demonstration, except for the headset that I received seemed to have apparent display anomalies that forced me to send it back for a replacement, and so in the meantime I could only finish the demonstration’s visual component:


(http://www.swordofmoonlight.net/wp-content/uploads/2018/05/Binocular-Gap.png)
[text in center was undoubled at the time this picture was taken]

I felt desperate to achieve a visual. I went to lengths I wouldn’t normally to make it work on my (puny) workstation. And now that it works (including double-vision and nontrivial lens distortion effects) and does so on an inexpensive, integrated chip in a box that will fit in the palm of your hand, no less, it’s still only half as exhilarating as the ability for Sword Of Moonlight to do this at all, without changing how it works in some more fundamental way. It is doing so now not by summoning raw horsepower but by achieving a clean, steady frame-rate, for the first time in its so far brief history.

Needless to say this has profound implications for games, even if surely, these problems would be solved some day, what’s important is now is that day, and the problems are no longer, or at least, have been not insufficiently mitigated for the time being.

For the record, I've chose to file this blog post under the same title of this earlier one from last year. They are both milestones on the way to Moratheia being a full-fledged game if it gets its act together, but my main inspiration is that the scenes pictured happen to be the same exact locale. Both posts deal with critical milestones... in fact if not for the breathtaking clipper developments from back then, I'm not sure SOM would be smooth enough for VR. But now it may well be some of the best VR in existence!

Before I forget, I wanted to add that last-moment I figured out how to change the "F3" mode to let you experience the full game without cutting off effects from contact with monsters. This is something I wanted to do since the subject of the original post but could not yet formulate how to do it. (It's done by preempting the special "system" DEATH event.)

Also, because the frame-rate is much more regular, do_aa is looking a lot better, and appears much more acceptable in full color mode (8-bits per RGB component) and in VR mode.


EDITED: Also, the following code can be added to the Ex.ini file to make the tools larger... or technically it's to make their text labels easier to read on a VR display.

Quote from: Ex.ini (excerpt)
[Editor]

;Increase tools' fonts 30%.
height_adjustment = 1.3*1_

(Note, I don't know if 1_ is ideal form, but it's shorthand for _[1] which you might find easier to read. It looks better for counters that use c than for function parameters that use _.)

P.S. New release is here (http://csv.swordofmoonlight.net/SomEx.dll/1.2.2.4.zip (http://csv.swordofmoonlight.net/SomEx.dll/1.2.2.4.zip)) but SVN Update also includes the new SomEx.dll file. But you'll likely still be prompted to Update it. I update the files in the TOOL folder from time to time because I expect new users to have some initial confusion about the update process, and so may not get their files up-to-date.
Title: Re: EXIT: Let there be light
Post by: Holey Moley on May 19, 2018, 07:32:34 PM
VR Instructions

F2 enters/exits stereo mode. This is saved as stereo in the INI file.  I think it will work without issue if your PC can truly output to 2 monitors (I recommend clone mode) and I've seen some evidence that the USB port may need to be the newer/faster USB3.0 type, but I don't know this for certain.

https://github.com/gusmanb/PSVRFramework/releases has a tool for controlling your PSVR on Windows. You want the Toolbox and DriversPackage downloads. Without this, you cannot put the headset into VR mode. While you're at it though, try playing SOM with the home-theater mode. That's the best experience I've ever had playing a first-person game hands down. It's not VR like in the articles you may've read, but it's better in my book, with minimal to no nausea, etc.

In stereo mode, Alt+F3 (or just F3 if not using the function overlay) changes the "Binocular Gap" setting, which is a little bit experimental at this stage. In this build it represents your "IPD" but is not necessarily a fixed measurement. The PSVR is supposed to have 64mm between the lenses. And if you set this to 15 it's supposed to match that. But I'm not 100% certain it lines up with the in-game camera, but it looks as though it does. (EDITED: Woops, forgot to explain Alt+Shift+F3 or alternatively F1... see Reply #3!)

It is the space between the hero's eyes... but you can set it to less or more than your own to experience a more or less pronounced 3D effect, where in theory 1=1mm. The value 0 is special, in that instead of being 49mm it is 0mm, or "mono" or what a cyclops sees, or what covering one eye might see if that eye was in the middle of your face. I don't believe this is an uncomfortable setting, and it may well be the most comfortable setting.

(Other than the hole at 0 you can override the built-in limit by hand editing the INI file.)

This demo doesn't interface with the headset. So it doesn't know where you are looking. You just have to mimic what you are putting into the controller, or don't look around. Or if you don't have a headset, just see if it runs at 60fps/smoothly on your PC or not.


P.S. In stereo mode there is extensive color correction to match my unit's color. But I've returned the headset, so it's possible that its color is not common to all PSVRs. I will know more when I get a second headset. The color wasn't among the reasons I eventually decided to exchange it. But it was a major disappointment that I only began to notice in my final days with it. Honestly, if I had to choose between the defects for which I returned it, and having correct color, I would choose the color....

But the odd thing is, the home-theater mode color does match my monitors. So either it's applying color correction, or the VR mode color is completely uncalibrated or possibly even deliberately hobbled by Sony to make it difficult to use with devices not its own.
Title: Re: EXIT: Let there be light
Post by: Holey Moley on May 20, 2018, 08:14:04 AM
EDITED: FORGOT TO ADD that the F3 setting goes from 0 to 30, but it doesn't go backward (it's a work in progress) so that originally I set it up for Shift to go backward, but that only works if you use Alt+Shift+F3... because Shift is the keyboard way to "attack" so last minute I made F1 go backward also, but that is likely a temporary arrangement.

(Using F4 isn't an option because Alt+F4 is universal for quitting out of software.)

This setting repeats, so you can hold the button down, and if you assign it to a macro/button it's very easy to use with the controller. But in a real life situation I'm not sure sacrificing two face buttons is worth it. But it can help to figure out what setting you think you might like... but here's the thing about that...

Basically our eyes are really good at combining two images, so they will combine anything you throw at them. I doubt it matters if they are exact, and you might want to just pick a setting that gives you the degree of effect you want.

When I first started doing tests, I used basically a cyclops mode with parallax, that I think would let me basically adjust the focal-length, independent of cropping) and I would set the length to very large numbers, so it was as if things in the distance were much closer than they are. It created the sensation that I was a very small person, even though nothing changed in terms of height. I believe this is less about FOV and instead has to do with the fact that our brains use the difference in the two pictures (per eye) to judge their distance from things, and so even though I was seeing the same thing, my brain was telling me it was closer or further away (although it was not exactly the same because the shear angle was changing, as if on either side of my nose.)

In any case, in the current set up, the focal length is "infinite" meaning the eyes are looking straight forward. This is actually how almost all VR games/demos work right now, and is considered best practice for not causing discomfort. But I still, later on, want to do experiments with dynamic focal lengths... in which case what I plan to set up is to change the focal length based on how far away a cluster of pixels in the center of the screen are. (IOW, depending on what you are looking at, the game will match what your eyes should be doing in real life... in this future mode. I think this will work well, or I'd be surprised if it doesn't, because the PSVR is already like wearing blinders... your eyes can't exactly roam, and are given every incentive not to.)
Title: Re: EXIT: Let there be light
Post by: Holey Moley on May 20, 2018, 09:23:56 AM
Minor Patch

http://csv.swordofmoonlight.net/SomEx.dll/1.2.2.4.zip

I had some problems with pressing Alt while ducking causing the character to stand up. So I made some changes, and I realized that I went too far, because Alt+Shift was letting the Attack occur, which I already decided way-back-when was not going to be allowed... so Alt is no longer viable for regular play, and while it can access different kinds of movement (lateral/vertical) it's not for play but just for navigating in the playtest context.

Bottom line, is Shift is too useful as a modifier to completely commit it to Attack, and playing with Alt is neither fun nor viable, and so not worth maintaining. Alt+Shift opens the System Menu (click icon in title bar.)

P.S. The one improvement this release makes, is pressing Alt while holding down the Action button (space-bar) to duck, etc. no longer stands up. This is important when Alt is used by "macros" (i.e. assigning key combinations to virtual buttons.)
Title: Re: EXIT: Let there be light
Post by: Holey Moley on May 21, 2018, 09:02:37 PM
height_adjustment Patch for SOM_MAP

http://csv.swordofmoonlight.net/SomEx.dll/1.2.2.4.zip

It occurred to me that SOM_MAP uses a larger font for its event text input boxes.

Since this extension enlarges fonts, and so enlarges the text boxes, the larger box will no longer fit its text.

I couldn't reliably enlarge the text to fit the box, so instead I did a quick-fix by adding an invisible margin to fill in the space. It also works a little differently if you go beyond the bottom of the box, in which case, there might be issues if there is not room for a scroll bar in the margin.

(I think SOM_MAP does this mainly because it uses a proportional font, unlike SOM_PRM and SOM_SYS, and these boxes need a fixed-width font.)

Hopefully the larger font can be read as easily as the enlarged font. This extension is not meant to be perfect, but it's important to get the wrapping right, since that's how it appears in the game, or in the script editor if your project is well organized.
Title: Re: EXIT: Let there be light
Post by: Holey Moley on May 24, 2018, 12:31:53 AM
PlayStation VR Patch

http://csv.swordofmoonlight.net/SomEx.dll/1.2.2.4.zip

I have another PSVR now. It has more or less the same characteristics as the one I returned...

I've made the text stereoscopic, even though I'm not sure what is the correct parameters for doing so, it's more clear now at every setting.

I generally cannot see much difference with the millimeter pupil distance setting, but I'm pretty confident it's correct.

I think a problem is the FOV setting. I know now that it needs to be much higher. I'm not sure how high, but in this patch I've set it to 100! I feel the best number is somewhere between 90 and 110. It's not a number that should be adjustable, but I can't really see a great deal of difference at these settings.

It's hard to believe the correct number is so extreme. You get a sense of moving very quickly at 50, and so 100 is very quick, as you can imagine. 100 on a monitor would appear ridiculous. It never dawned on me to try such settings, but I noticed that looking around a room just didn't look right, in obvious ways.

Without a more precise way to determine the FOV I'm thinking I will just wait until free-look is working and see if that helps to determine the correct FOV. It should feel unreal if the FOV is not correct. It's hard to tell with the controller though... and maybe I should try to set up a map that has a good amount of distance with many boxy things to compare.

P.S. Right now I'm working on COLLADA-DOM stuff primarily. I don't want to dive into VR again. But I wanted to check this new headset immediately. This patch has slightly less correction for greenness. I don't know if the set is less green, or it could be because I changed a correction that guarantees now pixel components are ever black to be closer to true black, whereas before it was using the first black-level that SOM doesn't treat as colorkey (although, technically it's Direct3D that did colorkey that way.)
Title: Re: EXIT: Let there be light
Post by: Holey Moley on May 24, 2018, 02:46:55 AM
Save Event menu scale/position patch

http://csv.swordofmoonlight.net/SomEx.dll/1.2.2.4.zip

This release makes menus more square for VR. I'm not sure I mentioned this here. In any case, the Save Event menu is not a fixed address (it turns out) and so it was often at a different address in the release build... but never in the debug build. This patch does a dirty fix that should work. Otherwise the Save Event menu can get scaled/positioned irregularly, often with little to nothing visible afterward.

It's always annoying when something shows up in release builds but not in the debug build, since there isn't a convenient way to debug it, and I mainly work with debug builds, and so rarely notice such bugs. Fortunately this is a good find.
Title: Re: EXIT: Let there be light
Post by: Holey Moley on May 24, 2018, 02:31:16 PM
PSVR color reproduction patch

http://csv.swordofmoonlight.net/SomEx.dll/1.2.2.4.zip

I'm quite happy with the color in this patch, under the circumstances. I feel like I can recommend buying a PlayStation VR for SOM. What I didn't expect is now (don't ask me how because I don't know) the game's Brightness setting looks good set to 0, whereas until now, I always had to crank it all the way up to be able to see color definition in dark colors.

The trick to getting half-decent color is to 1) never let pixels be pure black. 2) make dark pixels increasingly more purple, in order to overpower the green.

The question is how much to purple dark pixels and what pixels are considered to be dark. This patch adds a power-2 function to the mix, to make the map nonlinear, and I played with inverting before versus after the power-2 (square) is done. I think doing this transform in nonlinear sRGB space is not helping, but it's done so to keep it simple.

Also, because the PSVR picture is pallid, the "saturation" is ramped up a little bit. It's useful to set the saturation to 0 to "desaturate" the picture, to see if indeed looks like a b/w image, or if it is too purple or green. I've built in the potential to fiddle with these numbers, but I hope they are consistent across all PSVR displays.

The saturation is done after the lens color correction, which is not ideal, but it's not practical otherwise.

I've chosen a very conservative figure in terms of adding purple, so that the picture is neither too purple nor too green, but might be somewhat of either, but I think that the eye acclimates.

The PSVR color is pretty bizarre in general... it makes things in Moratheia that are quite clearly brown/black become bright green or blue, which is strange, because there is little to no green or blue in the pixel value if you take a screenshot and examine it in artistic software. It's hard to describe, but generally speaking it looks alight for our apparently primitive VR displays. (The sarcophagi in the final area/tomb are examples of neutral/black things that appear to be bright green/blue depending on color correction settings.)
Title: Re: EXIT: Let there be light
Post by: Holey Moley on June 15, 2018, 04:31:49 AM
Demo/patch

http://csv.swordofmoonlight.net/SomEx.dll/1.2.2.4.zip
http://csv.swordofmoonlight.net/SomEx.dll/1.2.2.5.zip

This is actually a patch to a demo. I don't believe the demo is changed much from the current release, besides having an improved VR mode.

Specifically this patches a bug caused by the new menu squaring extension work, that slipped past me, because the player resets the menu's scaling when canceling out of the Options menu, which I of course hadn't thought to consider, because it's a completely senseless thing to do.

I also noticed that 1280 x 800 had a pixel gap in the frames that is plugged. And I'd left some squaring logic in a rough state because I believed it was unlikely, because it dealt with scaling that was taller than wide... but because the scaling is in proportion to 640 x 480, 1280 x 1024 is actually taller than it is wide, in proportional terms, so this pathway required more attention. I just luckily noticed this when trying to get to the bottom of the cancellation bug. (I can't recall if the bug happens only when the resolution is changed prior to canceling or if always, but it's probably the former case, since it took me a while to notice this issue.)
Title: Re: EXIT: Let there be light
Post by: Holey Moley on June 15, 2018, 10:41:25 AM
EDITED: There's a new upload/patch because the same problem applied to changing the Options menu's color mode (bpp) and so needed to be addressed also, in the same manner.
Title: Re: EXIT: Let there be light
Post by: Holey Moley on June 18, 2018, 10:21:08 PM
OOPS :doh:

http://csv.swordofmoonlight.net/SomEx.dll/1.2.2.5.zip

SORRY... the VR demo didn't have the free-look feature, because I missed one of the "debug" mode checks, that disabled it until it was ready... I should have tested it. I must have forgotten to.

I only noticed it, because it had a mistake in it, where I'd swapped the direction of the gyros in the headset, because they are not installed upright, but that was actually causing problems for a "fusion" algorithm that tries to blend the gyroscope and accelerometer measurements... but it's only noticeable if you look backwards and sideways... thing is, I disabled this "fusion" because I noticed it pulling (overcorrecting) when looking up & down. It's much better without it, so it's something I have to look further into. It's probably supposed to minimize drift, but the pulling is much more bothersome than drift. Which is inevitable.

Strikeout: This problem was due to I believed there were two sets of sensors, but in fact there are two sets of data because there are two samples from the same sensor.

On the plus side, the blur when looking around seems to have been fixed by the FOV corrections.
Title: Re: EXIT: Let there be light
Post by: Holey Moley on June 19, 2018, 02:40:07 PM
Repair patch

http://csv.swordofmoonlight.net/SomEx.dll/1.2.2.5.zip

This patch puts back the "fusion" logic I disabled in the previous patch. The problem turned to be that I believed there were two sets of sensors, but really the data has two samples, from the same sensor. I thought I observed their timestamps being identical...

I hadn't come across anything that suggested these were two samples instead of two sensors.
Title: Re: EXIT: Let there be light
Post by: Holey Moley on June 21, 2018, 02:17:41 PM
Demo

http://csv.swordofmoonlight.net/SomEx.dll/1.2.2.5.zip

This is a special "build" that has an effect in the VR mode, which is designed to mimic the home-theater mode's smooth/stable appearance. I sat down to work on it, because I decided that if I'm going to spend a lot of time developing a camera based tracking feature, I'd like it if it at least looks nice!

What it does is to generate a mipmap for the final picture, so that the effective resolution (per eye) is really 480x540, almost. I think this is what home-theater mode does, which if you think about it, it is not even standard definition, after any cropping.

I first tried to do this with a 3D texture, so that it could be sampled from the middle, to get a blend of the current and previous frame, except I was surprised to discover that Direct3D 9's 3D textures don't have a way to update themselves from video memory, which is the last thing I was expecting. So they cannot be used for anything related to after effects processing.

This meant the only way was to use the existing picture, and just add mipmapping to it. This is not bad really, because it keeps the original full size image in the same texture, along with the mipmap. So it's possible to actually blend the 960x1080 image with the downsampled 480x540 image...

So I decided to blend 25% of the original, and 75% of the half sized image. So there is a hint of the original in there, but the end result is you're getting a really small image by today's standards.

I think that it may be the head set is a bit wobbly, or just that people's heads are wobbly, and that actually makes picture constantly move, which makes pixels flip off and on all of the time. So this kind of strategy helps to smooth that out. And it's also possible that if the wobble can be filtered out, that the blend might look okay at something like 50/50. That will depend on if the do_aa extension requires 75% or if it's the wobble that mainly demands that 75%. But I think anything below 50% will not look good under any circumstances, and that the PlayStation VR really needs something like this to be done.

I don't know if starting with a "4k" image would work, downsampled to HD. My intuition is it wouldn't. But I don't expect to be doing 4k or supersampling renders. It's certainly too early to bother with it, but I would not try anything less than 2x. It might actually make some sense to do this one day, because without an LOD scheme (and I generally don't like any modern game's LOD schemes, so I'm not sure if I can make a better one myself) if you are going to increase the visible distance, increasing the resolution is not a bad way to do that. What's to be avoided is drawing triangles that are smaller than pixels. So more pixels can afford smaller triangles.

EDITED/WARNING: A downside of this effect, that I don't really understand, is the "chromatic aberration" problem gets worse. I thought I'd almost succeeded at eliminating it. But now it's clearly visible again. Still, I think the trade-off between CA or a constant digital heat shimmer like effect, is better to live with the CA.

P.S. Another downside is of the 480x540 picture, in the head set, you can't really see a large part of it on the outside, so that it's really even much smaller than this, in terms of what we are used to, playing games on monitors. So it feels almost like we are back in the 90s. I'm not sure if this is an ideal way to experience a game for the first time, even if you can stand to do so without puking (which probably you can't) but I think this enhancement will also help to abate sickness a lot because it creates a fairly stable picture.
Title: Re: EXIT: Let there be light
Post by: Holey Moley on June 22, 2018, 12:01:35 AM
EDIT

The demo file (1.2.2.5.zip) is now patched with a CA fix and there was probably a bug to do with do_stipple that I discovered sampling the second mipmap level when it was not in use.

There are some new [Stereo] extensions that are listed below via a code excerpt (that is not an INI file.)

Code: (SomEx.ini.h) [Select]
//unlike Editor, these do not override Option
//but are instead parallel to it since stereo
//has special needs
EX_INI_OPTION(0)
do_not_aa,
do_not_lap,
do_not_force_full_color_depth,
do_not_dither,
do_smooth,
do_stipple;

//som_hacks_PSVR_dim
EX_INI_NUMBER(0,0,16) dim_adjustment;

//DMIPTARGET
EX_INI_NUMBER(0,0.75,1) fuzz_constant;

These give control over some of the PSVR settings. They set up a recommended set of options, that are distinct from [Option] extensions, but share the same naming conventions. Without do_not_force_full_color_depth the VR mode won't enter 16-bit color modes.

fuzz_constant is the new technique. It was making CA more pronounced, so I had to think about what could be doing that. And I remembered that just like the distorted shape was fixed by making it square, there was also a corresponding (Y-axis) parameter for the CA correction, which I forgot to make square at the same time as the other one. So now it is quite good, and might even be better without the "fuzz" effect.
Title: Re: EXIT: Let there be light
Post by: Holey Moley on June 22, 2018, 03:32:10 PM
Good News

I think the PlayStation VR can work without a camera! I've prepared a new demo with more aggressive sensor "fusion" and it feels like you can enjoy it without a camera setup, because the "drift" is slight to nonexistent. It tends to not just leak errors over time, but only occasionally. It's really quite good.

The sensor correction makes it wobble for some reason. So it's much more wobbly now. But I'm going to try several things to steady the in-game "camera" before messing with real life cameras. And I think I'm going to not worry about getting cameras to work as much. Not for a while anyway. I want to accomplish more goals with SOM first.

The wobble can actually help to smooth the picture out, in theory, but if I'm successful at eliminating it, it won't help, so there's not much point in saying so, except that there can be a silver lining, however things develop.
Title: Re: EXIT: Let there be light
Post by: Holey Moley on June 23, 2018, 11:10:59 PM
Demo Patch

http://csv.swordofmoonlight.net/SomEx.dll/1.2.2.5.zip

This one improves the drift/wobble a lot, more than the other one (which reduced drift at the cost of added wobble) just by switching from 32-bit precision to 64-bit. If I had developed the code that I used to get started with this myself I would've programmed it 64-bit from the offset.

For what it's worth, this change produces an effect much more like the home-theater mode's tracking. It's free of noise, and crisp/responsive. I kind of miss the wobble though, because it injected some fuzz into the picture, which helps a lot with this unorthodox/in-your-face display. I've retreated back to the old setting with less wobble.

If drift becomes an annoyance, there is a beta_constant extension that might be useful for decreasing it, by adding wobble. I recommend up to 0.1, and the default is 0.05.

Also now the Mute button on the headset can now do a recentering function. And the +/- volume buttons can counter drift on the turning axis (yaw) but there's no real benefit to preferring them over the recenter function. I tried them to see if the drift was bottoming out depending on the calibration conditions, in which case, it could've worked to make a correction, but that wasn't the case. The only benefit is it's less abrupt than recentering.

It can be hard to say if you've really drifted or not, because returning your neck to exactly where it was when recentered it is pretty subjective with small amounts of drift, and the drift seems to cancel itself out.
Title: Re: EXIT: Let there be light
Post by: Holey Moley on June 24, 2018, 05:06:38 PM
Patched again,

This upload adds 3D to menu graphics. I had given the text 3D to be legible, but returned to it, to figure out the right way to match the text with the menus. There was also a bug with right-aligned text.

Pros: I think there is a good way to determine your IPD setting (F4/F1) because the faux 3D menus create an optical illusion when you get the right setting, so that they brain interprets them to be 3D. I centered the menus so that the Inventory screen can be used as a guide for fine tuning purposes, by looking down its middle. The Summary screen also works for this, but has a wider gap.

Cons: I've placed the menu up close to your face, so that the items appear behind them menu. For picture backgrounds, this is kind of weird, because the brain will see them in front of the item, and they will appear like a window pane, even if they are opaque.

I will have to play with bringing the items forth, or pushing the menus back... which will remove their 3D characteristics. I haven't done anything with menus so far. In VR mode you can see enough to get by, but they don't move with you. And you can't read game text, so it's no way to play a game in demonstration form.


EDITED: I've also changed the fuzz_constant default to 0.6666666 (2/3rds.) This adds more detail. But I'm mainly looking for a magic effect that finds the right mix for antialiasing hard edges. The current version may not look as nice as it did a few patches back, and may drift more. It was much more wobbly/fuzzy then, which actually looks better on the unusual display.


P.S. The menus will probably need to have a 3D model option at some point... since flat is unacceptably flat in VR.
Title: Re: EXIT: Let there be light
Post by: Holey Moley on June 27, 2018, 12:47:36 AM
Really good Movement Patch

http://csv.swordofmoonlight.net/SomEx.dll/1.2.2.5.zip

Strikeout: I'm largely reverting this change for the time being... see next Reply for details.

This patch improves movement a lot, by a combination of discoveries and fixes. It's not so much about VR, but good movement helps with VR a lot.

The key discovery is to do 2D thumb pads, the analog data is not circular, but is actually square shaped. This kind of makes sense if the X and Y directions are independent of each other, as with the original input scheme (sometimes called tank controls I believe?)

In order to make them circular, they have to be distorted, a little bit like how the VR distorts the square input image into a bulbous one for the lenses.

I had never read about this anywhere, in all of my years, but I believe it's standard practice. I think the XInput API may do this automatically. But SOM uses DirectInput. In order to form a circle, you have to know which two axes go together, which is not at all a given. Because this change is so important, I came up with an automatic system for making educated guesses, based on the Analog Mode setting.

I am working on a manual system, that is going to use F1, since it's beside the Esc key that the Analog Mode setting currently uses. In order to do this, I removed the VR pupil distance function from F1, where it was using it temporarily for going backward. It now works just like the F3 field-of-view setting, but the PlayStation VR control pad can be used instead, by pressing its volume +/- buttons, which have been repurposed (the mute button recenters.)

EDITED: For the record, the new F1 system is going to also let the axes be rotated, in case you are like me, and your thumbs want to push inward when holding the controls. I already implemented an experimental version of this feature, but it turned out to not be viable, but works now that the pads are reshaped to move inside of a circle.

In addition to being able to move in circles (more true to how your thumbs move) this led me to discover some important oversights in the nonlinear movement extensions... these make it so turning ramps up so you can make fine turns. But also, which ducking down, it uses nonlinear movements also, since that tends to feel best. The problem with what I had done, was ironically very similar to the square vs. circle problem, insofar as I programmed for both axes being independent, but that that created a problem, which is why it would trace a very noticeable diamond in VR. I'd never been able to see the effect so clearly until inside of VR.

The fix was to combine the axes so that the diagonal has as much power as the lateral movements. At the same time, I noticed the speed limits, that affect going backward were in effect when ducking down. This was a simple oversight. The speed limits are imposed by reducing the analog values, so as a result there was less lean when leaning back, whereas the intended effect is to move freely in all directions.
Title: Re: EXIT: Let there be light
Post by: Holey Moley on July 02, 2018, 05:43:34 AM
Third times the charm / Hit a rough Patch :doh:

http://csv.swordofmoonlight.net/SomEx.dll/1.2.2.5.zip

(I deleted some posts)

I had given up on the previous patch, after spending an afternoon trying to eliminate some weird feelings I began to have about it. I posted a patch reverting to the old behavior...

Reminder: These are technically demos right now, normally I wouldn't share this sort of thing so eagerly. But as long as there is the extra latitude.

After I put everything a way, the bad experience gave way to a dumb idea to just see what happens with other approaches to mapping squares onto circles.

I felt like I understood the problem pretty well. And this (http://squircular.blogspot.com/2015/09/fg-squircle-mapping.html) looked like a good candidate to me, because the picture of the warped square looked pretty much how I imagined a joystick (a stick stuck to a ball at its base more or less) would behave.

The problem with the ball and stick approach, is our hero inside of the video game is not bowling pin. They more or less move in a circle on a plane.

With this change, walking about was immediately an acceptable experience. I still have doubts about looking about, but I think that the problems are more or less elsewhere. And future innovations can improve upon this patch. However, I feel like I'm in control of it, and I cannot say if it's better or worse, though it does feel a little different...

The real problem with looking around, having the UV axes tied together, I think has more to do with a quick snap function, where when not pushed, it quickly snaps back to not moving. This I think has to do with pushing the stick in circles, where you cross one of the center lines of the Cartesian system, and there it would have immediately snapped into place when it probably should not be doing so... I just don't understand I guess why this was never an apparent problem before now!

A fix for that seems simple, but it's hard to say if it really completely solves the problem or not. The basic idea is to ensure one is not triggering the quick snapping function as long as the other is nonzero. In addition to this, I've lessened the degree of snap.

I might have just ignored the looking about axes except that the reorientation feature I aim to add to F1 and can already be manually inputted into the INI file, relies on a circular mapping to work,  because a square cannot be spun around. I've never played a game that let me spin its thumb sticks... even though I suppose really on a PlayStation that should be a system setting. I don't know if it's because my hands are large (maybe they are, maybe they are not) but game controllers don't feel sized appropriately for my hands, and when I push my thumbs forward, they don't go straight up, like on a D-pad. So it helps a lot to rotate the sense of the sticks.
Title: Re: EXIT: Let there be light
Post by: Holey Moley on July 02, 2018, 10:07:32 PM
EDITED: For what it's worth, I've reuploaded the patch, with a fix that accounts for my confusion about the UV axes...

The fix goes, the trouble is that the "pedals" (basically they act like inertia) are able to cancel out the inputs when the directions changes from positive to negative. There is a spring-based simulation that I worked on when adding the nonlinear movement feature (u2_power) that had been misinterpreting these as as if the controller were not engaged.
Title: Re: EXIT: Let there be light
Post by: Holey Moley on July 04, 2018, 04:19:58 AM
Oops! :doh:

http://csv.swordofmoonlight.net/SomEx.dll/1.2.2.5.zip

Last patch broke the tools. I missed something subtle when consolidating some code.
Title: Re: EXIT: Let there be light
Post by: Holey Moley on July 04, 2018, 09:19:04 PM
EDITED: Oops again... broke multiple DATA folder support. Re-uploaded with fix. Lucky I noticed this.
Title: Re: EXIT: Let there be light
Post by: Holey Moley on July 05, 2018, 10:50:46 AM
Release Patch
Release Patch
Release Patch

http://csv.swordofmoonlight.net/SomEx.dll/1.2.2.4.zip
http://csv.swordofmoonlight.net/SomEx.dll/1.2.2.4.zip

This includes everything in the 1.2.2.5 demo, which is not really part of the next release.

This patch addresses a buffer overflow translating the Save Game screen, in Japanese (from Shift JIS to UTF-8.)

Also included are some nice movement enhancements of late.


EDITED: For the record, this was the result of some fix code slipped in in 2017 to improve compatibility with the KING'S FIELD sample project. It's not a problem as old as the hills, but it's not new either.
Title: Re: EXIT: Let there be light
Post by: Holey Moley on July 11, 2018, 06:13:29 AM
Release Patch

http://csv.swordofmoonlight.net/SomEx.dll/1.2.2.4.zip

Some code I thought I removed got left into the last patch, that causes weirdness when looking around, including the other axis moving on its own.

I've changed the dead zone so that related axes are tied together. I tested this before, but I think this bug may have been interfering with the tests. And I decided it was necessary after eliminating this glitch.

As a result, it's not as as easy to do a straight vertical or horizontal movement, however that's kind of robotic anyway, although it's nice I guess to be able to know you are not deviating from a straight line. It's better than getting pulled into a straight line when you don't want to be.


For the record, it feels funky to me, but I'm confident it's heading in the right direction, and can be refined down the road. I already have interesting plans for a coming F1 function, that's going to include a visualization, I believe by enable mouse trails on the cursor and momentarily using the controller to move the cursor to get a sense for its accuracy.

I can never be 100% confident when it comes to the right thumb stick, because I think "looking about" with it is a lot more sensitive than moving, and I'm not sure my right thumb is as coordinated as the left, and I prefer an inverted vertical axis, which I believe is fundamentally flawed with a thumb stick, but I cannot seem to train myself off of it. (I think inverted feels more like a rotary motion, whereas not so feels like the opposite of a rotary motion, which is not a flat motion. I think controllers should not be using mushroom shaped thumb sticks for rotary movements.)