查看: 1471|回复: 0
打印 上一主题 下一主题

简单的寻径扩展,A* Pathfinder based on Waypoints

[复制链接]

5552

主题

2

听众

8万

积分

首席设计师

Rank: 8Rank: 8

纳金币
-1
精华
11

最佳新人 活跃会员 热心会员 灌水之王 突出贡献

跳转到指定楼层
楼主
发表于 2012-3-23 11:04:02 |只看该作者 |倒序浏览
小巧实用的寻径系统,下面是英文介绍:

Greetings to everyone!

Even we had released the pathfinder system some weeks ago, we have recently updated the project.

What does this system do?

Using a very simple and friendly interface, you can tell your game characters to move to a certain position. Then the character will try to reach that position avoiding all obstacles by following the shortest path.

Yeah, but, how it works?

We designed this system so it would be very easy and fast to setup.

First of all you need to drag and drop waypoints around the map and press the Generate Connectionsbutton.

That was the "most complicated" part.

Let's say you want an enemy to reach the player. By using this pathfinder system you just need to write the following sentence:

var nextPosition = GetComponent(Pathfinder).GetPath(player);

// for iOS and Android:

var pathfinder = GetComponent(Pathfinder);

var nextPosition = pathfinder.GetPath(player);

What this does is to return a map position that the enemy has to move to in order to reach the player. There will be no obstacles between this position and the enemy. Once the enemy has reached this position it will automatically update the nextPosition value to a new position. To understand this better, take a look at the youtube videos at the end of this post.

What are those "waypoints" and how to set them?

You can think about waypoints as 360º turn-around security cameras. Those "cameras" can be used by the enemy to know where the player is hiding.

It is really easy to set them up. Just drag and drop waypoint prefabs around the map and press theGenerate Connections button. Take a look at the last video to have a more clear idea of how this is done.

Can I use it with my iOS or Android projects?

Yes, you can. But be aware that mobile devices are not desktop computers, so do not try to place 20 enemies following a target in a very complex map with lots of obstacles. The frame rate would be too low!

And what does this package come with?

By getting this package you will receive an full reference guide and well explained documentation. It also comes with 2 demo scenes. One with a flat floor and the other one with a small ramp where an enemy tries to catch you. It also contains some extra scripts like an improved orbit camera and a simple enemy AI script to show how to move the enemy.

And are there some advanced extra features?

Of course! It is all explained in the documentation manual. You can tell an enemy to ignore certain objects by using layers. You can also connect and disconnect waypoints in real time (what if you blow up a bridge?)

We are working hard to add more features to the system.

Where can I get it?

Take a look at the gameprefabs.com webpage: http://www.gameprefabs.com/products/show/192

====
•

•

•

•

•


Compatible with: Unity 3.x, Unity3 Android, Unity3 iOS, Unity3 Pro, Unity3

This A* Pathfinder system has been designed to be setup really fast, while keeping a decent frame rate during gameplay.

To set it up just follow these simple steps:
•Drag and drop waypoints onto the map and connect them.

•Get the next position your character has to move to achieve it's goal, using one single sentence: GetPath( target ).

What's in this pack?

This pack comes full documented with a Getting Started section where we cover step by step the basic setup of the pathfinder system. You can also find a reference guide for those who want to use some more advanced features like to get the path ignoring some layers.

It also contains two demonstration scenes, all the necessary code to setup the system and some extra scripts that you can use freely in your projects (modified orbit camera controller, player controller relative to the camera and a basic enemy AI)
Information for iOS and Android developers:
We have released the iOS and Android version. Be aware that mobile devices cannot handle massive calculations like other platforms. That means that you shouldn't use too many followers at the same time, or the frame rate will not be enough high.
Simple live Demo:

http://www.gameprefabs.com/products/preview/192
分享到: QQ好友和群QQ好友和群 腾讯微博腾讯微博 腾讯朋友腾讯朋友 微信微信
转播转播0 分享淘帖0 收藏收藏0 支持支持0 反对反对0
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

关闭

站长推荐上一条 /1 下一条

手机版|纳金网 ( 闽ICP备08008928号

GMT+8, 2024-5-5 19:30 , Processed in 0.081183 second(s), 32 queries .

Powered by Discuz!-创意设计 X2.5

© 2008-2019 Narkii Inc.

回顶部