1 / 7

遊戲人工智慧 – Greedy Snake

遊戲人工智慧 – Greedy Snake. 組員 : 吳孟純 劉英男 陳冠仲. 指導老師 : 鄞宗賢. AI 設計 – 移動模式清單. 將各種情況列入考慮後,分成幾種移動模式,並制訂該情況下的明確行為。 基本追逐 起點與終點單軸相等 終點位於 X or Y 軸邊界 終點位於雙軸角落處. AI 設計 – 移動模式分析. 基本追逐 Ex. If (snakeHead.x < food.x) GoDirection = Right; Else If(snakeHead.x > food.x)

edric
Download Presentation

遊戲人工智慧 – Greedy Snake

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 遊戲人工智慧 – Greedy Snake 組員: 吳孟純 劉英男 陳冠仲 指導老師: 鄞宗賢 AI遊戲人工智慧 - 2011/6/21

  2. AI設計 – 移動模式清單 將各種情況列入考慮後,分成幾種移動模式,並制訂該情況下的明確行為。 • 基本追逐 • 起點與終點單軸相等 • 終點位於X or Y軸邊界 • 終點位於雙軸角落處 AI遊戲人工智慧 - 2011/6/21

  3. AI設計 – 移動模式分析 • 基本追逐 Ex. If (snakeHead.x < food.x) GoDirection = Right; Else If(snakeHead.x > food.x) GoDirection = Left; …Y軸亦以相同方法處理。 AI遊戲人工智慧 - 2011/6/21

  4. AI設計 – 移動模式分析 • 起點與終點單軸相等(水平或垂直) 為避免蛇頭與其頭部反方向前進導致自己相撞,先使其往90度前進。 Ex. If(snakeHead.x < food.x && snakeHead.y == food.y) GoDirection = Down; AI遊戲人工智慧 - 2011/6/21

  5. AI設計 – 移動模式分析 • 終點位於X or Y軸邊界 在原本的狀況下,由於蛇頭吃到食物並不一定會立即往下一個食物的座標轉向,故會造成撞牆情況發生, 因此當蛇吃到食物時使其立即往安全方向前進。 Ex. If(food.x == AxisX.Upper && food.isEaten) GoDirection = Up; If(food.y == AxisY.Lower && food.isEaten) GoDirection = Down; AI遊戲人工智慧 - 2011/6/21

  6. AI設計 – 移動模式分析 • 終點位於雙軸角落處 當食物位於角落時, 有稍微明確的移動方向. Ex. If(food.x <= AxisX.Lower && food.y <= AxisY.Lower && food.isEaten) GoDirection = Right; AI遊戲人工智慧 - 2011/6/21

  7. 遭遇困難 • 無法取得有效的蛇頭與蛇身體的即時座標,導致規則制定上太過發散。 • 當規則過多時,規則彼此之間容易重複, 導致覆蓋的情況發生,因而造成錯誤。 AI遊戲人工智慧 - 2011/6/21

More Related