Skip to content

Commit 4e467cc

Browse files
authored
Merge pull request #2177 from goplus/dev
Release v1.10.3
2 parents 699fa07 + badcc0c commit 4e467cc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+3248
-1544
lines changed

.github/dependabot.yml

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,24 @@
1-
# To get started with Dependabot version updates, you'll need to specify which
2-
# package ecosystems to update and where the package manifests are located.
3-
# Please see the documentation for all configuration options:
4-
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5-
61
version: 2
7-
updates:
8-
- package-ecosystem: github-actions
9-
directory: /
10-
labels:
11-
- dependabot
12-
- actions
13-
schedule:
14-
interval: daily
152

16-
- package-ecosystem: "gomod" # See documentation for possible values
17-
directory: "/spx-backend" # Location of package manifests
3+
multi-ecosystem-groups:
4+
infrastructure:
185
schedule:
19-
interval: "daily"
20-
21-
- package-ecosystem: "gomod" # See documentation for possible values
22-
directory: "/tools/spxls" # Location of package manifests
6+
interval: weekly
7+
go-modules:
238
schedule:
24-
interval: "daily"
9+
interval: weekly
2510

26-
- package-ecosystem: "gomod" # See documentation for possible values
27-
directory: "/tools/ispx" # Location of package manifests
28-
schedule:
29-
interval: "daily"
11+
updates:
12+
- package-ecosystem: github-actions
13+
directory: /
14+
patterns:
15+
- "*"
16+
multi-ecosystem-group: infrastructure
17+
- package-ecosystem: gomod
18+
directories:
19+
- /spx-backend
20+
- /tools/spxls
21+
- /tools/ai
22+
patterns:
23+
- "*"
24+
multi-ecosystem-group: go-modules

.github/workflows/validate.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
run: corepack enable
1515

1616
- name: Set up Node.js
17-
uses: actions/setup-node@v4
17+
uses: actions/setup-node@v5
1818
with:
1919
node-version: 20.11.1
2020
cache: npm
@@ -41,7 +41,7 @@ jobs:
4141
run: npm run format-check
4242

4343
- name: Setup Go
44-
uses: actions/setup-go@v5
44+
uses: actions/setup-go@v6
4545
with:
4646
go-version: 1.24.x
4747

@@ -78,7 +78,7 @@ jobs:
7878
- uses: actions/checkout@v5
7979

8080
- name: Setup Go
81-
uses: actions/setup-go@v5
81+
uses: actions/setup-go@v6
8282
with:
8383
go-version: 1.24.x
8484

docs/openapi.yaml

Lines changed: 48 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,6 +1103,26 @@ paths:
11031103
schema:
11041104
$ref: "#/components/schemas/AIInteractionResponse"
11051105

1106+
/ai/interaction/archive:
1107+
post:
1108+
tags:
1109+
- AI
1110+
summary: Archive AI interaction history
1111+
description: Archive a batch of interaction turns into a condensed summary for future context.
1112+
requestBody:
1113+
required: true
1114+
content:
1115+
application/json:
1116+
schema:
1117+
$ref: "#/components/schemas/AIInteractionArchiveRequest"
1118+
responses:
1119+
"200":
1120+
description: Successfully archived interaction history.
1121+
content:
1122+
application/json:
1123+
schema:
1124+
$ref: "#/components/schemas/AIInteractionArchiveResponse"
1125+
11061126
/course:
11071127
post:
11081128
tags:
@@ -2017,10 +2037,6 @@ components:
20172037
items:
20182038
$ref: "#/components/schemas/AIInteractionCommandSpec"
20192039
description: Commands the AI is allowed to call.
2020-
previousCommandResult:
2021-
$ref: "#/components/schemas/AIInteractionCommandResult"
2022-
nullable: true
2023-
description: Outcome of the command executed in the previous turn.
20242040
history:
20252041
type: array
20262042
items:
@@ -2037,10 +2053,11 @@ components:
20372053
minimum: 0
20382054
default: 0
20392055
description: |
2040-
Current turn number in a multi-turn interaction.
2056+
Current turn number in a multi-turn interaction sequence.
20412057
20422058
A value of 0 means this is the initial turn from user input. Values > 0 indicate continuation turns where
2043-
the AI should decide next steps based on previous command results.
2059+
the AI continues the current interaction sequence based on the outcomes of commands executed within this
2060+
sequence.
20442061
examples:
20452062
- 0
20462063

@@ -2065,10 +2082,6 @@ components:
20652082
- Row: 1
20662083
Col: 1
20672084
Result: ""
2068-
archivedHistory:
2069-
$ref: "#/components/schemas/AIInteractionArchivedHistory"
2070-
nullable: true
2071-
description: Archived history information when history management occurs.
20722085

20732086
AIInteractionTurn:
20742087
type: object
@@ -2107,6 +2120,11 @@ components:
21072120
$ref: "#/components/schemas/AIInteractionCommandResult"
21082121
nullable: true
21092122
description: Result of executing the command requested in the response.
2123+
isInitial:
2124+
type: boolean
2125+
description: Indicates whether this turn is the initial turn of an interaction sequence.
2126+
examples:
2127+
- true
21102128

21112129
AIInteractionCommandSpec:
21122130
type: object
@@ -2165,21 +2183,31 @@ components:
21652183
examples:
21662184
- false
21672185

2168-
AIInteractionArchivedHistory:
2186+
AIInteractionArchiveRequest:
21692187
type: object
2188+
required:
2189+
- turns
21702190
properties:
2171-
content:
2191+
turns:
2192+
type: array
2193+
items:
2194+
$ref: "#/components/schemas/AIInteractionTurn"
2195+
description: Interaction turns to be archived.
2196+
existingArchive:
21722197
type: string
2173-
description: Archived content of historical interactions.
2198+
nullable: true
2199+
description: Existing archived content to be merged with new turns.
21742200
examples:
2175-
- Previous conversation summary...
2176-
turnCount:
2177-
type: integer
2178-
format: int32
2179-
minimum: 0
2180-
description: Number of turns that were archived.
2201+
- "Previous conversation summary..."
2202+
2203+
AIInteractionArchiveResponse:
2204+
type: object
2205+
properties:
2206+
content:
2207+
type: string
2208+
description: The consolidated archive content.
21812209
examples:
2182-
- 5
2210+
- "Complete conversation summary including new turns..."
21832211

21842212
UpInfo:
21852213
type: object

docs/product/ai-interaction.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# AI Interaction
22

3-
AI Interaction is a feature in Go+ Builder that allows games to communicate with AI during runtime. This functionality enables users to create rich interactive scenarios in games such as intelligent opponents (like AI opponents in board games), smart conversations, dynamic content generation, and adaptive gaming experiences.
3+
AI Interaction is a feature in XBuilder that allows games to communicate with AI during runtime. This functionality enables users to create rich interactive scenarios in games such as intelligent opponents (like AI opponents in board games), smart conversations, dynamic content generation, and adaptive gaming experiences.
44

55
The AI Interaction feature is designed for children around 10 years old who are learning programming. It provides minimal APIs that allow them to easily integrate AI capabilities into their games without needing to understand complex network requests, error handling, or AI model details.
66

docs/product/ai-interaction.zh.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# AI 交互(AI Interaction)
22

3-
AI 交互是 Go+ Builder 中允许游戏在运行时与 AI 进行通信的功能。通过这一功能,用户可以在游戏中创建智能对抗(如棋牌类游戏的人机对战)、智能对话、动态内容生成、自适应游戏体验等丰富的交互场景。
3+
AI 交互是 XBuilder 中允许游戏在运行时与 AI 进行通信的功能。通过这一功能,用户可以在游戏中创建智能对抗(如棋牌类游戏的人机对战)、智能对话、动态内容生成、自适应游戏体验等丰富的交互场景。
44

55
AI 交互功能专为学习编程的 10 岁左右的儿童设计,提供了极简的 API,使他们能够轻松地将 AI 能力集成到自己的游戏中,而无需理解复杂的网络请求、错误处理或 AI 模型细节。
66

docs/product/animation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ In addition to the basic information of an Animation, a Skeletal Animation also
5656

5757
### Sprite
5858

59-
Building upon the [Go+ Builder Product](./index.md), the Sprite is extended as follows:
59+
Building upon the [XBuilder Product](./index.md), the Sprite is extended as follows:
6060

6161
* Model: Model information, including Skeleton, Mesh, etc. Not every Sprite has Model information. Only Sprites with Model information can have Skeletal Animations added.
6262
* Animations: A list of Animations. A Sprite can contain zero or multiple Animations. The items in the list can be Costume-group Animations or Skeletal Animations.

docs/product/animation.zh.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Animation 的基本信息包括:
5656

5757
### 精灵 Sprite
5858

59-
[Go+ Builder Product](./index.zh.md) 基础上,对 Sprite 进行扩充如下:
59+
[XBuilder Product](./index.zh.md) 基础上,对 Sprite 进行扩充如下:
6060

6161
* Model: 模型信息,包括 Skeleton、Mesh 等;不是每个 Sprite 都拥有 Model 信息,只有拥有 Model 信息的 Sprite 才可以被添加 Skeletal Animation
6262
* Animations: Animation 列表,一个 Sprite 可以包含 0 个或多个 Animation;列表中的项可能是 Costume-group Animation,也可能是 Skeletal Animation

docs/product/camera.md

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
# Camera
2+
3+
When the stage is large and the game's display area is small, we cannot show the complete stage content to users. We use Camera to control which areas of content the users can see.
4+
5+
## Basic Concepts
6+
7+
### Stage Space
8+
9+
Stage Space is the original coordinate system of the game world. Sprite positions, stage size, and other elements are all defined based on this coordinate system.
10+
11+
### Viewport Space
12+
13+
Viewport Space is the coordinate system relative to the viewport. Objects that are visible in the viewport but do not belong to the game world (such as [Widget](./widget.md)) have their positions defined based on this coordinate system.
14+
15+
Camera determines the transformation relationship from Stage Space to Viewport Space.
16+
17+
### Camera Position
18+
19+
The Camera's position determines the center point of the viewport, affecting the location of the game area that players see. It is a coordinate in Stage Space.
20+
21+
The initial Camera Position defaults to (0,0); we may allow users to configure this through the editor in the future.
22+
23+
### Camera Zoom
24+
25+
Camera Zoom determines the size of the game area corresponding to the viewport.
26+
27+
When Camera Zoom is 1, a 100x100 area on the stage (Stage Space) will also be 100x100 in size in the viewport (Viewport Space).
28+
29+
The initial Camera Zoom defaults to 1; we may allow users to configure this through the editor in the future.
30+
31+
### Stage Size
32+
33+
Stage Size is the size of the game world, which determines the available space in the game and the areas that players can explore.
34+
35+
In Stage Config, we allow users to configure the stage size. We also allow users to dynamically adjust the stage size at runtime through the `setStageSize` API.
36+
37+
### Viewport Size
38+
39+
Viewport Size determines the size of the game viewport; Viewport Size divided by Camera Zoom is the size of the corresponding area in Stage Space.
40+
41+
Viewport Size currently remains at the default 480x360; we may allow users to configure this through the editor in the future.
42+
43+
Taking Stage Size 1000x1000, Viewport Size 480x360, Camera Zoom of 1, and Camera Position of 0,0 (stage center) as an example, the viewport shows the content corresponding to a 480x360 rectangular area at the center of the stage.
44+
45+
### Follow
46+
47+
We can control the viewport to follow a target sprite's movement to keep that sprite always visible in the viewport. This functionality is called Follow.
48+
49+
### Stage Viewer
50+
51+
Stage Viewer is used to display stage content from the viewport's perspective.
52+
53+
### Map Editor
54+
55+
Map Editor provides comprehensive map editing functionality, including preview of the entire map (with zoom support), adjustment of map size, and the ability to select sprites and edit their basic properties (position, direction, etc.) in place.
56+
57+
Map Editor does not provide preview and editing for Widgets.
58+
59+
## Related APIs
60+
61+
### Camera APIs
62+
63+
```go
64+
type Game struct {
65+
Camera Camera
66+
}
67+
68+
type Camera interface {
69+
Zoom() float64
70+
SetZoom(zoom float64)
71+
72+
Xpos() float64
73+
Ypos() float64
74+
SetXYpos(x float64, y float64)
75+
76+
Follow__0(target Sprite)
77+
Follow__1(target SpriteName)
78+
}
79+
```
80+
81+
### Stage APIs
82+
83+
```go
84+
type Game interface {
85+
SetStageSize(width, height float64)
86+
}
87+
```
88+
89+
### Mouse APIs
90+
91+
Mouse-related APIs (such as `MouseX`, `MouseY`) all use Stage Space for positioning.
92+
93+
For example, in Sprite code:
94+
95+
```spx
96+
setXYpos mouseX, mouseY
97+
```
98+
99+
This will move the Sprite to the current mouse position without requiring coordinate system conversion.
100+
101+
### Edge APIs
102+
103+
Edge-related APIs (such as `touching(Edge)`, `bounceOffEdge()`), the "edge" they refer to is always the stage edge, not the viewport edge.
104+
105+
For example, in Sprite code:
106+
107+
```spx
108+
touching(Edge)
109+
```
110+
111+
The expression evaluates to `true` when the Sprite touches the stage edge, regardless of whether the Sprite is at the viewport edge.
112+
113+
## User Story
114+
115+
### Enabling Camera
116+
117+
All projects can be considered to have Camera enabled by default, but in the default state, the viewport exactly displays the complete stage content, so the Camera's presence is not felt.
118+
119+
By setting Stage Size through Stage Editor, or adjusting Camera Zoom/Position through runtime APIs to make the viewport unable to fully display the stage content, this can be considered as "enabling Camera functionality".
120+
121+
Through Stage Viewer, you can intuitively see the Camera's effect and adjust the Camera's position.
122+
123+
### Camera Following the Main Character
124+
125+
In stage code:
126+
127+
```spx
128+
Camera.follow Hero
129+
```
130+
131+
### Click to Move and Coordinate Conversion
132+
133+
Players click the screen, and the main character moves to the position corresponding to the click. In stage code:
134+
135+
```go
136+
onClick => {
137+
Hero.setXYpos mouseX, mouseY
138+
}
139+
```
140+
141+
### Dynamic Zoom to Highlight Combat
142+
143+
Zoom in when combat starts, and restore when it ends. In Sprite code:
144+
145+
```go
146+
onMsg "fight", => {
147+
zoom := Camera.zoom
148+
Camera.setZoom zoom*1.4
149+
animateAndWait "fight"
150+
Camera.setZoom zoom
151+
}
152+
```

0 commit comments

Comments
 (0)