yairm210 / Unciv

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

Modding requests #3242

Open yairm210 opened 3 years ago

yairm210 commented 3 years ago

There have been a lot of various requests to extend the modding in various ways. Usually they're from one person, and have very little effect on the general playerbase, and they're kind of clogging up the issues.

So this is an issue to consolidate all those requests, as comments to this issue.

GoldenBronze commented 3 years ago
  1. Making roads and railroads modifyable - currently, these seem hardcoded. Putting their parameters in TileResources.json and allowing Unciv to handle modded roads and railroads would be extremely beneficial for, say, a mod with several kinds of roads.

When described in the json, roads and railroads could have parameters like "Double movement rate" and "Triple movement rate upon researching [ ]". There's lots of opportunity here.

  1. Allowing terrain-tied resources - currently, resources stay the same if a terrain feature (most commonly Forest and Jungle) is removed. I'd like it if it were possible to set a (in TileResources.json) a resource such that it disappears if the terrain feature it occurs on is removed. Admittedly, this is not present in Civ 5 itself, but it would be extremely helpful to modders like me in putting resources like Cedarwood: I mean, you can't get cedarwood from a tile you've deforested, after all!

A unique for this, maybe "Is removed by [Remove Forest]".

  1. Selective improvement construction: currently, the Roman Legion has the "Can construct roads" unique. It would be great if this unique could be generalised so that it works with any improvement: not only would it make it easy to add the Legion's other ability of constructing forts, it would also be extremely fruitful for modders.

"Can construct [Road], [Fort]".

  1. Tile improvements unique to units: I'd like to be able to define a modded tile improvement as being unique to a non-Worker unit, so that the Worker can't build it.

Maybe a "UniquetoUnit" parameter inside the "uniques": in TileImprovents.json or something similar? This would also allow Oil Wells to be restricted to Workers and Offshore Platforms to be restricted to Work Boats, as in Civ 5, assuming that the "improvement": parameter in TileResources.json can handle more than one improvement.

GoldenBronze commented 3 years ago
  1. Allow terrains, terrain features and resources to be restricted to spawn only on River tiles.

A unique to the effect of "Must be on [River]" or something similar would be great, especially for futureproofing Unciv for Civ 6 (if you eber get to that), and also for modding.

ravignir commented 3 years ago

Here are some ideas for uniques.

"Can not be sold" - for buildings.

"Unlocks at [Era name]" - for buildings and units and improvements (already implemented for Policies).

"Food required for population growth +/- [x]%" - as nation and policy unique (also called civ-wide).

ravignir commented 3 years ago

Just a clarification of what i've meant with the last idea. Capture+_2020-10-20-16-45-14(1) A way to interact with this parameter. Maybe call it "City growth rate +/-[value]%"

ravignir commented 3 years ago

Another suggestions; Modding unique that makes other policy trees non pickable: i.e If i pick Piety, I can't pick Rationalism and vice versa;

"Unlocks at [era]" unique for buildings, units;

Caballero-Arepa commented 3 years ago

This is already mentioned on the first comment but: A unique that allows units to build specific tile improvements, like "Can construct [Fort]". Currently there is only: "can build improvements on tiles" and " Can construct Roads".

Caballero-Arepa commented 3 years ago

A unique that let's you do canals for improvements or tiles. With this, we could make canals (like, suez canal) or make navigable rivers; or even the opposite, as bridges (like the one that ties scotland and ireland). I imagine the unique could be as: "Acts as [Water]" How it would is by allowing both land and water units move in such tile normally.

The problem I see with it is that AI would be very dumb to use it but what we care is for the player.

AdityaMH commented 3 years ago

Any wiki tutorial how to mod m̶u̶s̶i̶c̶ sound?

Caballero-Arepa commented 3 years ago

A unique for polices that gives you a free policy, but from a specific tree.

ajustsomebody commented 3 years ago

allow tile filter to contain more than one tile

f.i allow this to work "Must be next to [Desert]", "[+1 Food, +1 Production, +1 Gold] from [Desert] tiles without [Flood plains, Oasis, Hill] [in this city]"

this is my attempt to only make plain desert tiles get petra bonuses but it completely broke so it gives bonuses to all

ajustsomebody commented 3 years ago

more than 1 techs required for a building techrequired: "currency, sailing"

ajustsomebody commented 3 years ago

add a property to improvements that is can be build by [unitFilter] so the mods can add more than 1 types of workers. this however should only be the case for worker units that are able to open up select improvements to build window rather than something like legions that have an ability to build only roads

xlenstra commented 3 years ago

add a property to improvements that is can be build by [unitFilter] so the mods can add more than 1 types of workers. this however should only be the case for worker units that are able to open up select improvements to build window rather than something like legions that have an ability to build only roads

This is already implemented the other way around, as you can have the "Can build [improvementFilter] improvements" uniques for units, so this can allow building specific improvements or groups of improvements

ajustsomebody commented 3 years ago

add a property to improvements that is can be build by [unitFilter] so the mods can add more than 1 types of workers. this however should only be the case for worker units that are able to open up select improvements to build window rather than something like legions that have an ability to build only roads

This is already implemented the other way around, as you can have the "Can build [improvementFilter] improvements" uniques for units, so this can allow building specific improvements or groups of improvements

is there a distinction between units than can open up build improvement screen and others? also do you need to do something like this "can build [mine]" "can build [farm] etc or can it directly do can build "[mine,farm,quarry]" etc.

xlenstra commented 3 years ago

add a property to improvements that is can be build by [unitFilter] so the mods can add more than 1 types of workers. this however should only be the case for worker units that are able to open up select improvements to build window rather than something like legions that have an ability to build only roads

This is already implemented the other way around, as you can have the "Can build [improvementFilter] improvements" uniques for units, so this can allow building specific improvements or groups of improvements

is there a distinction between units than can open up build improvement screen and others? also do you need to do something like this "can build [mine]" "can build [farm] etc or can it directly do can build "[mine,farm,quarry]" etc.

Only units that have have the "Can build []" unique can open the "build improvement"-screen. Uniques don't support comma separation, so you need a different unique for each imrpovement

ajustsomebody commented 3 years ago

comma seperation for uniques

ajustsomebody commented 3 years ago

two uniquesets for anything that supports uniques, one for with religion on and one with religion off

like: monastery(r on) = 2 culture 2 faith from incense/wine monastery(r off) = 2 culture from incense/wine

or we can just make the game ignore anything about faith or gprop points when religion is disabled

ajustsomebody commented 3 years ago

being able to put decimals in bonuses for instance.

[+0.50 Food] for [tundra] tiles for each adjacent [mountain] tiles [in all cities] [-0.16 Food] for [tundra] tiles for each adjacent [snow] tiles without [mountain] tiles

for instance when calculating this you do math on each other and remove the decimal at the end of the calculation (or just allow decimals in [stats]) (0.50+0.50+0.50) - (0.32) which is 1.18. if the value is less than 0 you round it down normally (0 if <50 1 if >50) if it is over 1 just remove the decimals and if it is 1.82 something round it to 2

ajustsomebody commented 3 years ago

add an option to hide certain uniques from showing up in descriptions like uniques: "[HIDE] [+1 Gold, +1 Science] from every [grassland] with [jungle]", "[does something that dhows up in description]"

something something: 400Production womething that shows up in description

xlenstra commented 3 years ago

Use the replacementTextForUniques parameter, most major things have that

ajustsomebody commented 3 years ago

Use the replacementTextForUniques parameter, most major things have that

i recall you saying such thing in somewhere as to be more descriptive in object descriptions instead of just showing unique codes, do i recall correctly? edit: thx btw

xlenstra commented 3 years ago

Most objects have a replacementTextForUniques tag. When this is not empty, it is used instead of stringing together the uniques when showing the abilities of something to the user, so basically yes.

SomeTroglodyte commented 3 years ago

replacementTextForUniques

Units and Buildings so far - documentation is correct. To hide all uniques one would have to set this non-empty and thus you couldn't avoid vertical spacing at that point. Its output will also be unable to have links in Civilopedia - use civilopediaText instead. Placing of these lines is a bit unsatisfactory at the moment, may change in time.

ravignir commented 3 years ago

Include max city strength value in era.jsons (or maybe a value to replace tech count value).

        val techCount = getCivInfo().gameInfo.ruleSet.technologies.count()
        val techsPercentKnown: Float = if (techCount > 0) city.civInfo.tech.techsResearched.count().toFloat() / techCount else 0.5f // for mods with no tech
        strength += (techsPercentKnown * 5.5).pow(2.8).toFloat()

useful for mods that have smaller tech trees.

Caballero-Arepa commented 3 years ago

Yeah, that would be easier than increasing unit strengh and other tactics😅

ajustsomebody commented 3 years ago

policy types

i think there should be tags for each policy, for instance the get a free social policy in piety can be used to get any policy but with this suggestion it would only be able to get policies tagged with "religious" the ones in vanilla unciv should all be tagged "vanilla", the individual policies should have tags though, not entire trees

unique requests:

Gain [amount] free [policyType] policy

Incompatible with [policyType] policies

this will be especially useful for mods containing more than 1 adoptable ideology trees (none yet but we'll see)

also it would help with mods containing one huge branch of policies as the player adopts another path that is incompatible with others the player can just tag each branch with some code and work up from there

ajustsomebody commented 3 years ago

replacementTextForUniques

Units and Buildings so far - documentation is correct. To hide all uniques one would have to set this non-empty and thus you couldn't avoid vertical spacing at that point. Its output will also be unable to have links in Civilopedia - use civilopediaText instead. Placing of these lines is a bit unsatisfactory at the moment, may change in time.

it does not replace the description you get at city screen, it surely does add text to the civilopedia but still not exactly what i want

ajustsomebody commented 3 years ago

in other cities cityFilter

all cities - this city

ajustsomebody commented 3 years ago

a one time bonus production building, for instance you might build a thing that technically counts as building and it might provide 1 population but the player could sell it and re build it. one could add unsellable tag yes but i dont want it to show up in the buildings tab at all. like say.

a "building" that costs 100 production to built that can be built 5 times and requires at least 2 population that gives a free great person and takes away 1 population every time it is built.

unique requests:

Can only be built [amount] times per [cityFilter] (no matter the ownership status, it doesnt reset when the city changes hands)

Requires [at least/at most/exactly] [amount] population for it to be built. (can start and continue building if population meets the requirements, building pauses if unable to meet the reqs)

ravignir commented 3 years ago

an unique that makes promotions mutually exclusive.

ravignir commented 3 years ago

Does not need to embark unique, that basically makes all tiles Land tiles for this unit.

ravignir commented 3 years ago

"Consumes [amount] [resource]" for improvements (including placeable ones), preventing improvement construction when you don't have that resource.

not-navyblue commented 3 years ago

Make the "Bonus for units in 2 tile radius 15%" more customizable; that is, the unique becomes "Bonus for units in [amount] tile radius [amount]%"

Caballero-Arepa commented 3 years ago

A tile unique that makes you customize direct tile damage, something similar to: "[amount]% chance of unit taking [amount] damage if it ends turn on top of [tileFilter] tiles".

This would make that units are avaible to take damage like Mountains does to anny unit.

On the same topic, a similar unique but for dealing damage outwards but for tileImprovements.

I forgot to mention, also related a unique for countering this: "Ignores [tileFilter] tiles damage" and "Ignores [tileFilter] damage once [techFilter] is researched" and "[amount]% damage reduction from [tileFilter] tiles".

kingkarna1 commented 3 years ago

ive thought of these 3: "[unitfilter] can fight when embarked", "cannot enter [tilefilter] until [techfilter or policyfilter]", and "[amount]% [attack strength or defensive strength] when [techfilter, policyfilter, unitfilter, golden age]"

ajustsomebody commented 3 years ago

groundwork for canals

kingkarna1 commented 3 years ago

a recently added unqiue was cool but id like to make a 2nd shorter version: "May buy [unitFilter] units for [amount] [Stat] [cityFilter]"

kingkarna1 commented 3 years ago

a recently added unqiue was cool but id like to make a 2nd shorter version: "May buy [unitFilter] units for [amount] [Stat] [cityFilter]"

AdityaMH commented 3 years ago

Add "" or "?" variant, for conditional variable example "+Hill+Farm": ["*","HillFarm"], could be:

"Grasslands+Hill+Farm": ["Grasslands","HillFarm"], and "Plains+Hill+Farm": ["Plains","HillFarm"],

Also more specific: "?(Grasslands, Plains, Desert)+Hill+Farm": ["?(Grasslands, Plains, Desert)","HillFarm"],

or another method can be make more simpler.

Caballero-Arepa commented 3 years ago

Now that we have moddable music, I suggest a "music.json". In this file, you could add "uniques" so certain tracks only play on certain eras, or only play if you are with certain civ.

SomeTroglodyte commented 3 years ago

I suggest a "music.json"

Actually, that's old code that saw some testing and discussion with a mod maker - the one who did "Dacia" - back early 2020 or so. The idea will be that context events will get hooks - the track chooser will then fuzzy-match and quickly fade over when successful. Control which file is good for which context was done with prefix and suffix to the filenames, but I may rethink that. Advantage of the pre/suf-fixes is no json or any config needed. You place an "Germany-Ride-of-the-Valkyries-by-Richard-Wagner-War.ogg" in reach, and it will immediately give you that Apocalypse Now setting when the inglourious basterds inevitably declare war on you.

Would be mighty nice if someone started compiling a full set of "theme" short tunes for each of the built-in nations - for the nation picker and first-meets...

You noticed there's already two mods catering to the new feature? I like them, even if it's purely royalty-free music. Shameless plug, yes, so please don't star them.

Caballero-Arepa commented 3 years ago

So what you mention is already implemented?

SomeTroglodyte commented 3 years ago

Not 'Is', 'Was'. Will go forward in little steps. Existence of a mod with "Themes" would accelerate that of course. Naming scheme nation-whateveryouwhish-theme.(mp3|ogg) will most likely go with whatever I choose in the end to steer the contextual playback...

Caballero-Arepa commented 3 years ago

Ah ok, tell me when you decide to what go for.

kingkarna1 commented 3 years ago

Platform Chrome book(irrelevant)

Version 3.17.0(irrelevant)

Describe the bug on mods some resources that require farms dont have images

To Reproduce Steps to reproduce the behavior: download almost any mod that has resources, find resources that needs a farm and build it, See error

Screenshots Screenshot 2021-09-27 1 58 09 AM

ive attempted to remedy the by creating this: Screenshot 2021-09-27 1 48 02 AM farm

not-navyblue commented 2 years ago

How about customizable messages when a civ is denounced by the player? Defaults to the usual "We will remember this." when omitted.

not-navyblue commented 2 years ago

Also how about unit HP-related conditionals, like <when at [amount] HP or lower> and <when at [amount] HP or higher>?

FriedrichWilhelm123 commented 2 years ago

Provides [1] [happiness] per [2] additional social policies adopted

SpacedOutChicken commented 2 years ago

A national unique that prevents the nation from making certain units: "Cannot build [unitFilter] units".

This would be especially handy for DeCiv Redux; I could just slap "Cannot build [Low Tech] units" on the Patriots instead of having to make special hidden units for each kind of Low Tech unit.

not-navyblue commented 2 years ago

How about these global uniques: "Hidden in [difficulty] difficulty" and "Can only be acquired in [difficulty] difficulty"? What these uniques do is to restrict what difficulties do a unit, improvement, building, etc. appear on and not appear on.