You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add project description for RustShips
* docs: add inspiration and resource links
* added: image paths in index.md
* updated: architecture scheme in index.md
* docs: optimize 3D PCB render images to webp format
* fix: resize and compress images to pass repo size limits
* fix: deleted identifier files
* chore: update and optimize hardware images
* Week 14: simulator complete, all game logic implemented and tested
* Fix MDX link syntax on line 8
* Add WebP compressed prototype photo
* Final tweaks to docs and image
@@ -11,18 +11,18 @@ A two-player Battleship game running on devices having a 4" touchscreen display
11
11
12
12
## Description
13
13
14
-
RustShips is a fully embedded, wireless two-player Battleship game. Each player owns a dedicated device consisting of an STM32U545RE Nucleo-64 board connected to a 4" TFT touchscreen (ST7796S, 320×480) wtih action buttons and a passive buzzer. The two devices communicate wirelessly via NRF24L01+ radio modules over SPI.
14
+
RustShips is a fully embedded, wireless two-player Battleship game. Each player owns a dedicated device consisting of an STM32U545RE Nucleo-64 board connected to a 4" TFT touchscreen (ST7796S, 320×480) with action buttons and a passive buzzer. The two devices communicate wirelessly via NRF24L01+ radio modules over SPI.
15
15
16
16
Each player places a fleet of 5 ships on a 10×10 grid, then takes turns firing at the opponent's grid. The game tracks two matrices per device: `my_fleet` (own ships and incoming hits) and `enemy_radar` (shots fired and confirmed results). A dedicated button toggles between the two views.
17
17
18
18
The game features three special mechanics, each usable once per game:
19
-
-**Sonar Scan**: hold the action button for 3 seconds to reveal a 3×3 area of the enemy grid for 2 seconds
20
-
-**Airstrike**: double-press the action button to instantly sink an entire enemy ship
19
+
20
+
-**Sonar Scan**: hold the action button for 1.5 seconds to reveal a 3×3 area of the enemy grid for 1 second
21
+
-**Airstrike**: double-press the action button within a 300 ms window to instantly sink an entire enemy ship
21
22
-**Ferris Repair**: named after Ferris the Rust mascot — fully repair a damaged ship and move it to a new position
22
23
23
24
The entire game logic is written as a `no_std` Rust library (`game-core`) that compiles for both the real MCU and a desktop simulator built with `embedded-graphics-simulator`.
24
25
25
-
26
26
## Motivation
27
27
28
28
The choice of this project comes from a long-standing interest in classical strategy games like Battleships and a desire to translate tactile, paper-based mechanics into a robust digital embedded system. Beyond the childhood nostalgia, this project serves as a comprehensive learning platform for several reasons:
@@ -31,7 +31,7 @@ The choice of this project comes from a long-standing interest in classical stra
31
31
-**Hardware Integration**: The project offers hands-on experience with SPI bus sharing between high-resolution displays, touch controllers, and wireless radio modules.
32
32
-**Future Potential**: This handheld terminal is designed as a versatile gaming platform. Its low energy consumption and independent peer-to-peer wireless link make it ideal for offline use (trains, planes, or remote trips). It establishes a foundation for a suite of offline multiplayer games like or Connect 4, Tic-Tac-Toe, or even singleplayer Sudoku.
33
33
34
-
## Architecture
34
+
## Architecture
35
35
36
36
The project is split into three crates inside a Cargo workspace:
37
37
@@ -42,6 +42,7 @@ The project is split into three crates inside a Cargo workspace:
42
42
**`embassy-app`** — `no_std` Embassy application for the real hardware. Spawns independent async tasks that communicate via Embassy channels and signals.
- Updated the KiCAD images for the web documentation page
141
+
- PCB files sent to JLCPCB for production
142
+
- Implemented the full simulator game loop `main.rs` with two-player local split-screen
143
+
- Built `display.rs` which renders both player panels, grids, ships, hit/miss markers, specials
144
+
- Implemented `input.rs` with keyboard-to-InputEvent mapping with timing logic
145
+
- Implemented `fake_network.rs` to simulate the NRF24L01+ link between two players as in-process channel pair
146
+
- Wired all three special abilities end-to-end in the simulator: Sonar Scan, Airstrike, and Ferris Repair
147
+
- Fixed numerous game logic bugs across `game-core` (placement validation, cursor and key press behavior, view toggle, Ferris Repair, Airstrike, Sonar Scan, radar sync, game states)
148
+
- Playtested full games including all specials, edge cases, and win conditions
149
+
- Still waiting for the PCB to arrive
150
+
151
+
### Week 14
152
+
153
+
- Finally received the long-awaited PCB
139
154
140
155
## Hardware
141
156
142
157
Each player's device consists of:
143
158
144
159
-**STM32U545RE-Q Nucleo-64**: Arm Cortex-M33 microcontroller running at up to 160 MHz, 512 KB flash, 274 KB SRAM. Runs the Embassy async runtime with multiple concurrent tasks.
160
+
-**Power Management Subsystem**: Powered by a 3.7V LiPo battery. Includes a TP4056 module for USB-C charging, a custom P-Channel MOSFET auto-power latch circuit for software-controlled shutdown, and a 3.3V Buck-Boost converter to provide stable voltage to the MCU and peripherals.
145
161
-**4.0" TFT LCD (ST7796S, 320×480)**: Connected via SPI. Displays both game grids, ship positions, hit/miss markers, and special ability highlights. Driven by the `mipidsi` crate with `embedded-graphics`.
146
162
-**XPT2046 resistive touch controller**: Shares the SPI bus with the display (separate CS pin). Used for cell selection on the touchscreen.
147
163
-**NRF24L01+ radio module**: Connected via SPI. Provides 2.4 GHz peer-to-peer wireless communication between the two devices. No server or router required.
148
164
-**Passive buzzer**: Driven via PWM. Provides audio feedback for shots, hits, sinks, special abilities, and win/lose outcomes.
149
165
-**Navigation buttons**: Arrow buttons (up/down/left/right) for cursor movement and ship placement, plus Action, View-Toggle, and Rotate buttons.
The schematic integrates the STM32 Nucleo, nRF24L01+ transceiver, SPI TFT Display, and a custom P-Channel MOSFET auto-power latch circuit for battery management.
156
176
157
177

158
-
*Figure 1: Full system schematic including power management, MCU, and peripherals.*
178
+
_Figure 1: Full system schematic including power management, MCU, and peripherals._
159
179
160
180
#### 2. PCB Layout and Routing (2D)
161
181
162
182
The board has been floorplanned to accommodate a comfortable handheld form factor. Critical components (like the nRF24 decoupling capacitors) have been placed as close to their target pins as possible.
163
183
164
-

165
-
*Figure 2: Current 2-layer copper routing (Front: Red, Back: Blue).*
184
+

185
+
_Figure 2: Current 2-layer copper routing (Front: Red, Back: Blue)._
166
186
167
187
#### 3. 3D Render
168
188
169
-
This is the physical representation of the board, which will be used to design the 3D-printed enclosure.
189
+
This is the physical representation of the board, which will be used to design the 3D-printed enclosure.
170
190
171
-

172
-

173
-
*Figure 3: 3D visualization of the assembled PCB (front and back).*
|[Resisistors]()|Leds and power management |[20 RON](https://www.optimusdigital.ro/ro/componente-electronice-rezistoare/638-set-de-rezistoare-smd-0805.html?search_query=0104110000003560&results=1)|
206
+
|[Resisistors]()|For leds and power management |[20 RON](https://www.optimusdigital.ro/ro/componente-electronice-rezistoare/638-set-de-rezistoare-smd-0805.html?search_query=0104110000003560&results=1)|
0 commit comments