starlit  Check-in [e905f495dc]

Overview
Comment:fix some bugs, start work on actually using the tier system, add usage docs
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: e905f495dc51bcb45ecc91c61af102a75b3b1404db5a70f61225e3101e12f1b7
User & Date: lexi on 2024-05-07 23:16:29
Other Links: manifest | tags
Context
2024-05-09
15:33
add beginnings of construction system, add cuprite, fix granite, tweak balance, add sane asset management system check-in: d831add94c user: lexi tags: trunk
2024-05-07
23:16
fix some bugs, start work on actually using the tier system, add usage docs check-in: e905f495dc user: lexi tags: trunk
03:45
compiler now draws power, better compile job progress bars, stats screen refreshes check-in: 52a4f364ac user: lexi tags: trunk
Changes

Modified mods/starlit-electronics/init.lua from [50792bb85d] to [edafa25ca2].

302
303
304
305
306
307
308

309
310
311
312
313
314
315
316

317
318
319
320
321
322
323
324
325
326
327
328

329
330
331
332
333
334
335

336
337
338
339
340
341
342
343
344
345
346
347

348
349
350
351
352
353
354
355
356
357
358
359
360

361
362
363
364
365
366
367
368
369
370
371
372
373

374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
...
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
...
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
-- makeshift: cheap, weak, low quality
-- imperial ("da red wunz go fasta"): powerful, low quality
-- commune ("snooty sophisticates"): limited power, high quality, expensive
-- usukwinya ("value engineering"): high power, mid quality, affordable
-- eluthrai ("uncompromising"): high power, high quality, wildly expensive
-- firstborn ("god-tier"): exceptional


local batteryTiers = {
	makeshift = {
		name = 'Makeshift'; capacity = .5, decay = 3, leak = 2, dischargeRate = 1,
		fab = starlit.type.fab {
			element = {copper=10};
			cost = {power = 0.3};
			time = {print = .25};
		};

		desc = "Every attosecond this electrical abomination doesn't explode in your face is but the unearned grace of the Wild Gods.";
		complexity = 1;
		sw = {rarity = 1};
	};
	imperial  = {
		name = 'Imperial'; capacity = 2, decay = 2, leak = 2, dischargeRate = 2; 
		fab = starlit.type.fab {
			element = {copper=15, iron = 20};
			size = { print = 0.1 };
			cost = {power = 2};
			time = {print = .5};
		};

		desc = "The Empire's native technology is a lumbering titan: bulky, inefficient, unreliable, ugly, and awesomely powerful. Their batteries are no exception, with raw capacity and throughput that exceed even Usukinwya designs.";
		drm = 1;
		complexity = 2;
		sw = {rarity = 2};
	};
	commune   = {
		name = 'Commune'; capacity = 1, decay = .5, leak = .2, dischargeRate = 1; 

		fab = starlit.type.fab {
			element = {vanadium = 50};
			metal = {steel=10};
			size = { print = 0.05 };
			cost = {power = 1};
		};
		desc = "The Commune's proprietary battery designs prioritize reliability, compactness, and maintenance concerns above raw throughput, with an elegance of engineering and design that would make a Su'ikuri cry.";
		complexity = 5;
		sw = {rarity = 3};
	};
	usukwinya = {
		name = 'Usukwinya'; capacity = 2, decay = 1, leak = 1, dischargeRate = 1.5,

		fab = starlit.type.fab {
			element = {argon=10};
			metal = {vanadium=30};
			size = { print = 0.07 };
			cost = {power = .8};
		};
		desc = "A race of consummate value engineers, the Usukwinya have spent thousands of years refining their tech to be as cheap to build as possible, without compromising much on quality. The Tradebirds drive an infamously hard bargain, but their batteries are more than worth their meagre cost.";
		drm = 2;
		sw = {rarity = 10};
		complexity = 15;
	};
	eluthrai  = {
		name = 'Eluthrai'; capacity = 3, decay = .4, leak = .1, dischargeRate = 1.5,

		fab = starlit.type.fab {
			element = {beryllium=20, platinum=20, technetium = 1};
			metal = {cinderstone = 10};
			size = { print = 0.03 };
			cost = {power = 10};
			time = {print = 2};
		};
		desc = "The uncompromising Eluthrai are never satisfied until every quantifiable characteristic of their tech is maximally optimised down to the picoscale. Their batteries are some of the best in the Reach, and unquestionably the most expensive -- especially for those lesser races trying to copy the designs without the benefit of the sublime autofabricator ecosystem of the Eluthrai themselves.";
		complexity = 200;
		sw = {rarity = 0}; -- you think you're gonna buy eluthran schematics on SuperDiscountNanoWare.space??
	};
	firstborn = {
		name = 'Firstborn'; capacity = 5, decay = 0.1, leak = 0, dischargeRate = 3;

		fab = starlit.type.fab {
			element = {neodymium=20, xenon=150, technetium=5};
			metal = {sunsteel = 10};
			crystal = {astrite = 1};
			size = { print = 0.05 };
			cost = {power = 50};
			time = {print = 4};
		};
		desc = "Firstborn engineering seamlessly merges psionic effects with a mastery of the physical universe unattained by even the greatest of the living Starsouls. Their batteries reach levels of performance that strongly imply Quantum Gravity Theory -- and several major holy books -- need to be rewritten. From the ground up.";
		complexity = 1000;
		sw = {rarity = 0}; -- lol no
	};
}

local batterySizes = {
................................................................................
	huge  = {name = 'Huge',  capacity =  3, dischargeRate =   2, complexity = 1, matMult = 2,
		fab = starlit.type.fab {size={print=0.8},cost={power=8},time={print=120}}};
}

local batteryTypes = {
	supercapacitor = {
		name = 'Supercapacitor';
		desc = 'Room-temperature superconductors make for very reliable, high-dischargeRate, but low-capacity batteries.';
		fab = starlit.type.fab {
			metal = { enodium = 5 };
			size = {print=0.8};
			cost = {power = 1e3};
		};
		sw = {
			cost = {
................................................................................
for bTierName, bTier in pairs(batteryTiers) do
for bSizeName, bSize in pairs(batterySizes) do
	-- elemath(elementCost, bType.fab.element or {}, bSize.matMult)
	-- elemath(elementCost, bTier.fab.element or {}, bSize.matMult)
	-- elemath(metalCost, bType.fab.metal or {}, bSize.matMult)
	-- elemath(metalCost, bTier.fab.metal or {}, bSize.matMult)
	local fab = bType.fab + bTier.fab + bSize.fab + starlit.type.fab {
		element = {copper = 10, silicon = 5};
	}
	local baseID = string.format('battery_%s_%s_%s',
		bTypeName, bTierName, bSizeName)
	local id = 'starlit_electronics:'..baseID
	local name = string.format('%s %s Battery', bTier.name, bType.name)
	if bSize.name then name = bSize.name .. ' ' .. name end
	local function batStat(s)







>



|
|
|
|
|
>






|
|
|
|
|
|
>







>
|
|
|
|
|
|






>
|
|
<
|
|
|







>
|
|
|
|
|
|
|






>
|
|
|
|
|
|
|
|







 







|







 







|







302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354

355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
...
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
...
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
-- makeshift: cheap, weak, low quality
-- imperial ("da red wunz go fasta"): powerful, low quality
-- commune ("snooty sophisticates"): limited power, high quality, expensive
-- usukwinya ("value engineering"): high power, mid quality, affordable
-- eluthrai ("uncompromising"): high power, high quality, wildly expensive
-- firstborn ("god-tier"): exceptional

		print(dump(starlit.world.tier.fabsum('commune', 'battery')))
local batteryTiers = {
	makeshift = {
		name = 'Makeshift'; capacity = .5, decay = 3, leak = 2, dischargeRate = 1,
-- 		fab = starlit.type.fab {
-- 			element = {copper=10};
-- 			cost = {power = 0.3};
-- 			time = {print = .25};
-- 		};
		fab = starlit.world.tier.fabsum('makeshift', 'battery');
		desc = "Every attosecond this electrical abomination doesn't explode in your face is but the unearned grace of the Wild Gods.";
		complexity = 1;
		sw = {rarity = 1};
	};
	imperial  = {
		name = 'Imperial'; capacity = 2, decay = 2, leak = 2, dischargeRate = 2; 
-- 		fab = starlit.type.fab {
-- 			element = {iron = 20};
-- 			size = { print = 0.1 };
-- 			cost = {power = 2};
-- 			time = {print = .5};
-- 		};
		fab = starlit.world.tier.fabsum('imperial', 'battery');
		desc = "The Empire's native technology is a lumbering titan: bulky, inefficient, unreliable, ugly, and awesomely powerful. Their batteries are no exception, with raw capacity and throughput that exceed even Usukinwya designs.";
		drm = 1;
		complexity = 2;
		sw = {rarity = 2};
	};
	commune   = {
		name = 'Commune'; capacity = 1, decay = .5, leak = .2, dischargeRate = 1; 
		fab = starlit.world.tier.fabsum('commune', 'battery');
-- 		fab = starlit.type.fab {
-- 			element = {vanadium=10};
-- 			metal = {aluminum=10};
-- 			size = { print = 0.05 };
-- 			cost = {power = 1};
-- 		};
		desc = "The Commune's proprietary battery designs prioritize reliability, compactness, and maintenance concerns above raw throughput, with an elegance of engineering and design that would make a Su'ikuri cry.";
		complexity = 5;
		sw = {rarity = 3};
	};
	usukwinya = {
		name = 'Usukwinya'; capacity = 2, decay = 1, leak = 1, dischargeRate = 1.5,
		fab = starlit.world.tier.fabsum('usukwinya', 'battery');
-- 		fab = starlit.type.fab {
-- 			element = {argon=10, vanadium=10};

-- 			size = { print = 0.07 };
-- 			cost = {power = .8};
-- 		};
		desc = "A race of consummate value engineers, the Usukwinya have spent thousands of years refining their tech to be as cheap to build as possible, without compromising much on quality. The Tradebirds drive an infamously hard bargain, but their batteries are more than worth their meagre cost.";
		drm = 2;
		sw = {rarity = 10};
		complexity = 15;
	};
	eluthrai  = {
		name = 'Eluthrai'; capacity = 3, decay = .4, leak = .1, dischargeRate = 1.5,
		fab = starlit.world.tier.fabsum('eluthrai', 'battery');
-- 		fab = starlit.type.fab {
-- 			element = {beryllium=20, platinum=20, technetium = 1};
-- 			metal = {cinderstone = 10};
-- 			size = { print = 0.03 };
-- 			cost = {power = 10};
-- 			time = {print = 2};
-- 		};
		desc = "The uncompromising Eluthrai are never satisfied until every quantifiable characteristic of their tech is maximally optimised down to the picoscale. Their batteries are some of the best in the Reach, and unquestionably the most expensive -- especially for those lesser races trying to copy the designs without the benefit of the sublime autofabricator ecosystem of the Eluthrai themselves.";
		complexity = 200;
		sw = {rarity = 0}; -- you think you're gonna buy eluthran schematics on SuperDiscountNanoWare.space??
	};
	firstborn = {
		name = 'Firstborn'; capacity = 5, decay = 0.1, leak = 0, dischargeRate = 3;
		fab = starlit.world.tier.fabsum('firstborn', 'battery');
-- 		fab = starlit.type.fab {
-- 			element = {neodymium=20, xenon=150, technetium=5};
-- 			metal = {sunsteel = 10};
-- 			crystal = {astrite = 1};
-- 			size = { print = 0.05 };
-- 			cost = {power = 50};
-- 			time = {print = 4};
-- 		};
		desc = "Firstborn engineering seamlessly merges psionic effects with a mastery of the physical universe unattained by even the greatest of the living Starsouls. Their batteries reach levels of performance that strongly imply Quantum Gravity Theory -- and several major holy books -- need to be rewritten. From the ground up.";
		complexity = 1000;
		sw = {rarity = 0}; -- lol no
	};
}

local batterySizes = {
................................................................................
	huge  = {name = 'Huge',  capacity =  3, dischargeRate =   2, complexity = 1, matMult = 2,
		fab = starlit.type.fab {size={print=0.8},cost={power=8},time={print=120}}};
}

local batteryTypes = {
	supercapacitor = {
		name = 'Supercapacitor';
		desc = 'Room-temperature superconductors make for very reliable, high-discharge rate, but low-capacity batteries.';
		fab = starlit.type.fab {
			metal = { enodium = 5 };
			size = {print=0.8};
			cost = {power = 1e3};
		};
		sw = {
			cost = {
................................................................................
for bTierName, bTier in pairs(batteryTiers) do
for bSizeName, bSize in pairs(batterySizes) do
	-- elemath(elementCost, bType.fab.element or {}, bSize.matMult)
	-- elemath(elementCost, bTier.fab.element or {}, bSize.matMult)
	-- elemath(metalCost, bType.fab.metal or {}, bSize.matMult)
	-- elemath(metalCost, bTier.fab.metal or {}, bSize.matMult)
	local fab = bType.fab + bTier.fab + bSize.fab + starlit.type.fab {
		element = {copper = 10};
	}
	local baseID = string.format('battery_%s_%s_%s',
		bTypeName, bTierName, bSizeName)
	local id = 'starlit_electronics:'..baseID
	local name = string.format('%s %s Battery', bTier.name, bType.name)
	if bSize.name then name = bSize.name .. ' ' .. name end
	local function batStat(s)

Modified mods/starlit/terrain.lua from [e1d816e7a5] to [18098e5201].

1
2







3
4
5
6
7
8
9
..
32
33
34
35
36
37
38

39
40
41
42
43
44
45
..
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
..
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
...
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150

151
152
153
154
155
156
157
158
159
160

161
162
163
164
165
166
167
local T = starlit.translator
local lib = starlit.mod.lib








starlit.terrain = {}
local soilSounds = {
	footstep = 'default-dirt-footstep';
	dug = 'default-dug-node';
}
local sandSounds = {
................................................................................
	tiles = {'starlit-terrain-soil.png'};
	groups = {looseClump = 2, soil = 1};
	drop = soilDrop;
	sounds = soilSounds;
	_starlit = {
		kind = 'block';
		elements = {};

	};
})


minetest.register_node('starlit:sand', {
	description = T 'Sand';
	tiles = {'starlit-terrain-sand.png'};
................................................................................
	description = T 'Lifesilt';
	tiles = {'starlit-terrain-lifesilt.png'};
	groups = {looseClump = 1, lifesilt = 1, falling_node = 1};
	drop = '';
	sounds = sandSounds;
	_starlit = {
		kind = 'block';
		fab = starlit.type.fab { element = { carbon = 8, silicon = 4 } };
	};
})

minetest.register_craftitem('starlit:soil_clump', {
	short_description = T 'Soil';
	description = starlit.ui.tooltip {
		title = T 'Soil';
................................................................................
		if me:get_count() < 3 then return end
		if minetest.place_node(point.above, {name = 'starlit:soil'}, luser) then
			me:take_item(3)
		end
		return me
	end;
	_starlit = {
		fab = starlit.type.fab { element = { carbon = 12 / 4 } };
	};
})

function starlit.terrain.createGrass(def)
	local drop = {
		max_items = 4;
		items = {
................................................................................
				tileable_vertical = false;
			};
		};
		groups = {looseClump = 2, grass = 1, soil = 1, sub_walk = 1};
		drop = soilDrop;
		sounds = grassSounds;
		_starlit = {
			fab = def.fab;
			recover = def.recover;
			recover_vary = def.recover_vary;
		};
	})
end


starlit.terrain.createGrass {
	name = 'starlit:greengraze';
	desc = T 'Greengraze';
	img = 'starlit-terrain-greengraze';
	fab = starlit.type.fab {
		element = { carbon = 12; };
		time = { shred = 2.5; };
	};
}

starlit.terrain.createGrass {
	name = 'starlit:undergloam';
	desc = T 'Undergloam';
	-- fungal carpet
	img = 'starlit-terrain-undergloam';
	fab = starlit.type.fab {
		element = {
			carbon = 12;
		};
		time = { shred = 2.5; };
	};
}

for _, w in pairs {false,true} do
	minetest.register_node('starlit:liquid_water' .. (w and '_flowing' or ''), {
		description = T 'Water';
		drawtype = 'liquid';
		waving = 3;
		tiles = {
			{
				name = "default_water_source_animated.png";

				backface_culling = false;
				animation = {
					type = "vertical_frames";
					aspect_w = 16;
					aspect_h = 16;
					length = 2.0;
				};
			};
			{
				name = "default_water_source_animated.png";

				backface_culling = true;
				animation = {
					type = "vertical_frames";
					aspect_w = 16;
					aspect_h = 16;
					length = 2.0;
				};


>
>
>
>
>
>
>







 







>







 







|







 







|







 







<











|
<
<
<







|
<
<
<
<
<









|
>









|
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
..
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
..
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
..
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
...
113
114
115
116
117
118
119

120
121
122
123
124
125
126
127
128
129
130
131



132
133
134
135
136
137
138
139





140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
local T = starlit.translator
local lib = starlit.mod.lib

local soilRec = starlit.type.fab {
	element = {
		carbon = 25;
	};
	time = { shred = 2.5; };
};

starlit.terrain = {}
local soilSounds = {
	footstep = 'default-dirt-footstep';
	dug = 'default-dug-node';
}
local sandSounds = {
................................................................................
	tiles = {'starlit-terrain-soil.png'};
	groups = {looseClump = 2, soil = 1};
	drop = soilDrop;
	sounds = soilSounds;
	_starlit = {
		kind = 'block';
		elements = {};
		recover = soilRec;
	};
})


minetest.register_node('starlit:sand', {
	description = T 'Sand';
	tiles = {'starlit-terrain-sand.png'};
................................................................................
	description = T 'Lifesilt';
	tiles = {'starlit-terrain-lifesilt.png'};
	groups = {looseClump = 1, lifesilt = 1, falling_node = 1};
	drop = '';
	sounds = sandSounds;
	_starlit = {
		kind = 'block';
		recover = starlit.type.fab { element = { carbon = 16, silicon = 16, rubidium = 4 } };
	};
})

minetest.register_craftitem('starlit:soil_clump', {
	short_description = T 'Soil';
	description = starlit.ui.tooltip {
		title = T 'Soil';
................................................................................
		if me:get_count() < 3 then return end
		if minetest.place_node(point.above, {name = 'starlit:soil'}, luser) then
			me:take_item(3)
		end
		return me
	end;
	_starlit = {
		recover = starlit.type.fab { element = { carbon = 25 / 4 } };
	};
})

function starlit.terrain.createGrass(def)
	local drop = {
		max_items = 4;
		items = {
................................................................................
				tileable_vertical = false;
			};
		};
		groups = {looseClump = 2, grass = 1, soil = 1, sub_walk = 1};
		drop = soilDrop;
		sounds = grassSounds;
		_starlit = {

			recover = def.recover;
			recover_vary = def.recover_vary;
		};
	})
end


starlit.terrain.createGrass {
	name = 'starlit:greengraze';
	desc = T 'Greengraze';
	img = 'starlit-terrain-greengraze';
	recover = soilRec;



}

starlit.terrain.createGrass {
	name = 'starlit:undergloam';
	desc = T 'Undergloam';
	-- fungal carpet
	img = 'starlit-terrain-undergloam';
	recover = soilRec;





}

for _, w in pairs {false,true} do
	minetest.register_node('starlit:liquid_water' .. (w and '_flowing' or ''), {
		description = T 'Water';
		drawtype = 'liquid';
		waving = 3;
		tiles = {
			{
-- 				name = "default_water_source_animated.png";
				name = "starlit-water.png";
				backface_culling = false;
				animation = {
					type = "vertical_frames";
					aspect_w = 16;
					aspect_h = 16;
					length = 2.0;
				};
			};
			{
-- 				name = "default_water_source_animated.png";
				name = "starlit-water.png";
				backface_culling = true;
				animation = {
					type = "vertical_frames";
					aspect_w = 16;
					aspect_h = 16;
					length = 2.0;
				};

Modified mods/starlit/tiers.lua from [513c94b946] to [de1b489a19].

7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
..
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
..
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
...
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159

160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190



191
192
193
194
195
196
197
198
199
...
202
203
204
205
206
207
208
209
210
211

212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
function starlit.world.tier.fabsum(name, ty)
	local dest = fab {}
	local t = starlit.world.tier.db[name]
	assert(t, 'reference to nonexisting tier '..name)
	if t.super then
		dest = dest+starlit.world.tier.fabsum(t.super, ty)*(t.cost or 1)
	end
	if t.fabclasses and t.fabclasses[ty] then
		dest = dest + t.fabclasses[ty]
	end
	return dest
end

function starlit.world.tier.tech(name, tech)
	local t = starlit.world.tier.db[name]
	if t.techs and t.techs[tech] ~= nil then return t.techs[tech] end
................................................................................
	------------------
	-- tier classes --
	------------------

	lesser = {
		name = 'Lesser', adj = 'Lesser';
		super = 'base';
		fabclasses = {
			basis = fab {
				metal = {aluminum=4};
			};
		};
	};
	greater = {
		name = 'Greater', adj = 'Greater';
		super = 'base';
		fabclasses = {
			basis = fab {
				metal = {vanadium=2};
			};
		};
	};
	starlit = {
		name = 'Starsoul', adj = 'Starsoul';
		super = 'base';
		fabclasses = {
			basis = fab {
				metal = {osmiridium=1};
			};
		};
	};
	forevanished = {
		name = 'Forevanished One', adj = 'Forevanished';
		super = 'base';
		fabclasses = {
			basis = fab {
				metal = {elusium=1};
			};
		};
	};

	------------------
................................................................................
		name = 'Makeshift', adj = 'Makeshift';
		super = 'lesser';
		techs = {tool = true, prim = true, electric = true};
		power = 0.5;
		efficiency = 0.3;
		reliability = 0.2;
		cost = 0.3;
		fabclasses = { -- characteristic materials
			basis = fab { -- fallback
				metal = {iron=3};
			};
		};
	};

	imperial = { --powerful trash
		name = 'Imperial', adj = 'Imperial';
		super = 'lesser';
		techs = {tool = true, electric = true, electronic = true, suit = true, combatSuit = true, weapon = true, hover='ion'};
		power = 2.0;
		efficiency = 0.5;
		reliability = 0.5;
		cost = 1.0;
		fabclasses = {
			basis = fab {
				metal = {steel=2};
			};
		};
	};

	commune = { --reliability
		name = 'Commune', adj = 'Commune';
		super = 'lesser';
		techs = {tool = true, electric = true, electronic = true, suit = true, combatSuit = true, weapon = true, gravitic = true, hover='grav'};
		power = 1.0;
		efficiency = 2.0;
		reliability = 3.0;
		cost = 1.5;
		fabclasses = {
			basis = fab {
				metal = {titanium=1};
				time = {print = 1.2}; -- commune stuff is intricate
			};
		};
	};

	-------------------
	-- Greater Races --
................................................................................
		name = 'Su\'ikuri', adj = "Su'ikuruk";
		super = 'starlit';
		techs = {psi = true, prim = true, bioSuit = true, psiSuit = true};
		power = 1.5;
		efficiency = 1.0;
		reliability = 3.0;
		cost = 2.0;
		fabclasses = {
			psi = fab {
				metal = {numinium = 2.0};
				crystal = {beryllium = 1.0};
			};
			bio = fab {
				crystal = {beryllium = 1.0};
			};
		};
	};

	usukwinya = { --value for 'money'; no weapons; no hovertech (they are birds)
		-- NOTA BENE: the ususkwinya *do* have weapons of their own; however,
		-- they are extremely restricted and never made available except to a
		-- very select number of that species. consequently, usuk players

		-- of a certain scenario may have usuk starting weapons, but these must
		-- be manually encoded to avoid injecting them into the overall crafting
		-- /loot system. because there are so few of these weapons in existence,
		-- all so tightly controlled, the odds of the weapons or plans winding
		-- up on Farthest Shadow are basically zero unless you bring them yourself
		name = 'Usukwinya', adj = 'Usuk';
		super = 'starlit';
		techs = lib.tbl.set('tool', 'electric', 'electronic', 'suit', 'gravitic');
		power = 2.0;
		efficiency = 2.0;
		reliability = 2.0;
		cost = 0.5;
		fabclasses = {
			basis = fab {
				crystal = {aluminum = 5}; -- ruby
			};
		};
	};

	eluthrai = { --super-tier
		name = 'Eluthrai', adj = 'Eluthran';
		super = 'starlit';
		techs = {tool = true, electric = true, electronic = true, weapon = true, gravitic = true, gravweapon = true, suit = true, combatSuit = true, hover = 'grav'};
		power = 4.0;
		efficiency = 4.0;
		reliability = 4.0;
		cost = 4.0;
		fabclasses = {
			basis = fab {
				crystal = {carbon = 5}; -- diamond
			};



			special	= fab {
				metal = {technetium=1, cinderstone=1}
			};
		};
	};

	-----------------------
	-- Forevanished Ones --
	-----------------------
................................................................................
		name = 'Firstborn', adj = 'Firstborn';
		super = 'forevanished';
		techs = {tool = true, electric = true, electronic = true, suit = true, psi = true, combatSuit = true, weapon = true, gravitic = true, gravweapon = true};
		power = 10.0;
		efficiency = 5.0;
		reliability = 3.0;
		cost = 10.0;
		fabclasses = {
			basis = fab {
				metal = {technetium=2, neodymium=3, sunsteel=1};

				crystal = {astrite=1};
			};
		};
	};

	forevanisher = { --godslayer-tier
		name = 'Forevanisher', adj = 'Forevanisher';
		super = 'forevanished';
		techs = {tool = true, electric = true, electronic = true, suit = true, psi = true, combatSuit = true, weapon = true, gravitic = true, gravweapon = true};
		power = 20.0;
		efficiency = 1.0;
		reliability = 2.0;
		cost = 100.0;
		fabclasses = {
			basis = fab {
				metal = {};
				crystal = {};
			};
		};
	};

}







|
|







 







|

|






|

|




|

|

|






|







 







|

|












|

|












|

|







 







|

|
<


|







|
>












|

|












|

|

>
>
>

|







 







|

|
>
|












|


<





7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
..
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
..
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
...
138
139
140
141
142
143
144
145
146
147

148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
...
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231

232
233
234
235
236
function starlit.world.tier.fabsum(name, ty)
	local dest = fab {}
	local t = starlit.world.tier.db[name]
	assert(t, 'reference to nonexisting tier '..name)
	if t.super then
		dest = dest+starlit.world.tier.fabsum(t.super, ty)*(t.cost or 1)
	end
	if t.fabclass and (t.fabclass[ty] or t.fabclass.basis) then
		dest = dest + (t.fabclass[ty] or t.fabclass.basis)
	end
	return dest
end

function starlit.world.tier.tech(name, tech)
	local t = starlit.world.tier.db[name]
	if t.techs and t.techs[tech] ~= nil then return t.techs[tech] end
................................................................................
	------------------
	-- tier classes --
	------------------

	lesser = {
		name = 'Lesser', adj = 'Lesser';
		super = 'base';
		fabclass = {
			basis = fab {
				element = {aluminum=4};
			};
		};
	};
	greater = {
		name = 'Greater', adj = 'Greater';
		super = 'base';
		fabclass = {
			basis = fab {
				element = {vanadium=2};
			};
		};
	};
	starlit = {
		name = 'Starlit', adj = 'Starlit';
		super = 'base';
		fabclass = {
			basis = fab {
				element = {iridium=1};
			};
		};
	};
	forevanished = {
		name = 'Forevanished One', adj = 'Forevanished';
		super = 'base';
		fabclass = {
			basis = fab {
				metal = {elusium=1};
			};
		};
	};

	------------------
................................................................................
		name = 'Makeshift', adj = 'Makeshift';
		super = 'lesser';
		techs = {tool = true, prim = true, electric = true};
		power = 0.5;
		efficiency = 0.3;
		reliability = 0.2;
		cost = 0.3;
		fabclass = { -- characteristic materials
			basis = fab { -- fallback
				element = {aluminum=4};
			};
		};
	};

	imperial = { --powerful trash
		name = 'Imperial', adj = 'Imperial';
		super = 'lesser';
		techs = {tool = true, electric = true, electronic = true, suit = true, combatSuit = true, weapon = true, hover='ion'};
		power = 2.0;
		efficiency = 0.5;
		reliability = 0.5;
		cost = 1.0;
		fabclass = {
			basis = fab {
				element = {iron=2};
			};
		};
	};

	commune = { --reliability
		name = 'Commune', adj = 'Commune';
		super = 'lesser';
		techs = {tool = true, electric = true, electronic = true, suit = true, combatSuit = true, weapon = true, gravitic = true, hover='grav'};
		power = 1.0;
		efficiency = 2.0;
		reliability = 3.0;
		cost = 1.5;
		fabclass = {
			basis = fab {
				element = {titanium=1};
				time = {print = 1.2}; -- commune stuff is intricate
			};
		};
	};

	-------------------
	-- Greater Races --
................................................................................
		name = 'Su\'ikuri', adj = "Su'ikuruk";
		super = 'starlit';
		techs = {psi = true, prim = true, bioSuit = true, psiSuit = true};
		power = 1.5;
		efficiency = 1.0;
		reliability = 3.0;
		cost = 2.0;
		fabclass = {
			psi = fab {
				element = {numinium = 2.0};

			};
			bio = fab {
				element = {beryllium = 1.0};
			};
		};
	};

	usukwinya = { --value for 'money'; no weapons; no hovertech (they are birds)
		-- NOTA BENE: the ususkwinya *do* have weapons of their own; however,
		-- they are extremely restricted and never made available except to a
		-- very select number of that species, those members who need stronger
		-- defenses than their native psionics can provide. consequently, usuk players
		-- of a certain scenario may have usuk starting weapons, but these must
		-- be manually encoded to avoid injecting them into the overall crafting
		-- /loot system. because there are so few of these weapons in existence,
		-- all so tightly controlled, the odds of the weapons or plans winding
		-- up on Farthest Shadow are basically zero unless you bring them yourself
		name = 'Usukwinya', adj = 'Usuk';
		super = 'starlit';
		techs = lib.tbl.set('tool', 'electric', 'electronic', 'suit', 'gravitic');
		power = 2.0;
		efficiency = 2.0;
		reliability = 2.0;
		cost = 0.5;
		fabclass = {
			basis = fab {
				element = {cobalt=2};
			};
		};
	};

	eluthrai = { --super-tier
		name = 'Eluthrai', adj = 'Eluthran';
		super = 'starlit';
		techs = {tool = true, electric = true, electronic = true, weapon = true, gravitic = true, gravweapon = true, suit = true, combatSuit = true, hover = 'grav'};
		power = 4.0;
		efficiency = 4.0;
		reliability = 4.0;
		cost = 4.0;
		fabclass = {
			basis = fab {
				element = {scandium = 1};
			};
			weapon = {
				metal = {cinderstone = 1};
			};
			special	= fab {
				element = {technetium=1};
			};
		};
	};

	-----------------------
	-- Forevanished Ones --
	-----------------------
................................................................................
		name = 'Firstborn', adj = 'Firstborn';
		super = 'forevanished';
		techs = {tool = true, electric = true, electronic = true, suit = true, psi = true, combatSuit = true, weapon = true, gravitic = true, gravweapon = true};
		power = 10.0;
		efficiency = 5.0;
		reliability = 3.0;
		cost = 10.0;
		fabclass = {
			basis = fab {
				element = {technetium=2, neodymium=3};
-- 				metal = {sunsteel=1};
-- 				crystal = {astrite=1};
			};
		};
	};

	forevanisher = { --godslayer-tier
		name = 'Forevanisher', adj = 'Forevanisher';
		super = 'forevanished';
		techs = {tool = true, electric = true, electronic = true, suit = true, psi = true, combatSuit = true, weapon = true, gravitic = true, gravweapon = true};
		power = 20.0;
		efficiency = 1.0;
		reliability = 2.0;
		cost = 100.0;
		fabclass = {
			basis = fab {
				metal = {};

			};
		};
	};

}

Modified mods/starlit/user.lua from [4cee014aa7] to [1ac6a2a876].

158
159
160
161
162
163
164

165
166
167
168
169
170
171
...
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728

		uiColor = function(self) return lib.color {hue=238,sat=.5,lum=.5} end;

		-----------
		-- stats --
		-----------
		statDelta = function(self, stat, d, cause, abs)

			local dt = self.persona.statDeltas
			local min, max, base = self:statRange(stat)
			if abs then
				if     d == true  then d = max
				elseif d == false then d = min end
			end
			if stat == 'health' then
................................................................................
			dropInv 'main'
			dropInv 'starlit_suit'
			self:updateSuit()
		end;
		onRespawn = function(self)
			local meta = self.entity:get_meta()
			self.entity:set_pos(vector.from_string(meta:get_string'starlit_spawn'))
			self:statDelta('psi',          0, 'death', true)
			self:statDelta('nutrition', 1500, 'death', true)
			self:statDelta('hydration',    2, 'death', true)
			self:statDelta('fatigue',      0, 'death', true)
			self:statDelta('stamina',      0, 'death', true)
			self:updateSuit()
			return true
		end;







>







 







|







158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
...
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729

		uiColor = function(self) return lib.color {hue=238,sat=.5,lum=.5} end;

		-----------
		-- stats --
		-----------
		statDelta = function(self, stat, d, cause, abs)
			if self.entity:get_hp() == 0 then return end
			local dt = self.persona.statDeltas
			local min, max, base = self:statRange(stat)
			if abs then
				if     d == true  then d = max
				elseif d == false then d = min end
			end
			if stat == 'health' then
................................................................................
			dropInv 'main'
			dropInv 'starlit_suit'
			self:updateSuit()
		end;
		onRespawn = function(self)
			local meta = self.entity:get_meta()
			self.entity:set_pos(vector.from_string(meta:get_string'starlit_spawn'))
			self:statDelta('numina',          0, 'death', true)
			self:statDelta('nutrition', 1500, 'death', true)
			self:statDelta('hydration',    2, 'death', true)
			self:statDelta('fatigue',      0, 'death', true)
			self:statDelta('stamina',      0, 'death', true)
			self:updateSuit()
			return true
		end;

Modified mods/vtlib/math.lua from [276f7a5d6e] to [818384c4da].

89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
function fn.lerp(t, a, b) return (1-t)*a + t*b end
function fn.gradient(grad, pos)
	local n = #grad
	if n == 1 then return grad[1] end
	local op = pos*(n-1)
	local idx = math.floor(op)
	local t = op-idx
	return fn.lerp(t, grad[1 + idx], grad[2 + idx])
end

function fn.trim(fl, prec)
	local fac = 10^prec
	return math.floor(fl * fac) / fac
end








|







89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
function fn.lerp(t, a, b) return (1-t)*a + t*b end
function fn.gradient(grad, pos)
	local n = #grad
	if n == 1 then return grad[1] end
	local op = pos*(n-1)
	local idx = math.floor(op)
	local t = op-idx
	return fn.lerp(t, grad[1 + idx] or grad[n], grad[2 + idx] or grad[n])
end

function fn.trim(fl, prec)
	local fac = 10^prec
	return math.floor(fl * fac) / fac
end

Modified starlit.ct from [7cb4085b3b] to [ee106030ea].

24
25
26
27
28
29
30

















31
32
33
34
35
36
37

[!liars], all of them.

are there other survivors? have they been similarly changed? what was that artifact and who were those terrorists? important questions, all, but they pale in comparison with the most important one:

how the fuck are you going to survive the next 24 hours?


















## engine
starlit is developed against a bleeding-edge version of minetest. it definitely won't work with anything older than v5.7, and ideally you should build directly from master.

starlit is best used with a patched version of minetest, though it is compatible with vanilla. the recommended patches are:

* [>p11143 11143] - fix third-person view orientation








>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







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

[!liars], all of them.

are there other survivors? have they been similarly changed? what was that artifact and who were those terrorists? important questions, all, but they pale in comparison with the most important one:

how the fuck are you going to survive the next 24 hours?

## usage
the ideal way to install [`starlit] on your system is to simply clone the repository with [`fossil]. this way, you can easily update the game whenever it's updated.
~~~
$ cd ~/.minetest/games
$ fossil clone https://c.hale.su/starlit
~~~
game assets are not versioned. to update these, run the following command [*in the root of the open starlit repository] (otherwise the archiver will shit all over your everything).
~~~
$ fossil uv cat asset.cpxz | xzcat | cpio -i
~~~
if, for some unaccountable reason, you don't want to use fossil, you can download a tarball.
~~~
$ curl https://c.hale.su/starlit/tarball/starlit.tar.gz | tar x
$ curl https://c.hale.su/starlit/uv/asset.cpxz | xzcat | cpio -i
~~~
eventually i might make proper release tarballs available that bundle the game and assets together, but the game isn't stable enough to do that yet.

## engine
starlit is developed against a bleeding-edge version of minetest. it definitely won't work with anything older than v5.7, and ideally you should build directly from master.

starlit is best used with a patched version of minetest, though it is compatible with vanilla. the recommended patches are:

* [>p11143 11143] - fix third-person view orientation