Announcement

Collapse
No announcement yet.

RTS prototype

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

  • replied
    I am also working on something similar to this and yours look great, good job man.

    Leave a comment:


  • replied
    Upload a video that all they are walking.

    Leave a comment:


  • replied
    Originally posted by lentinant View Post
    Any notes for selection system?
    For single selection i just used a trace. For box selection i iterate through all pawns and project all bounding box points to the screen. Then i check if they are inside the box or not

    Leave a comment:


  • replied
    Any notes for selection system?

    Leave a comment:


  • replied
    Originally posted by Neongho View Post
    Nice, i would love to see the AI code

    Hey. I just followed the Mougli AI tutorial:

    Code:
    class CMAIController extends AIController;
    
    var Vector TargetLocation;
    var Vector TempDest;
    
    event PostBeginPlay()
    {
        super.PostBeginPlay();
     
        NavigationHandle = new(self) class'NavigationHandle';
    }
    
    event Possess(Pawn inPawn, bool bVehicleTransition)
    {
        super.Possess(inPawn, bVehicleTransition);
        Pawn.SetMovementPhysics();
    }
    
    function MoveToTarget(Vector v)
    {
    	TargetLocation = v;
    	TargetLocation.Z += Pawn.EyeHeight;
    	GoToState('MoveToLocation');
    }
    
    function float GetPathLength()
    {
    	//TODO
    	return 0;	
    }
    
    state MoveToLocation
    {	
    	function bool FindNavMeshPath()
        {
            // Clear cache and constraints (ignore recycling for the moment)
            NavigationHandle.PathConstraintList = none;
            NavigationHandle.PathGoalList = none;
     
            // Create constraints
            class'NavMeshPath_Toward'.static.TowardPoint( NavigationHandle,TargetLocation );
            class'NavMeshGoal_At'.static.AtLocation( NavigationHandle, TargetLocation,32 );
     
            // Find path
            return NavigationHandle.FindPath();
        }
    	
    Begin:
        if( NavigationHandle.PointReachable(TargetLocation) )
        {	
    		MoveToDirectNonPathPos(TargetLocation,None,32);
    		GotoState('Idle');
        }
    	else if( FindNavMeshPath() )
        {
            NavigationHandle.SetFinalDestination(TargetLocation);
            FlushPersistentDebugLines();
            NavigationHandle.DrawPathCache(,TRUE);
      
            // move to the first node on the path
            if(NavigationHandle.GetNextMoveLocation( TempDest, Pawn.GetCollisionRadius()))
            {
            	DrawDebugLine(Pawn.Location,TempDest,255,0,0,true);
                DrawDebugSphere(TempDest,16,20,255,0,0,true);
                MoveTo( TempDest, None,32);
            }
        }
        else
        {
            GotoState('Idle');
        }
        goto 'Begin';
    
    }
    
    auto state Idle
    {
    Begin:
    }
    
    
    defaultproperties
    {
    	
    }

    Leave a comment:


  • replied
    The path finding seems solid, good work.

    Leave a comment:


  • replied
    Nice, i would love to see the AI code

    Leave a comment:


  • replied
    Nice work!

    Leave a comment:


  • started a topic RTS prototype

    RTS prototype

Working...
X