ece493-capstone's People
ece493-capstone's Issues
ProjectileStates not sending
Hardcode obstacles in server
Some obstacles don't generate collisions, or generate collisions in the wrong location
From @mrboisvert :
So when I add this code to add a whole bunch of obstacles the agent does collide with some of them. I think maybe it's the obstacle positions that are weird. Like the obstacles don't collide at the locations we are expecting. I'm pretty confused
self.physics.add_obstacle(Obstacle(self.gen_id(), Vector2(479.5, 337.5), 32, 32))
self.physics.add_obstacle(Obstacle(self.gen_id(), Vector2(511.5, 369.5), 32, 32))
self.physics.add_obstacle(Obstacle(self.gen_id(), Vector2(447.5, 305.5), 32, 32))
self.physics.add_obstacle(Obstacle(self.gen_id(), Vector2(799.1666666666666, 562.5), 32, 32))
self.physics.add_obstacle(Obstacle(self.gen_id(), Vector2(831.1666666666666, 562.5), 32, 32))
self.physics.add_obstacle(Obstacle(self.gen_id(), Vector2(799.1666666666666, 530.5), 32, 32))
self.physics.add_obstacle(Obstacle(self.gen_id(), Vector2(863.1666666666666, 562.5), 32, 32))
self.physics.add_obstacle(Obstacle(self.gen_id(), Vector2(799.1666666666666, 498.5), 32, 32))
self.physics.add_obstacle(Obstacle(self.gen_id(), Vector2(159.83333333333334, 112.5), 32, 32))
self.physics.add_obstacle(Obstacle(self.gen_id(), Vector2(127.83333333333334, 112.5), 32, 32))
self.physics.add_obstacle(Obstacle(self.gen_id(), Vector2(159.83333333333334, 144.5), 32, 32))
self.physics.add_obstacle(Obstacle(self.gen_id(), Vector2(95.83333333333334, 112.5), 32, 32))
self.physics.add_obstacle(Obstacle(self.gen_id(), Vector2(159.83333333333334, 176.5), 32, 32))
Collision bug
AttributeError: 'NoneType' object has no attribute '_add_collision'
Render name of agent and health bar
From SRS, FR3 - UI.RenderGame:
The system should render the following items:
...
- Agents
- text label showing the name of each agent
- health bar showing the percentage of health that each agent has
...
Exception in player-overridden Agent methods will cause game to crash on server
On the server, we should wrap every call to potentially player-overridden Agent methods such as run
and on_damage_taken
in try-catch blocks and send any error messages to the client using ServerToClientConnection.send_python_error
Handle state messages in frontend
State messages are received by frontend but positions of sprites aren't properly updated.
Also, we need to send a message to indicate that when projectiles are removed.
Stop rendering agents when health gets to zero.
Remove a projectile after receiving a an object destroyed from server #16
Stop receiving keyboard input.
Add CSS to frontend
Make the code input / results look pretty.
Walking through walls in some situations
Needs more testing
Agent walks through wall when direction is changes in the on_obstacle_scan callback
Unit tests are not being run by github actions
The logs say that zero tests are being run:
Run python3 -m unittest
----------------------------------------------------------------------
Ran 0 tests in 0.000s
OK
get_agents_health raises error when called
on_obstacle_hit is called twice
Moving through obstacles after collision
While agent collision with obstacles is detected and the collision callback is called, agents can still move through obstacles or boundaries if they continue to set their velocities in the direction of the obstacle.
Agents can move through obstacles while attacking
When the following player code is used for both agents, the agent on the right moves through the right wall
class MyAgent(Agent):
"""Enter your code here ..."""
angle = 20
movement = 250
hit_flag = False
x = 20
def run(self):
self.attack_ranged(0)
if MyAgent.hit_flag:
self.set_movement_direction(MyAgent.angle - 90)
self.set_movement_speed(MyAgent.movement)
MyAgent.x -= 1
if MyAgent.x <= 0:
MyAgent.hit_flag = False
MyAgent.x = 20
else:
self.set_movement_speed(MyAgent.movement)
self.set_movement_direction(MyAgent.angle)
def on_obstacle_hit(self):
MyAgent.angle += 90
MyAgent.hit_flag = True
Check for win condition and display results
Game should check for an agent being eliminated. When this happens, the game should stop and the server should send the results to clients.
The clients should display the results screen.
We will need to keep track of survival times in the Game class.
Add game boundaries to physics engine
Colliding with a boundary should be similar to colliding with an obstacle
Clients aren't removed from matchmaking queue if they disconnect before a game starts
If another client connects and a game is started, the follow error with be raised:
ServerToClientConnection closed
New ServerToClientConnection
Starting a new game
ERROR:tornado.application:Uncaught exception GET /websocket (::1)
HTTPServerRequest(protocol='http', host='localhost:9000', method='GET', uri='/websocket', version='HTTP/1.1', remote_ip='::1')
Traceback (most recent call last):
File "/home/may/.local/lib/python3.10/site-packages/tornado/websocket.py", line 954, in _accept_connection
open_result = handler.open(*handler.open_args, **handler.open_kwargs)
File "/home/may/Files/school/ece493/ece493-capstone/src/server.py", line 24, in open
self.game_server.enqueue(self)
File "/home/may/Files/school/ece493/ece493-capstone/src/gameserver.py", line 19, in enqueue
self.start_game(clients)
File "/home/may/Files/school/ece493/ece493-capstone/src/gameserver.py", line 26, in start_game
client.write_message("Found match. Starting game...")
File "/home/may/.local/lib/python3.10/site-packages/tornado/websocket.py", line 337, in write_message
raise WebSocketClosedError()
tornado.websocket.WebSocketClosedError
Agent keeps moving in different direction after colliding with obstacle
Create end-to-end tests
https://www.selenium.dev/documentation/
Tests:
- "good path" (call every api method, finish game)
- this will be partly manually verified (one of us will have to watch it and make sure everything is rendered correctly)
- error during code submission
- error during game
Implement remaining API functions
attackRanged, setMovementSpeed, setMovementDirection
Obstacle sprite positions don't match server obstacle positions
Render animation for attacks and damage
From SRS, FR3 - UI.RenderGame:
The system should render the following items:
...
- Animations for when agents perform an attack or are hit by an attack
- Note: Animations do not need to be complicated. They can be as simple as a colour
change.
- Note: Animations do not need to be complicated. They can be as simple as a colour
...
Comment requirements on each code file
From system implementation assignment:
Each code unit must include a reference (as comments) to one or more specific requirements mandating its inclusion.
Probably good enough to have one comment per file
Agent velocity set to 0 when colliding with a projectile
Send messages to clients when an object is destroyed
Messages should be sent to indicate when a projectile or agent is destroyed.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.