Commit Graph
100 Commits
Author SHA1 Message Date
fjc40 e77208aea1 MarkRoundingSequence now stores data using the leg number, rather than the leg object itself. This was an issue as leg objects would be recreated when race xml files are received.
Fixes issue #64
2017-09-27 16:08:02 +13:00
Fraser Cope 75f8231bc5 Merge branch 'story1292_hp_punish' into 'master'
Story1292 and Story1291 hp

Story 1291:

AC's:
-Mock sends out HP packets
-Visualiser displays each boat's HP in tab view
-User boat HP is displayed on main UI beside boat

Story 1292:

AC's:
-Boats lose HP when they collide
-Boats lose HP when they are out of bounds
-Indication when HP drops below thresholds (20hp, 10hp, 0hp)

See merge request !65
2017-09-27 15:24:38 +13:00
fjc40 5ea4200e67 Some javadoc warning fixes. 2017-09-27 14:47:51 +13:00
fjc40 76dff8009c Removed countdown timer from lobby screen. 2017-09-25 23:48:00 +13:00
fjc40 9763150e85 Merge remote-tracking branch 'origin/master' into game_start_button_1352 2017-09-25 22:39:29 +13:00
fjc40 20702f352b Lobby start button is hidden/disabled by default, to avoid it being visible to non-host clients for a split seconds while loading screen. 2017-09-25 11:56:55 +13:00
fjc40 46192af628 Race now has a 10 minute delay before starting (which is increased whenever it falls below 5 minutes).
The start button (visible to host) starts the race in whatever the prepatory time is.
#story[1352]
2017-09-24 22:15:11 +13:00
fjc40 da901d6e0c Merge remote-tracking branch 'origin/master' into game_start_button_1352 2017-09-24 20:01:15 +13:00
fjc40 612b4b455e Added start button for host on the ingameLobby screen.
#story[1352]
2017-09-24 19:59:56 +13:00
fjc40 db27d673de Another fix for race xml stuff - the xml was fine, but the data sources would sometimes be overridden by empty ones, due to threading stuff. 2017-09-19 13:38:07 +12:00
fjc40 424cd63c59 Should fix the race xml issues where boats get unassigned sometimes.
This removes the static raceServer stuff.
The Race/Boat/Regatta XML commands only execute if they contain newer data (it checks the sequence number).
2017-09-18 12:44:10 +12:00
fjc40 acd99f58cd Merge remote-tracking branch 'origin/master' into nullptr_finish_race_arrow 2017-09-18 12:03:15 +12:00
fjc40 75c15d492e There was a null pointer exception when finishing the race, as the finish leg doesn't have compound marks. 2017-09-15 11:24:55 +12:00
Fraser Cope 11a50b6f09 Merge branch 'boat_movement_smooth' into 'master'
Boats move about smoothly instead of jumping about



See merge request !51
2017-09-15 10:04:00 +12:00
fjc40 eacbe8d8ea Merge remote-tracking branch 'origin/master' into boat_movement_smooth 2017-09-15 09:04:42 +12:00
fjc40 2c92102b2a Changed GraphCoordinate to use double instead of int.
This results in waaaaay smoother movement. Boats no longer jump around.
2017-09-15 01:34:32 +12:00
fjc40 191f249bfb Speed scale is 2, rather than 10.
Server simulates frames every 16ms rather than 50ms.
2017-09-15 01:00:26 +12:00
fjc40 5c58ca11ff Boats use their assigned color.
Boat name is displayed in lobby instead of source ID.
2017-09-15 00:59:43 +12:00
fjc40 eb2ed45ed2 Merge branch 'master' into spectate_mode_basic
# Conflicts:
#	racevisionGame/src/main/java/visualiser/Controllers/LobbyController.java
2017-09-15 00:46:07 +12:00
Fraser Cope a6aeab5ee3 Merge branch 'scoreTable' into 'master'
Score table



See merge request !48
2017-09-15 00:39:48 +12:00
Fraser Cope 94b5f06ede Merge branch 'issue55-collision' into 'master'
Resolve issue #55 - only one collision displayed per boat

Resolves issues #55 and #57.

See merge request !47
2017-09-14 23:47:28 +12:00
fjc40 ae9594f8c3 Removed a println and fixed some javadoc warnings. 2017-09-14 23:46:54 +12:00
fjc40 47d013612a Fix for null pointer exception when finishing race. 2017-09-14 23:40:52 +12:00
fjc40 24b068f249 Collision effect uses color.transparent instead of a custom transparent color. 2017-09-14 23:33:23 +12:00
fjc40 536428ce16 There was a null pointer exception related to going into/leaving third person camera and the arrow annotation. 2017-09-14 23:11:52 +12:00
fjc40 f308f5b8f3 Visualiser model thread was updating GUI instead of fx thread. 2017-09-14 23:08:58 +12:00
fjc40 43a1fbcb64 Spectate mode can be selected by clients when they join a game.
#story[1194]
2017-09-14 14:33:21 +12:00
fjc40 b59d36f4e5 Actually fixed the wind arrow direction. 2017-09-14 13:32:23 +12:00
fjc40 afd923c9fb Revert "Appears to fix wind arrow direction."
This reverts commit 8e6a720558.
2017-09-14 13:22:35 +12:00
fjc40 e0278fdb85 Merge remote-tracking branch 'origin/master' into wind_arrow_direction_5 2017-09-14 12:40:23 +12:00
fjc40 8e6a720558 Appears to fix wind arrow direction. 2017-09-14 12:39:41 +12:00
fjc40 b655b3e233 Fixed merge bug, and an unrelated null pointer exception. 2017-09-13 14:52:21 +12:00
fjc40 6761778dd4 Merge remote-tracking branch 'origin/master' into story_51_rounding_fix
# Conflicts:
#	racevisionGame/src/main/java/mock/app/Event.java
2017-09-13 14:43:49 +12:00
fjc40 d29a47ec23 Merge remote-tracking branch 'origin/master' into story_51_rounding_fix
# Conflicts:
#	racevisionGame/src/main/java/mock/app/Event.java
#	racevisionGame/src/main/java/mock/model/MockRace.java
#	racevisionGame/src/main/java/shared/model/Constants.java
2017-09-13 13:30:51 +12:00
Fraser Cope d1f74dec3a Merge branch 'storyB-)' into 'master'
B) [V,M] As a player I would like to have the game run smoothly and have a unique game experience

Acceptance criteria:
*  Boat moves smoothly when executing command
*  The appearance of the game is unique and consistent

This merge request also closes issue #42.

See merge request !42
2017-09-13 13:25:15 +12:00
fjc40 070654a95c Javadoc fix. 2017-09-13 13:07:13 +12:00
fjc40 2ad947b57d The start time of the race is no longer scaled by the race speed scalar.
Changed the prestart time to 30 seconds (was 3 minutes).
Changed the preparatory time to 10 seconds (was 1 minute).
Phases: player list +prestart > warning > race view + preparatory + no more joining > started > finished.
2017-09-13 12:59:51 +12:00
fjc40 ab96884dc6 Javadoc. 2017-09-13 12:10:36 +12:00
fjc40 55402136ed Merge remote-tracking branch 'origin/master' into story_51_rounding_fix
# Conflicts:
#	racevisionGame/src/main/java/mock/app/Event.java
#	racevisionGame/src/main/java/mock/xml/RaceXMLCreator.java

Also added keybindings.xml to git ignore.
#story[1185]
2017-09-13 12:04:32 +12:00
fjc40 2a6085c9e8 Test fix. 2017-09-13 00:52:35 +12:00
fjc40 a1684a410c Javadoc. 2017-09-13 00:43:38 +12:00
fjc40 9fa1b9ee67 Re-enabled source id allocator check.
Re-enabled rotation of map at startup.
Changed race.xml schema so that yacht elements aren't required inside the participants element.
#story[1185]
2017-09-13 00:41:23 +12:00
fjc40 3fa6b9200d Finished MarkRoundingSequence class. Added MarkRoundingData class.
RaceState has a MarkRoundingSequenceMember.
The temporary rounding line drawing in canvas uses MarkRoundingSequence.
MockRace now uses MarkRoundingSequence.
#story[1185]
2017-09-13 00:38:58 +12:00
fjc40 346aa148ef Added some debug statements, and WIP MarkRoundingSequence class.
Temporarily disabled source id allocator time checks.
Added mark rounding stuff to race canvas to help debug.
#story[1185]
2017-09-11 11:35:11 +12:00
fjc40 ec82e65ae7 Fixed javadocs in xml creation classes. 2017-09-08 13:45:36 +12:00
fjc40 361856ea1d Updated timescale. 2017-09-04 11:38:45 +12:00
fjc40 dd1cb89b66 Merge remote-tracking branch 'origin/master' into 77_racexml_updates 2017-09-04 11:28:21 +12:00
Fraser Cope df03cc5a66 Merge branch 'story86-3D' into 'master'
Story86 3D

Provide a 3D view for the lobby to view boats.

Acceptance Criteria:
- Mesh is loaded from file and is displayed rotating at a reasonable turn rate.
- 3D view can be used as a JavaFX node with no coupling to model.

See merge request !33
2017-09-03 17:10:14 +12:00
fjc40 e3cbb6d482 Start game button actually starts the game. 2017-09-03 16:39:59 +12:00
fjc40 ac891fa91c Fixed tests. 2017-09-02 01:03:47 +12:00
fjc40 16bf57e333 javadoc fixes. 2017-09-02 00:45:08 +12:00
fjc40 8c76d6c26e Added boats.xml schema.
RaceServer now creates an XMLMessage when the race's BoatDataSource changes.
#story[1188]
2017-09-02 00:34:41 +12:00
fjc40 298fcd03dc Added regatta schema.
RaceServer now creates an XMLMessage when the race's RegattaDataSource changes.
#story[1188]
2017-09-02 00:33:09 +12:00
fjc40 ec58f0c847 Participants can now join during the warning period as well.
Added RaceDataSourceToXML.
RaceServer now create an XMLMessage when the race's RaceDataSource changes.
#story[1188]
2017-09-02 00:27:44 +12:00
fjc40 9156bde8af Moved XML message creation to RaceServer instead of ConnectionAcceptor.
RaceServer does not currently generate new XMLMessages - NYI.
Added a sequence number to RaceDataSource - this is used to indicate that the data source has been modified.
#story[1188]
2017-09-01 01:19:17 +12:00
fjc40 d0eebcdb2f SourceIdAllocator now allocates from the BoatDataSource and RaceDataSource exposed by MockRace, instead of having its own source IDs. Can only allocate ids during PRESTART period.
RaceLogic now calls MockRace.initialiseBoats() after the prestart period has finished.
MockRace create a VisualiserBoat when a source ID is allocated.
MockOutput now sends updated XML messages during the race, instead of only at the start.
#story[1188]
2017-09-01 01:14:43 +12:00
fjc40 3176e76c8c MockRace:
Now uses RaceState as its base class, rather than Race. This aligns it with VisualiserRace. RaceState contains the shared race state between the client and server, and stores most of its data in RaceDataSource etc..., instead of maintaining its own copy.
Moved collider registry member to MockRace.

XMLUtilities:
Added documentation to two important functions, and updated them to use generics instead of Objects.
#story[1188]
2017-08-31 21:06:13 +12:00
fjc40 eb980c436e Wind arrow now points in the direction the wind is blowing, as per P.O feedback (again....). 2017-08-18 22:58:47 +12:00
fjc40 a9fde95b39 Updated maven version to 2.0.
Added a dedicatedServer module.
Removed Visualiser module.
Removed mock module.
Removed network module.
Fixed weird exception non-handling that appeared for some reason.
2017-08-18 22:55:50 +12:00
fjc40 0d2be85d17 Brought over long/latitude fix from "rounding_line_visible_hack" branch. 2017-08-18 21:58:31 +12:00
fjc40 666c7b029f Disabled map rotation - temp fix for the demo.
Set race to use 3 boat race.xml file.
2017-08-17 22:26:56 +12:00
fjc40 2656efcb4d Marks are a bit darker.
Wake no longer has circle at end.
2017-08-17 13:30:10 +12:00
fjc40 0f58270c10 Merge branch 'master' into issue_18_track_alpha
# Conflicts:
#	racevisionGame/src/main/java/visualiser/model/VisualiserRaceState.java
2017-08-17 13:00:13 +12:00
fjc40 62f400b924 Trackpoint line color fades out. 2017-08-17 12:56:11 +12:00
fjc40 fa26abe10c Minor tidy. 2017-08-17 12:18:17 +12:00
fjc40 114c18763b Reduced track point period to 1000ms.
issue #18
2017-08-16 19:44:42 +12:00
fjc40 20055b1883 Removed redunant calls in VisualiserRaceState.initialiseBoats().
Slightly refactored ResizableRaceCanvas - removed a redundant drawPoint() function, functions which alter the gc stroke call save/restore.
Text is drawn black, at 20pts.
The drawBoats() function: instead of drawing everything for each boat, one boat at a time, it draws the track points for all boats, then wake for all boats, etc..., to have better layering.
issue #18
2017-08-16 18:10:30 +12:00
fjc40 f1e41d5d8f Merge branch 'master' into issue_18_trackpoint 2017-08-16 16:52:32 +12:00
fjc40 85e703cba5 RaceController/info table now makes a copy of the boat list, to avoid race conditions.
#story[1095]
2017-08-15 23:10:32 +12:00
fjc40 bcb6b79f8d Fixed player boat not being highlighted.
#story[1095]
2017-08-15 22:41:43 +12:00
fjc40 a4755ed88b Maybe fixed updating boat list on FX thread. 2017-08-15 21:08:56 +12:00
fjc40 0483859c40 Fixed sparkline y axis labelling. Reverted it to how it previously worked (negative data values instead of negative scale).
issue #32
2017-08-15 20:40:29 +12:00
fjc40 9ab12a9c58 MockBoat: Removed redundant isAutoVMG() function.
TackGybeCommand now disables autoVMG.
Removed print statements from VMGCommand.
2017-08-15 18:48:14 +12:00
fjc40 dc4610d6eb Fixed sparkline not updating.
#story[1095]
2017-08-15 18:41:28 +12:00
fjc40 5ae8393126 Fixed null pointer exception when a boat finishes the race.
Boats now default to have position (0, 0).
Added mark rounding data to single player race.xml
2017-08-15 17:13:12 +12:00
fjc40 3a0bd10a57 Merge remote-tracking branch 'origin/master' into story_61
# Conflicts:
#	racevisionGame/src/main/java/mock/model/MockRace.java
#	racevisionGame/src/main/java/mock/model/commandFactory/CommandFactory.java
#	racevisionGame/src/main/java/visualiser/gameController/ControllerClient.java
#	racevisionGame/src/main/java/visualiser/gameController/ControllerServer.java
#	racevisionGame/src/main/resources/visualiser/scenes/race.fxml
2017-08-15 14:49:58 +12:00
fjc40 c9875f3987 RaceLogic no longer uses AnimationTimer for its main loop (since that ran in javafx thread). 2017-08-15 14:37:36 +12:00
fjc40 5a03d97713 Added comment. 2017-08-14 13:01:27 +12:00
fjc40 b07c30704a The trackpoint line is now a line (poly-line) instead of a sequence of circles. A point along the poly-line is added every 250ms.
issue #18
2017-08-14 12:58:05 +12:00
fjc40 175fb11178 Javadoc fixes.
#story[1095]
2017-08-14 01:02:58 +12:00
fjc40 7366aba5ec Added empty data sources, to be used by VisualiserRace.
Created FrameRateTracker which can be used to track framerate.
Updated RequestToJoinEnum and JoinAcceptanceEnum to match the agreed connection API.
Added AssignPlayerBoat message, which is used internally on the client to assign the player a source ID once they have connected.
Fixed some race conditions in the MessageRouter.
Updated ConnectionAcceptor.CheckClientConnection to wait slightly longer before removing connection (there was a slight race condition before).
Race no longer has a reference to LatestMessages. LatestMessages no longer has specific messages types in it.
Created RaceState class, which contains the state that is shared between VisualiserRaceState and MockRaceState (currently only used on visualiser).
Split VisualiserRace into VisualiserRaceState and VisualiserRaceService.
Added the VisualiserRace commands (BoatLocatonCommand, RaceStatusCommand, etc...).
Slightly increased the preferred width of race.fxml table columns.
issues #27 #37 #35
#story[1095]
2017-08-14 00:53:05 +12:00
fjc40 89b0aa8b77 Implemented MessageRouter.
Added ConnectionToServerCommandFactory, and JoinSuccessfulCommand, RaceParticipantsFullCOmmand, ServerFullCommand.
Added IncomingHeartBeatCommandFactory, and IncomingHeartBeatCommand.
Added ConnectionToServerState, which represents the client's connection state to server.
Renamed VisualiserInput to VisualiserRaceController.
Added ConnectionToServer, which tracks the client's connection to server.
Added ConnectionToServerController, which accepts JoinAcceptance messages, turns them into commands, and passes them to ConnectionToServer.
Added IncomingHeartBeatService, which tracks the heart beat status of the connection.
Added IncomingHeartBeatController, which accepts HeartBeat messages, turns them into commands, and passes them to IncomingHeartBeatService.
Refactored ServerConnection a bit.
#story[1095]
2017-08-12 19:58:47 +12:00
fjc40 6e5fb62880 Added REQUEST_RECEIVED and DECLINED to ConnnectionStateEnum.
#story[1095]
2017-08-12 01:05:45 +12:00
fjc40 41b0a5d7f7 Merge branch 'story_61' of eng-git.canterbury.ac.nz:seng302-2017/team-7 into story_61 2017-08-11 22:38:55 +12:00
fjc40 b625b6ab05 XMLReader.readXMLFileToString no longer throws a Transformer exception. 2017-08-11 22:38:39 +12:00
fjc40 61d18f85c5 javadoc fixes. 2017-08-10 23:57:54 +12:00
fjc40 19984772c0 Merge branch 'master' into story_61
Also got client-server handshake working. Multiple clients can connect and control their own boat.
The client's boat has a larger black triangle drawn around it. Probably needs tidying up.
Added isClientBoat boolean to VisualiserBoat.

WindGenerator is now an interface, implemented by ConstantWindGenerator (useful for testing) and RandomWindGenerator. Added ConstantWindGeneratorTest.
RandomWindGenerator was formerly WindGenerator.
The WindGenerator is passed in to MockRace.

CommandFactory throws a CommandConstructionException if it cannot create a command.

MessageSerialiser and MessageDeserialiser correctly terminate on error.

Readded VisualiserInput's switch statement in the main loop, pending a refactor.

Removed the sleep statement from LobbyController - it was blocking javaFX thread.

Lobby.fxml: moved buttons and text input into grid panes, so they don't break when you resize screen.

Added some test object creation functions in several test classes (MockRaceTest.createMockRace(), BoatXMLReaderTest.createBoatDataSource(), etc...).

#story[1095]
2017-08-10 23:49:21 +12:00
Fraser Cope a8af866228 Merge branch 'pom_profile_fix' into 'master'
Pom profile fix

The racevisionGame pom still had "profiles", which aren't needed with a single jar build, and the built jar didn't have a mainifest/main class.

See merge request !19
2017-08-10 13:29:05 +12:00
fjc40 5bc51343f5 Merge remote-tracking branch 'origin/master' into pom_profile_fix 2017-08-10 13:25:08 +12:00
Fraser Cope cdb6219cce Merge branch 'issue_28_36_decoders' into 'master'
Issue 28 & 36 - encoders and decoders refactor

This resolves #28 #36.
This was on the story_61 branch, but I figured it may be helpful to push this into master/other branches before then.

The main changes:
- Moved encoding functions from RaceVisionByteEncoder into their own encoder classes.
- Added a EncoderFactory and DecoderFactory, which return correct en/decoder based on MessageType.
- All encoders implement MessageEncoder interface, and all decoder implement MessageDecoder interface.

Extra changes:
- Added names to most threads that are created.
- Removed the nested while loop from MockOutput, and moved the XML stuff before the main loop (functionally it's the same).

See merge request !23
2017-08-10 13:21:42 +12:00
fjc40 130ffcbf07 Fixed some merge issues. 2017-08-10 13:16:53 +12:00
fjc40 805c12bf41 Merge remote-tracking branch 'origin/master' into issue_28_36_decoders
# Conflicts:
#	racevisionGame/src/main/java/mock/app/ConnectionAcceptor.java
#	racevisionGame/src/main/java/mock/app/Event.java
#	racevisionGame/src/main/java/visualiser/gameController/ControllerServer.java
2017-08-10 13:12:26 +12:00
Fraser Cope 7b382e48ac Merge branch 'story63' into 'master'
63. [C, M] I'd like to be able to make small adjustments to the heading of my boat, as Gemma, either upwind or downwind.

Note: each keypress should change the boat's heading by a small amount (3 degrees?) Pressing the 'upwind' key will turn the boat's head towards the wind by that small amount, while the 'downwind' key will do the opposite. Continuing to press the downwind key when the boat is already heading straight downwind, or upwind when heading directly upwind, achieves nothing.

Acceptance criteria:

- The player boat turns towards wind a small amount for each press of the 'upwind' key.
- The player boat turns away from the wind by a small amount for each press of the 'downwind' key.
- If the boat heading is directly into wind after a series of 'upwind' keypresses, the heading will continue to change in the same direction for one more keypress.
- Substitute 'downwind' for 'upwind' for the downwind case.


See merge request !21
2017-08-10 12:57:21 +12:00
fjc40 39b5cc2edc MockBoat has autoVMG disabled by default.
Wind/Tack commands disable autoVMG. VMG command enables it.
Upwind command was turning until boat was at 0 degrees, instead of being aligned with wind direction, but that's fixed.
#story[1096]
2017-08-10 12:44:42 +12:00
fjc40 7cc39abe57 WIP. Probably need to cherry pick stuff out of here.
Added ClientConnection and server-side handshake.
Added MessageSerialiser and Deserialiser.
#story[1095]
2017-08-10 12:13:40 +12:00
fjc40 3ec87582d3 Merge remote-tracking branch 'origin/master' into story_61 2017-08-08 20:58:53 +12:00
fjc40 634d78ab70 Added names to threads created.
MockOutput had a nested while loop, but it wasn't needed. Also tidied some of the error handling in MockOutput.

#story[1095]
2017-08-07 13:42:50 +12:00
fjc40 134586f407 The message encoders and decoders now catch exceptions, and throw InvalidMessageException.
Removed the big switch statement from BinaryMessageDecoder - it now uses the decoder factory instead.
issue #35 #36
#story[1095]
2017-08-06 22:25:43 +12:00
fjc40 9c64b678e3 Added MarkRoundingEncoder.
Refactored MarkRoundingDecoder - it now implements MessageDecoder.
Tidied up MarkRounding - it is now documented and has getters. Also Created MarkRoundingBoatStatusEnum, MarkRoundingIDEnum, MarkRoundingSideEnum, MarkRoundingTypeEnum.
Added MarkRoundingDecoderTest.
issue #35 #36
#story[1095]
2017-08-06 21:38:12 +12:00
fjc40 da800e659a Added AverageWindEncoder.
Refactored AverageWindDecoder - it now implements MessageDecoder.
Refactored AverageWind - it now uses milliseconds and knots, instead of packed MMperSec and tenths of a second. It also exposes its attributes now.
Added (un)packAverageWindPeriod to AC35UnitConverter.
Added AverageWindDecoderTest.
issue #35 #36
#story[1095]
2017-08-06 20:31:21 +12:00