Commit Graph

1105 Commits

Author SHA1 Message Date
Alistair McIntyre 430779c943 Boat auto pilots correctly for tacking/gybing. Needs proper testing.
#story[1105]
2017-08-10 14:53:24 +12:00
William Muir 9c79897e01 Tidied code, added MidPoint to CompoundMark class
Compound Mark class is now constructed with a list of marks.
A mid point is created on its construction for use in Geo Calculations

#story[1124] #pair[wmu16, hyi25]
2017-08-10 13:58:32 +12:00
Michael Rausch 07386ed2db Improved boat bounce-back calculation
- Changed boat bounce back send the boat n meters in the opposite direction.
- Improved test to use the minimum of yacht and mark collision distances

Tags: #story[1117]
2017-08-10 13:01:31 +12:00
William Muir 249ad9e5c0 Fixed Mark rounding Algorithm
Algorithm now knows when a player has to round a gate or just pass right through

#story[1124] #pair[wmu16, hyi25]
2017-08-10 12:02:19 +12:00
alistairjmcintyre 9d02d2fbea Implemented a fairly simple auto pilot setting for the yacht, on update if the boat is set to autopilot it will adjust the heading towards the desired heading. Needs some refinement.
#story[1105]
2017-08-10 02:04:51 +12:00
Michael Rausch b1598ccb0f Changed testUpdateYachtWithCollision to use MARK_COLLISION_DISTANCE
Changed testUpdateYachtWithCollision to use MARK_COLLISION_DISTANCE constant.

#story[1117]
2017-08-09 22:36:34 +12:00
Michael Rausch 4cc48a355e Added mark collisions
- Boats now collide with marks
- Added method to MarkOrder to get all marks
- Reduced the frequency at which collisions are detected. This fixed some performance issues
- Added method to bounce the boat off a mark

Tags: #story[1117]
2017-08-09 21:57:50 +12:00
Calum 2c5fddb695 Implemented zooming and clipping of race border. Implementation is still hackish.
#pair[ptg19, cir27] #story[1121]
2017-08-09 16:56:46 +12:00
Calum 126d8ea870 Added factory class for producing mark arrows.
#story[1118]
2017-08-09 15:24:32 +12:00
Calum 30a6cb98ec Action packets now sent at regular 20ms intervals
#issue[38] #implement
2017-08-09 14:03:21 +12:00
Zhi You Tan 8813d06010 Created a simple red blink on a top of a yacht given source id.
Created and updated methods reading yacht event packet to translate to collision alert on visualiser.
WIP: sending yacht event packet to inform collision

#story[1117]
2017-08-09 01:26:59 +12:00
Kusal Ekanayake 0fbca89030 Merge branch 'develop' into Story64_SailsAnimations
# Conflicts:
#	src/main/java/seng302/model/Yacht.java
2017-08-08 19:45:08 +12:00
Kusal Ekanayake 421ef3c65a Started progress on zooming, can now use z and x keys to zoom into map.
Nothing scales correctly asides from the map itself (the boats stay in the same position).

#story[1121]
2017-08-08 19:41:51 +12:00
Zhi You Tan 5937f8b640 Merge remote-tracking branch 'origin/develop' into Story66_Collision
# Conflicts:
#	src/main/java/seng302/gameServer/GameState.java
#	src/main/java/seng302/model/Yacht.java
2017-08-08 17:04:34 +12:00
Zhi You Tan 5ec67d0b80 Added junit for update yacht (after collision implementation). Removed another version of initialise boat positions.
#story[1117]
2017-08-08 16:51:29 +12:00
William Muir a545e9dbc3 Removing '>' characters from docstrings to fix build
Note: This is probably a XML style guid thing and is stupid. Can probably fix this
2017-08-08 16:14:13 +12:00
William Muir b0e7dddaf3 Fixed gate passing algorithm
boats now must pass through the correct way. This works for start in-race and finish gates
Refactored yacht algorithm code for better readability
Logging function added or seeing mark roundings occur

tags: #story[1124] #pair[hyi25, wmu16]
2017-08-08 15:58:13 +12:00
Haoming Yin ed0a783374 Fixed the bug that boats could round over a gate but still "across" it. Added unit test to ensure the algorithm works.
tags: #story[1124]
2017-08-08 10:42:36 +12:00
Kusal Ekanayake 97696cc95b Started work on cucumber tests. Trying to sort through threads, getting inconsistent results.
#story[1111] #pair[kre39,ptg19]
2017-08-07 17:54:34 +12:00
William Muir 4375b73257 Implemented algorithm for checking if boat passes through a mark.
Mark rounding works for whole course (WITH BUGS)
Still some gate logic to work out.
Moved gate function to GeoUtil class

tags: #story[1124] #pair[hyi25, wmu16]
2017-08-07 17:28:12 +12:00
Kusal Ekanayake f97b18d594 Sailsin graphics moving and working as expected.
#story[1111] #pair[kre39,ptg19]
2017-08-07 16:48:30 +12:00
Kusal Ekanayake c7857872ce Luffing sails animation working correctly, working on sailsin animation now.
#story[1111] #pair[kre39,ptg19]
2017-08-07 15:24:01 +12:00
Zhi You Tan 79105a1bdc Created a simple collision detection by iterating each boats per update. Working but sequential checks can be costly.
#story[1117]
2017-08-07 12:01:26 +12:00
Zhi You Tan a4b22190c0 Changed the spawn point to behind start line and calculated quadrant to make sure yachts spawn behind start line in different map scenario.
#story[1117]
2017-08-07 11:50:07 +12:00
Calum a3ce5998ff Action packets now sent at regular 20ms intervals
#issue[38] #implement
2017-08-07 10:58:07 +12:00
William Muir 7f0329dda6 WIP: Implemented basic mark rounding algorithm.
Removed RacePosition class. Instead marks are just grabbed from the mark order class when necessary.
No marks are stored as an attribute in the yacht class but the 'currentMarkSeqID' which is used to get current, and surrounding marks.
Works for all marks in between but not including starting and finishing gate as no angle can be made with them. Still to work out how to implement this

 #story[1124]
2017-08-07 00:23:54 +12:00
Calum 8a40119a98 Action packets now sent at regular 20ms intervals
#issue[38] #implement
2017-08-06 22:17:08 +12:00
Zhi You Tan a470cb66a2 Updated initialise boat function so it can now initialise boats with distance apart in meters.
Created a second prototype function which is more testable compared to the initial design. New function takes in parameters (starting marks, yacht starting position, yacht) and initialise yacht correctly with position.

#story[1117]
2017-08-06 21:16:14 +12:00
Kusal Ekanayake ecf2c52cfa Added tests, and sails to all clients.
#story[1111]
2017-08-06 15:43:22 +12:00
Haoming Yin 43788bd153 Added a method to test if a geo point is located in a triangle which is formed by other three geo points.
The method helps to check the mark rounding.

Also unit tests have been done for this method.

tags: #story[1124]
2017-08-06 12:36:57 +12:00
William Muir e90a0ce435 Merge branch '1124_Mark_Sequence_From_RaceXML' into 'develop'
Loading mark sequence from RaceXML

# Loading mark sequence from RaceXML

## Change Log
1. Added MarkOrder class
* Mark order is read from the generated RaceXML and stored
* Added .getNextMark() to get the next mark in the race
* Added .equals() and .hashCode() for Marks
* NEW: Added RacePosition class to hold players position in the race
* NEW: Fixed issue where the duplicates weren't stored in the mark order

## Testing
* Unit tests in models/MarkOrderTest.java

## Acceptance Criteria
* Use the mark sequence in the raceXML
    * Met by change log item (1)

* Store relevant mark details with each participating boat (Last mark, next mark)
    * Method in MarkOrder to get next mark, however the last mark and next mark will need to be stored by whoever implements the second task.

See merge request !52
2017-08-05 15:18:26 +12:00
Zhi You Tan a727014fcb Implemented boats spawning in parallel at the start line with spacing.
Added two more colours to support up to eight boats.

#story[1117]
2017-08-05 00:31:36 +12:00
Kusal Ekanayake ae28ccf228 Made sails luff in the right direction.
#story[1111]
2017-08-04 16:24:34 +12:00
Michael Rausch 281ce2d842 Loading course mark order from RaceXML
- Re-engineered code to work with the new marks
- Fixed bug where race order wasn't correct (added RacePosition class to fix)
- Rewrote tests to work with new RacePosition class

Tags: #story[1124] (Task 1)
2017-08-04 13:20:50 +12:00
Kusal Ekanayake f8af9cc259 Works for clients and server.
Due to the information being sent and received, it only currently works on client side boats.

#story[1111]
2017-08-03 19:07:30 +12:00
Zhi You Tan 8af80e6c3a WIP: Connected game client to main server thread to pass compound mark variable.
Boats are initialised in main server thread behind start line before game starts.

#story[1117]
2017-08-03 18:39:15 +12:00
William Muir 874cdec654 Added booleans: has entered rounding zone, has crossed first line, has crossed second line
All for purposes of checking mark rounding.

Currently not yet finished

tags: #story[1124] #pair[hyi25, wmu16]
2017-08-03 17:39:07 +12:00
Kusal Ekanayake 99d5545ed3 Made the sails work properly by toggling.
Need to remove the unneeded code I added.

#story[1111]
2017-08-03 16:33:51 +12:00
William Muir 423f1acdb6 Merge remote-tracking branch 'origin/develop' into develop 2017-08-03 16:29:22 +12:00
William Muir 454e9ac9f1 Added an attribute to each yacht: 'DistanceToNextMark'
This attribute is calculated at each update of the boat as prompted by the game state regularly
Removed the lat and lng attribute from the Yacht class and replaced its usage with the GeoPoint object instead

Removed redundant test files and merged GeoUtility and testGeoUtil test classes into one

tags: #story[1124] #pair[hyi25, wmu16]
2017-08-03 16:29:12 +12:00
Zhi You Tan 1ab849fd0d Added cucumber dependency. 2017-08-03 14:02:52 +12:00
William Muir db078538ff Minor cleaning in yacht class
tags: #story[1124]
2017-08-03 13:53:30 +12:00
Calum f9e6df46c1 Fixed issues caused by merge.
#bug
2017-08-03 13:23:43 +12:00
Calum 5228c078bc Merge branch 'develop' into 1124_Mark_Sequence_From_RaceXML
# Conflicts:
#	src/main/java/seng302/gameServer/GameState.java
#	src/main/java/seng302/gameServer/server/simulator/Simulator.java
#	src/main/java/seng302/models/mark/Mark.java
#	src/main/java/seng302/visualiser/map/CanvasMap.java
2017-08-03 12:27:11 +12:00
William Muir 1160f274ee Reformatted code in appropriate style
Build fails server side only due to some dependency issue. Internet problem server side?? (M I C H A E L?)

tags: #issue[34]
2017-08-03 12:06:07 +12:00
William Muir 53f5d63f15 Fixed build. (Actually this time) ((NOW WERE READY TO MERGE)))
All doc string annotations were required to be fixed for all methods

tags: #issue[34]
2017-08-03 11:50:07 +12:00
William Muir 1150ec3e43 Merge branch 'develop' into story61_player_perspective
# Conflicts:
#	src/main/java/seng302/App.java
2017-08-03 11:48:54 +12:00
William Muir c655cb3fab Fixed build. (Actually this time)
All doc string annotations were required to be fixed for all methods

tags: #issue[34]
2017-08-03 11:45:14 +12:00
William Muir 8e24c204fd Fixed build.
Google map does not work

tags: #issue[34]
2017-08-03 11:26:44 +12:00
Michael Rausch 7885b3fae2 Loading course mark order from RaceXML
- Mark order is read from the generated RaceXML and stored
- Added .getNextMark() to get the next mark in the race
- Added .equals() and .hashCode() for Marks

Tags: #story[1124] (Task 1)
2017-08-02 22:03:10 +12:00