Intelligent Rogue Chars编程代做
Intelligent Rogue Chars
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.
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.
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.
Monster's Strategy
The monster is tenacious and its sole mission is to chase and intercept the rogue. A natural strategy for the monster is to always take one step toward the rogue. In terms of the underlying graph, this means that the monster should compute a shortest path between itself and the rogue, and take one step along such a path. This strategy is not necessarily optimal, since there maybe ties, and taking a step along one shortest path may be better than taking a step along another shortest path.
Consider the following two dungeons.
In the first dungeon above, monster B's only optimal strategy is to take a step in the NE direction. Moving N or E would enable the rogue to make a mad dash for the opposite corridor entrance.
In the second dungeon, the monster C can guarantee to intercept the rogue by first moving E.
Your first task is to implement an effective strategy for the monster. To implement the monster's strategy, you may want to consider using BFS.
Rogue's Strategy
The rogue's goal is to avoid the monster for as long as possible. A naive strategy is to move to an adjacent site that is as far as possible from the monster's current location.
That strategy is not necessarily optimal.
Consider the following two dungeons.
It is easy to see that that strategy may lead to a quick and unnecessary death, as in the second dungeon above where the rogue can avoid the monster J by moving SE.
Another potentially deadly strategy would be togo to the nearest corridor. To avoid the monster F in the first dungeon, the rogue must move towards a northern corridor instead.
A more effective strategy is to identify a sequence of adjacent corridor and room sites which the rogue can run around in circles forever, thereby avoiding the monster indefinitely. This involves identifying and following certain cycles in the underlying graph. Of course, such cycles may not always exist, in which case your goal is to survive for as long as possible. To implement the rogue's strategy, you may want to use both BFS and DFS.
Implementation and Specification
In this section, you will discover the expected details regarding the implementation and specifications of the Rogue game, which you are required to adhere to.
Dungeon File Input Format
The input dungeon consists of an integer N, followed by N rows of 2N characters each. For example:
A room is a contiguous rectangular block of room sites. Rooms may not connect directly with each other. That is, any path from one room to another will use at least one corridor site.
There will be exactly one monster and one rogue, and each will start in some room site.
You will be given 18 dungeon files to test your code with.
You may create your own dungeon files (explain the novelty in your report/video!). In the rubric subsection below, you are required to show the correctness and the performance of your rogue and monster on at least 5 non-trivial dungeons in total.
Game of Rogue Specification
We will provide some files that are already completed as the game infrastructure. There are two files to complete: Monster.java and Rogue.java, for which some skeleton code is provided.
The given files are only for a quick start: you should modify the files so your program exhibits more object-oriented programming principles!
The following is the interface of Monster.java :
public Monster(Game g) // create a new monster playing game g
public Site move() // return adjacent site to which it moves
And the analogous program Rogue.java:
public Rogue(Game g) // create a new rogue playing a game g
public Site move() // return adjacent site to which it moves
The move() method should implement the move of the monster/rogue as specified by the strategy that you have created.
Game.java reads in the dungeon from standard input and does the game playing and refereeing. It has three primary interface functions that will be needed by
Rogue.java and Monster.java. public Site getMonsterSite() public Site getRogueSite()
public Dungeon getDungeon()
// return site occupied by monster // return site occupied by rogue
// return the dungeon
Dungeon.java represents an N-by-N dungeon.
public boolean isLegalMove(Site v, Site w) // is moving from site v
to w legal?
public boolean isCorridor(Site v) // is site v a corridor site?
public boolean isRoom(Site v) // is site v a room site?
public int size() // return N = dim of dungeon
In.java is a library from Algorithms optional textbook to read in data from various sources. You will have to create your own input library for your CW3 program.
Site.java is a data type that represents a location site in the N-by-N dungeon.
public Site(int i, int j) // create new Site for location (i, j)
public int i() // get i coordinate
public int j() // get j coordinate
public int manhattan(Site w) // return Manhattan distance
from invoking site to w
public boolean equals(Site w) // is invoking site equal to w?
If you have two sites located at coordinates (i1, j1) and (i2, j2), then the Manhattan distance between the two sites is |i1 - i2 | + |j1 - j2 |. This represents the length you have to travel, assuming you can only move horizontally and vertically.
You should modify the files or create other Java files, so your final program exhibits more object-oriented programming principles. Finally, you must only use libraries that are covered in CPT204 (including in Liang textbook). Violating this by using libraries that are not covered in CPT204 will result in an automatic total mark of 0.
Deliverables
In this section, you will find the details regarding the files that you are required to submit,and the report and video specifications.
Submission Requirements
You are required to submit:
1) The Rogue.java and Monster.java source code Java files, as well as any other auxiliary Java files and the dungeon files that you selected/created in your project, altogether combined in a ZIP file.
2) Your report, in both Word and PDF format (2 separate files).
请加QQ:99515681 邮箱:99515681@qq.com WX:codinghelp
- 语境敏感:全球app云筛帮助你在不同文化中避免尴尬和误解
- Instagram群发助手 - ins定位采集/ig私信博主/ins批量养号/缔造奇迹
- 铸造3D打印设备操作维保培班,首期培训班圆满结业!
- 世贸通移民:2024年六大移民趋势发布
- 代写 2XC3、代做 Python 设计编程
- 从梦想到现实,我走过了一段曲折而又充满挑战的路。而在这段旅程中,WhatsApp拉群工具成了我实现生意喜悦变现的得力助手。
- 代做Godunov-Type Scheme
- 网络通信革新:Telegram协议号如何提高通信效率?
- ins营销软件,ins群发拉群助手,爆粉软件欢迎测试联系
- 远光软件推出基于大模型训练的智能填单助手
- 2024金智维大模型应用暨新品发布会成功举办,助推新质生产力发展
- ig营销引流,ins协议群发私信软件-instagram营销软件
- Instagram营销软件 - ins采集软件/ig采集助手/ins群发助手
- instagram群发引流软件,ins批量私信群发器,ig引流营销工具
- Instagram群发筛选软件,Ins群发注册工具,助你轻松营销!
- Telegram引流利器,智能群发采集,助你快速引流!
- instagram低成本引流推广!Ins自动私信工具,Instagram营销软件推荐!
- 外贸的未知星球,充满神秘与机遇。作为一位科幻魔法师,我时刻寻找着能为业务注入前所未有体验魔力的工具。而WhatsApp拉群工具,正是我近期发现的宝藏。
- 全球智慧 专家分享 WhatsApp拉群营销工具点燃我业务成功的烈火
- 马斯克:特斯拉搞AI?除非我控制25%的投票权
- 山西木业行业网:传承与创新,共筑绿色木业未来
- 代写Clue-Less程序设计
- 跨国战略部署:全球app云筛是制定全球营销计划的得力助手
- EBU4201代做、代写Java设计编程
- Ins那款营销软件好用?Instagram独家引流推广群发软件,博主推荐购买!
- 法律GPT技术进一步提升律师工作效率,AlphaGPT赋能合同审查
- 数字智慧 专家心得 WhatsApp拉群营销工具是我业务成功的科技奇迹
- 电报/TG自助群发拉群软件,Telegram/TG智能采集群发系统,TG/纸飞机营销优化
- 北斗筛选全球app云筛的艺术:日筛选量可达2亿-3亿的号码量筛选
- 全线高端 智能焕新,东软医疗强势亮相2024CMEF
推荐
- 智慧驱动 共创未来| 东芝硬盘创新数据存储技术 为期三天的第五届中国(昆明)南亚社会公共安 科技
- 全力打造中国“创业之都”名片,第十届中国创业者大会将在郑州召开 北京创业科创科技中心主办的第十届中国创业 科技
- 疫情期间 这个品牌实现了疯狂扩张 记得第一次喝瑞幸,还是2017年底去北京出差的 科技
- 创意驱动增长,Adobe护城河够深吗? Adobe通过其Creative Cloud订阅捆绑包具有 科技
- 苹果罕见大降价,华为的压力给到了? 1、苹果官网罕见大降价冲上热搜。原因是苹 科技
- 老杨第一次再度抓握住一瓶水,他由此产生了新的憧憬 瘫痪十四年后,老杨第一次再度抓握住一瓶水,他 科技
- 如何经营一家好企业,需要具备什么要素特点 我们大多数人刚开始创办一家企业都遇到经营 科技
- 丰田章男称未来依然需要内燃机 已经启动电动机新项目 尽管电动车在全球范围内持续崛起,但丰田章男 科技
- B站更新决策机构名单:共有 29 名掌权管理者,包括陈睿、徐逸、李旎、樊欣等人 1 月 15 日消息,据界面新闻,B站上周发布内部 科技
- 升级的脉脉,正在以招聘业务铺开商业化版图 长久以来,求职信息流不对称、单向的信息传递 科技