Announcement

Collapse
No announcement yet.

C++ climbing and vaulting system

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • replied
    Thanks Alex3d!!! I'll study your system as soon as get a copy, and share my progress here

    Leave a comment:


  • replied
    Originally posted by Horus View Post
    So here's my concern:
    [ATTACH=CONFIG]11441[/ATTACH]
    You see what the problem is? Your system will only detect offseted ledges, just like Alex's.
    My system detects your number one concern, Horus, as you can see here: https://www.youtube.com/watch?v=1TjnWZhGyG8#t=173 ( minute 2:55 )




    Aragonath, you could wait a little more and grab a copy of my system, and convert must of it to C++.

    Leave a comment:


  • replied
    Great!!! Thanks for the code Master Kyp, it will be very helpful, I'll give it a try, although it would be awesome to create a procedural climbing and vaulting system like Alex3D's one, in case someone is interested, we could team up to make it real. thanks for all the help and advices!!

    Leave a comment:


  • replied
    Originally posted by Aragonath View Post
    First of all, Thanks for your responses!! @Horus: I've based part of my code in Alex3D's climbing system, so, that's why the offseted ledges part, and @Master Kyp, that approach is very interesting, I would like to know which one would be the best and more efficient way, and according to that, I'll start the programming phase, and all tips and advices are welcomed!!!
    The nice part of programming is there really isn't a wrong way to do it. There are only more efficient ways of handling things. I personally would go with the idea of a volume-box that recognizes an actor in the area so long as a particular button is held.

    I believe this to be much more modular due to the fact that you could scale it in any way you wanted or shape it to specific ledges. The down-side to it is you'll want to place this on every conceivable ledge so for procedural generated terrains and maps you're going to run into an issue.

    Whether you use a mesh or actor or honestly anything so long as it fits your needs then it doesn't really matter in the end.

    Here is a quick RayTrace example to get the name of an actor. Simply use this function and name the actor whatever you want in the editor. This way if you can just make one, copy and paste it over and over and shape it however you'd like. This should help to get you started.

    ((P.S don't mind the messiness of the code! Organize it how you'd like. ))


    Code:
    FString * AProjectX2Character::GetName()
    {
    
    	FVector CameraLoc;
    	FRotator CameraRot;
    	GetActorEyesViewPoint(CameraLoc, CameraRot);
    
    
    	FVector StartTrace = CameraLoc;
    	FVector EndTrace = CameraLoc + (CameraRot.Vector() * 5000);
    
    
    	static FString testString;
    
    	FCollisionQueryParams TraceParams
    		(
    		FName(TEXT("GetName")),
    		false,
    		this
    		);
    
    	FHitResult HitResult;
    
    	if (GetWorld()->LineTraceSingle(HitResult, StartTrace, EndTrace, ECC_Visibility, TraceParams))
    	{
    
    		AActor * ActorTest;
    
    
    		if (HitResult.GetActor())
    		{
    			ActorTest= HitResult.GetActor();
    
    
    			if (HitResult.GetActor()->GetName() == "TestingName")
    			{
    				testString = HitResult.GetActor()->GetName();
    			}
    
    			else
    			{
    				testString = FString("Nothing");
    			}
    
    		}
    
    		else
    		{
    			testString = FString("Not an Actor");
    		}
    
    		GEngine->AddOnScreenDebugMessage(-1, 5.0, FColor::Red, FString::FString(testString));
    
    
    		DrawDebugLine
    			(
    			GetWorld(),
    			StartTrace, // Start Trace
    			HitResult.Location, // Hit Result Location
    			FColor(255, 0, 0), // Red
    			false, // Persistent Lines
    			5.0, // Time
    			0, // Depth Priority
    			5.0 // Thickness
    			);
    	}
    
    	return & testString; // return the address 
    }

    Leave a comment:


  • replied
    Originally posted by Aragonath View Post
    Well, Thanks Horus, I'll share any update in the code I'll write. A quick question, ¿how can I attach my character to the ledge location?? I read something about a function called "setBase" in Udk, but I can't figure out how to use it.
    Attach your actor to the mesh actor keeping the relative offset

    Leave a comment:


  • replied
    Well, Thanks Horus, I'll share any update in the code I'll write. A quick question, ¿how can I attach my character to the ledge location?? I read something about a function called "setBase" in Udk, but I can't figure out how to use it.

    Leave a comment:


  • replied
    @Aragonath- Assassin's creed uses an actor placement system, of this I'm 99% sure. Procedural tracing is the best way no doubt, but also the more complicated... in that field, I'm pretty sure I can't help you a lot, maybe alvarofer0020 or Master Kyp can, and I'll use their tips to learn as well ^^

    Leave a comment:


  • replied
    @Horus: I used that approach because was the only one I found as a guide, and it was just for learning proposes, but thanks for that tip!!!! @alvarofer0020: The procedural tracing method is what I was Aiming from the beginning, but Master Kyp's idea is a really good option in case the procedural one fails. I'm trying to emulate Outlast's gameplay, the vaulting and climbing system isn't as complicated as Mirror's edge or Assassins Creed, ¿How would you guys do this???

    Leave a comment:


  • replied
    True,but while it can be a good thing having a dynamic approach,it can also be too much,meaning glitches,acessing areas you're not supposed to,and so on. I am a fan of procedural as well,but I'm not sure about it...
    Anyway how would you do it alvarofer0020?

    Leave a comment:


  • replied
    Id rather use a procedural tracing method, by the end of the day if you use custom actors its going to be much more limiting than a procedural solution, meaning every object that looks that can be vaulted or climbed , it will be able to , Im nearly sure mirrors edge used mostly traces for its movement system ( not completly sure ) But it worked perfectly for them

    Leave a comment:


  • replied
    @aragonath- i think its a bad approach to use offseted only,though it is easier.you should ask rama or a epic programmer to see which appoach they would take

    Leave a comment:


  • replied
    First of all, Thanks for your responses!! @Horus: I've based part of my code in Alex3D's climbing system, so, that's why the offseted ledges part, and @Master Kyp, that approach is very interesting, I would like to know which one would be the best and more efficient way, and according to that, I'll start the programming phase, and all tips and advices are welcomed!!!

    Leave a comment:


  • replied
    @MasterKyp- If you want to go with specific name meshes then well I think I have a simpler and more effective way:
    Make a collision box in front of your player, check when it collides with LEDGE_ACTORS, and from there take the behaviour. Actors are better than named meshes because they are more generic and can be used on just about anything. Not only that, but you can program to take multiple options through the editor, such as one-sided vault, two-sided vault, drop and roll, drop and fall,etc. Its the same as mesh naming, but a tad more dynamic and scalable.
    This way there is no need for continuous raycasting each tick.
    I would love to hear Rama's opinion on the best way to do this.
    Last edited by Horus; 09-12-2014, 08:08 AM.

    Leave a comment:


  • replied
    I think the best way in handling this would trace for specific names so it grabs on to specific ledges by name. That way it's much more modular in design and can be changed in size or variation for whatever suits your need.

    Typically when detecting ledges on objects you'll run into what Horus mentioned. Not only that but... I mean if you make a modular system your lower end programmers(If you have any) will be much more happy with you in the future.

    Outside of that yeah i'd just handle it by calling custom animations from a function to really give that appeal and of course depending on the name of the object it's traced will determine the type of animation to see if it's a vine or concrete, ect, ect. Then of course use anim_montages to play the proper particle effects for dust falling or whatever additional effect you might want.

    Leave a comment:


  • replied
    So here's my concern:
    Click image for larger version

Name:	algorithm.png
Views:	1
Size:	31.0 KB
ID:	1056607
    You see what the problem is? Your system will only detect offseted ledges, just like Alex's.

    Leave a comment:

Working...
X