CI: add presentation
31
.github/workflows/deploy.yml
vendored
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
name: Deploy to GitHub Pages
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
name: Deploy to GitHub Pages
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Clone fonts repository
|
||||||
|
run: git clone https://github.com/touying-typ/fonts.git fonts --depth=1
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v4
|
||||||
|
with:
|
||||||
|
python-version: '3.x'
|
||||||
|
- name: Install Touying Exporter
|
||||||
|
run: pip install touying
|
||||||
|
- name: Build HTML File
|
||||||
|
run: |
|
||||||
|
mkdir build
|
||||||
|
touying compile presentation.typ --output build/index.html --format html --font-paths fonts
|
||||||
|
- name: Deploy to GitHub Pages
|
||||||
|
uses: JamesIves/github-pages-deploy-action@v4
|
||||||
|
with:
|
||||||
|
branch: gh-pages
|
||||||
|
folder: build
|
||||||
BIN
assets/images/crates/hexlab.png
Normal file
|
After Width: | Height: | Size: 148 KiB |
BIN
assets/images/game/grid.png
Normal file
|
After Width: | Height: | Size: 199 KiB |
BIN
assets/images/game/tile-spreadout.png
Normal file
|
After Width: | Height: | Size: 62 KiB |
BIN
assets/images/game/tile.png
Normal file
|
After Width: | Height: | Size: 48 KiB |
BIN
assets/images/redblogmages/axial-coords.png
Normal file
|
After Width: | Height: | Size: 77 KiB |
BIN
assets/videos/coords/coords.gif
Normal file
|
After Width: | Height: | Size: 36 MiB |
BIN
assets/videos/coords/coords.webm
Normal file
BIN
assets/videos/coords/palette.png
Normal file
|
After Width: | Height: | Size: 950 B |
BIN
assets/videos/hexmaze/hexmaze.gif
Normal file
|
After Width: | Height: | Size: 3.6 MiB |
BIN
assets/videos/hexmaze/hexmaze.webm
Normal file
BIN
assets/videos/hexmaze/palette.png
Normal file
|
After Width: | Height: | Size: 974 B |
329
presentation.typ
@ -35,6 +35,8 @@
|
|||||||
cover: fletcher.hide,
|
cover: fletcher.hide,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
#set figure(supplement: none)
|
||||||
|
|
||||||
// Theorems configuration by ctheorems
|
// Theorems configuration by ctheorems
|
||||||
#show: thmrules.with(qed-symbol: $square$)
|
#show: thmrules.with(qed-symbol: $square$)
|
||||||
#let theorem = thmbox("theorem", "Theorem", fill: rgb("#eeffee"))
|
#let theorem = thmbox("theorem", "Theorem", fill: rgb("#eeffee"))
|
||||||
@ -55,9 +57,10 @@
|
|||||||
#show: university-theme.with(
|
#show: university-theme.with(
|
||||||
aspect-ratio: "16-9",
|
aspect-ratio: "16-9",
|
||||||
config-info(
|
config-info(
|
||||||
title: [Kvalifikācijas darbs],
|
title: [Spēles izstrāde, izmantojot Bevy spēļu dzinēju],
|
||||||
subtitle: [Spēles izstrāde, izmantojot Bevy spēļu dzinēju],
|
subtitle: [Kvalifikācijas darbs],
|
||||||
author: [Kristiāns Francis Cagulis kc22015],
|
author: [Kristiāns Francis Cagulis kc22015],
|
||||||
|
date: [2025],
|
||||||
institution: [Latvijas Universitāte],
|
institution: [Latvijas Universitāte],
|
||||||
// logo: emoji.school,
|
// logo: emoji.school,
|
||||||
),
|
),
|
||||||
@ -70,186 +73,206 @@
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
#set heading(numbering: numbly("{1}.", default: "1.1"))
|
|
||||||
|
|
||||||
#title-slide()
|
#title-slide()
|
||||||
|
|
||||||
= Animation
|
|
||||||
|
|
||||||
== Simple Animation
|
#slide[
|
||||||
|
= Pārskats
|
||||||
|
|
||||||
We can use `#pause` to #pause display something later.
|
- Entitāšu komponenšu sistēma (ECS)
|
||||||
|
- Spēles pārskats un funkcijas
|
||||||
#pause
|
- Hexlab bibliotēka
|
||||||
|
- Tehniskā demonstrācija
|
||||||
Just like this.
|
- Rezultāti un secinājumi
|
||||||
|
|
||||||
#meanwhile
|
|
||||||
|
|
||||||
Meanwhile, #pause we can also use `#meanwhile` to #pause display other content synchronously.
|
|
||||||
|
|
||||||
#speaker-note[
|
|
||||||
+ This is a speaker note.
|
|
||||||
+ You won't see it unless you use `config-common(show-notes-on-second-screen: right)`
|
|
||||||
]
|
]
|
||||||
|
|
||||||
|
= Entitāšu komponenšu sistēma (ECS)
|
||||||
|
|
||||||
== Complex Animation
|
== Kas ir ECS?
|
||||||
|
|
||||||
At subslide #touying-fn-wrapper((self: none) => str(self.subslide)), we can
|
- Koncentrējas uz kompozīciju, nevis mantošanu.
|
||||||
|
- Datu orientēta arhitektūra.
|
||||||
|
- Nodalīti dati (komponentes) un uzvedība (sistēmas).
|
||||||
|
|
||||||
use #uncover("2-")[`#uncover` function] for reserving space,
|
== Datu izkārtojums
|
||||||
|
|
||||||
use #only("2-")[`#only` function] for not reserving space,
|
// Here is an illustration to help you visualize the logical structure. The
|
||||||
|
// checkmarks show what component types are present on each entity. Empty cells
|
||||||
|
// mean that the component is not present. In this example, we have a player, a
|
||||||
|
// camera, and several enemies.
|
||||||
|
#context {
|
||||||
|
show raw: set text(size: 16pt)
|
||||||
|
table(
|
||||||
|
columns: 7,
|
||||||
|
[*Entity (ID)*],
|
||||||
|
[*Transform*],
|
||||||
|
[*Player*],
|
||||||
|
[*Enemy*],
|
||||||
|
[*Camera*],
|
||||||
|
[*Health*],
|
||||||
|
[*...*],
|
||||||
|
|
||||||
#alternatives[call `#only` multiple times \u{2717}][use `#alternatives` function #sym.checkmark] for choosing one of the alternatives.
|
`...`, "", "", "", "", "", "",
|
||||||
|
"107",
|
||||||
|
[#emoji.checkmark.heavy `<translation>`\ `<rotation>`\ `<scale>`],
|
||||||
|
emoji.checkmark.heavy,
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
[#emoji.checkmark.heavy `<50.0>`],
|
||||||
|
"",
|
||||||
|
|
||||||
|
"108",
|
||||||
|
[#emoji.checkmark.heavy `<translation>`\ `<rotation>`\ `<scale>`],
|
||||||
|
"",
|
||||||
|
emoji.checkmark.heavy,
|
||||||
|
"",
|
||||||
|
[#emoji.checkmark.heavy `<25.0>`],
|
||||||
|
"",
|
||||||
|
|
||||||
|
"109",
|
||||||
|
[#emoji.checkmark.heavy `<translation>`\ `<rotation>`\ `<scale>`],
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
[#emoji.checkmark.heavy `<camera data>`],
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
|
||||||
|
`...`,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
== Piemērs
|
||||||
|
#context {
|
||||||
|
show raw: set text(size: 16pt)
|
||||||
|
```rust
|
||||||
|
#[derive(Component)]
|
||||||
|
struct Player;
|
||||||
|
|
||||||
|
#[derive(Component)]
|
||||||
|
struct Health {
|
||||||
|
current: u32,
|
||||||
|
max: u32
|
||||||
|
}
|
||||||
|
|
||||||
|
fn heal_player(
|
||||||
|
mut query: Query<&mut Health, With<Player>>,
|
||||||
|
time: Res<Time>,
|
||||||
|
) {
|
||||||
|
for mut health in query.iter_mut() {
|
||||||
|
let new_health = health.current + 2. * time.delta_secs();
|
||||||
|
health.current = new_health.min(health.max);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
== Callback Style Animation
|
= Maze Ascension
|
||||||
|
== Spēles pārskats
|
||||||
#slide(
|
#grid(
|
||||||
repeat: 3,
|
columns: 2,
|
||||||
self => [
|
gutter: 1em,
|
||||||
#let (uncover, only, alternatives) = utils.methods(self)
|
[
|
||||||
|
- Procedurāli ģenerēta spēle ar sešstūrainu labirintu
|
||||||
At subslide #self.subslide, we can
|
- Procedurāli ģenerēti līmeņi
|
||||||
|
- Izstrādāts ar Bevy spēles dzinēju
|
||||||
use #uncover("2-")[`#uncover` function] for reserving space,
|
- Labirintu ģenerēšanas bibliotēka
|
||||||
|
|
||||||
use #only("2-")[`#only` function] for not reserving space,
|
|
||||||
|
|
||||||
#alternatives[call `#only` multiple times \u{2717}][use `#alternatives` function #sym.checkmark] for choosing one of the alternatives.
|
|
||||||
],
|
],
|
||||||
|
image("assets/images/placeholder.jpg"),
|
||||||
|
)
|
||||||
|
|
||||||
|
== Spēles funkcionalitāte
|
||||||
|
|
||||||
|
#grid(
|
||||||
|
columns: 2,
|
||||||
|
gutter: 1em,
|
||||||
|
[
|
||||||
|
- Izveidots, izmantojot Bevy spēļu dzinēju
|
||||||
|
- Pielāgota labirintu ģenerēšanas bibliotēka
|
||||||
|
- Procedurāla līmeņu ģenerēšana
|
||||||
|
- Dinamiska grūtības pakāpes mainīšana
|
||||||
|
],
|
||||||
|
image("assets/images/placeholder.jpg"),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
== Math Equation Animation
|
= Hexlab bibliotēka
|
||||||
|
#pagebreak()
|
||||||
|
#figure(
|
||||||
|
caption: link("https://crates.io/crates/hexlab"),
|
||||||
|
image("assets/images/crates/hexlab.png", height: 92%),
|
||||||
|
)
|
||||||
|
|
||||||
Equation with `pause`:
|
== Ģenerēšanas algoritms
|
||||||
|
// recursive backtracking
|
||||||
|
#figure(
|
||||||
|
caption: link("https://en.wikipedia.org/wiki/Maze_generation_algorithm"),
|
||||||
|
image("assets/videos/hexmaze/hexmaze.gif", height: 92%),
|
||||||
|
)
|
||||||
|
|
||||||
$
|
= Sešstūru implementācija
|
||||||
f(x) &= pause x^2 + 2x + 1 \
|
== Iedvesma
|
||||||
&= pause (x + 1)^2 \
|
#figure(
|
||||||
$
|
caption: link("https://www.redblobgames.com/grids/hexagons/"),
|
||||||
|
grid(
|
||||||
#meanwhile
|
columns: 2,
|
||||||
|
figure(image("assets/images/redblogmages/axial-coords.png", height: 92%)),
|
||||||
Here, #pause we have the expression of $f(x)$.
|
figure(image("assets/videos/coords/coords.gif", height: 92%)),
|
||||||
|
|
||||||
#pause
|
|
||||||
|
|
||||||
By factorizing, we can obtain this result.
|
|
||||||
|
|
||||||
|
|
||||||
== CeTZ Animation
|
|
||||||
|
|
||||||
CeTZ Animation in Touying:
|
|
||||||
|
|
||||||
#cetz-canvas({
|
|
||||||
import cetz.draw: *
|
|
||||||
|
|
||||||
rect((0, 0), (5, 5))
|
|
||||||
|
|
||||||
(pause,)
|
|
||||||
|
|
||||||
rect((0, 0), (1, 1))
|
|
||||||
rect((1, 1), (2, 2))
|
|
||||||
rect((2, 2), (3, 3))
|
|
||||||
|
|
||||||
(pause,)
|
|
||||||
|
|
||||||
line((0, 0), (2.5, 2.5), name: "line")
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
== Fletcher Animation
|
|
||||||
|
|
||||||
Fletcher Animation in Touying:
|
|
||||||
|
|
||||||
#fletcher-diagram(
|
|
||||||
node-stroke: .1em,
|
|
||||||
node-fill: gradient.radial(
|
|
||||||
blue.lighten(80%),
|
|
||||||
blue,
|
|
||||||
center: (30%, 20%),
|
|
||||||
radius: 80%,
|
|
||||||
),
|
),
|
||||||
spacing: 4em,
|
|
||||||
edge((-1, 0), "r", "-|>", `open(path)`, label-pos: 0, label-side: center),
|
|
||||||
node((0, 0), `reading`, radius: 2em),
|
|
||||||
edge((0, 0), (0, 0), `read()`, "--|>", bend: 130deg),
|
|
||||||
pause,
|
|
||||||
edge(`read()`, "-|>"),
|
|
||||||
node((1, 0), `eof`, radius: 2em),
|
|
||||||
pause,
|
|
||||||
edge(`close()`, "-|>"),
|
|
||||||
node((2, 0), `closed`, radius: 2em, extrude: (-2.5, 0)),
|
|
||||||
edge((0, 0), (2, 0), `close()`, "-|>", bend: -40deg),
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
== Attēlošana
|
||||||
|
|
||||||
= Theorems
|
#grid(
|
||||||
|
columns: 2,
|
||||||
|
figure(
|
||||||
|
image("assets/images/game/tile-spreadout.png", height: 100%),
|
||||||
|
),
|
||||||
|
figure(
|
||||||
|
image("assets/images/game/tile.png", height: 100%),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
== Prime numbers
|
#figure(
|
||||||
|
image("assets/images/game/grid.png", height: 100%),
|
||||||
|
)
|
||||||
|
|
||||||
#definition[
|
= Saskarne
|
||||||
A natural number is called a #highlight[_prime number_] if it is greater
|
== foo
|
||||||
than 1 and cannot be written as the product of two smaller natural numbers.
|
#lorem(10)
|
||||||
]
|
|
||||||
#example[
|
|
||||||
The numbers $2$, $3$, and $17$ are prime.
|
|
||||||
@cor_largest_prime shows that this list is not exhaustive!
|
|
||||||
]
|
|
||||||
|
|
||||||
#theorem("Euclid")[
|
= Secinājumi
|
||||||
There are infinitely many primes.
|
== Rezultāti
|
||||||
]
|
- Veiksmīgi īstenota procedurālā ģenerēšana.
|
||||||
#proof[
|
- Efektīvs labirinta ģenerēšanas algoritms.
|
||||||
Suppose to the contrary that $p_1, p_2, dots, p_n$ is a finite enumeration
|
- Vienmērīga spēlēšanas pieredze.
|
||||||
of all primes. Set $P = p_1 p_2 dots p_n$. Since $P + 1$ is not in our list,
|
- Modulāra un atkārtoti izmantojama kodu bāze.
|
||||||
it cannot be prime. Thus, some prime factor $p_j$ divides $P + 1$. Since
|
|
||||||
$p_j$ also divides $P$, it must divide the difference $(P + 1) - P = 1$, a
|
|
||||||
contradiction.
|
|
||||||
]
|
|
||||||
|
|
||||||
#corollary[
|
== Turpmākie darbi
|
||||||
There is no largest prime number.
|
|
||||||
] <cor_largest_prime>
|
|
||||||
#corollary[
|
|
||||||
There are infinitely many composite numbers.
|
|
||||||
]
|
|
||||||
|
|
||||||
#theorem[
|
= Paldies par uzmanību
|
||||||
There are arbitrarily long stretches of composite numbers.
|
|
||||||
]
|
|
||||||
|
|
||||||
#proof[
|
|
||||||
For any $n > 2$, consider $
|
|
||||||
n! + 2, quad n! + 3, quad ..., quad n! + n #qedhere
|
|
||||||
$
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
= Others
|
|
||||||
|
|
||||||
== Side-by-side
|
|
||||||
|
|
||||||
#slide(composer: (1fr, 1fr))[
|
|
||||||
First column.
|
|
||||||
][
|
|
||||||
Second column.
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
== Multiple Pages
|
|
||||||
|
|
||||||
#lorem(200)
|
|
||||||
|
|
||||||
|
Jautājumi?
|
||||||
|
|
||||||
#show: appendix
|
#show: appendix
|
||||||
|
|
||||||
= Appendix
|
= Pēcvārds
|
||||||
|
== ECS vs OOP
|
||||||
== Appendix
|
#grid(
|
||||||
|
columns: (1fr, 1fr),
|
||||||
Please pay attention to the current slide number.
|
gutter: 1em,
|
||||||
|
[
|
||||||
|
*ECS*
|
||||||
|
- Plakanā hierarhija
|
||||||
|
- Datu orientēta
|
||||||
|
- Kešatmiņai piemērots
|
||||||
|
- Paralēla apstrāde
|
||||||
|
],
|
||||||
|
[
|
||||||
|
*OOP*
|
||||||
|
- Dziļa mantojamība (inheritance)
|
||||||
|
- Objektorientēta
|
||||||
|
- Kešatmiņa izkliedēts
|
||||||
|
- Secīga apstrāde
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|||||||