Download Skyline video tutorials for offline viewing.

Navmesh Tutorial

Navmesh Tutorial

Postby SolarPortal » 23 Jan 2016, 17:06

Hey,

Well, that was no fun lol :P After recording for a half hour and another 30 mins to review, the first one was not good enough. Tried to edit and installed movie maker and i believe it broke the mic audio. So i started and recorded the next video for 26mins without any mic audio and i thought i did quite well as well lol oh well .... :(

So you have a video tutorial designed with audio, but has no audio and could have been done in 10 mins for this level of tutorial.
again oh well....

heres the video:



Note: Its processing but it is HD

Here are some of the points i made for myself when discussing on the video:

  • The first part of the video is to show how quick it can be done to get characters moving on the navmesh.
  • The second part of the video when the scene is closed and start working on another skyline copy from scratch is showing how to do it from scratch.
  • The third part of the video is with the RoyalSorceress character and the Mesh Editor explaining about Pivots and how they can affect the agent.
  • Navmesh Agents are the controllers for the Entities that are moving. They are controlled by the navmesh and are told to go along the path line that is got from the setDestination().
    With the cube which is non physical, it has its position "set" each frame to that of the Agents(green wired sphere).
    With the SCC or DCC, the agent moves in front of the character and slows to let the character keeps up. The character is moved by the physics engine to follow the agent.
  • The agent is the sphere around or in front of the SCC.
  • The scene has characters that use SCC's(Simple Character Controllers) and also a non physics cube.
  • The same code can work for SCC and non physics entity.
  • For DCC's(Dynamic Character Controller), you have to use navmesh.addDCC(dccID); instead of navmesh.addEntity(obj);.
  • Single nav mesh creates a navmesh over all surfaces and you do not have the ability to reload or delete specific areas.
    It is generated on load and is not stored in a file like the Tiled nav mesh is, but it is fast to generate.
  • Tiled Nav mesh uses a grid based system that gives you more flexibility on how you use the navmesh.
    For instance, you can remove tiles in areas that the AI cannot go or you don't want them to walk in
    and you also have the ability to reload certain grid tiles which is great and quick for once you have edited an area
    or in your game you have a closed door that opens. Reload the navmesh to et the characters through. Makes sense.
  • Currently there is no turn speed.
  • The Grid resolution is for controlling the size tiles that are generated for the Tile Based Navmesh, lower numbers
    will increase the resolution of the navmesh built for areas that are small but have a lot of height in the area to be ran on.
    Smaller resolutions will use more memory though.

Here is the script for an SCC character. It can be used on characters with no animations as well.

Code: Select all
obj = 0;
function onInit(objID)
   sky.lprint("LUA: Script Active!");
   obj = objID;
end

function postInit(objID)
   navmesh.addEntity(obj);
   navmesh.showAgentDebug(obj, 1);
   navmesh.setAgentMaxSpeed(obj, 5);
   
   pos = newType.vec3(entity.getPosition(entity.getIDFromTag("EndPoint")));
   
   lprint("pos: x: "..pos.x.." y: "..pos.y.." z: "..pos.z);
   navmesh.setDestination(obj, pos.x, pos.y, pos.z, 0);
   lprint("anim: "..anim.getFromMap(obj, "Walk"));
   anim.playAnimation(obj, anim.getFromMap(obj, "Walk"), 0, 0);
end

function onUpdate( timeDelta )
   if( navmesh.isDestinationReached(obj) == 1)then
      lprint("Reached Destination!");
      navmesh.setAgentControlled(obj, 0);
      lprint("anim: "..anim.getFromMap(obj, "Idle1"));
      anim.playAnimation(obj, anim.getFromMap(obj, "Idle1"), 30, 1);
   end
end



Sorry for the rant and i hope you find it useful..... :)
Skyline Game Engine - Lead Dev.
Please provide as much info as possible when asking for help.


Specs: OS: Win 10 64bit, CPU: Intel i7 4770 3.4ghz x 4 core(8 threads), GPU: Nvidia GTX 1060 6GB, Ram: 16gig DDR3, Windows on 250gb Samsung Evo 860

Twitter: @SolarPortal
Instagram: @SolarPortal
User avatar
SolarPortal
Skyline Founder
Skyline Founder
 
Posts: 3631
Joined: 29 Jul 2012, 15:56
Location: UK
Skill: 3D Modeller
Skill: 2D Artist
Skill: Programmer
Skill: Level Designer

Re: Navmesh Tutorial

Postby CreativeOcclusion » 23 Jan 2016, 19:50

Thanks for the video...Without sound I will have to study it for a while...maybe I gave the wrong advice for the sound...Anyways, thanks for taking the time to make it, and I will put it to good use...
Thanks, CreativeOcclusion
User avatar
CreativeOcclusion
Skyline Warrior
 
Posts: 366
Joined: 22 Jun 2015, 19:34
Location: Texas

Re: Navmesh Tutorial

Postby SolarPortal » 23 Jan 2016, 20:08

lol, yeah... It still shows all the practices for using navmesh, but may take a few watches :)
The audio was working fine on the first recordings, but the last video was just a shame hehe :P
Skyline Game Engine - Lead Dev.
Please provide as much info as possible when asking for help.


Specs: OS: Win 10 64bit, CPU: Intel i7 4770 3.4ghz x 4 core(8 threads), GPU: Nvidia GTX 1060 6GB, Ram: 16gig DDR3, Windows on 250gb Samsung Evo 860

Twitter: @SolarPortal
Instagram: @SolarPortal
User avatar
SolarPortal
Skyline Founder
Skyline Founder
 
Posts: 3631
Joined: 29 Jul 2012, 15:56
Location: UK
Skill: 3D Modeller
Skill: 2D Artist
Skill: Programmer
Skill: Level Designer

Re: Navmesh Tutorial

Postby CreativeOcclusion » 23 Jan 2016, 20:15

SolarPortal wrote:lol, yeah... It still shows all the practices for using navmesh, but may take a few watches :)
The audio was working fine on the first recordings, but the last video was just a shame hehe :P


No problem...I didn't expect you to get it done so soon...I will figure it out but may have a few questions...As always...Thanks
Thanks, CreativeOcclusion
User avatar
CreativeOcclusion
Skyline Warrior
 
Posts: 366
Joined: 22 Jun 2015, 19:34
Location: Texas


Return to Video Tutorials

Who is online

Users browsing this forum: No registered users and 2 guests

cron