Jump to content
Sign in to follow this  
outlawled

Third-Person Limiter Thing

Recommended Posts

So, I made this small mod-thing, right? And then I was gonna release it, but I was kinda worried that it was really, really stupid and nobody would want to use it and everyone would make fun of me, so I didn't release it.

But I thought I'd post here with a description of the mod and perhaps a video or two in case it's something that someone in the community would maybe want to use or would want me to develop further...or something. I dunno.

You know how when you're in third-person, you can hide behind a wall and just freelook around the corner? So you can see everything on the other side of the wall without exposing yourself? The obvious solution is to just disable third-person, but I quite like having third-person as an option...I just hate when people abuse it. So I made this mod in an attempt to solve that problem.

There are several different methods I've come up with to accomplish this. Here's a short video demonstration of one of the methods.

I wrote the code for this particular method about an hour ago and didn't spend too much time on it. This is just a proof of concept. If there's any interest, I'll develop it further. Or I can make video demonstrations for the other methods, too, I guess.

Basically, every enemy unit is set to invisible by default. The script loops every half second to check if there is a direct line of sight from the player's eye position to each enemy unit. If there is a direct line of sight to a unit, that unit is set to visible.

If you're in first-person, all enemy units are set to visible at all times. So as long as you're in first-person, the game plays exactly as it normally does.

If you're in third-person, and you're standing behind a wall free-looking around to the other side of it, any enemy units on the other side will not be visible. In order to be able to see them, you must get to a position where your character can actually see that enemy unit.

The other methods are detailed in the fourth post of this thread.

Edited by Outlawled

Share this post


Link to post
Share on other sites

The obvious problem with the first two would be the size of error. If you move your camera in 3rd person, even just slightly, it would reveal areas invisible from the original, and the player's, position. Meaning you'd never be able to go into 3rd person. With the second one... it could be interesting as it would allow 3rd person if enemies weren't around but then force you into 1st during most combat.... still it could be used as a cheat to detect enemies, so I'd veto that.

The third is a very interesting idea. I quite like it... I'd love to see an example video, because if the time taken to hide the enemy is too long you could still get an idea from it. Also it would be good if you somehow demonstrated the player's line of sight, so that enemies didn't just appear out of nowhere.

Still, the best solution is just to play first person. There's a reason most shooters are... well.. FPSers.

Oh, and no need for the self negativity! These are good ideas, I think you should just make whichever one you think has the best chance of success, test it yourself, and, if you think it works, release it into the wild and see what others think. You're thinking up some pretty abstract solutions to a major problem, which is better than most people on these forums, me included!

Share this post


Link to post
Share on other sites

Anything that helps remove third abuse has my vote.

Myself I try only to play on servers with it off but... as BIS saw fit not to include an MP browser filter to only show 3rd disabled servers.

It gets tedious joining every server to see if that regular difficulty is just because the server admin is lazy or if they have altered the servers .profile file.

As already mentioned though your second and third options are basically telling the player there is an enemy near.

So Idea #1 for me.

Its a shame BIS thought their arma series needed an "I want to see my Barbie Doll" view.

Share this post


Link to post
Share on other sites
The obvious problem with the first two would be the size of error. If you move your camera in 3rd person, even just slightly, it would reveal areas invisible from the original, and the player's, position. Meaning you'd never be able to go into 3rd person. With the second one... it could be interesting as it would allow 3rd person if enemies weren't around but then force you into 1st during most combat.... still it could be used as a cheat to detect enemies, so I'd veto that.

Thanks for responding 'n stuff, man. I appreciate it.

I guess I was a bit too brief in those descriptions of the different methods.

1) With the first method, there are a bunch of small, invisible spheres placed 360 degrees around the player. If the player is in third-person, the script will check if there's an object intersecting an imaginary line between each sphere and the character's eyes. If there's an object blocking one of the spheres, the script will check if there's an object intersecting an imaginary line between that same sphere and the camera.

If there's an object intersecting the line from Sphere A to the character's eyes but there's no object intersecting the line between Sphere A and the camera, that means that the camera can see around an object that the player cannot, so the camera switches to first-person.

It works quite well in most situations.

The main problem with this method is that it very much errs on the side of switching-to-first-person-when-it-doesn't-necessarily-have-to. If you're sitting behind a chain-link fence at just the right angle, you'll be locked into first-person...or if you're in a forest...or next to a dead, basically see-through bush... I mean, technically there's an object between the player and the sphere and there isn't one between the camera and the sphere, but it's such a small object that it's not really obstructing the player's view, so the player shouldn't be forced into first-person.

2) The second method essentially substitutes enemy units for the spheres. It just checks to see if there's an object intersecting the line between the player's eyes and the enemy unit, if there is, it checks to see if there's an object intersecting the line between the camera and the enemy unit. If there isn't, it switches the player into first-person and then places a 3D arrow at the exact coordinates that the camera was. The enemy unit will be able to see the arrow if they are looking in that direction no matter what because if the camera could see the enemy, the enemy can see the camera...or the arrow that represents the camera. This is to simulate the fact that if the player was actually leaning around a wall and was able to see the enemy legitimately, the enemy would also be able to see him.

The main problem with this method is that it can be used to determine if there is an enemy in the area. You may not be able to make out where the enemy is before you're auto-switched into third-person, but you'll know that there is an enemy who can be seen from the position your camera was just at. Of course, if they're looking in your direction, they'll now know that you're there... But still.

Another problem is that it places a 3D arrow into the world for 3 seconds which kinda breaks immersion and stuff. But peaking around a wall in third-person is also pretty immersion-breaking...

3) The third method is the same as the second, but instead of switching the player into first-person and placing a 3D arrow where his camera was, it makes the enemy unit invisible.

The main problem with this method is that the refresh rate has to be incredibly fast (pretty much on each frame), otherwise the player will be able to see the enemy for a brief moment.

Another problem is that you can still see particle effects caused by an invisible unit. So if they're shooting, you can see where they are...

Here's another option. I haven't coded it yet, but hear me out.

If a player is in third-person, any enemy unit within 500m would be invisible by default. In order for them to become visible, there needs to be a direct line of sight from the player's eyes to the enemy unit.

If the player's in first-person, though, enemies will default to visible.

So instead of hiding enemies when you shouldn't be able to see them, it hides them by default and reveals them when you are able to see them.

This would solve the refresh rate problem of method 3.

Let me know what you think. I'll write the code for it tomorrow and then create a quick video showing each method.

Its a shame BIS thought their arma series needed an "I want to see my Barbie Doll" view.

Yeah, I dunno...I like having the option to go into third-person. In certain situations, the amount of situational awareness it provides is more realistic than first-person. But that's just my opinion. In a perfect world, it'd be first-person only and everyone would have an Oculus Rift.

Edited by Outlawled

Share this post


Link to post
Share on other sites

Yer I know allot of people like having 3rd on so they can see better.

I dont think it adds more realistic situational awareness though being able to see over walls you wouldn't be able to normally etcetc.

Dont get me wrong I love arma and its been my go to game since OFP.

And when I play other FPS now I scream and rant about why they dont have a look feature like arma so you can turn your head as your walking around.

I like what your trying to do.

I just think the only real solution is to play with 3rd off.

But myself an others have been saying that since OFP :)

Share this post


Link to post
Share on other sites

Updated OP with Proof of Concept video and stuff. Sorry it took me so long, I wasn't home at all today.

Share this post


Link to post
Share on other sites

the progress with this solution is great and needed for every public match!

and something like this is needed by default

but it need to improve more in reaction time. (the unit is flashing out on the end while switching)

maybe against the unit flickering on perspective switching a transistion from black to normal or a slower "out scrolling"

is it a line of sight script with hide object?

Edited by SaltatorMortis

Share this post


Link to post
Share on other sites

This sounded good from your description but the video makes it look 1000 times better. So long as you make it MP-compatible and iron-out any gamebreaking issues, this could become a must-have mod.

Share this post


Link to post
Share on other sites

The solution in your video is exactly what I hoped for. I'd love to see this released (if people must play with third person at all XD)

BTW: Has anyone got this working with their Rift? So far I've been unsuccessful, and the only video I found was one where he'd bound it to his mouselook (not his head, freelook) so it looked f*cking retarded.

Share this post


Link to post
Share on other sites

First off AMAZING mod friend seriously!!!!!!!!!Jeeez and again why BI why?? Dayz is having a hard time choosing to go 3rd or 1st person with Rocket choosing something along the lines of going prone puts you back into 1st person only which leaves the standing cheats still lingering.Someone should mention this to him.;)

Share this post


Link to post
Share on other sites

This looks rather impressive, but I'd still rather just disable 3rd person on servers that are supposed to have serious PvP play for 3 reasons:

1. This still allows you to see stuff you would otherwise not be able to see, as someone who would just have a body part visible in 1st person may be fully visible in 3rd person.

2. Performance-wise this just doesn't sound right. And even if the "only every 1/2 a second" still works well with a large number of units around, it can still cause problems with units appearing and/or disappearing at the wrong time.

3. It can be rather confusing and just cause even more complaints that if you just disabled 3rd person on your server.

In the end, I've seen people complain about no 3rd person, but they always end up getting used to dealing with it. After all, the game is perfectly playable without 3rd person, and is much more serious and competitive that way.

Share this post


Link to post
Share on other sites
and is much more serious and competitive that way.

well i wouldn't call it "serious". it's a game. it's for fun. but lots of people instantly whine about no 3rd person and totally miss how immersive the game can be in 1st person. PvP feels so right with the new movement and gun handling from 1st person view. it's so hard to watch wasteland videos. you'll see the 3rd person exploits in every single one of them. it's beyond me how people can like it that way in a purely PvP centered game mode. but that's what happens when it's all about the grinding (kills, loot whatever)

Share this post


Link to post
Share on other sites
that solution is great! i guess you are using hideobject http://community.bistudio.com/wiki/hideObject ? it's perfect since it's local. seems like your "thing" is working great. time to give it a good name and release a first version so people can find things so you can make it perfect :)

Hey, thanks!

Yeah, if hideObject wasn't local, this would not work at all, so that's pretty fortunate.

Hopefully I'll release a beta version some time this week for some testing and feedback, and if that goes well, a full release will follow shortly.

the progress with this solution is great and needed for every public match!

and something like this is needed by default

but it need to improve more in reaction time. (the unit is flashing out on the end while switching)

maybe against the unit flickering on perspective switching a transistion from black to normal or a slower "out scrolling"

is it a line of sight script with hide object?

Thanks!

Yeah, I'll definitely work with reaction time and all that stuff to make it more streamlined.

And yep, that's pretty much it. Just checks to see if your character's eyes have a direct line of sight to the enemy unit and if they don't, it hides them.

This looks rather impressive, but I'd still rather just disable 3rd person on servers that are supposed to have serious PvP play for 3 reasons:

1. This still allows you to see stuff you would otherwise not be able to see, as someone who would just have a body part visible in 1st person may be fully visible in 3rd person.

2. Performance-wise this just doesn't sound right. And even if the "only every 1/2 a second" still works well with a large number of units around, it can still cause problems with units appearing and/or disappearing at the wrong time.

3. It can be rather confusing and just cause even more complaints that if you just disabled 3rd person on your server.

In the end, I've seen people complain about no 3rd person, but they always end up getting used to dealing with it. After all, the game is perfectly playable without 3rd person, and is much more serious and competitive that way.

1.) Actually, the way it works right now, you essentially have to see more than half of someone for them to be visible in third-person. So even if you can see their left arm in first-person, they'll be invisible in third-person.

2.) I tested it with around 30 AI and didn't notice any performance issues, but I will definitely do a much more in-depth performance test once I write the full script.

And yes, there may be some situations where units disappear at the wrong time, like in cases where only part of the enemy unit is obstructed, but it will only ever err on the side of hiding enemy units when you technically can see at least part of them. So you'll never be able to see a unit in third-person that you wouldn't be able to see in first-person, you'll only ever not be able to see a unit in third-person that you can see in first-person. Also, an enemy unit will never be invisible if you can see 100% of them.

As long as you're in first-person, you don't have to worry about being lead astray. And regardless of what perspective you're in, you never have to worry about other players seeing you when they shouldn't be able to.

3.) Yeah, maybe some people will be confused and I'm sure most, or perhaps all, server owners will opt not to use this mod, and that's totally fine, but options are nice. And you know, maybe someone smarter and better at programming and more attractive and just a better person in general will be inspired by this mod and come up with a way better solution.

Share this post


Link to post
Share on other sites
And yes, there may be some situations where units disappear at the wrong time, like in cases where only part of the enemy unit is obstructed, but it will only ever err on the side of hiding enemy units when you technically can see at least part of them. So you'll never be able to see a unit in third-person that you wouldn't be able to see in first-person, you'll only ever not be able to see a unit in third-person that you can see in first-person. Also, an enemy unit will never be invisible if you can see 100% of them.

that's actually good point and exactly how it should be. this basically disables 3rd person as a good combat option in CQB while keeping everything else that is good about it. like checking out your own butt and stuff ;)

And you know, maybe someone smarter and better at programming and more attractive and just a better person in general will be inspired by this mod and come up with a way better solution.

nah you can't be super handsome AND a master coder. that would make the universe implode.

anyways. in all seriousness. the more i think about this, the more it makes sense. 3rd person will still be useable for combat but in CQB and all situations where visual obstruction is a factor it will be the worse option. perfect in my opinion.

Share this post


Link to post
Share on other sites
you can't be super handsome AND a master coder

I beg to differ. (though master might be being a little generous) ;)

Share this post


Link to post
Share on other sites

Hey, guys. Quick update 'n stuff.

Um. So I haven't been working on this at all this last month...school started up again, and I was busy updating Mag Repack, and some other things happened that aren't important.

Anyway, I finally had time today to work on it, and I was wondering if any of you awesome dudes would like to test it out for me and give me all of the feedbacks.

I've run into some problems today (not so much with coding or anything, just the main concept, no biggie) which I will outline below.

1.) Walking past fences and other objects that have a lot of thin portions just make all the units on the other side flicker a bunch and it's kind of annoying... This probably wouldn't be too big a problem in an actual game because the player would likely be in first-person in a close quarters combat situation, or once they see the enemies, they'll change to first-person...I dunno. I'm not sure if this will be a huge issue or not.

2.) The script creates an array with all the units in a 500m radius and checks to see if the player can see them 'n stuff, right? That's all good and well, but lots of times, you can't even see someone beyond, like, 200 meters anyway (in vanilla) if they're camouflaged well and aren't moving and such. So, if you are in third-person, behind a rock, the enemy will be invisible. If you move away from that rock and now have a line of sight to the enemy, the enemy will become visible. Unfortunately, it's not a smooth transition...they just pop into existence which draws attention to them...which kinda ruins the whole point.

To fix this problem, I've made it so that there's an inner perimeter as well as the outer one. All units within the outer perimeter (500m currently) are added to the array of units to be checked by the script. It then does some other checks (e.g. whether that unit is on the same side as the player, if that unit is a civilian, etc.), and then it checks to see if that unit is within the inner perimeter (100m), if he is, then the script acts normally (making him invisible unless the player has a direct line of sight), if the unit is not in the inner perimeter, the script checks to see if that unit is moving, if he is, he's treated normally.

So, essentially, any non-moving units further than 100m away from the player will remain visible at all times.

Any units within 100m will be set to invisible by default, and only shown if the player has a direct line of sight (from the player's eye position to the unit's eye position).

Any units between 100m and 500m that are moving will be set to invisible, and only shown if the player has a direct line of sight.

The nice thing about this is that you won't likely notice the far away, non-moving units, and the units that are moving will have their movements concealed.

It's not a perfect solution, but, you know...it's a thing.

Personally, I'm starting to just prefer first-person only. I mean, it is super nice to be able to look at my ass on occasion in third-person because, I mean, have you seen my ass? Fugetaboutit.

But the movement mechanics have improved enough in ArmA 3 that first-person isn't unbearable at all.

Also, another thing of good news is that I haven't noticed any drop in performance whatsoever. (I tested it with 140 enemy units all within that 500m outer perimeter).

The script runs in a loop, obviously, and the refresh rate is dependent on whether or not the player is in third-person. If he is in third-person, the refresh rate is 0.5 seconds (meaning that the script will iterate through the entire list of units within that outer perimeter every 0.5 seconds), and if the player is in first-person, the refresh rate is 0.05 seconds.

It's basically:

while {alive player} do
{
if (cameraView == "EXTERNAL") then
{
	// do all of the things
	sleep 0.5;
}
else
{
	sleep 0.05;
};
};

So, yeah, let me know if you want to test it.

Edited by Outlawled
Emphasized a word. For emphasis.

Share this post


Link to post
Share on other sites

I found this in the forums a while ago:

while {true} do {
 sleep 0.1;
 waitUntil {((cameraView == "External") and ((vehicle player) == player) and alive player)};
 (player switchCamera "INTERNAL");
};

Share this post


Link to post
Share on other sites
I found this in the forums a while ago:

while {true} do {
 sleep 0.1;
 waitUntil {((cameraView == "External") and ((vehicle player) == player) and alive player)};
 (player switchCamera "INTERNAL");
};

This is a terrible solution. If you want to completely disable 3rd person just disable it on server settings. Yes, it does allow the flexibilty of having 3rd person in vehicles, but 3rd person in vehicles isn't exactly fair either! You can use it to cheat just as you use infantry 3rd person. Also, you can still abuse this in infantry as the tiny delay makes you still able to see around corners or above walls in many situations.

Share this post


Link to post
Share on other sites

@Outlawed: that all sounds pretty good. i like how you solved the pop up problem. i wouldn't worry too much about tiny inconsistencies since the point is to make 3rd person the worse option for combat. so while i prefer to play in 1st person overall not only for competitive but much more for immersion reasons, i see this nicely filling the gap fro inbetween. good job so far. PM me if you need some testing.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×