abaines / Resource-Marker

Factorio Mod
Other
5 stars 7 forks source link

internal names for Angels ores & infinite resources #7

Open danyax opened 3 years ago

danyax commented 3 years ago

I have two inconviniences running Bob + Angel mods

First, Angels ores are shown as "angels-ore1", "angels-ore2", "angels-infinite-ore1" etc. Only coal has normal name. I assume it would be easy to retrieve human-readable name from resource prototype, like Saphirite, Jivolite etc

Second, all infinite ores are generated inside normal ore patches. So for each patch two labels are present. It would much be more readable if just one label is created and infinite portion of patch will be present as second number, something like "Coal 1.1M, 20K%", the second number being the total infinite % as combined yield that base game shows on the map. Or just have an option to ignore infinite part of patch for non liquid resources.

It would also help if you put to mod portal the list of console commands mod supports.

abaines commented 3 years ago

Thank you for the report. 🧡

I've looked at this issue in the past several times. The problem is that looking up "English" or internationalized text is a lengthy process that requires lots of asynchronous events. This actually comes up in Discord and the Forums a lot for many mods. Here is an example of one of the topic threads, and this isn't even the complicated case where the text has to be shared per team. The issue is multiplayer; which user's language do you use? This normally isn't a problem because most text only the active player can see, but map labels are shared for all players on the same team. The code cannot make assumptions, and best I can tell, I can't always just grab "English", unless there is an English player. 😭

I do accept pull requests. 😀

Source discussion

abaines commented 3 years ago

Also added command descriptions to the mod portal 🚀

⌨ The mod introduces four commands: 1️⃣ /generate-chunks \<radius in chunks> "Generate chunks around starting area (in chunk radius)." 2️⃣ /chart-generated-chunks "Reveal all generated chunks to player's force." 3️⃣ /clear-map-tags-and-data "Remove all labels for the given user's force." 4️⃣ /reset-map-tags-and-data "Remove all labels for the given user's force and then re-tag all resources with new labels."

abaines commented 3 years ago

Also see: Resource-Marker/issues/2

danyax commented 3 years ago

I am not skilled enough in lue to make all the changes ((

My I ask you to just put static translation table to English names for most popular mods, line Bob and Angels? It will be as good as could be for non-English players, but it definetely better than internal names. I can provide you data table with internal and english names. Yours is the only working mod for 1.1 that adds labels, so you are my last hope )

Another request is was for combined patches (same area, infinite ore sits right in middle of non-infinite patch). For those patches two icons are created. Ideally it should be one icon, either with just count of non-infinite resource or plus total % of infinine one.

For fully infinite patches (like oil), currently total resource amount is shown which makes no sense. Total % would be much better.

abaines commented 3 years ago

While I don't like hard-coded tables, I am strongly considering something like this. 🤔

Are you willing to come up with the raw-internal-name-to-English-mappings for all of the big mods if I can provide a simple way for you to provide them?

To your knowledge, do all non-infinite and infinite ores share the same icon? Are you aware of any mods that have an infinite ore that has a different icon for it's non-infinite equivalent?

However I may not be able to get around to it for a week or two. 📅

danyax commented 3 years ago

I think covering Bob + Angels + Krastorio will serve 90% of population. Yes, I can provide ore name mapping.

For Bob and Angels icon is the same for infinite and non infinite. If will check with Krastorio, should be same as well, as both types gives same ore by definition, one just not depletes.

You can decide if to merge non-infinite and infine ore icons in the same location by looking in product list of both. If products are the same, combine them.

abaines commented 3 years ago

My plan was to merge them if their English-mapped names were the same. 😀 Bit more flexible and lazy....

So if "angels-ore1" and "angels-infinite-ore1" both English-mapped to "Saphirite", then it would merge them; then pick one of the icons "at random".

danyax commented 3 years ago

No problem, as long as you provide for infinite patches combined yeild %, it should be clear for players. I will compile list of ores and fluids over weekend.

abaines commented 3 years ago

🥳 releases/tag/0.6.21

english.lua contains all of the mappings. Anything that maps to the same name will automatically get merged into one map tag. When you get the time, please update that file (via PR) with all of the English ore/resource translations for Bob + Angels + Krastorio and any other mods you want. Hopefully the syntax for that file is pretty simple, but if you have any questions, please let me know. 🧡

danyax commented 3 years ago

I have no experience with github, could you please accept just updated code for english.lua below. Tested on Angel & Bobs, works like a charm. It covers PY, Angel, Bobs and some smaller mods supported by Angel Infinite Ores

return { ["iron-ore"]="Iron ore", -- base game ["coal"]="Coal", -- base game ["copper-ore"]="Copper ore", -- base game ["uranium-ore"]="Uranium ore", -- base game ["stone"]="Stone", -- base game ["crude-oil"]="Crude oil", -- base game -- infinite version of base game ores ["infinite-iron-ore"]="Iron ore", ["infinite-coal"]="Coal", ["infinite-copper-ore"]="Copper ore", ["infinite-uranium-ore"]="Uranium ore", ["infinite-stone"]="Stone",

-- Bob ores
["tin-ore"]="Tin ore",
["infinite-tin-ore"]="Tin ore",
["gold-ore"]="Gold ore",
["infinite-gold-ore"]="Gold ore",
["bauxite-ore"]="Aluminium ore",
["infinite-bauxite-ore"]="Aluminium ore",
["lead-ore"]="Lead ore",
["infinite-lead-ore"]="Lead ore",
["quartz"]="Silicon ore",
["infinite-quartz"]="Silicon ore",
["rutile-ore"]="Titanium ore",
["infinite-rutile-ore"]="Titanium ore",
["tungsten-ore"]="Tungsten ore",
["infinite-tungsten-ore"]="Tungsten ore",
["zinc-ore"]="Zinc ore",
["infinite-zinc-ore"]="Zinc ore",
["nickel-ore"]="Nickel ore",
["infinite-nickel-ore"]="Nickel ore",
["gem-ore"]="Gem ore",
["infinite-gem-ore"]="Gem ore",
["sulfur"]="Sulfur",
["infinite-sulfur"]="Sulfur",
["silver-ore"]="Silver ore",
["infinite-silver-ore"]="Silver ore",
["cobalt-ore"]="Cobalt ore",
["infinite-cobalt-ore"]="Cobalt ore",
["thorium-ore"]="Thorium ore",
["infinite-thorium-ore"]="Thorium ore",
["ground-water"]="Ground water",
["lithia-water"]="Lithia water",    

-- Uranium Power
["uraninite"]="Uraninite",
["infinite-uraninite"]="Uraninite",
["fluorite"]="Fluorite",
["infinite-fluorite"]="Fluorite",

["tenemut"]="Tenemut cluster",
["infinite-tenemut"]="Tenemut cluster",

-- Yuoki
["y-res1"]="N4-material chunk",
["infinite-y-res1"]="N4-material chunk",
["y-res2"]="F7-material chunk",
["infinite-y-res2"]="F7-material chunk",

-- Angels
["angels-ore1"]="Saphirite",
["infinite-angels-ore1"]="Saphirite",
["angels-ore2"]="Jivolite",
["infinite-angels-ore2"]="Jivolite",
["angels-ore3"]="Stiratite",
["infinite-angels-ore3"]="Stiratite",
["angels-ore4"]="Crotinnium",
["infinite-angels-ore4"]="Crotinnium",
["angels-ore5"]="Rubyte",
["infinite-angels-ore5"]="Rubyte",
["angels-ore6"]="Bobmonium",
["infinite-angels-ore6"]="Bobmonium",
["angels-natural-gas"]="Natural gas",
["angels-fissure"]="Fissure",

-- PY
["borax"]="Borax",
["infinite-borax"]="Borax",
["niobium"]="Niobium",
["infinite-niobium"]="Niobium",
["molybdenum-ore"]="Molybdenum",
["infinite-molybdenum-ore"]="Molybdenum",
["ore-quartz"]="Quartz",
["infinite-ore-quartz"]="Quartz",
["raw-coal"]="Raw coal",
["infinite-raw-coal"]="Raw coal",
["ore-aluminium"]="Aluminium",
["infinite-ore-aluminium"]="Aluminium",
["ore-chromium"]="Chromium",
["infinite-ore-chromium"]="Chromium",
["ore-lead"]="Lead",
["infinite-ore-lead"]="Lead",
["ore-nickel"]="Nickel",
["infinite-ore-nickel"]="Nickel",
["ore-tin"]="Tin",
["infinite-ore-tin"]="Tin",
["infinite-ore-titanium"]="Titanium",
["ore-titanium"]="Titanium",
["ore-zinc"]="Zinc",
["infinite-ore-zinc"]="Zinc",
["oil-sand"]="Oil sand",
["infinite-oil-sand"]="Oil sand",

}

abaines commented 3 years ago

I loaded a bunch of random popular mods and getting these messages:

The english.lua table missing `aluminium-rock`
The english.lua table missing `arum`
The english.lua table missing `bitumen-seep`
The english.lua table missing `chromium-rock`
The english.lua table missing `coal-rock`
The english.lua table missing `copper-rock`
The english.lua table missing `grod-flower`
The english.lua table missing `iron-rock`
The english.lua table missing `kicalk-tree`
The english.lua table missing `lead-rock`
The english.lua table missing `natural-gas-1`
The english.lua table missing `natural-gas-2`
The english.lua table missing `natural-gas-3`
The english.lua table missing `natural-gas-4`
The english.lua table missing `nexelit-rock`
The english.lua table missing `nickel-rock`
The english.lua table missing `oil-mk01`
The english.lua table missing `oil-mk02`
The english.lua table missing `oil-mk03`
The english.lua table missing `oil-mk04`
The english.lua table missing `ore-bioreserve`
The english.lua table missing `phosphate-rock`
The english.lua table missing `phosphate-rock-02`
The english.lua table missing `quartz-rock`
The english.lua table missing `ralesia-flowers`
The english.lua table missing `rare-earth-bolide`
The english.lua table missing `regolites`
The english.lua table missing `rennea-flowers`
The english.lua table missing `salt-rock`
The english.lua table missing `sulfur-patch`
The english.lua table missing `tar-patch`
The english.lua table missing `tin-rock`
The english.lua table missing `titanium-rock`
The english.lua table missing `tuuphra-tuber`
The english.lua table missing `uranium-rock`
The english.lua table missing `volcanic-pipe`
The english.lua table missing `yotoi-tree`
The english.lua table missing `yotoi-tree-fruit`
The english.lua table missing `zinc-rock`

Using the mod-list.json:

{
    "mods": [
        {
            "name": "base",
            "enabled": true
        },
        {
            "name": "angelsaddons-mobility",
            "enabled": true
        },
        {
            "name": "angelsaddons-storage",
            "enabled": true
        },
        {
            "name": "angelsbioprocessing",
            "enabled": true
        },
        {
            "name": "angelsindustries",
            "enabled": true
        },
        {
            "name": "angelsinfiniteores",
            "enabled": true
        },
        {
            "name": "angelspetrochem",
            "enabled": true
        },
        {
            "name": "angelsrefining",
            "enabled": true
        },
        {
            "name": "angelssmelting",
            "enabled": true
        },
        {
            "name": "bobassembly",
            "enabled": true
        },
        {
            "name": "bobelectronics",
            "enabled": true
        },
        {
            "name": "bobgreenhouse",
            "enabled": true
        },
        {
            "name": "boblibrary",
            "enabled": true
        },
        {
            "name": "boblogistics",
            "enabled": true
        },
        {
            "name": "bobmining",
            "enabled": true
        },
        {
            "name": "bobores",
            "enabled": true
        },
        {
            "name": "bobplates",
            "enabled": true
        },
        {
            "name": "bobrevamp",
            "enabled": true
        },
        {
            "name": "bobvehicleequipment",
            "enabled": true
        },
        {
            "name": "companionship",
            "enabled": true
        },
        {
            "name": "flib",
            "enabled": true
        },
        {
            "name": "kizraks-robots",
            "enabled": true
        },
        {
            "name": "lightArtillery",
            "enabled": true
        },
        {
            "name": "ModuleInserter",
            "enabled": true
        },
        {
            "name": "pyalienlife",
            "enabled": true
        },
        {
            "name": "pyalienlifegraphics",
            "enabled": true
        },
        {
            "name": "pyalienlifegraphics2",
            "enabled": true
        },
        {
            "name": "pyalienlifegraphics3",
            "enabled": true
        },
        {
            "name": "PyBlock",
            "enabled": false
        },
        {
            "name": "pycoalprocessing",
            "enabled": true
        },
        {
            "name": "pycoalprocessinggraphics",
            "enabled": true
        },
        {
            "name": "pyfusionenergy",
            "enabled": true
        },
        {
            "name": "pyfusionenergygraphics",
            "enabled": true
        },
        {
            "name": "pyhightech",
            "enabled": true
        },
        {
            "name": "pyhightechgraphics",
            "enabled": true
        },
        {
            "name": "pyindustry",
            "enabled": true
        },
        {
            "name": "pypetroleumhandling",
            "enabled": true
        },
        {
            "name": "pypetroleumhandlinggraphics",
            "enabled": true
        },
        {
            "name": "pyrawores",
            "enabled": true
        },
        {
            "name": "pyraworesgraphics",
            "enabled": true
        },
        {
            "name": "resourceMarker",
            "enabled": true
        },
        {
            "name": "showTileGridLite",
            "enabled": true
        },
        {
            "name": "stdlib",
            "enabled": true
        },
        {
            "name": "vonNeumann",
            "enabled": false
        },
        {
            "name": "WireShortcuts",
            "enabled": true
        },
        {
            "name": "Yi_Tech_Tree",
            "enabled": true
        },
        {
            "name": "Yuoki",
            "enabled": true
        }
    ]
}