This is where active bugs can be seen and where to post a new bug.

Navmesh Lua bug

Navmesh Lua bug

Postby SpiderMack » 16 Dec 2017, 23:35

There is a npc with Simple character controller and this micro script :
Code: Select all
 
obj = 0;

-- System initialisation - Skyline script entry point
function onInit(objID)
   sky.lprint("LUA: Script Active!");
   obj = objID;
end

-- Called after all the scenes onInit() have been called.If you need to ensure your data exits, then do you set up here
function postInit()
navmesh.addEntity(obj);
navmesh.showAgentDebug(obj,1);
navmesh.setAgentMaxSpeed(obj, 10);
local pos = newType.vec3(entity.getPosition(entity.getIDFromTag("Player"));
navmesh.setDestination(obj, pos.x,pos.y,pos.z);
end

-- Updated every frame
function onUpdate(timeDelta)
   if (navmesh.isDestinationReached(obj)==1) then
      navmesh.setAgentControlled(obj,0);
   
   end
end


Navmesh is generated.
Player character has tag "Player", running the game the npc doesn't move.
User avatar
SpiderMack
Skyline Expert
 
Posts: 441
Joined: 02 Dec 2016, 09:15
Skill: Concept artist
Skill: 3D Modeller
Skill: Level Designer
Skill: Scripter

Re: Navmesh Lua bug

Postby SolarPortal » 17 Dec 2017, 12:53

ok, will try this aswell

Edit: yeah, there is an error in the script, but when i started commenting bits out it crashed the editor.
Thanks for reporting :)

Edit2: ok, the crash is fixed and was caused by adding an agent but not setting a destination which you weren't doing anyway.

Onto the code you posted. The line:
Code: Select all
local pos = newType.vec3(entity.getPosition(entity.getIDFromTag("Player")));

is missing a parenthesis on the end of the player. You only had 2, whereas 3 was required.

There is also something about navmesh agents and their pivots, setting them up so they are at the floor makes them walk better which is strange lol :P Will also look into this one :)

but apart from that, navmesh did load back with a saved scene, all i needed to do was turn the debug on the navmesh editor back on and it appeared.
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 Lua bug

Postby SpiderMack » 17 Dec 2017, 14:26

SolarPortal wrote:ok, will try this aswell

Edit: yeah, there is an error in the script, but when i started commenting bits out it crashed the editor.
Thanks for reporting :)

Edit2: ok, the crash is fixed and was caused by adding an agent but not setting a destination which you weren't doing anyway.

Onto the code you posted. The line:
Code: Select all
local pos = newType.vec3(entity.getPosition(entity.getIDFromTag("Player")));

is missing a parenthesis on the end of the player. You only had 2, whereas 3 was required.

There is also something about navmesh agents and their pivots, setting them up so they are at the floor makes them walk better which is strange lol :P Will also look into this one :)

but apart from that, navmesh did load back with a saved scene, all i needed to do was turn the debug on the navmesh editor back on and it appeared.


Yes, i got navmesh loaded correctly this time, has it been some update ? let's hope there won't be no more bugs about navmesh loading.

What do you mean about pivot ?
The only navmesh component is the script, the character only have Simple TPS controller.

I got a strange result, some green sphere is moving very slowly whatever script values are for navmesh speed, and character npc doesn't follow it :lol:
User avatar
SpiderMack
Skyline Expert
 
Posts: 441
Joined: 02 Dec 2016, 09:15
Skill: Concept artist
Skill: 3D Modeller
Skill: Level Designer
Skill: Scripter

Re: Navmesh Lua bug

Postby SolarPortal » 17 Dec 2017, 15:01

No, we havent released the code in an update yet, we are still working on things :P

I got a strange result, some green sphere is moving very slowly whatever script values are for navmesh speed, and character npc doesn't follow it

yeah, this is what i was meaning from the pivot wierd bug. I guess its the zombie and the SCC, if you change the SCC offset to 0,-1,0 so the character sinks to the ground closer, then it will follow the sphere which is the debug agent to let you know where the nav agent is.

Its something i will be looking at to see if it can be improved :)
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 Lua bug

Postby SpiderMack » 17 Dec 2017, 17:13

This is a bug, SimpleCharacterController doesn't move whatever you change Y.

I changed it to a sphere physic rigidbody and it works, the characters follows navmesh.
User avatar
SpiderMack
Skyline Expert
 
Posts: 441
Joined: 02 Dec 2016, 09:15
Skill: Concept artist
Skill: 3D Modeller
Skill: Level Designer
Skill: Scripter

Re: Navmesh Lua bug

Postby SolarPortal » 17 Dec 2017, 18:00

yeah, like i mentioned, i will be taking a look at improving the movement.

i found at Y = -1 on the SCC offset; the character did rotate a bit but followed the navmesh agent to the players position on my earlier tests with the code you provided, placed onto a zombie with SCC and microscript. The player was the robot mesh from models > Characters folder.
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 Lua bug

Postby SpiderMack » 23 Dec 2017, 22:32

The bug is still here after last update to 1.0 , simple Character Controller is not usable with navmesh.

Perhaps it's better this way as you don't need a character controller when you use navmesh usually, instead a simple capsule physics collider is lot more appropriate and enough.
User avatar
SpiderMack
Skyline Expert
 
Posts: 441
Joined: 02 Dec 2016, 09:15
Skill: Concept artist
Skill: 3D Modeller
Skill: Level Designer
Skill: Scripter

Re: Navmesh Lua bug

Postby SolarPortal » 24 Dec 2017, 13:12

We ran out of time to fix the movement on the navmesh with SCC. However, lowering the offset of the character so its feet touch the floor does allow it to follow the nav agent in our tests
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 Lua bug

Postby SolarPortal » 24 Dec 2017, 13:36

Here is a demo level where the NPC Zombie continuously chases the Player:

Navmesh.zip
(47.17 KiB) Downloaded 636 times


I tested this on 32bit and DX11 and it is working fine... It should give you a good enough starting point to get going :)
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 Lua bug

Postby SpiderMack » 24 Dec 2017, 19:23

SolarPortal wrote:We ran out of time to fix the movement on the navmesh with SCC. However, lowering the offset of the character so its feet touch the floor does allow it to follow the nav agent in our tests


I didn't succeed, and it's really weird work around.
Let's hope some bug fix will come to get it working as it should be without moving characters through floor :lol:
User avatar
SpiderMack
Skyline Expert
 
Posts: 441
Joined: 02 Dec 2016, 09:15
Skill: Concept artist
Skill: 3D Modeller
Skill: Level Designer
Skill: Scripter


Return to Active / New Bugs

Who is online

Users browsing this forum: No registered users and 1 guest