Mining Rewrite/Expansion

A place to discuss mods in development and concepts for new mods.
Post Reply
TranscendentGeek
Commonwealth Pilot
Commonwealth Pilot
Posts: 88
Joined: Fri Mar 09, 2012 6:13 pm

Hi Folks, I know I have been buys lately and haven't had time for T. Got to thinking about it today though and wanted to see what people wanted from a Mining Rewrite/Expansion. Mining Pack 1 was very popular, but the Fabled Mining Pack 2 kinda died on the drawing board as real life over took me and WillyTheSquid. So without my partner in crime I am considering what can be done with Mining in the future.

Before I share my ideas I want to hear yours.
User avatar
Atarlost
Fleet Admiral
Fleet Admiral
Posts: 2391
Joined: Tue Aug 26, 2008 12:02 am

I'm not familiar with mining pack 1, but in vanilla mining has three main problems:
1) It's a skinner box, and a shallow one at that.
2) The need for a mining weapon penalizes the freighter, which is the ship that should most lean towards mining.
3) Ore is heavy, places to sell it aren't exactly abundant, and you can get a substantial fraction of the ore they'll accept from beating up outlaw miners.
3a) There are no good places to sell ore in the Ungoverned Territories since Enclaves and blue factories only appear in the New Beyond (and almost exclusively in fixed systems at that) and Ringers only appear in the Outer Realm.

I think you fixed the first with a scanner and the second with a mining autodefensedevice. Fixing the third probably requires changing the economy so a single industrious EI500 can't saturate it permanently since currently only the blue factory stations ever consume their inventory. Probably Rasiermesser and Makayev factories should buy ore at a premium like Corporate Enclaves do.
Literally is the new Figuratively
TranscendentGeek
Commonwealth Pilot
Commonwealth Pilot
Posts: 88
Joined: Fri Mar 09, 2012 6:13 pm

What I am looking at is making it more in depth and more interesting instead of just a cash cow.
User avatar
Aury
Fleet Admiral
Fleet Admiral
Posts: 5421
Joined: Tue Feb 05, 2008 1:10 am
Location: Somewhere in the Frontier on a Hycrotan station, working on new ships.

Id say a major thing that requires rework is the way that asteroids dispense ore before getting into anytmore in-depth - though perhaps mining could attract the attention of pirates who would be... interested in your ore.

At the moment (in vanilla) you shoot at it until (hopefully) a large chunk appears, without even knowing if the asteroid contains ore, or when it has been depleted.

This has the problem that it is:
Truly Finite (Which I propose to solve by diminishing returns & regeneration - basically means that in a vanilla game the theoretical infinite volume of ore wont unbalance in a time:money ratio, NPCs can legitimately mine ore without permanent consequence to the play style, allows for very-long-duration sandbox type games (Especially with highly limited number of systems))
Boring simply by merit of not seeing anything happening most of the time (Which I propose to solve by having more ore objects generated - which in turn would need a sort of automated pickup system)
Empty asteroids are literally a waste of time (Which I propose to solve with every asteroid having some ore coefficient - this can be tied in with a scanner as well)

I'll be posting up some new code w/ comments with my proposed solutions in a bit

I might turn it into a simple demo extension after I get TSB to the very first beta release - or maybe before if its really primitive
(shpOrder gPlayership 'barrelRoll)
(plySetGenome gPlayer (list 'Varalyn 'nonBinary))
Homelab Servers: Xeon Silver 4110, 16GB | Via Quadcore C4650, 16GB | Athlon 200GE, 8GB | i7 7800X, 32GB | Threadripper 1950X, 32GB | Atom x5 8350, 4GB | Opteron 8174, 16GB | Xeon E5 2620 v3, 8GB | 2x Xeon Silver 4116, 96GB, 2x 1080ti | i7 8700, 32GB, 6500XT
Workstations & Render machines: Threadripper 3990X, 128GB, 6900XT | Threadripper 2990WX, 32GB, 1080ti | Xeon Platinum 8173M, 48GB, 1070ti | R9 3900X, 16GB, Vega64 | 2x E5 2430L v2, 24GB, 970 | R7 3700X, 32GB, A6000
Gaming Systems: R9 5950X, 32GB, 6700XT
Office Systems: Xeon 5318Y, 256GB, A4000
Misc Systems: R5 3500U, 20GB | R5 2400G, 16GB | i5 7640X, 16GB, Vega56 | E5 2620, 8GB, R5 260 | P4 1.8ghz, 0.75GB, Voodoo 5 5500 | Athlon 64 x2 4400+, 1.5GB, FX 5800 Ultra | Pentium D 3.2ghz, 4GB, 7600gt | Celeron g460, 8GB, 730gt | 2x Athlon FX 74, 8GB, 8800gts 512 | FX 9590, 16GB, R9 295x2 | E350, 8GB | Phenom X4 2.6ghz, 16GB, 8800gt | random core2 duo/atom/i5/i7 laptops
User avatar
Aury
Fleet Admiral
Fleet Admiral
Posts: 5421
Joined: Tue Feb 05, 2008 1:10 am
Location: Somewhere in the Frontier on a Hycrotan station, working on new ships.

NOTE I have not tested this code (may have MAJOR bugs/not work at all!), but it should convey the general idea

I'll post a tested version once this is actually implemented in a mod

If you want go ahead and use it - credit is nice but afaic (as far as I care) this is for the public domain

Code: Select all

<Globals>
	(block Nil
		;;;;MINING GLOBALS;;;;
		(block Nil
			;;;;;;;;;;;;;;;;;;;;;;
			;;Global definitions;;
			;;;;;;;;;;;;;;;;;;;;;;
			(setq gOreMinCoef 1) ;Minimum possible ore coefficient - cannot go lower than this after mining - zero prevents regeneration
			(setq gOreMinBaseCoef 10) ;Minimum ore coefficient - set what you think works right
			(setq gOreRegenInvCoef 10) ;Inverse coef for mining regeneration - 0 is effectively instant - next unit - regeneration 1 is linear versus ore coef - large numbers cause slower regeneration especially at low values
			(setq gOreRegenTimeCoef 30) ;30 sets it to be seconds because of 30 ticks per second
			(setq gOreMinQty 1) ;Mininum amoutn of ore items per ore object
			(setq gOreMaxQty 3) ;Maximum amount of ore items per ore object
			(setq gDefaultOreStation &stMinedOre;) ;Default mined ore object
			;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
			;;
			;;Dont edit the stuff below this comment in this block
			;;This makes sure that the values above always are valid
			;;Removing this in order to set illegal values may cause functions to malfunction
			;;Pun intended. Deal with it.
			;;
			;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
			
			(setq gOreMinCoef (max gOreMinCoef 0))
			(setq gOreMinBaseCoef (max gOreMinBaseCoef gOreMinCoef))
			(setq gOreRegenInvCoef (max gOreRegenInvCoef 0))
			(setq gOreRegenTimeCoef (max gOreRegenTimeCoef 1))
			(setq gOreMinQty (max gOreMinQty 1))
			(setq gOreMaxQty (max gOreMaxQty gOreMinQty))
			(if (isError gDefaultOreStation) (setq gDefaultOreStation &stMinedOre;))
		)
		;;;;MINING EVENTS;;;;;
		;;;;Note that these functions let you specify a bunch of stuff meaning that you can get creative or call them remotely or whatever you like
		;;;;When used normally with normal asteroids just use gSource as theRoid
		;;;;You can also have special asteroids or objects that have their own special mining chance
		;;;;This code even works with non ore objects
		;;;;;;;;;;;;;;;;;;;;;;
		(setq roidCreateOre (lambda (theRoid oreRichness) ;;we specify the object we want so this can be called remotely
			(block Nil
				(objSetData theRoid 'oreCoef (max gOreMinBaseCoef (min oreRichness 100))) ;;Initial ore coef cant be less than the min coef and cant be greater than 100
				(objSetData theRoid 'maxOreCoef (max gOreMinBaseCoef (min oreRichness 100)))
			)
		))
		(setq roidMining (lambda (theRoid pMining theOre oreStation posMining dirMining)
			(block (oreCoef)
				(setq oreCoef (objGetData theRoid 'oreCoef))
				(if (not(eq oreCoef Nil)) ;;Is this thing even set up for mining
					;;Lets see if we get lucky
					(block (cMining pMined)
						(setq pMined (multiply oreCoef pMining));;get the combined chance
						(setq cMining (random 1 10000));;get a random number
						(if (leq cMining pMining) ;;Did we mine it
							(block (qtyOre createdOre createdStation) ;;we mined it
								;;create an ore object with some ore in it
								;;figure out how much we want
								(setq qtyOre (random gOreMinQty gOreMaxQty))
								(if (eq Nil oreStation);;make sure this is a valid object
									(setq oreStation gDefaultOreStation)
								)
								;;create the ore to give
								(setq createdOre (itmGetType theOre) qtyOre)
								;;create the ore station
								(setq createdStation (sysCreateStation oreStation posMining))
								;;place the ore in the station
								(objAddItem createdStation createdOre)
								;;make the ore station move away from the asteroid
								(objIncVel createdStation (sysVectorPolarVelocity dirMining 5))
							)
							(block (pLose cLose) ;;we failed to mine it
								;;chance to lose some existing ore due to low quality mining weapon
								(setq pLose (divide (subtract pMining 100) 10));;calculate chance of losing ore - good mining weapons have no chance of losing ore
								(setq cLose (random 1 100))
								(if (leq cLose pLose)
									;;We lose some ore
									(block Nil
										(subtract oreCoef (random 1 gOreMaxQty))
										(objSetData theRoid 'oreCoef oreCoef)
									)
								)
							)
						)
						;;dont regenerate ore while being mined
						(sysCancelTimerEvent theRoid "onRegenerateOre")
						;;set a new timer based on the ore amount
						(sysAddObjTimerEvent (roidCalcTime oreCoef) theRoid "onRegenerateOre")
					)
				)
			)
		))
		(setq roidRegenerate (lambda (theRoid)
			(block (oreCoef)
				;;make sure nothing else set extra copies of the event
				(sysCancelTimerEvent theRoid "onRegenerateOre")
				;;increment the ore amount
				(setq oreCoef (add 1 (objGetData theRoid 'oreCoef)))
				(objSetData theRoid 'oreCoef oreCoef)
				;;set a new timer based on the ore amount if we havent reached the max
				(if (ls oreCoef (objGetData theRoid 'maxOreCoef))
					(sysAddObjTimerEvent (roidCalcTime oreCoef) theRoid "onRegenerateOre")
					;;Otherwise do nothing
				)
			)
		))
		;;;;MINING UTIL FUNCS;;;;
		(setq roidCalcTime (lambda (oreCoef)
			(multiply
				(max
					(divide (multiply 100 gOreRegenInvCoef) oreCoef) ;;Remember kids divides syntax is divide numerator denominator - not the other way around - oreCoef is leq 100
					1 ;;Ensure that it cant be 0
				)
				gOreRegenTimeCoef ;;convert to number of ticks
			)
		))
	)
</Globals>

<!-- sample events for an asteroid -->
<!--
<Events>
	<onCreate>
		(roidCreateOre gSource 50) ;set the initial ore coefficient for the asteroid
	</onCreate>
	<onMining>
		(roidMining gSource aMineProbability (random (objGetItems gSource "* +Ore;")) Nil aMinePos aMineDir) ;do the mining
	</onMining>
	<onRegenerateOre>
		(roidRegenerate gSource) ;Regenerate our ore
	</onRegenerateOre>
</Events>
-->
(shpOrder gPlayership 'barrelRoll)
(plySetGenome gPlayer (list 'Varalyn 'nonBinary))
Homelab Servers: Xeon Silver 4110, 16GB | Via Quadcore C4650, 16GB | Athlon 200GE, 8GB | i7 7800X, 32GB | Threadripper 1950X, 32GB | Atom x5 8350, 4GB | Opteron 8174, 16GB | Xeon E5 2620 v3, 8GB | 2x Xeon Silver 4116, 96GB, 2x 1080ti | i7 8700, 32GB, 6500XT
Workstations & Render machines: Threadripper 3990X, 128GB, 6900XT | Threadripper 2990WX, 32GB, 1080ti | Xeon Platinum 8173M, 48GB, 1070ti | R9 3900X, 16GB, Vega64 | 2x E5 2430L v2, 24GB, 970 | R7 3700X, 32GB, A6000
Gaming Systems: R9 5950X, 32GB, 6700XT
Office Systems: Xeon 5318Y, 256GB, A4000
Misc Systems: R5 3500U, 20GB | R5 2400G, 16GB | i5 7640X, 16GB, Vega56 | E5 2620, 8GB, R5 260 | P4 1.8ghz, 0.75GB, Voodoo 5 5500 | Athlon 64 x2 4400+, 1.5GB, FX 5800 Ultra | Pentium D 3.2ghz, 4GB, 7600gt | Celeron g460, 8GB, 730gt | 2x Athlon FX 74, 8GB, 8800gts 512 | FX 9590, 16GB, R9 295x2 | E350, 8GB | Phenom X4 2.6ghz, 16GB, 8800gt | random core2 duo/atom/i5/i7 laptops
PM
Fleet Admiral
Fleet Admiral
Posts: 2570
Joined: Wed Sep 01, 2010 12:54 am

Mining will always be a cash cow. What matters is how easy or hard it is to get the cash. In standard, the player can get all the ore (and cash) if he is willing to shoot every last rock dozens of times. This is mind-numbingly boring, but it works and an option for those in dire straits and unable to fight.

A possible idea: Dock ore-bearing asteroids and play a mini-game to get ore.
  • Eliminate mining by shooting.
  • Asteroids can be docked, but only if it is known to have ore. Otherwise, docking may not be attempted.
  • Player needs a scanner or pre-calculated coordinates to detect ore.
  • Once player docks an asteroid, he plays a mini-game to get ore. Examples:
    • Piloting a rover to pickup ore ala Star Control 2.
    • Drilling game similar to Lunar Lander or neurohack mission.
Download and Play in 1.9 beta 1...
Drake Technologies (Alpha): More hardware for combat in parts 1 and 2!
Star Castle Arcade: Play a classic arcade game adventure, with or without more features (like powerups)!
Playership Drones: Buy or restore exotic ships to command!

Other playable mods from 1.8 and 1.7, waiting to be updated...
Godmode v3 (WIP): Dev/cheat tool compatible with D&O parts 1 or 2.
Jay2Jay
Militia Commander
Militia Commander
Posts: 283
Joined: Fri Jan 11, 2013 12:57 am

I tried to do the coding for a mining pack, but it gradually beat me as there was no way I could balance anything based on in game dimensions and it started to grate on my nerves (ultralight titanium armor was in the thousands of credits) since I could not consciously make mining that crazy. If you need ideas or help I would be more than happy to supply what I learned through hours of wasted research and several free college courses that I took to make this thing happen accurately.

http://forums.kronosaur.com/viewtopic.php?f=25&t=5842

Just know that realism is a slippery slope, one that I could not climb back up again.

EDIT: read my original post and got re-inspired. dammit
Post Reply