-
-
Notifications
You must be signed in to change notification settings - Fork 992
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Teleporter] - Ensure you cannot teleport into collidable objects #8
Comments
Yeah I know, it's a frustrating one. I need to come up with a good solution. The problem with just resolving the collision and moving the play area back means you could get stuck in a situation where your play area is always colliding with something it shouldn't and then either get stuck in an infinite loop and crash or stick you somewhere you shouldn't be. I'm interested to see how other games solve this. Things like the lab do it by just not letting you teleport near walls, which is a potential solution but i just think it's a bit cheap |
Maybe as an option, like in the lab, draw the playspace on the floor at the pointers location and make the playspace boundaries unable to move horizontally through objects/walls. Green teleport is possible, red unable to teleport, and actually prevent the teleporting script from being activated when the teleport shows red ( or whatever color ). |
preventing the invalid teleport location is easy enough. I need to come up with a good way of making a generic solution to stop wall clipping. The Lab gets away with it because the levels have been designed so you can't be next to a wall. So one of the ideas is maybe an object on the floor (like an invisible floor) that is only a valid teleport location (or the opposite where there is a floor object that is an invalid location). Then you have to make your level with these floor tiles to describe where is teleportable and where isn't. Not sure how this would work with varying room scale play areas though. |
Might work. If your prevent the playspace from being outside the teleport floor tile. But I can see it becoming a problem for very complex floor layouts. |
I have a similar problem in a game I'm making, the rooms are filled with stuff like tables and whatever, and you can teleport into the tables (or at least walk into them), but then if I prevented the clipping with the table, the only place it could put me would be into an area where i could walk through a wall. Another potential idea is check if the headset object has walked into an area that you're not supposed to be then teleport you back to a good location. This way you could teleport next to a wall and that is a valid location, then if you walk through the wall (maybe with checking collisions on the headset?) if your headset collides with an object then you're just teleported back to your last valid location. It may be a bit jarring, but it would certainly be easier to implement and get around a lot of collision resolution issues with the play area. |
This might be a good place to figure out how to use the SteamVR_Fade. Another toggle for Teleport would be nice to choose between the point you teleport being the center of your playspace vs where your head is. If you have the teleport put your head at that spot - and block the ability to teleport outside of the walls of a space, then you could use the fade to turn everything black if the user tries to poke their head through the wall. |
I had a play with the headset collision stuff, it didn't work very well. Problem with just fading to black on a collision is you can just keep walking until you're not colliding and then you've walked through a wall. Even if you adjust the play space so it's not in the wall doesn't prevent you from still walking out of the play area (if you have a big enough room) and doesn't stop you putting your hand out through the boundaries and just teleporting again. I'll keep investigating solutions, hopefully I'll find one that works well (or someone will come up with one that I can just use! :p ) |
I've just played the budget cuts demo and it suffers from the same problem that you can step out of game play space into dead space. You can also stick your hand through walls and teleport. They have a pretty neat teleport idea though where it fires a ball and then you work out the collision detection on that ball then teleport with a different button. I've reached out to the dev team on twitter to see if they have any good ideas on how to resolve teleport collision issues. |
I feel like being able to show people the dark when they break the bounds On Fri, Apr 29, 2016 at 11:25 AM, StoneFox notifications@github.com wrote:
|
Yeah I agree that if your headset went black on collision your natural instinct would be to move back because you think you've done something wrong in the game world. Doesn't stop people from cheating and walking through walls. Although maybe that's just a problem that can't be solved generically and comes down to good level design? I still think there needs to be collision resolution for the play area so it can't clip objects, but making it work so it doesn't get stuck in an infinite loop of trying to resolve itself (especially for large play areas). I may look at a separate script for the headset that just fades to black on collision and you attach it directly to the headset but it doesn't do any teleport collision resolution. |
http://steamcommunity.com/games/433600/announcements/detail/847051226705749665 This is how it's now done by " A Legend of Luca " they also experimented with different options, even shrinking the room / objects & npc's down for smaller rooms, but most people didn't really enjoy playing that way. I think restricting the playarea from clipping through walls/objects horizontaly is a must for most first person games. As you said it's mostly up to the level designer to find clever ways around the fact that people can still walk / look through walls. What could be done is give the level designers the tools to prevent them from having to make rooms next to each other, and thus allowing people to walk through the wall and potentialy "break" the game. Both rules should have been completed before the teleport works ( the door must be open, and the player must stand on the teleport location ) |
That's a good idea in projecting the play space boundaries when you teleport, because then if that boundary has any collision you could potentially prevent any teleport from ever happening. I think I'm going to add that as an option because it's a neat solution. I also like your idea of making rooms far apart, I think the solution is mostly going to come down to game design. I think for it to work you'd probably need a camera on the doorway into the other room (consider Portal) so it looks like you're right next to the room. |
I was thinking and what if you walked into the wall your movement speed would be reduced to 0 the direction you are moving, that would just feel like an endless black void and would prevent you from walking across walls but would still allow backing away. Just an idea.
|
I'm not sure if you can stop the movement speed of your camerarig in the play area. I can have a tinker and see what's possible |
You are probably right, I just thought that it might be possible, if the whole controller is put into an empty game object, then it’s easier to force movement onto that game object to add the needed “resistance”.
|
I'll have a tinker a bit later and see what's possible. I'm still learning how this SteamVR plugin actually works :p |
It’s great that you are doing this, I think this can turn into an awesome plugin to use!
|
Yeah I'm hoping it helps loads of people get starting building great VR content. Hopefully it will form a good foundation for others to contribute too (or even make their own toolkits). |
This issue: #20 will be the resolution of this teleport collision issue. If you cannot teleport to a location because of collision then you don't need to resolve the player's position on collision if it "should" never happen. |
Need some way of dealing with collisions on teleport to prevent the play area allowing a user to walk into a game object
The text was updated successfully, but these errors were encountered: