-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.go
More file actions
100 lines (76 loc) · 2.31 KB
/
config.go
File metadata and controls
100 lines (76 loc) · 2.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
package main
import (
"image/color"
"github.com/notwithering/multilife/ecosystem"
"github.com/notwithering/multilife/gfx/font"
"github.com/notwithering/multilife/renderer"
"github.com/notwithering/multilife/rng"
"github.com/notwithering/multilife/specie"
"github.com/notwithering/multilife/stats"
"github.com/notwithering/multilife/ui"
)
func newConfig() config {
config := config{}
// ecosystem
config.Ecosystem.Species = []specie.SpecieConfig{
specie.SpecieSlowBlob,
specie.SpecieWalledCities,
specie.SpecieVote4_5,
specie.SpecieDiamoeba,
specie.SpecieVote,
specie.SpecieAmoeba,
specie.SpecieConwaysLife,
specie.SpecieBacteria,
}
sizeDivisor := 4
config.Ecosystem.Width = 1920 / sizeDivisor
config.Ecosystem.Height = 1080 / sizeDivisor
config.Ecosystem.Render.BackgroundColor = color.Black
config.Ecosystem.Region.Density = 50 //%
config.Ecosystem.Region.Padding = 10 //px
// renderer
config.Renderer.Video.FPS = 60
config.Renderer.Video.SourceWidth = config.Ecosystem.Width
config.Renderer.Video.SourceHeight = config.Ecosystem.Height
config.Renderer.Video.OutputWidth = 1920
config.Renderer.Video.OutputHeight = 1080
config.Renderer.Video.OutputFile = "output.mp4"
// main
config.Main.Infinite = true
videoLengthInSeconds := 30 //seconds
config.Main.VideoLength = config.Renderer.Video.FPS * videoLengthInSeconds
// legend
config.UI.Legend.Enabled = true
config.UI.Legend.X = 1
config.UI.Legend.Y = 1
config.UI.Legend.Padding = 1
config.UI.Legend.Font = font.FontNanofont3x4
config.UI.Legend.BackgroundColor = color.RGBA{0, 0, 0, 255 / 2}
config.UI.Legend.FontColor = color.RGBA{170, 170, 170, 255}
// rng
config.RNG.Seed = 0
// stats
config.Stats.Infinite = config.Main.Infinite
config.Stats.Enabled = true
config.Stats.Interval = 1
config.Stats.Basic.Enabled = true
config.Stats.Basic.TotalFrames = config.Main.VideoLength
config.Stats.Basic.FPS = config.Renderer.Video.FPS
config.Stats.Timings.Enabled = true
config.Stats.Timings.Interval = 50
config.Stats.Ecosystem.Enabled = true
config.Stats.Ecosystem.Interval = 10
return config
}
type config struct {
Ecosystem ecosystem.Config
Renderer renderer.Config
Main MainConfig
UI ui.Config
RNG rng.Config
Stats stats.Config
}
type MainConfig struct {
VideoLength int
Infinite bool
}