Skip to content

Commit

Permalink
finish docs
Browse files Browse the repository at this point in the history
Signed-off-by: Frosty <[email protected]>
  • Loading branch information
FrostyHec committed Jun 28, 2024
1 parent addeda8 commit b924b8f
Show file tree
Hide file tree
Showing 2 changed files with 202 additions and 4 deletions.
45 changes: 45 additions & 0 deletions .idea/stat.log

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

161 changes: 157 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


<div align=center>

# Dark Chess: CS107 Final Project
Expand Down Expand Up @@ -30,12 +28,156 @@ For instructions, please refer to [User Guide](Publication/UserGuide.md)

## Project Introduction

### Project Structure

```
DarkChess
├── Code/DarkChess # source code
├── Docs
│ ├── developing # project design document
│ ├── Reference # referencing materials
│ │ (project requirement in previous semester)
│ └── Demostrate # presentation materials
├── Publication
│ ├── DarkChess # Executable file of the application
│ └── UserGuide.md
├── .gitattributes
├── .gitignore
├── LICENSE
└── README.md
```

### Feature List and Technical Implementation

The project implement the following functionalities from scratch:

- [x] Game Logic
- [x] Random Initialization
- [x] Move Legality Check
- [x] Score Calculation
- [x] Multi-step Undo
- [x] Cheat Mode
- [x] Game Progress Detection and Hints
- [x] Restart Between Games
- [x] Game Storage (Technical Implementation: Serialization)
- [x] State Saving
- [x] Save File Legality Check
- [x] Save File Replay
- [x] Load Specified Save File
- [x] Save File Deletion
- [x] Import External Save Files
- [x] Graphical Interface (Technical Implementation: JavaFX+CSS)
- [x] Basic Interface Drawing
- [x] Game Hints (e.g., Highlight Selected Piece, Move Hints)
- [x] Multi-interface Switching
- [x] Animation Effects
- [x] Variable Screen Styles
- [x] Screenshots
- [x] Artificial Intelligence
- [x] Game Mode Switching (Support for Human vs. AI)
- [x] Random AI
- [x] Basic Greedy AI
- [x] MinMax Search AI
- [x] Multiple AI Difficulty Levels
- [x] Multi-user
- [x] Local Multi-user
- [x] Game Record Statistics
- [x] Leaderboard
- [x] Custom User Information (e.g., Avatar)
- [x] Online Battle (Technical Implementation: Native Java Socket)
- [x] Server Side
- [x] Client Side
- [x] LAN Multiplayer
- [x] Multiplayer Game Rooms
- [x] Spectator Mode
- [x] Gameplay Data Statistics
- [x] Sound Effects
- [x] Button Sound Effects
- [x] Background Music
- [x] Background Music Switching Based on Game Progress
- [x] Expandable Music Pack
- [x] Music Station (Switchable Music)
- [x] Multi-language
- [x] Multi-language Support
- [x] Expandable Language Pack
- [x] Settings
- [x] Default Function Selection
- [x] Game Function Settings
- [x] Adjustable Visual Effects
- [x] Adjustable Sound Effects
- [x] In-game Settings Modification (Partial Effect)
- [x] Other Features
- [x] EXE Packaging
- [x] Early Defense

(Note: The above list only includes the main basic features. For detailed instructions and usage, see
the [User Guide](Publication/UserGuide.md))

## Development Summary

### Development Log

- 2022.11.14 - 2022.12.20 Approximately 5 weeks

- 2022.11.14 - 2022.11.20 Project framework design, basic game logic, and graphical interface implementation
- 2022.11.21 - 2022.11.27 Game logic debugging, further improvement of the graphical interface (scoreboard, user bar),
cheat function, game restart, main menu, captured pieces display
- 2022.11.28 - 2022.12.04 Save function implementation, undo function implementation, game debugging
- 2022.12.05 - 2022.12.11 Artificial intelligence implementation, multi-user implementation, music station
implementation, game mode selection, online battle development
- 2022.12.12 - 2022.12.18 Online battle debugging, leaderboard, game information statistics (e.g., win rate, game
duration), interface beautification, piece animation settings implementation
- 2022.12.19 - 2022.12.20 Screenshot function implementation, expansion of language packs, music packs, and skin packs,
music player debugging completion, EXE packaging, defense materials preparation
- 2022.12.20 Early Presentation

Cumulative code: Approximately 8000 lines of Java + Fxml + Css + resource texts
![Java+Fxml+Css approach to 9300lines.png](Docs%2Fdeveloping%2FJava%2BFxml%2BCss%20approach%20to%209300lines.png)

263 Commit
![263 commits.png](Docs%2Fdeveloping%2F263%20commits.png)

### Technical Summary

Graphical Interface: Honestly, developing desktop applications with JavaFX is much better than Swing. HTML is very
suitable for describing graphical interfaces, and CSS can easily implement theme switching (The project's
technology choices were limited, otherwise, using Electron might have resulted in a better visual interface).

Framework Design: Proper use of object-oriented principles and some design patterns can balance simplicity and
extensibility. Both design and coding are very important.

Network Design: There are indeed many exceptions and special states that need to be handled in network design. It is
essential to first sort out the possible states during network interaction and determine specific handling methods
before starting to write code. During development, we encountered the "packet sticking problem". After studying
computer networks, we better understood the stream transmission characteristics of TCP, and realized the need to add
corresponding headers/footers for segmentation to solve this "problem".

Others: The development of many small features was actually quite fast (it seems that a lot of functional blocks were
completed in one week according to the log), but thorough testing (preferably writing automated test cases) is required
to ensure the quality of the program.

### Postscript

This is probably the first time I have implemented a project with so many features from scratch. Many thanks to my
partner [@Super](https://github.com/redhecker) for working together to complete this project.

I didn't expect to accomplish so much in five weeks. It was a lot of work, but it paid off in the end.

The reference scoring standards from previous years were very detailed, essentially guiding the project's requirements (
clear requirements seem to be the most critical part of the development process, and having this reference was quite
convenient).

Although the final product still has many shortcomings, we will continue to work hard and hope to do better in future
projects.

We hope you enjoy your time with this game!

—— Frosty

## 项目介绍

### 项目结构

```
DarkChess
├── Code/DarkChess # 项目源代码
Expand All @@ -51,6 +193,7 @@ DarkChess
├── LICENSE
└── README.md
```

### 功能列表与技术实现

本项目从空项目开始,实现了以下功能:
Expand Down Expand Up @@ -83,7 +226,7 @@ DarkChess
- [x] 基本贪心AI
- [x] MinMax搜索AI
- [x] 多AI难度选择
- [x] 多用户
- [x] 多用户
- [x] 本地多用户
- [x] 游戏记录统计
- [x] 积分榜
Expand Down Expand Up @@ -138,7 +281,17 @@ Commit: 263次

### 技术总结

[TODO]
图形化界面:说实在做桌面JavaFX还是比Swing来的要好用的,HTML很适合用于描述图形化界面,CSS也能很方便地实现
主题风格的切换(不过主要是project对技术选型有限制,否则用Electron可能能够做出效果更好的视觉界面)

框架设计:用好面向对象以及一些设计模式能够平衡好简洁与可扩展性,设计和编码都是很重要的

网络设计:网络要处理的异常与特殊状态之类的真挺多的,还是要先梳理网络交互过程中的可能状态以及确定具体处理方式
再开始写代码。在开发过程中遇到了“粘包问题”,但其实学了计网之后才更加清晰的理解了TCP的流式传输特性,需要添加
对应的包头/尾以进行分割

其它:许多小功能的开发其实速度还是挺快的(似乎log里面有一周速通了很多功能块),不过还是需要充分的测试(最好是
编写可自动化运行的测试用例)才能保证程序的质量

### 后记

Expand Down

0 comments on commit b924b8f

Please sign in to comment.