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.

 
 

Author Topic: Cool new look down/up feature!! (Maybe VR progress?)  (Read 1040 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: December 06, 2018, 12:57:25 PM »

I had an unexpectedly interesting afternoon yesterday after I happened upon a VR article (https://www.roadtovr.com/vr-expert-to-oculus-rift-devs-make-sure-youre-doing-3d-right/) that recommends skewing the projection matrix that each eye uses...

That said, most of the comments say that this is not correct for their Oculus brand sets, and so I'm not positive it's right for PlayStation VR. I've written the person who is the subject of the article. It suggests that they say the Oculus does implement this in its proprietary driver set. But that's just an optimistic reading of their quotes.

What I can say is following the links here (https://web.archive.org/web/20170924184212/http://doc-ok.org/?p=77) and here (https://web.archive.org/web/20170919095247/http://www.orthostereo.com:80/geometryopengl.html) leads to some code that was enough to make it clear what is recommended. But it doesn't seem to provide an explanation of why this approach is correct...

What I can say is, it felt much better to me, and looked more correct, especially in places that had looked artificial to me before. By feeling better, I mainly mean that every time I can remember moving around with the controller while standing up wearing the VR helmet my legs would go wobbly, especially at the take-off. I didn't feel that any longer with this modification. It's possible I imagined the whole thing. But there seems to be something to it, maybe.

Something I wrong was I glossed over the "frustumshift" formula on the page with code, thinking that the screenZ part was farZ instead, since taking the near/far ratio is pretty common for setting up projection matrices. I wasn't going to use the screenZ part at first, but by doing this, my first experience was as if the "screen" was at the very back, on what is called the far-plane, which for SOM is the map's draw-distance.

I haven't yet played with this. I intend to today. My plan was to set the screen on the near-plane. Which is the closest you can anything. I don't actually know what the screen represents. I think for a "CAVE" system it is the screen on the wall. Maybe for goggles its the lens, but I don't know. If it's the distance of focus, it could be a good way to get started with adding focus to the VR experience... that is to focus on what is the average distance in the middle of the screen.


Strike-through: As memory serves me this line of research did not prove conclusive so I don't recommend reading this block of text. I ultimately gave up on it, and probably imagined any positive effects.

But something I noticed yesterday, is only tracking the direction rotation wise doesn't really feel right when looking down, because our heads are stuck onto necks, and our eyes aren't in the middle of the neck, and they don't just roll down to look down! Why this looks funny is you feel like you should be looking down at something, but instead its further out beyond your head, and so you see the side of it at a shear angle instead of the top. Like a headstone (a familiar sight in King's Field) for instance. Because your body in front of it, you cannot look down at it, without climbing on top of it, like an idiot...

Which is actually how it is without VR too, but you don't notice it so much, because you notice a lot in VR you don't notice otherwise. Which is why I believe if nothing else it's a very good tool for artists. Like I recently noticed that the terminals in the save room in KF2 are actually hovering 0.125 meters off the ground!


Well, I haven't begun to try to do an effect like this for VR. But I thought about how it might be done, and instead quickly mocked something up for without VR. This turned out to actually be a very interesting feature, that I believe will be in the next release, and will be a part of KF henceforth...

The feature is really very simple, and I guess it was not obvious to me, or required some thinking outside of the box. I've long wanted a way to see below ledges. I thought before that it could be implemented with a guardrail style system, but have long had reservations about guardrails too. Although I very often wish I had them, so that I can walk around more focused on scenery than my feet in the games!

Currently it's possible to look below ledges by ducking down, since you can't move then, and so you can freely lean out over the edge. So there is something you can do while ducking you cannot do while standing. It's not good to have that of disparity. And so I feel very motivated to rectify this.

The way the new feature works is you just look down. And where before if you look down far and let go it would pull you back up to a middle angle, just like pushing off walls, etc. Instead, once you get into that extreme looking down angle, it begins to transition to leaning out, and in order to still be able to see your feet, it's made possible to look down further than 90 degrees at the extreme.

It's also possible to look up, but is not nearly so extreme. Only because necks/backs are not so limber in that direction. Still, if you found yourself at the mouth of a cave that exits into a chasm, you can look up at the wall outside the mouth. So that you can freely look everywhere. The most dangerous place to look would be to the sides. I don't have system for that quite yet. With VR it would work to just look sideways.


The quick job I did of it today feels okay but has some discontinuities in places, when doing unusual transitions. It doesn't work with the Action button. It wasn't supposed to work when squatting down, but for some reason or another it does a little bit... I think I know why. But it's kind of interesting, because this can be a way to initiate a crawling mode, which would be just like squat-walking, but even lower to the ground. This system provides a visual cue that your head is looking down close to the ground when ducking in other words. It looks like your ready to start walking on your hands, or might turn your head to listen the ground. Which would be a pretty cool feature.

It also has problem with clipping if something is in front of you. I still have to work out these kinks. It will probably start to feel a little bit better after a few releases out.


For what it's worth, I think VR could benefit from showing the character's feet. It would help to have a basic sense of a body. If so I'm thinking that the feet could only appear when looking down like this. In VR you can look anywhere, and so it might be hard to control. But what I mean, is when running I think you cannot quite look down far enough to see your feet. And maybe that's a good thing. It would mean that they don't have to be animated most of the time. And the same can apply to walking also.

In general I don't like the idea of seeing things in front your view. I think it cheapens the experience. I want to not have anything obstructing my view. The reason I think feet might help VR is because I think without feet the brain might expect to see its own feet. But I'm hoping if there are feet there it will accept them, and maybe even be happy with a character that is not the same height as the audience. Plus, in my own time with it, I just feel like feet would help when I look down. I can't explain why. Maybe it would just be a reminder that there is a character there.
« Last Edit: June 07, 2019, 10:26:27 PM by Holy Diver »

Holy Diver has 2452 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: December 07, 2018, 05:00:17 PM »

Follow-up: I had a pretty miserable evening yesterday of working on making this feature not clip through walls. I stayed up too long, but lucked out by the end of it.

These things are tricky to implement, since SOM is a polygon soup approach to clipping. Make no mistake, I like this about SOM very much. But it is trying.

What I ended up with was a combination of suppressing the feature when pressed up against walls, combined with suppressing it when there is not enough clearance in front of your character to bend over.

I think it needed both, but I might go back and reevaluate. Trouble is it doesn't kick in until you start looking down far enough (or up, but that is much less of a problem.)

Blending these suppressing conditions together was just a matter of dumb luck. It has to look smooth. I just experimented with many ways, and eventually got lucky. I was relieved because the experimentation process was not fun.

The need for clearance does not cover the entire body, leaving up the possibility of standing over things like a table in front of yourself. It would have been too complicated to try to expand the body size anyway, and I don't think it needs to be any larger than it already is, since it's just a circle/cylinder.

The clearance distance to make it work is exactly an equal sized cylinder placed in front, half way so they overlap equally. Other sizes just don't work. Probably because the clipping code (now) ignores things that have a center on the opposite side of the wall. It needs to be constant because there can't generally be feedback in these systems or they just twitch unpleasantly.

As an accident, the ability to look all the way down (or even further) is not suppressed with back against a wall. It doesn't lean forward, but you can still look down. I left it this way, since I think if you were really walking a ledge with your back against a wall, you wouldn't want to lean forward anyway, and if your weight is pressing against the wall, it can't really be going in both directions (i.e. butt against the wall, leaning forward) simultaneously. I mean, it can, but it would suggest more freedom than is otherwise accommodated by the other features. I think losing the ability to look down at your feet, on the ledge you are walking would be bad...

Prior to this feature it wasn't really possible to look that far down. You can see your shadow in the bottom half of the screen... but not the center. It lets you see more of your surroundings. Incidentally, anything less than 45 degree zoom sees through the wall. I suppose that requires work. I've gotten used to higher settings, even though I don't like how they distort tall/high structures. I like having the option to switch to lower zoom settings, if only for sightseeing.


I have to add objects and NPCs to the clipping regime. I guess they will all have to be considered. I don't think I've ever done a custom NPC clip test before. For some reason it barely passes through KF2's lighthouse. I'm not going to try to fix it. I think there must be something about its clipping geometry that is unique/warrants investigating.

It looks good on KF2's jagged cave walls. I changed the sinusoid function to look smoother. It makes the transition less obvious. I liked the original's qualities, because it kind of pushed against the wall, and also the ground, because it started on an upward trajectory instead of a flat part of the curve. I tried different options, and went with the smoothest one overall. It is better that way overall, for just looking up and down in the range that does not spring back.

If I ever get to adding SIXAXIS support I'm certain that outside of menus turning the controller sideways will be used to look around corners. Unfortunately there is no way to do that with the regular inputs. Face tracking is another option. I think turning sideways is the only input that would be reliable enough, since it can accurately gauge the pull of gravity. Everything else is only suitable for gestural inputs. Note, you can just walk around the corner, except for when there is no floor, and so you would fall if you do so. Which is what I'm really talking about, I guess. It's possible to see around corners, but not without ducking down.


P.S. I did more work with that VR business yesterday. I found an error in my code that suggests at least part of the time I was imagining any perceived benefits. So I've even more doubt. In VR the cliffs seem very underwhelming. Maybe it's because you can see them in their entirety up close. They feel like a two story house at most. I don't know if it's a problem with VR. Depth cues are very hard to reason about in VR. I mean from a development perspective, I'm always doubting it I'm doing everything correctly or not. I've put out another call for help in this (https://www.reddit.com/r/learnVRdev/comments/a4153r/skew_matrix_beneficial_or_detrimental_projection/) and another Reddit channel via crossposting.
« Last Edit: December 07, 2018, 05:20:31 PM by Holy Diver »

Holy Diver has 2452 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: June 21, 2020, 02:59:31 AM »

1.5yrs later... (damn)

Off-topic: Just while I'm sharing (which ties into this post, but I don't have another place to file this info) at one point yesterday I realized a simple way to add a rotation effect to climbing would be to reuse the bouncing effect from jumping/hitting the ground, and set about working on it, and while I was gauging the feel of it I realized that I'd adjusted the non-rotational effect for my KFII project because it uses the original 62 degree vertical field-of-view, so my comparisons between other projects (KFII doesn't really have any 0.5m platforms like most SOM projects have) were meaningless...

So I finally broke down and worked on making these bounce effects adapt to the field-of-view, which is important because they need to feel right more than they need to be accurate to any kind of real life movement, and feeling is weird when you're stuck to the very narrow FOV of a monitor. This wasn't actually hard to do, but I'm still torn on the extension strategy I've deployed and wonder if I'll regret it later.

I also used this opportunity to reduce the rotation if you're looking up or down and increase it somewhat if looking up at a slight angle, this helps to make the effect feel the same regardless of the angle you're at. Because the effect for a while has just been set at a one-size-fits all setting that doesn't really serve the extremes very well I was able to make the effects more/less dramatic at the extremes.

On-topic: Meanwhile, since I was playing with climbing to test this stuff I identified some issues with the new system that is the subject of this topic/thread. I think I've improved it some, but it still has some fighting issues that only seems to happen with cylinder shaped objects, which I have to figure out (address or get to the bottom of) or just accept for the time being.

While I was doing this I recalled that I had an idea just a little while back to make an alternative way to interact with the simple containers and dead body type objects, and I realized that what it demands is essentially identical to this feature, so I put two-and-two together and am now thinking of them as related somehow.

So my eventual goal is if you look down like this over these types of objects they'll behave as if you pressed the action button on them. But I'm not yet certain if they will open the "take item?" prompt or if they will just display the name of the item in real-time like the "empty" message is displayed. If so, I suspect you would not automatically retrieve the item, but I'm not sure yet...

But I have some ideas because I'm trying to make it work when crouching too, in which case you must hold down the action button, and so can't press it to actually pull up the prompt without standing back up. I think I'd already considered something like this contingency before and am planning to make taking items have a way to use the direction controls to pull the item closer that will eventually take the item and close the screen out. This frees up some buttons for important reasons. I can't remember the reasons, but one of them might be this crouching example.

My rationale for needing an alternative way to do this interaction is two-fold: 1) pressing the action button makes you duck a little, which can look neat for picking up money and things, but it generally strikes me as inappropriate for the abstract interaction of retrieving items from sealed barrels for example; 2) with walls it's possible to press against the wall, and assuming it's not a ledge, you can activate it (e.g. a secret door) without climbing on top of it, however for empty barrels doing this currently will either pull up the take item prompt or climb onto the (empty) barrel, so you have to make sure you're not pressing against it, plus, in the future climbing will override the prompt.

So the alternative way just removes these additional steps and seems better suited to the interaction. I just have to figure out the semantics. A lot of this will tie into making SOM behave more like King's Field II (by default) which I find to be a more elegant system, in almost every way. In that case instead of a prompt the items will probably raise up and either the direction controls will interact with them or the attack buttons will act as confirm/cancel or both.

I'm sure eventually it will be made to use the attack buttons in menus. That's just more modern and less confusing. (I'm actually more inclined to use the attack buttons for the "take item" prompts but I'm a little hesitant to make that switch since it's very different from how things have been, but using the action button for everything is often ambiguous, but I don't know if switching to attack buttons for menu interactions will necessarily mean using them more outside of the menu system. What I do know is while using the direction buttons would be neat, and possibly a welcome addition, it'd be clumsy if the direction buttons are used to interact with the containers, meaning that you must let them return to neutral first and upon leaving the prompt the old directions aren't retained. I also wonder if this behavior will eventually extend to "items" sitting out in the open too.)
« Last Edit: June 21, 2020, 03:11:02 AM by Holy Diver »

Holy Diver has 2452 posts