Advanced Object Oriented Programming CPT204

Intelligent game-playing characters have been used in the game industry to harness the power of graph algorithms to navigate complex virtual environments, strategically analyzing interconnected nodes and edges to optimize their movements and decision making processes. By leveraging graph traversal techniques such as breadth-first search (BFS) and depth-first search (DFS), these characters can efficiently explore vast game worlds, identify optimal paths, and anticipate opponent movements.
In this coursework, you will use graph algorithms you have learned in Lecture 10 to develop an effective approach to track and intercept a moving opponent in a (simplified version of the) 2D Game called Rogue . You will also create a viable plan to evade interception from said opponent.
Rogue
The game Rogue was created by Michael Toy and Glen Wichman, who, while
experimenting with Ken Arnold's C library named curses in the late 1970s, designed a graphical adventure game shown below.
In 1984, CMU graduate students developed Rog-o-matic, an automated Rogue player, which became the highest-rated player. Rog-o-matic's algorithm prioritized avoiding monster encounters to facilitate health regeneration, posing an intriguing graph search challenge, which inspired this coursework.
Rules of the Game
The game of Rogue is played on an N-by-N grid that represents the dungeon. The two players are a rogue and a monster. The rogue is represented with the character @.
The monster is represented by an uppercase letter A through Z.
The monster and rogue take turns making moves, with the monster going first . If the monster intercepts the rogue (i.e., occupies the same site), then the monster kills the rogue, and the game ends. In each turn, a player either remains stationary or moves to an adjacent site.
There are three types of sites:
1. Rooms represented by .
2. Corridors represented by +
3. Walls represented by (a space)
The movement rules are:
If a player is in a room site, then they can move to an adjacent room site in one of the 8 compass directions (N, E, S, W, NW, NE, SW, SE) or a corridor site in one of the 4 directions (N, E, S, W).
If a player is in a corridor site, then they can move to an adjacent room or
corridor site in one of the 4 directions (N, E, S, W).
The walls are impenetrable.
Consider the following two dungeons.
In the first dungeon above, the rogue can avoid the monster I indefinitely by moving N and running around the corridor.
In the second dungeon, the monster A can use the diagonal moves to trap the rogue in a corner.
  • 22
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值