Skip to content
Snippets Groups Projects

Rework diplomacy page

Merged svornost requested to merge svornost/fc-pregmod:diplomacy into pregmod-master

Since our arcology's neighbors have locations, I figured I'd see what I could do to move diplomacy to something a bit more graphical.

Examples: image image image

Thoughts?

Border color indicates ownership status (white is yours, blue owned, red not). FS diamonds each indicate one adopted FS, with color indicating whether they're shared (blue) or conflicting (red) with one of yours, and tooltips indicating the actual FS name. Ownership % is you (blue), public (yellow), foreign opposition (orange), and hostile (red), with tooltips indicating the meaning.

Edited by svornost

Merge request reports

Approval is optional

Merged by PregmodderPregmodder 4 years ago (May 31, 2020 1:43am UTC)

Merge details

  • Changes merged into pregmod-master with 949e302f.
  • Did not delete the source branch.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • svornost added 1 commit

    added 1 commit

    • a15e20ad - fix player owned percentage for non-player arcologies

    Compare with previous version

  • svornost added 1 commit

    added 1 commit

    • e94227cb - don't get stuck on colored FS diamonds

    Compare with previous version

  • svornost changed the description

    changed the description

    • Unfortunately that directional aspect is something that I want to move away from. You can see the discussion about Free City structure in the derelict City Map merge request.

      For the time being, you can sort them by arcology number. When they lack a name, they are named by number, and even after losing that name, they don't exactly move, you know?

    • Author Reporter

      The cell renderer itself is actually pretty independent of direction; it just drops arcologies into a CSS container in a specified order. Here's the same game in three different modes:

      City Grid (like above): image

      List, By ID: image

      List, By Name image

      Could add others pretty easily too, if something else makes sense (prosperity, ownership)?

      If we move away from the direction grid, we can replace the grid layout itself with something else without too much trouble at all (or show the cells as overlays on the map, if you go for a map approach).

      Edited by svornost
    • Rival. We should mark the rival arcology with a unique color.

    • Author Reporter

      Want the rival to be red, and switch other unowned arcs to yellow?

    • Red is generally used for unowned, so I'd keep it red. Maybe crimson?

    • I would suggest purple as it can be striking and seems to be unused. However when should it be triggered though? Odds are that most player's will not know who the rival is until the passage pointing it out is shown (the week or so) after crushing the failed state invasion attempt.

      Edited by Blank_Alt
    • Author Reporter

      Crimson is almost indistinguishable to me; not sure how obvious you want it to be:

      image

      Blast's suggestion is purple:

      image

      Maybe maroon would be a compromise?

      image

      Edited by svornost
    • I just like crimson. Maroon doesn't look bad. Either way, should have a reddish component since it is also an unowned arcology.

      I can't tell apart shades of pink. It can get fun at times.

    • Author Reporter

      Left it on crimson; if someone complains later it's easy to adjust. Maybe it's just me that can't tell the difference with red.

    • Please register or sign in to reply
  • svornost added 1 commit

    added 1 commit

    • 12b5db94 - Split out container mode and render the cells a few different ways, since we...

    Compare with previous version

  • svornost added 1 commit

    added 1 commit

    • b0057b30 - rename from grid to display, since only one of the render modes actually uses a grid container

    Compare with previous version

  • svornost added 1 commit

    added 1 commit

    • 25d0a5cf - Kill off another hardcoded list of FSes.

    Compare with previous version

  • ezsh
    ezsh @ezsh started a thread on the diff
16 if (typeof targetArcology.FSNull === "undefined") { targetArcology.FSNull = "unset"; }
17
18 let opinion = 0;
19
20 const {shared, conflicting} = FutureSocieties.diplomaticFSes(activeID, targetID);
21
22 for (const fs of shared) {
23 opinion += activeArcology[fs];
24 opinion += targetArcology[fs];
25 }
1 /** get one arcology's opinion of another
2 * @param {number} activeID index
3 * @param {number} targetID index
4 * @returns {number} opinion
5 */
6 App.Neighbor.opinion = function(activeID, targetID) {
  • Reporter

    activeID? Do we have arcology IDs? Also, "active" is a fuzzy term in this context, at least for me. Maybe "object" and "target"?

  • Author Reporter

    Arcology array indexes get called IDs all over. I'm not sure if there was a conscious decision for that or not, but the array is in a static order, so they can be treated that way.

    Keep in mind that the opinion function is not new, just renamed into the new namespace.

  • Please register or sign in to reply
  • ezsh
  • ezsh
  • ezsh
    ezsh @ezsh started a thread on the diff
  • 137 } else {
    138 const conflict = diplo.conflicting.find((f) => f[0] === fs);
    139 if (conflict) {
    140 style = "red";
    141 }
    142 }
    143 frag.appendChild(withTooltip("", FutureSocieties.displayName(fs), style));
    144 }
    145 }
    146 return App.UI.DOM.makeElement("div", frag);
    147 }
    148
    149 function ownershipFrag() {
    150 let frag = document.createDocumentFragment();
    151 const owned = arcID === 0 || arcology.government === "your trustees" || arcology.government === "your agent";
    152 const yourPercent = arcID === 0 ? `${arcology.ownership}%` : `${arcology.PCminority}%`;
    • Reporter

      A thin space between the number and unit ('%'), please?

    • Author Reporter

      I think that looks considerably worse

      image

      and we don't do that for percentages elsewhere (sidebar, for instance).

      Edit: I've looked into this in more detail, and there's no international consensus. ISO follows DIN and SI in prescribing a space, but every American and UK style guide I can find (including the Chicago MOS, APA, and the Oxford Style Manual) prescribe no space for percentages. Since we tend to follow American English style here, I'm going to stick with omitting the space, even though it might look wrong to some of our European players.

      Edited by svornost
    • Reporter

      even though it might look wrong to some of our European players.

      Oh, yes, it does. '%' is a regular unit, and SI rules mandate a space between a number and its unit.

      Offtopic: while the current US language and measurement system is archaic as comparing to the Britisch English and the international unit system, maybe one can expect its modernisation, especially in a Free City?

    • Author Reporter

      Hah....the EU's English style guides were revised post-Brexit; the pre-Brexit ones specify, "with figures, use the per cent sign (%), closed up to the figure, e.g. 25%", but the post-Brexit ones specify, "Percentages: 15 % (the symbol is preceded by a hard space)." Someone in Brussels is going to be editing an awful lot of documents...

      Most Free Cities, I'd expect, wouldn't speak English at all, and I'd be surprised if any outside of North America used Conventional units. We currently set arcology language to English only in North America and Australia, and for oceanic terrain. Maybe some particularly crazy leaders might invent their own unit system...and I could certainly imagine entrenched Roman Revivalist FC's adopting pedes, stadia, and congii, Edo Revivalist ones re-adopting the shakkanhō system, etc.

    • That would be amazing and absolutely terrifying to do work with.

      Anyway, after the 'colour' ruling, I'd stick with no space.

    • Please register or sign in to reply
  • svornost added 1 commit

    added 1 commit

    Compare with previous version

  • svornost added 1 commit

    added 1 commit

    • bebe6bb2 - cleanup for opinion function

    Compare with previous version

  • svornost added 1 commit

    added 1 commit

    • e91a7cf6 - Calculate average prosperity with _.mean

    Compare with previous version

  • svornost added 1 commit

    added 1 commit

    • 33b86ee7 - Port most of neighborInteract.tw to DOM so it can be rebuilt dynamically when...

    Compare with previous version

  • svornost added 1 commit

    added 1 commit

    • 86492afa - Move neighborDescription and neighborInteract twine source to src/neighbor

    Compare with previous version

  • svornost added 8 commits

    added 8 commits

    • 86492afa...369010f2 - 7 commits from branch pregmodfan:pregmod-master
    • e241c38d - Merge branch 'pregmod-master' of ssh.gitgud.io:pregmodfan/fc-pregmod into diplomacy

    Compare with previous version

  • Author Reporter

    OK, that's the rest of it in and tested, so I'm going to consider this ready (or at least ready for review).

    It replaces the text list of the arcology/government/GSP since it contains all that information and more. Also moves the agent/agent-partner display down to the agent details for each arcology (so you just see the agent for the selected arcology)...I think this is better organizationally than having them interleaved but it does bury them one click deeper.

    Almost everything in Neighbor Interact can now update dynamically without passage transitions, too. The responsiveness is really nice.

    Edited by svornost
  • svornost unmarked as a Work In Progress

    unmarked as a Work In Progress

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading