yairm210 / Unciv

Open-source Android/Desktop remake of Civ V
Mozilla Public License 2.0
8.14k stars 1.52k forks source link

Idea/RFC: Transient terrain Phenomena. #5836

Closed will-ca closed 2 years ago

will-ca commented 2 years ago

"Phenomena" would be a subcategory of Terrain Features, but with a finite duration, at the end of which they are removed. As they would be a type of terrain feature, they would be usable in Uniques' terrainFilters and conditionals, and they would have moddable stats, movement costs, uniques, and textures like all Terrains do.

All Uniques relevant with terrains would be relevant with phenomena too, but Uniques like the following could be implemented specifically for phenomena:

Unique Template Applies To
"Creates [phenomenon] at target for [amount] turns when attacking" Unit
"Creates [phenomenon] for [amount] turns when defending" Unit
"Can create [phenomenon] for [amount] turns [amount] times" Unit
"Can end [phenomenon] [amount] times" Unit
"Creates [phenomenon] at city for [amount] turns when completed" Building
"Creates [phenomenon] for [amount] turns when ending" Phenomenon
"[amount]% chance to create [phenomenon] for [amount] turns each turn" Terrain (including phenomena)
"Creates [amount]-[amount] [phenomenon] in [amount]-[amount] nearby tiles for [amount]-[amount] turns when starting" Phenomenon

(About the last one: A zero-turn phenomenon with this Unique would be used to make sure that the real phenomenon always spawns in groups, or control its spreading behaviour.)

Example moddable use cases:

(More practical examples: Wildfire/tornado/earthquake/volcano, rain dance/firefighter, Great Person improvement but temporary, landmines, canals, wonder/social policy temporary effect visualization.)

Some of this does go into or near territory that I myself think is possibly too far out of scope from Civ V mechanics to be implemented in the core. (A lot of it is similar to stuff I was actually already planning as Python scripting examples/tests.)

…But ultimately, this entire proposal actually comes from trying to generalize in as moddable of a form as possible the very simple question: "How do I make nukes display a mushroom cloud where they impact?"

(Original thought was to do something like my arrows PR, but displayed like terrain features… but stripping away unneeded functionality would have been close to hardcoding for nukes… So let mods specify which units create which sprites through a Unique, then… But a Unique should be able to affect gameplay and not just add a sprite— At which point, I'm basically describing temporary terrain features.)

(I'm thinking the best way to implement this might be to just add an "Is temporary phenomenon" unique that can go in "Terrains.json"… Or honestly, for the most basic use case of a unit spawning a temporary feature, could just use terrains without any special distinction.)

yairm210 commented 2 years ago

This goes against our principles of following Civ V mechanics, and this is big change. Denied.

AdityaMH commented 2 years ago

But, for modding request. Then yes.

For base ruleset, we can ignore even denied this. but modding flexibility, this absolutely good idea.

will-ca commented 2 years ago

TL;DR: Actually, IDC about transient terrain phenomena. Real question is: How should I structure a PR to add mushroom cloud graphics for nukes? (Terrain phenomena is just the extreme limit of scope creep on that question.)


@yairm210 Well, Civ V has animations, that comprise both flair and tactical data. Unciv doesn't, and won't for the foreseeable future, hence trying to find non-Civ-V ways of accomplishing similar goals.

What if it were restricted to a much, much smaller scope? Contents I've been considering PR'ing:

Or, actually: How should a mushroom cloud be displayed in a way that fits with project principles? I mean, even the function name for "NUKE" is capitalized, and it can turn the tide of an entire war; There 'ought to be a more dramatic on-screen indication than a notification which doesn't even get displayed in spectator mode. It's simple in principle and probably quick to whip up a PR for; I'm just not sure what the best approach would be.

yairm210 commented 2 years ago

An AlertPopup is probably the way to go - we can have an AlertPopup with unique text, the nuke image, and have it pop up for all players after the first nuke in the game is launched (probably one per game, maybe one per civ? each neww civ that joins the nuclear war generates another one? not sure)

will-ca commented 2 years ago

I would really like to show it on the tilemap, though.

I was watching an every-Civ AI spectator game on the biggest map size to test the arrows PR. Hundreds of turns of suspense, watching Rome steamroll half a dozen other Civs while all the other major powers were too busy squabbling to seriously compete. Then dozens of turns of anticipation as I realized what was coming— Getting the notifications that each Civ had advanced to the Atomic Era, then that they were working on the Manhattan project— Short red attack arrows coming first from riflemen, then longer ones from submarines, and then finally laser-like rays from the bombers in cities and on carriers— Seeing the two biggest powers start building nukes in their cities, Augustus moving his towards his invasion of Korea and Ramesses moving his towards Egypt's border with Rome.

And then... Nothing. Zip, nada. Five or six cities got covered in fallout in just as many turns, and I wouldn't have even noticed if I hadn't already been looking at that part of the map. I still don't know where all the nukes went; I assume the cities that ended up with more fallout around them must have been hit two or three times. Would have probably had notifications as a non-spectator player, of course, but still: Why read if you can just see?

A popup would certainly help with the flair, but only once, and without adding any clearer visual indication of location. And since last turn's attacks are/will be (pending merge and player opinion) already tracked to show overlay arrows, it would actually be considerably more complexity to keep track of which Civs still need the popup than to add a sprite in the TileGroup for every nuclear strike.

I mean, show, don't tell, right?