Please login or register.

Login with username, password and session length
Advanced search  

News:

IRC channel - server: waelisch.de  channel: #wme (read more)

Author Topic: Pathfinding  (Read 3509 times)

0 Members and 1 Guest are viewing this topic.

Derrek3D

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 82
    • View Profile
Pathfinding
« on: November 25, 2007, 10:22:00 AM »

Hello,

I'm a bit puzzled by the reaction of my 3D actor to clicks around my scene (I use the "Find path using 2D elements only" option). When I click on my "floor" region the actor walks to that point just fine. Now when I click on any non-interactive areas in my scene that are outside the "floor" region, my actor walks to some arbitrary location on the "floor" that apparently has nothing to do with where I made the click.

I have no idea what the problem is but more so, I don't even know what the correct behavior of an actor for when the user clicks on any other non-interactive part of the scene should be. Should the actor walk anywhere in such case?
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Pathfinding
« Reply #1 on: November 26, 2007, 03:53:39 PM »

I have no idea what the problem is but more so, I don't even know what the correct behavior of an actor for when the user clicks on any other non-interactive part of the scene should be. Should the actor walk anywhere in such case?
Yes, the actor should walk to a nearest "walkable" point in the scene. In case of 3D actors, try to design the hidden scene geometry that way so that the walkable mesh covers the majority of the 2D scene. This mesh is used for converting the 2D clicks to 3D space. If you click outside the walkable mesh, once again the engine tries to find the nearest walkable point, but given the 2D to 3D conversion issues, it may or may not give reasonable results.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Derrek3D

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 82
    • View Profile
Re: Pathfinding
« Reply #2 on: November 26, 2007, 04:45:15 PM »

Sorry, wrong thread. Moving...
« Last Edit: November 26, 2007, 05:06:41 PM by Derrek3D »
Logged

Derrek3D

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 82
    • View Profile
Re: Pathfinding
« Reply #3 on: November 26, 2007, 05:19:07 PM »

So if walking to the nearest "walkable" point in the scene isn't very logical in the case of a specific scene, should I override the GoTo for this specific scene and manage what happens when the mouse is clicked in the non-walkable area myself?
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Pathfinding
« Reply #4 on: November 27, 2007, 05:58:10 PM »

That's one way to do it. However, if you only need this in a single scene, you can handle it in the "scripts\scene.script", which is attached to every scene by default and which handles those clicks in non-walkable areas (or rather detach this script in this case and make a customized version).
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Derrek3D

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 82
    • View Profile
Re: Pathfinding
« Reply #5 on: November 28, 2007, 11:15:32 AM »

Good advice, I'll try that. Thanks.
Logged
 

Page created in 0.069 seconds with 19 queries.