Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
ffcbbc7
更新README.md以添加Docker安装和运行说明,新增Dockerfile以支持容器化部署
Lucas04-nhr Jul 5, 2025
1522018
更新Docker部分的说明,强调需要访问Docker Hub以确保顺利运行ZZZ-Simulator
Lucas04-nhr Jul 5, 2025
150466c
更新Docker部分的说明,修正Orbstack安装链接
Lucas04-nhr Jul 5, 2025
0a7ae30
更新README.md,添加Orbstack用户访问ZZZ-Simulator的提示
Lucas04-nhr Jul 5, 2025
a514266
更新README.md,修正macOS和Linux的安装说明,添加Homebrew安装步骤
Lucas04-nhr Jul 5, 2025
058d202
更新README.md,将“Pull the image”更改为“Build the image”以更准确地描述Docker操作
Lucas04-nhr Jul 5, 2025
290e116
更新README.md,移除Docker Hub的拉取提示,简化Docker部分说明
Lucas04-nhr Jul 5, 2025
6ebf407
更新README.md,移除Docker部分关于预构建镜像的说明,简化容器创建步骤
Lucas04-nhr Jul 5, 2025
be1e74c
Merge branch 'main' into main
Lucas04-nhr Jul 6, 2025
1d7fa8a
Merge branch 'main' into main
Lucas04-nhr Jul 8, 2025
8c9c7fd
fix: 修正副词条最大值过小
Lucas04-nhr Jul 8, 2025
de159f1
fix: 更新变量
Lucas04-nhr Jul 8, 2025
7eaf008
Fix/buff lable bug (#49)
Steinwaysj Jul 8, 2025
857d54e
fix: 修正副词条最大值过小
Lucas04-nhr Jul 8, 2025
d2d4a89
fix: 更新变量
Lucas04-nhr Jul 8, 2025
7755a69
Merge branch 'ZZZSimulator:main' into main
Lucas04-nhr Jul 8, 2025
387b452
fix: 添加副词条最大百分比常量导入
Lucas04-nhr Jul 8, 2025
f26ca69
Merge branch 'main' into fix/value_error
Lucas04-nhr Jul 8, 2025
b50ca0c
Merge pull request #1 from Lucas04-nhr/fix/value_error
Lucas04-nhr Jul 8, 2025
5c3cfad
fix: update max value for secondary attributes to use sc_max_percent
Lucas04-nhr Jul 8, 2025
f54dc80
chore: adjust variable values
Lucas04-nhr Jul 8, 2025
a3ba7f4
Merge pull request #2 from Lucas04-nhr/fix/value_error
Lucas04-nhr Jul 8, 2025
9e0e9f6
Merge branch 'ZZZSimulator:main' into main
Lucas04-nhr Jul 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM python:3.12-slim-bookworm
COPY --from=docker.io/astral/uv:latest /uv /uvx /bin/

WORKDIR /app
COPY . /app

RUN uv venv
RUN uv pip install .
ENV PATH=$PATH:/app/.venv/bin

EXPOSE 8501

CMD ["zsim", "run"]
50 changes: 47 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ It provides a user-friendly interface to calculate the total damage output of a
- Edit agents equipment
- Edit APL code

## Install
> [!TIP]
> You can either install `ZZZ-Simulator` via `uv` or run it with dockers.

## Install via UV

Download the latest source code in release page or use `git clone`

Expand All @@ -33,10 +36,15 @@ Download the latest source code in release page or use `git clone`
Open terminal anywhere in your device:

```bash
# On macOS or Linux:
# On Linux or macOS without Homebrew:
curl -LsSf https://astral.sh/uv/install.sh | sh
```

```bash
# On macOS with Homebrew:
brew install uv
```

```bash
# On Windows11 24H2 or later:
winget install --id=astral-sh.uv -e
Expand All @@ -63,7 +71,7 @@ uv venv
uv pip install . # there is a '.' refer to relative path
```

## Run
### Run

Open terminal anywhere in your device:

Expand All @@ -82,6 +90,42 @@ uv run ./zsim/run.py run
uv run zsim run
```

Then you can access the simulator at `http://localhost:8501`.

## Install via Docker

You can also run `ZZZ-Simulator` with Docker.

> [!NOTE]
> Make sure you have docker installed on your machine. If you haven't installed it yet, please refer to the [official Docker installation guide](https://docs.docker.com/get-docker/).
>
> On macOS, it is recommended to use [Orbstack](https://docs.orbstack.dev/install) for a better experience.

### Build the image

```bash
docker build -t zzzsimulator .
```

### Create a container

```bash
docker create --name zzzsimulator \
-p 8501:8501 \
zzzsimulator
```

### Run the container

```bash
docker start zzzsimulator
```

Then you can access the simulator at `http://localhost:8501`.

> [!TIP]
> If you are using Orbstack, you can access the simulator at `https://zzzsimulator.orb.local/`.

## TODO LIST

Go check [develop guide](https://github.com/ZZZSimulator/ZSim/wiki/%E8%B4%A1%E7%8C%AE%E6%8C%87%E5%8D%97-Develop-Guide) for more details.
3 changes: 2 additions & 1 deletion zsim/lib_webui/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ def _init_char_mapping() -> dict[str, str]:
}

# 副词条最大值
sc_max_value = 40
sc_max_percent = 40
sc_max_value = 1000

# 计算结果缓存文件路径
ID_CACHE_JSON = "./results/id_cache.json"
Expand Down
15 changes: 8 additions & 7 deletions zsim/page_character_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,14 +223,15 @@ def page_character_config():
key=f"{name}_main_stat6",
)
from zsim.lib_webui.constants import sc_max_value
from zsim.lib_webui.constants import sc_max_percent

st.text("副词条数量:")
col1, col2, col3, col4, col5 = st.columns(5)
with col1:
st.number_input(
"攻击力%",
min_value=0,
max_value=sc_max_value,
max_value=sc_max_percent,
value=saved_char_config[name].get("scATK_percent", 0)
if name in saved_char_config
else 0,
Expand All @@ -249,7 +250,7 @@ def page_character_config():
st.number_input(
"生命值%",
min_value=0,
max_value=sc_max_value,
max_value=sc_max_percent,
value=saved_char_config[name].get("scHP_percent", 0)
if name in saved_char_config
else 0,
Expand All @@ -268,7 +269,7 @@ def page_character_config():
st.number_input(
"防御力%",
min_value=0,
max_value=sc_max_value,
max_value=sc_max_percent,
value=saved_char_config[name].get("scDEF_percent", 0)
if name in saved_char_config
else 0,
Expand All @@ -287,7 +288,7 @@ def page_character_config():
st.number_input(
"暴击率",
min_value=0,
max_value=sc_max_value,
max_value=sc_max_percent,
value=saved_char_config[name].get("scCRIT", 0)
if name in saved_char_config
else 0,
Expand All @@ -296,7 +297,7 @@ def page_character_config():
st.number_input(
"暴击伤害",
min_value=0,
max_value=sc_max_value,
max_value=sc_max_percent,
value=saved_char_config[name].get("scCRIT_DMG", 0)
if name in saved_char_config
else 0,
Expand All @@ -306,7 +307,7 @@ def page_character_config():
st.number_input(
"异常精通",
min_value=0,
max_value=sc_max_value,
max_value=sc_max_percent,
value=saved_char_config[name].get("scAnomalyProficiency", 0)
if name in saved_char_config
else 0,
Expand All @@ -315,7 +316,7 @@ def page_character_config():
st.number_input(
"穿透值",
min_value=0,
max_value=sc_max_value,
max_value=sc_max_percent,
value=saved_char_config[name].get("scPEN", 0)
if name in saved_char_config
else 0,
Expand Down