starlit  Diff

Differences From Artifact [fff344db38]:

To Artifact [d82ba893dd]:


275
276
277
278
279
280
281


282
283
284
285
286
287
288
289
290
291


292
293
294
295
296
297
298
299
300
301
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
...
373
374
375
376
377
378
379

380
381
382
383
384
385
386
387
388
389
390
391
...
393
394
395
396
397
398
399

400
401
402
403
404
405
406
407
408
409
410
411
412
413
...
416
417
418
419
420
421
422

423
424
425
426
427
428
429
430
431
432
433
434
435
436
437

438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
...
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
...
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
-- firstborn ("god-tier"): exceptional

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


		};
		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 };


		};
		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 };

		};
		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 };

		};
		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 };


		};
		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 };


		};
		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 = {
	small = {name = 'Small', capacity = .5, dischargeRate =  .5, complexity = 1, matMult = .5, fab = starlit.type.fab {size={print=0.1}}};

	mid   = {                capacity =  1, dischargeRate =   1, complexity = 1, matMult = 1, fab = starlit.type.fab {size={print=0.3}}};

	large = {name = 'Large', capacity =  2, dischargeRate = 1.5, complexity = 1, matMult = 1.5, fab = starlit.type.fab {size={print=0.5}}};

	huge  = {name = 'Huge',  capacity =  3, dischargeRate =   2, complexity = 1, matMult = 2, fab = starlit.type.fab {size={print=0.8}}};

}

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};

		};
		sw = {
			cost = {
				cycles = 5e9; -- 5 bil cycles
				ram = 10e9; -- 10GB
			};
			pgmSize = 2e9; -- 2GB
			rarity = 5;
		};
		capacity = 50e3, dischargeRate = 1000;
		leak = 0, decay = 1e-6;

................................................................................
	};
	chemical = {
		name = 'Chemical';
		desc = '';
		fab = starlit.type.fab {
			element = { lithium = 3 };
			size = {print=1.0};

		};
		sw = {
			cost = {
				cycles = 1e9; -- 1 bil cycles
				ram = 2e9; -- 2GB
			};
			pgmSize = 512e6; -- 512MB
			rarity = 2;
		};
		capacity = 200e3, dischargeRate = 200;
		leak = 0.2, decay = 1e-2;
		complexity = 1;
................................................................................
	carbon = {
		name = 'Carbon';
		desc = 'Carbon nanotubes form the basis of many important metamaterials, chief among them power-polymer.';
		capacity = 1;
		fab = starlit.type.fab {
			element = { carbon = 40 };
			size = {print=0.5};

		};
		sw = {
			cost = {
				cycles = 50e9; -- 50 bil cycles
				ram = 64e9; -- 64GB
			};
			pgmSize = 1e9; -- 1GB
			rarity = 10;
		};
		capacity = 100e3, dischargeRate = 500;
		leak = 0.1, decay = 1e-3;
		complexity = 10;
	};
	hybrid = {
................................................................................
		capacity = 1;
		fab = starlit.type.fab {
			element = {
				lithium = 10;
				carbon = 20;
			};
			size = {print=1.5};

		};
		sw = {
			cost = {
				cycles = 65e9; -- 65 bil cycles
				ram = 96e9; -- 96GB
			};
			pgmSize = 5e9; -- 5GB
			rarity = 15;
		};
		capacity = 300e3, dischargeRate = 350;
		leak = 0.3, decay = 1e-5;
		complexity = 30;
	};
}


local function elemath(dest, src, mult)
	dest = dest or {}
	for k,v in pairs(src) do
		if not dest[k] then dest[k] = 0 end
		dest[k] = dest[k] + v*mult
	end
	return dest
end

for bTypeName, bType in pairs(batteryTypes) do
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)
................................................................................
	})
end)

-- in case other mods want to define their own tiers
E.chip.tiers = lib.registry.mk 'starlit_electronics:chipTiers'
E.chip.tiers.meld {
	-- GP chips
	tiny    = {name = 'Tiny Chip', clockRate = 512e3, flash = 4096, ram = 1024, powerEfficiency = 1e9, size = 1};
	small   = {name = 'Small Chip', clockRate = 128e6, flash = 512e6, ram = 512e6, powerEfficiency = 1e8, size = 3};
	med     = {name = 'Chip', clockRate = 1e9, flash = 4e9, ram = 4e9, powerEfficiency = 1e7, size = 6};
	large   = {name = 'Large Chip', clockRate = 2e9, flash = 8e9, ram = 8e9, powerEfficiency = 1e6, size = 8};
	-- specialized chips
	compute = {name = 'Compute Chip', clockRate = 4e9, flash = 24e6, ram = 64e9, powerEfficiency = 1e8, size = 4};
	data    = {name = 'Data Chip', clockRate = 128e3, flash = 2e12, ram = 32e3, powerEfficiency = 1e5, size = 4};
	lp      = {name = 'Low-Power Chip', clockRate = 128e6, flash = 64e6, ram = 1e9, powerEfficiency = 1e10, size = 4};
	carbon  = {name = 'Carbon Chip', clockRate = 64e6, flash = 32e6, ram = 2e6, powerEfficiency = 2e9, size = 2, circ='carbon'};
}

E.chip.tiers.foreach('starlit_electronics:genChips', {}, function(id, t)
	id = t.id or string.format('%s:chip_%s', minetest.get_current_modname(), id)
	local circMat = t.circ or 'silicon';
	starlit.item.chip.link(id, {
		name = t.name;
................................................................................
			flag = {
				silicompile = true;
			};
			time = {
				silicompile = t.size * 24*60;
			};
			cost = {
				energy = 50e3 + t.size * 15e2;
			};
			element = {
				[circMat] = 50 * t.size;
				copper = 30;
				gold = 15;
			};
		};







>
>










>
>












>











>












>
>












>
>








|
>
|
>
|
>
|
>









>



|
|







 







>



|
|







 







>



|
|

|







 







>



|
|

|








>







|







 







|
|
|
|

|
|
|
|







 







|







275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
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
...
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
...
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
...
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
...
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
...
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
-- 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 = {
	small = {name = 'Small', capacity = .5, dischargeRate =  .5, complexity = 1, matMult = .5,
		fab = starlit.type.fab {size={print=0.1},cost={power=.5},time={print=25}}};
	mid   = {                capacity =  1, dischargeRate =   1, complexity = 1, matMult = 1,
		fab = starlit.type.fab {size={print=0.3},cost={power=1},time={print=40}}};
	large = {name = 'Large', capacity =  2, dischargeRate = 1.5, complexity = 1, matMult = 1.5,
		fab = starlit.type.fab {size={print=0.5},cost={power=2},time={print=60}}};
	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 = {
				cycles = 48e9; -- 48 bil cycles
				ram = 4e9; -- 10GB
			};
			pgmSize = 2e9; -- 2GB
			rarity = 5;
		};
		capacity = 50e3, dischargeRate = 1000;
		leak = 0, decay = 1e-6;

................................................................................
	};
	chemical = {
		name = 'Chemical';
		desc = '';
		fab = starlit.type.fab {
			element = { lithium = 3 };
			size = {print=1.0};
			cost = {power = .5e3};
		};
		sw = {
			cost = {
				cycles = 16e9; -- 16 bil cycles
				ram = 1e9; -- 1GB
			};
			pgmSize = 512e6; -- 512MB
			rarity = 2;
		};
		capacity = 200e3, dischargeRate = 200;
		leak = 0.2, decay = 1e-2;
		complexity = 1;
................................................................................
	carbon = {
		name = 'Carbon';
		desc = 'Carbon nanotubes form the basis of many important metamaterials, chief among them power-polymer.';
		capacity = 1;
		fab = starlit.type.fab {
			element = { carbon = 40 };
			size = {print=0.5};
			cost = {power = 2.5e3};
		};
		sw = {
			cost = {
				cycles = 256e9; -- 256 bil cycles
				ram = 16e9; -- 64GB
			};
			pgmSize = 4e9; -- 4GB
			rarity = 10;
		};
		capacity = 100e3, dischargeRate = 500;
		leak = 0.1, decay = 1e-3;
		complexity = 10;
	};
	hybrid = {
................................................................................
		capacity = 1;
		fab = starlit.type.fab {
			element = {
				lithium = 10;
				carbon = 20;
			};
			size = {print=1.5};
			cost = {power = 10e3};
		};
		sw = {
			cost = {
				cycles = 512e9; -- 512 bil cycles
				ram = 24e9; -- 96GB
			};
			pgmSize = 7e9; -- 7GB
			rarity = 15;
		};
		capacity = 300e3, dischargeRate = 350;
		leak = 0.3, decay = 1e-5;
		complexity = 30;
	};
}

--[[
local function elemath(dest, src, mult)
	dest = dest or {}
	for k,v in pairs(src) do
		if not dest[k] then dest[k] = 0 end
		dest[k] = dest[k] + v*mult
	end
	return dest
end]]

for bTypeName, bType in pairs(batteryTypes) do
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)
................................................................................
	})
end)

-- in case other mods want to define their own tiers
E.chip.tiers = lib.registry.mk 'starlit_electronics:chipTiers'
E.chip.tiers.meld {
	-- GP chips
	tiny    = {name = 'Tiny Chip', clockRate = 512e3, flash = 4096, ram = 1024, powerEfficiency = 1e10, size = 1};
	small   = {name = 'Small Chip', clockRate = 128e6, flash = 512e6, ram = 512e6, powerEfficiency = 1e9, size = 3};
	med     = {name = 'Chip', clockRate = 1e9, flash = 4e9, ram = 4e9, powerEfficiency = 1e8, size = 6};
	large   = {name = 'Large Chip', clockRate = 2e9, flash = 8e9, ram = 8e9, powerEfficiency = 1e7, size = 8};
	-- specialized chips
	compute = {name = 'Compute Chip', clockRate = 4e9, flash = 24e6, ram = 64e9, powerEfficiency = 1e9, size = 4};
	data    = {name = 'Data Chip', clockRate = 128e3, flash = 2e12, ram = 32e3, powerEfficiency = 1e6, size = 4};
	lp      = {name = 'Low-Power Chip', clockRate = 128e6, flash = 64e6, ram = 1e9, powerEfficiency = 1e11, size = 4};
	carbon  = {name = 'Carbon Chip', clockRate = 64e6, flash = 32e6, ram = 2e6, powerEfficiency = 2e10, size = 2, circ='carbon'};
}

E.chip.tiers.foreach('starlit_electronics:genChips', {}, function(id, t)
	id = t.id or string.format('%s:chip_%s', minetest.get_current_modname(), id)
	local circMat = t.circ or 'silicon';
	starlit.item.chip.link(id, {
		name = t.name;
................................................................................
			flag = {
				silicompile = true;
			};
			time = {
				silicompile = t.size * 24*60;
			};
			cost = {
				power = 50e3 + t.size * 15e2;
			};
			element = {
				[circMat] = 50 * t.size;
				copper = 30;
				gold = 15;
			};
		};