首页
网站开发
桌面应用
管理软件
微信开发
App开发
嵌入式软件
工具软件
数据采集与分析
其他
首页
>
> 详细
data编程代做、java程序语言代写
项目预算:
开发周期:
发布时间:
要求地区:
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
工作时间:8:00-23:00
微信:codinghelp
热点项目
更多
代做 program、代写 c++设计程...
2024-12-23
comp2012j 代写、代做 java 设...
2024-12-23
代做 data 编程、代写 python/...
2024-12-23
代做en.553.413-613 applied s...
2024-12-23
代做steady-state analvsis代做...
2024-12-23
代写photo essay of a deciduo...
2024-12-23
代写gpa analyzer调试c/c++语言
2024-12-23
代做comp 330 (fall 2024): as...
2024-12-23
代写pstat 160a fall 2024 - a...
2024-12-23
代做pstat 160a: stochastic p...
2024-12-23
代做7ssgn110 environmental d...
2024-12-23
代做compsci 4039 programming...
2024-12-23
代做lab exercise 8: dictiona...
2024-12-23
热点标签
mktg2509
csci 2600
38170
lng302
csse3010
phas3226
77938
arch1162
engn4536/engn6536
acx5903
comp151101
phl245
cse12
comp9312
stat3016/6016
phas0038
comp2140
6qqmb312
xjco3011
rest0005
ematm0051
5qqmn219
lubs5062m
eee8155
cege0100
eap033
artd1109
mat246
etc3430
ecmm462
mis102
inft6800
ddes9903
comp6521
comp9517
comp3331/9331
comp4337
comp6008
comp9414
bu.231.790.81
man00150m
csb352h
math1041
eengm4100
isys1002
08
6057cem
mktg3504
mthm036
mtrx1701
mth3241
eeee3086
cmp-7038b
cmp-7000a
ints4010
econ2151
infs5710
fins5516
fin3309
fins5510
gsoe9340
math2007
math2036
soee5010
mark3088
infs3605
elec9714
comp2271
ma214
comp2211
infs3604
600426
sit254
acct3091
bbt405
msin0116
com107/com113
mark5826
sit120
comp9021
eco2101
eeen40700
cs253
ece3114
ecmm447
chns3000
math377
itd102
comp9444
comp(2041|9044)
econ0060
econ7230
mgt001371
ecs-323
cs6250
mgdi60012
mdia2012
comm221001
comm5000
ma1008
engl642
econ241
com333
math367
mis201
nbs-7041x
meek16104
econ2003
comm1190
mbas902
comp-1027
dpst1091
comp7315
eppd1033
m06
ee3025
msci231
bb113/bbs1063
fc709
comp3425
comp9417
econ42915
cb9101
math1102e
chme0017
fc307
mkt60104
5522usst
litr1-uc6201.200
ee1102
cosc2803
math39512
omp9727
int2067/int5051
bsb151
mgt253
fc021
babs2202
mis2002s
phya21
18-213
cege0012
mdia1002
math38032
mech5125
07
cisc102
mgx3110
cs240
11175
fin3020s
eco3420
ictten622
comp9727
cpt111
de114102d
mgm320h5s
bafi1019
math21112
efim20036
mn-3503
fins5568
110.807
bcpm000028
info6030
bma0092
bcpm0054
math20212
ce335
cs365
cenv6141
ftec5580
math2010
ec3450
comm1170
ecmt1010
csci-ua.0480-003
econ12-200
ib3960
ectb60h3f
cs247—assignment
tk3163
ics3u
ib3j80
comp20008
comp9334
eppd1063
acct2343
cct109
isys1055/3412
math350-real
math2014
eec180
stat141b
econ2101
msinm014/msing014/msing014b
fit2004
comp643
bu1002
cm2030
联系我们
- QQ: 9951568
© 2021
www.rj363.com
软件定制开发网!