Zack And Wiki style 3D Point-And-Click Control

Hey guys. So, I am working on a game that is point-and-click in a 3D environment. I’m wondering if you guys have a best guess as to what method the game “Zack Wiki” on the wii uses for pathfinding when moving Zack around.

Here is a video example:

You can see at around :55 that the player clicks from the upper level to the lower level, and the character simply “finds” his way there. Initially I would be inclined to think they are using some kind of a way-point system, but there is such fine control when clicking at a destination that I find it unlikely that they created so many way points for navigation.

Can you think of any unity project that has anything similar to this? What would your personal thoughts be on what type of system to use (a*, waypoints, navmesh?) to reproduce this type of player control?

I am going to start trying to learn about pathfinding, but I want to make sure that I am approaching it from the right perspective. Any input would be greatly appreciated.

PS - This is for an iPhone project, would that rule out certain navigation methods due to processor load?

I’m guessing you’re familiar with the Waypoints (used in the FPS Tutorial)? All you have to do is cast a ray from your camera into the point in the screen, and instantiate a Waypoint at that point, and using the same code as the one in the tutorial, it should be able to move towards it.

Cool thanks. I’ll take a look. So, the FPS tutorial does not use an A* system? Do you think this system (waypoints) would allow for, say, movement around a room filled with furniture? Can it find its way across long distances or is it just point-to-point?

Anyway, just asking for now until I take a look at it myself later tonight.

Thanks!

The FPS Tutorial uses a waypoint system for the robots to move. Yup, that could work around a room with furnitures, what you could do is perhaps set different layers for the ground and the furnitures, and set the raycast so that it would only cast into the layer of the ground.

I so wrote the best reply ever here… and then the forum crashed… sigh

Noooo!!! Please please try again!

Okay, gonna try again :slight_smile:

First I just wanna rant at Zack and Wiki because for about 2 hours I thought I was in heaven. A truly wonderful piece of design. Then, it kicked me in the nuts and called me a girl and I had to stop playing it.

Such a shame.

Anyways… here’s how I would handle a scene like the one in YouTube on the iPhone. I wouldn’t use anything too clever code wise, just clever layout of the level. If you notice - a lot of the Zack and Wiki levels keep their collisions around the edges. This gives you lots of clear space for simple click and walk movement.

I would not design a level where you have to have your character negotiate lots of furniture. Keep it clean and easy to play - especially for the iPhone.

I’ve added a couple of sketches to show options for scene handling.

You obviously have to do some wall floor collision with your character. The simpler the walls (i.e.) flat, the better something like an iPhone will be able to handle the scene.

[As a side note: The project I’m tinkering with uses touch to walk in a very controlled environment. I specifically designed the look and movement system so I don’t have to do player collision at all. It’s always good to design your way out of complex solutions if possible!!]

For edges you could do a simple raycast, or a box collision to stop you from walking, or if you know you player should never go further than a certain Z position, simply lock the limits of their movement.

Keeping your scene open means you can pretty much click and move and not worry.

For something like the stairs I would have a trigger on there that has some nodes attached. When the player clicks on the trigger you simply target the player at the nearest node and get them to walk to it.

For objects you interact with, give them a trigger box and a node at the front of the object. When the player clicks on the object, get the player to move to the node.

Trial and error, good scene design, and tweaking of node placement means you can do a Zack and Wiki/3D Monkey Island game without going for intense code solutions.

Hope that made some sense!!


Just realised I should have added my usual gripe about how it would be much easier to do the stair climb if Unity had a path tool and script commands to follow a path like every other game engine :smile:

cough PATH TOOL cough

cough IT DOES cough

http://forum.unity3d.com/viewtopic.php?t=19032

not cough exactly…

For low CPU stuff like iPhone it would be handy to have a spline tool to drop a single ‘path’ (not nav mesh) that an object can move along. Useful for simple patrols, camera movement etc.

I was pretty sure I posted about this a year and a half ago, but I guess not! I REALLY want this functionality.

You should check out Path 0.4 before commenting on its performance. I’ve designed it to run on unity iPhone and will be releasing for it as soon as unity supports external assemblies on unity iPhone.

Furthermore, if navmeshes are not suitable for a project, Path 0.4 also includes a rapid author interface for designing waypoint networks. Drop a bunch of waypoints around and manually connect them or auto-connect them based on scene colliders.

Guess I know why you are called angry. Wasn’t commenting on your code. Was simply saying that a basic spline tool and associated script commands were missing from unity as an engine.

Hope that’s clear.

Oh that wasn’t me being angry - that was a sales pitch. Apparently that wasn’t clear :wink:

Regarding basic splines, check out this project: http://www.unifycommunity.com/wiki/index.php?title=Spline_Controller

Hey Ant, I’ve been very impressed by your pathfinding stuff (I think it should be “officially” incorporated into unity personally). I’ve been reading a bit on A* methodology, and it looks like you try to account for most of it.

A couple of questions.

In .4 do you have solution to the “zig-zag” issue? I noticed in .3 that the pathfinding exhibits this (common) problem where getting from A-to-B will result in unnatural zig-zagging even if the path only requires a straight line.

Further, is there a solution incorporate to smooth corners in general?

Finally, is the efficiency of this system ultimately dependent on how complex your nav-mesh or node-network is? So, if I used a super-simple nav-mesh, would that make it more likely to run efficiently on the iPhone?

Sorry for the barrage of questions, I’m just trying to plan my project out carefully as it relies heavily on this type of system to move the player character around.

PS: Have you been able to look at any of the Zack and Wiki youtube videos to gauge an opinion on how they are doing their system?

Thanks!

In .4 I’m supplying more tools to provide smooth path following, but basically this issue comes down to how you have your characters follow the path rather than how it is calculated.

The efficiency of a search is dictated by how complex your navmesh or waypoint network is and how long a path needs to be calculated. IE you can have gigantic networks if each node has few connections and you’re travelling short distances in the network.

To boost efficiency not only at runtime, but also in network authoring, .4 offers grid networks which essentially are combined into one big network of networks at runtime. This allows the Path runtime to first calculate a very generalised route in very few steps, using network connections, and then afterwards calculate the path within each involved network to go between network connections.

At design time, this also allows you to create networks for individual buildings for instance (which often need more complex networks) and less detailed, larger networks for exteriors - connecting them all up using grid networks. You can even mix navmeshes and waypoint networks together in a grid network.

I checked out the video linked, but its hard to guess at which method is used there by just examining a gameplay video. A lot of tricks can be done in path following to smooth out rough pathes. Also it could be that they simply pre-defined the path followed up and down the stairs. This could also be done in Path by customising the path following script. You could tag connections as “special transition connection” and then do a lookup on its name and perform needed action for that - IE use an elevator or board a train.