Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

another "unremovable" attempt (enhancement) #2372

Closed
EndrosG opened this issue Apr 7, 2017 · 6 comments
Closed

another "unremovable" attempt (enhancement) #2372

EndrosG opened this issue Apr 7, 2017 · 6 comments
Labels
mechanics Things dealing with the mechanics & code of how the game works

Comments

@EndrosG
Copy link
Contributor

EndrosG commented Apr 7, 2017

Okay, this is gonna be a long post. Just saying in advance...
And I do not follow the original intention of #1780 and also want to achieve some different aspects than in #1412. That's why I prefer to open a new thread in order to not go too much offtopic in the other issues.

I jumped from pull #1935 to pull #2037, then to issue #1763, then to #1412 and from there finally to #1413 and #1780.
And it didnt take even a whole single day (24 hours) to perform these jumps, even without having any Hyperdrive at home, nor any hyperspace fuel ;-)

Following cd23758, the first commit in #1413, I found out myself, that this is not enough.
I tested in the game (v0.9.6) again, what happens when you try to sell a Local Map or a Pilot's License.

You cannot sell maps / license...
Okay, how is that done? How does the game achieve that "You cannot sell (xy)" for two specific outfits? Does the whole solution already exist? Lets see...

I modified my latest savegame of my 2nd pilot, Lydia S, as follows:

ship Hawk
	name Ha-wk
	sprite ship/hawk
[...]
	outfits
		Hyperdrive
		Supercapacitor 3
		"Heavy Laser" 2
		"D41-HY Shield Generator"
		"A255 Atomic Steering"
		"S3 Thermionic"
		"A250 Atomic Thruster"
		"Pilot's License" 2
		"Local Map" 3
		"Korath Piercer" 6
		"Copper" 2

Those Korath Piercers were intentionally placed, without having a launcher or storage depot.

Loading this, resulted in some "nice" effects:

  • neither the licenses nor the maps are properly shown as installed
  • all installed copies can be sold for 25%, i.e. I cant sell my original and keep a "fake" one this way. The reasons are in terms of game mechanics obvious.
  • after having sold all installed copies, I cant sell the last copy but then get the same dialog as anybody else.
  • the Copper can be sold (=uninstalled), just not reinstalled. @Amazinite New outfit tags #1412 saying "installable" -1 makes things uninstallable already. Or do I miss any way to uninstall an installed item into cargo space without selling it?

endless_sky_v0_9_6__20170407__outfitter_panel_selling_licenses

This told me, that https://github.com/endless-sky/endless-sky/blob/master/source/OutfitterPanel.cpp#L521 would not be the point where to implement the unremovable tag. This only gives the error when clicking on the greyed out sell button. Still a good thing to do when implementing unremovable but not the most important section.

I got to the point of CanSell() in Line 442.

I decided it would be best to add a check just below the Cargo() check, i.e. allowing the unremovable items to be sold as long as they have not been installed (some games refer this to "bind on equip", BoE), which allows for interesting missios where you can take such items from freighters which transport outfits from one colony to another as cargo.
I then looked ba23883, the second commit in #1413, and found out Isaac had placed his code just a little bit lower (and didnt finish the return line with a semicolon).


I fully follow the argumentation of @Bladewood in #1780 regarding changing the way of thinking and I follow @Amazinite in #1780 regarding the useless outfits and extra works in terms of images.
I hereby explicitely do NOT follow #1780. And I do not follow #1412 with respect to the fire-while-cloaked line, but refer to @Isaacssv552 in #1412

variant versions of ships with special, high-efficiency (or otherwise boosted), versions of outfits.
and combine it with @Bladewood from #1780.
Pug and Drak ships do not strictly have irremovable generators.
They are the generators.

Oh, and unlike @Sinsling wrote in #1412, uninstallable did not make it into 0.9.3 according to the changelog and is not part of the currect code (master, 0.9.6+). So this is not available right now. And @Amazinite is wrong saying "installable" -1 makes things uninstallable already.

I agree with @endless-sky in #1412 that a range of applications can already be achieved with negative attributes on the hull. A range of.

I intend to hereby show a few content ranges, explicitely following some of the ideas quote above, which imho would be a mess to achieve this way. Knowing, that any tag (which does not conflict with existing ones) can be used, is good to know...

I will try to shorten any quotes and codes to an acceptable minimum in order to show the idea of - not writing a full lore. And I will reuse standard outfits as far as possible, or simply name some...
For each of the applications I am happily accepting proposal on how to achieve them "nicely" without unremovable tag.

But lets get to those concepts!

  • Application One: living bodies in space (I am a bit proud on that one)
  • Application Two: existing but blocked weapon hardmounts
  • Application Three: blast marks
  • Application Four: ship tuning (variants and after buying)
@EndrosG
Copy link
Contributor Author

EndrosG commented Apr 7, 2017

Application One: living bodies in space

A coalition or other form ob symbiotic coexistence of a rather "human-like" species (including the arach, kimek etc.) and at least one species of organisms living in space, like may be the bodies of the Pug ships or the Archons.

  • please dont blame me for super perfect balance. This ship, its outfits and the missions were finally written down in about 2+ hours without excel sheets or alike, rewriting the dying process took another 45 minutes?
  • this is not tested and not guaranteed to work, it is a design concept
ship "Alien Warship"
	sprite "ship/drak"
	attributes
		category "Medium Warship"
		"cost" 100000
		"shields" 0
		"hull" 100
		"required crew" 1
		"bunks" 1
		"mass" 50
		"drag" 1
		"heat dissipation" .9
		"outfit space" 20
		"weapon capacity" 8
		"engine capacity" 48
	outfits
		"Hyperdrive"
		"Alien Warship alive: young"
		"blocked gun" 5
		"blocked turret" 7
		
	engine 6 30
	engine -6 30
	gun -20 -50 "blocked gun"
	gun -2 -60 "blocked gun"
	gun 2 -60 "blocked gun"
	gun 20 -30 "blocked gun"

	turret -20 10 "blocked turret"
	turret -20 60 "blocked turret"
	turret -10 60 "blocked turret"
	turret 0 60 "blocked turret"
	turret 10 60 "blocked turret"
	turret 20 60 "blocked turret"
	turret 20 10 "blocked turret"

	explode "medium explosion" 10
	explode "large explosion" 5
	description "This is a living ship. The pilot lives in symbiosis with the ship. Many pilots die when or soon after their ship dies."
	description "LORE: Over time, the ship adapts to the pilots personality. The longer a ship flys with one and the same pilot, the harder it is becomes for a different pilot to fly it. Nobody wants a sturdy ship. That explains depreciation as of v0.9.6 :-)"

# next section: modifications as the ship grows alive

outfit "Alien Warship alive: young"
	"cost" 10000
	"age" 1
	"hull" 50
	"hull repair rate" 0.01
	"mass" 2.5
	"drag" 0.05
	"heat dissipation" -0.01
	"fuel capacity" 20
	"cargo space" 1
	"outfit space" 4
	"energy capacity" 5
	"energy generation" 0.2

	"turn" 1
	"turning energy" .07
	"turning heat" .5
	"thrust" 30
	"thrusting energy" .1
	"thrusting heat" .6

	"installable" 1
	"unremovable" 1
	description "Each installed instance represents one year of your ships life in the named live section."

outfit "Alien Warship alive: maturity"
	"cost" 500000
	"age" 1
	"hull" 200
	"required crew" 1
	"bunks" 2
	"outfit space" 100
	"engine capacity" 50
	"weapon capacity" 100

	"jump speed" .5
	"jump drive" 1

	"installable" 1
	"unremovable" 1
	description "The ships maturity is one of the most important events in its life!"

outfit "Alien Warship alive: adult"
	"cost" 5000
	"age" 1
	"hull" 25
	"bunks" 0.2
	"mass" 1
	"drag" 0.01
	"cargo space" 1
	"outfit space" 2
	"fuel capacity" 10
	"energy capacity" 10
	"energy generation" 0.1
	"weapon capacity" 2
	"turn" 0.2
	"thrust" 3

	"installable" 1
	"unremovable" 1
	description "Each installed instance represents one year of your ships life in the named live section."

outfit "Alien Warship alive: old"
	"cost" -10000
	"age" 1
	"hull" -50
	"hull repair rate" -0.01
	"mass" -1
	"drag" 0.01
	"cargo space" -1
	"outfit space" -2
	"heat dissipation" -0.01
	"fuel capacity" -20
	"energy capacity" -20
	"energy generation" -0.2
	"turn" -0.5
	"thrust" -20

	"installable" 1
	"unremovable" 1
	description "Each installed instance represents one year of your ships life in the named live section."

outfit "Alien Warship alive: dying"
	description "Your ship is clearly dying. It is just a matter of time until it dies."

# next section: the dead versions of a ships living. Each "alive" year gets replaced by a "dead" year as the ship dies.

outfit "Alien Warship dead: young"
	"cost" 1000
	"age" 1
	"hull" 20
	"mass" 2.3
	"drag" 0.05
	"heat dissipation" -0.01
	"fuel capacity" 10
	"cargo space" 1
	"outfit space" 3

	"turning energy" .07
	"thrusting energy" .1

	"installable" 1
	"unremovable" 1

outfit "Alien Warship dead: maturity"
	"cost" 50000
	"age" 1
	"hull" 100
	"required crew" 1
	"bunks" 2
	"outfit space" 80
	"engine capacity" 40
	"weapon capacity" 80

	"installable" 1
	"unremovable" 1

outfit "Alien Warship dead: adult"
	"cost" 500
	"age" 1
	"hull" 10
	"bunks" 0.2
	"mass" 0.9
	"drag" 0.01
	"cargo space" 1
	"outfit space" 2
	"fuel capacity" 5
	"energy capacity" -10
	"energy generation" -0.1
	"weapon capacity" 2

	"installable" 1
	"unremovable" 1

outfit "Alien Warship dead: old"
	"cost" -1000
	"age" 1
	"hull" -20
	"hull repair rate" -0.01
	"mass" -1.2
	"drag" 0.02
	"cargo space" -1
	"outfit space" -2
	"heat dissipation" -0.01
	"fuel capacity" -20
	"energy capacity" -20
	"energy generation" -0.2
	"turn" -0.5
	"thrust" -20

	"installable" 1
	"unremovable" 1


outfit "Alien Warship dead: death"
	"cost" -100000
	"hull repair rate" -2
	"required crew" 50

	"energy capacity" -10000
	"energy generation" -100
	"turn" -100
	"thrust" -1000

	"organ removal capacity" 3

	"installable" 1
	"unremovable" 1
	description "This indicates the death of a ship. What remains is a dead corpus which slowly vanishes."
	description "Controlling this ship is almost impossible since no energy transfer systems are available at all and new ones cant be installed. If you want to operate any engines, hyperdrives, weapons or other outfits, you have to use parts with integrated energy generation!"
	# game mechanics: Use outfits which do not require any energy to operate!
	description "	Installing this item means killing your ship which is irreversible!"


# initial version, no longer used
outfit "Alien Warship aging: death"
	"cost" -1000000
	"hull repair rate" -2.5
	"required crew" 50

	"energy capacity" -1000000
	"energy generation" -10000
	"turn" -1000
	"thrust" -1000000

	"organ removal capacity" 3

	"installable" 1
	"unremovable" 1
	description "This indicates the death of a ship. What remains is a dead corpus which slowly vanishes."
	description "Controlling this ship is almost impossible since no energy transfer systems are available at all and new ones cant be installed. If you want to operate any engines, hyperdrives, weapons or other outfits, you have to use parts with integrated energy generation!"
	# game mechanics: Use outfits which do not require any energy to operate!
	description "	Installing this item means killing your ship which is irreversible!"


outfit "Alien Warship: brain removal"
	"bunks" 70
	"outfit space" 100

	"organ removal capacity" -1
	"installable" 1
	"unremovable" 1
	description "	Installing this item means removing some inner organs which can only be done after death and is irreversible."
	description "LORE WARNING: All removal outfits assume your ship died old upon age, not young due to mutual kill."

outfit "Alien Warship: heart removal"
	"cargo space" 200
	"outfit space" 300

	"organ removal capacity" -1
	"installable" 1
	"unremovable" 1
	description "	Installing this item means removing some inner organs which can only be done after death and is irreversible."
	description "LORE WARNING: All removal outfits assume your ship died old upon age, not young due to mutual kill."

outfit "Alien Warship: muscle removal"
	"outfit space" 600
	"engine capacity" 600

	"organ removal capacity" -1
	"installable" 1
	"unremovable" 1
	description "	Installing this item means removing some inner organs which can only be done after death and is irreversible."
	description "LORE WARNING: All removal outfits assume your ship died old upon age, not young due to mutual kill."



event "Alien ship aging"

mission "Alien Warship aging"
	invisible
	landing
	repeat
	description "This annually repeating mission controls the aging process of your ship. Sadly, due to game mechanics it currently can only manipulate your flagship."
	to offer
		has "event: Alien ship aging"
		require "Alien Warship alive: young"
	on offer
		# not yet tested: will this already erase the existing "event: Alien ship aging" condition? or do I need some sort of "event: Alien ship aging" = 0 ?
		event: "Alien ship aging" 365
		conversation
			# untested idea : tryout branch conditions with two criteria, making ships having some sort of minimum life expectation but having chances to get even older
			# eventually a ship may even have another birthday or two while already slowly dying (depending on landing frequency)
			# branch old
			#	or
			#		require "Alien Warship alive: old"
			#		and
			#			require "Alien Warship alive: adult" >= 30
			#			random < 50
			branch dead
				require "Alien Warship dead: death"
			branch dying
				require "Alien Warship alive: old" >= 30
			branch old
				require "Alien Warship alive: adult" >= 50
			branch adult
				require "Alien Warship alive: maturity"
			branch maturity
				require "Alien Warship alive: young" >= 20

			label young
			apply
				outfit "Alien Warship alive: young" 1
				goto notify

			label maturity
			apply
				outfit "Alien Warship alive: maturity" 1
			`	Your ship reached maturity. Congratulations.`
				goto end

			label adult
			apply
				outfit "Alien Warship alive: adult" 1
				goto notify

			label old
			apply
				outfit "Alien Warship alive: old" 1
			`	Your ship is getting old and weak.`
				goto end

			label dying
			apply
				outfit "Alien Warship alive: dying" 1
			`	It appears that your ship is dying slowly.`
				goto end

			# initial version had immediate death, removed in favor of slow death
			label death
			apply
				outfit "Alien Warship aging: death" 1
			`	Your ship died after a long, long live.`
				goto end

			label notify
			`	You should celebrate your ships birthday, shouldnt you?`

			label end
				decline

mission "Alien Warship dying"
	invisible
	landing
	repeat
	description "This mission controls the dying process of your ship. Sadly, due to game mechanics it currently can only manipulate your flagship. Please do not use dying ships as escorts. :-("
	to offer
		require "Alien Warship alive: dying"
		random < 85
	on offer
		conversation
			# LORE: "young" outfits get replaced first as they have been in use for the longest time ; the "old" outfits, which were added as last, die as last. Similar to forgetting first what happened in your youth.
			branch young
				require "Alien Warship alive: young"
			branch maturity
				require "Alien Warship alive: maturity"
			branch adult
				require "Alien Warship alive: adult"
			branch old
				require "Alien Warship alive: old"
			branch death
				require "Alien Warship alive: dying"

			label young
			apply
				outfit "Alien Warship alive: young" -1
				outfit "Alien Warship dead: young" 1
				goto notify

			label maturity
			apply
				outfit "Alien Warship alive: maturity" -1
				outfit "Alien Warship dead: maturity" 1
				goto notify

			label adult
			apply
				outfit "Alien Warship alive: adult" -1
				outfit "Alien Warship dead: adult" 1
				goto notify

			label old
			apply
				outfit "Alien Warship alive: old" -1
				outfit "Alien Warship dead: old" 1
				goto notify

			label death
			apply
				outfit "Alien Warship alive: dying" -1
				outfit "Alien Warship dead: death" 1
			`	Your ship died after a long, long live.`
				goto end

			label notify
			`	You can almost feel how your ship is becoming weaker every day.`

			label end
				decline

@EndrosG
Copy link
Contributor Author

EndrosG commented Apr 7, 2017

Application Two: existing but blocked weapon hardmounts
Note: The coalition ships come with weapon mounts, even though they dont sell you weapons...

ship "Alien Warship"
	outfits
		"Hyperdrive"
		"Alien Warship alive: young"
		"blocked gun" 5
		"blocked turret" 7

	gun -20 -50 "blocked gun"
	gun -2 -60 "blocked gun"
	gun 2 -60 "blocked gun"
	gun 20 -30 "blocked gun"

	turret -20 10 "blocked turret"
	turret -20 60 "blocked turret"
	turret -10 60 "blocked turret"
	turret 0 60 "blocked turret"
	turret 10 60 "blocked turret"
	turret 20 60 "blocked turret"
	turret 20 10 "blocked turret"


outfit "blocked gun"
	"gun ports" -1
	"unremovable" 1
	description "This indicates that your ship is not yet aware of its full military potential. Try to find somebody who will give your ship some military training if you want to unlock that gun port."
# in human space: One of your gun ports is locked. You require an advanced license from any major military organisation to unlock that gun port. If you have such a license, go to their headquarter and ask them to unlock it for you.

outfit "blocked turret"
	"turret mounts" -1
	"unremovable" 1
	description "This indicates that your ship is not yet aware of its full military potential. Try to find somebody who will give your ship some military training if you want to unlock that turret mount."
# in human space: One of your turret mounts is locked. You require an advanced license from any major military organisation to unlock that turret mount. If you have such a license, go to their headquarter and ask them to unlock it for you.

# currently not supported by game mechanics:
outfit "blocked fighter bay"
outfit "blocked drone bay"


mission "Alien Warship military training"
#	landing
	repeat
	to offer
		and
			require "Alien Warship alive: maturity"
			or
				require "blocked gun"
				require "blocked turret"
				require "blocked fighter bay"
				require "blocked drone bay"
	on offer
		conversation
			branch gun
				require "blocked gun"
			branch turret
				require "blocked turret"

			`I do not see how I could help you right now. I can train your ships regarding gun ports and weapon turrets, but if you have locked fighter bays or drone bays, you better find the famous captain of a heavily modified kestrel ship and ask him for assistance.`
				goto end

			label gun
			apply
				outfit "blocked gun" -1
			`	I could successfully train your ship and it is now capable of using one more gun.`
				goto finish

			label turret
			apply
				outfit "blocked turret" -1
			`	I could successfully train your ship and it is now capable of using another turret.`
				goto finish

			label finish
			`	I wish you and your ship the very best. Come back if you need my help again.`

			label end
				decline

@EndrosG
Copy link
Contributor Author

EndrosG commented Apr 7, 2017

Application Three: blast marks

LORE: each ship can have many, many blast marks. The more it has, the longer its history or the bigger the battles it fought in. Either way, these may even make a ship more valuable - being a famous ship... That's why I decided for positive price tags for the blast marks! Otherwise they'd be negative
Depreciation of blast marks:

Hey Captain <last>, please tell me, is that blast mark from the big battle in the <some system> system? Wow, I've just read yesterday in the news about it!
sounds different then...
(You tell the story of when you got that mark) Which battle? When was it? I've never heard about it... -- long, long time ago... nobody remembers, nobody values it

Note: adding the correct blast mark type to a ship requires the game to be aware of who built the ship originally which might be achieved with some attribute (probably cant be checked in conditions and branches?!?) or alternatively with some faction outfit saying "This is a human ship" / "This is a hai ship" / "This is a coalition ship".

outfit "permanent hull damage: patch"
	"cost" 500
	"shields" 50
	"hull" 80
	"outfit space" 1
	"patch capacity" -1

#	"installable" 1
#!	"removable" 1

	description `This is a small patch applied to a blast mark on your outer hull, preventing loss of atmosphere.`

outfit "permanent hull damage (human): blast mark"
	"cost" 2000
	"shields" -100
	"hull" -100
	"outfit space" -2
	"patch capacity" 1

	"installable" -1
	"unremovable" 1

	description `Your ship took some serious hits in a previous battle. Some of the damages go beyond regular means of repair. You can apply some patching to it, but the marks will remain.`
	description `	The major shipyards like the ones on Geminus, Tarazed and Valhalla might be able to fully repair your ship but it will cost you some money.`

outfit "permanent hull damage (hai): blast mark"
	"cost" 2000
	"shields" -100
	"hull" -100
	"outfit space" -2
	"patch capacity" 1

	"installable" -1
	"unremovable" 1

	description `Your ship took some serious hits in a previous battle. Some of the damages go beyond regular means of repair. You can apply some patching to it, but the marks will remain.`
	description `	The shipyard on Hai-home might be able to fully repair your ship but it will cost you some money.`


outfit "permanent hull damage (wanderer / korath / coalition): blast mark"
	description `	The shipyard on Hai-home might be able to fully repair your ship but it will cost you some money.`



outfit "permanent hull damage (alien bioship): big plaster"
	"cost" 500
	"shields" 50
	"hull" 80
	"outfit space" 1
	"patch capacity" -1

#	"installable" 1
#!	"removable" 1

	description `This is a gigantic plaster applied to a blast mark on your outer hull, preventing loss of atmosphere.`


# wounds decrease a ships value, different from blast marks in human space
outfit "permanent hull damage (alien bioship): wound / blast mark"
	"cost" -1000
	"shields" -100
	"hull" -100
	"outfit space" -2
	"patch capacity" 1

	"installable" -1
	"unremovable" 1

	description `Your ship took some serious hits in a previous battle. Some of the damages go beyond regular means of healing and regeneration. You can apply some plaster to it, but the marks will remain.`
	description `	The medical facilities on (space hospital location) might be able to fully heal your ship but it will cost you quite some money.`

mission "Hull Repair (Human, Tarazed)"
	invisible
	repeat
	to offer
		require "permanent hull damage (human): blast mark"
	on offer
		conversation
			`Hello Captain <last>, welcome to our shop on <source>. Do you want us to repair some of your blast marks? It will cost you <payment> per blast mark... You may come back as often as you want. But we can only perform that sort of repairs with the ships we know.`
			choice
			`	(Yes).`
			`	(No).`
				defer
			apply
				outfit "permanent hull damage (human): blast mark" -1

			branch patch
				ideally: has "blast mark > patches"
				alternatively: require "patch"

@EndrosG
Copy link
Contributor Author

EndrosG commented Apr 7, 2017

Application Four: ship tuning (variants)

This includes the option to re-write some existing variants (not really intended) but also (that's the relevant application topic) the chance to modify your ship after you bought it, without selling it...
That is even more relevant/attractive with the introduction of depreciation, in my opinion.

ship "Fury"
	plural "Furies"
	sprite "ship/fury"
	attributes
		category "Interceptor"
		"cost" 490000
		"tuning capacity" 1

ship "Firebird"
	sprite "ship/firebird"
	attributes
		category "Medium Warship"
		"cost" 3700000
		"tuning capacity" 2

ship "Cruiser"
	sprite "ship/cruiser"
	licenses
		Navy
		Cruiser
	attributes
		category "Heavy Warship"
		"cost" 11200000
		"tuning capacity" 3

ship "Carrier"
	sprite "ship/carrier"
	licenses
		Navy
		Carrier
	attributes
		category "Heavy Warship"
		"cost" 15200000
		"tuning capacity" 4


outfit "tuning kit: engines"
	"cost" 200000
	"outfit space" 20
	"engine capacity" 15

	"tuning capacity" -1
	"installable" 1
	"unremovable" 1
	description `The engineers on <some special fancy outfitter planet "Tuning Labs Inc HQ"> are NOT the only ones known in human space to be able to tune the engine ports. But they are the best ones. Nine out of ten tuned ships were tuned by Tuning Labs Inc and most of their customers decide for one of the standardized tuning kits because individual tuning is very, very expensive and because the kits come with a lifetime warranty.`

outfit "tuning kit: shields"

outfit "tuning kit: weapons"


ship "Firebird" "Marauder Firebird (engines)"
	outfits
		"[...]"
		"tuning kit: engines" 2

@EndrosG
Copy link
Contributor Author

EndrosG commented Apr 7, 2017

Application Five: empty placeholder
(I like placeholders)

@Lorantine
Copy link
Contributor

you really don't have to copy-paste several missions in every issue, just simply saying what's up does too

@endless-sky endless-sky added the mechanics Things dealing with the mechanics & code of how the game works label May 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mechanics Things dealing with the mechanics & code of how the game works
Projects
None yet
Development

No branches or pull requests

2 participants