Project

General

Profile

Bug #855670

Team 2 has acquired Pottery from ancient scrolls of wisdom.

Added by Chippo Elder 6 months ago. Updated 6 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
General
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:

Description

In version 3.0.0-alpha3+ (41e42cbc47), civ2civ3 ruleset, if you have an embassy with a player who learns tech by visiting a village, you get a message in Messages similar to the subject of this task.

It is easy to work out which player it is from Nations, but it would be more fitting with the style of the other messages to rather use the actual name ('The Bulgarians' in this case).

m-30-26-lua-research-name.patch (5.1 KB) m-30-26-lua-research-name.patch master, S3_0, S2_6 Jacob Nevins, 2020-01-22 01:10 AM
26_embassy_tech.sav.bz2 (15.8 KB) 26_embassy_tech.sav.bz2 2.6 test game Jacob Nevins, 2020-01-22 01:11 AM

History

#1 Updated by Marko Lindqvist 6 months ago

'Team 2' is the actual name of the team, 'The Bulgarians' would be just one of the nations in the team.

#2 Updated by Chippo Elder 6 months ago

Marko Lindqvist wrote:

'Team 2' is the actual name of the team, 'The Bulgarians' would be just one of the nations in the team.

Sure, but elsewhere in Messages, we don't say "Team 2 stole Construction from Team 7", or "Team 3 researched Medicine".

I don't care whether we call them 'Team 2' or 'The Bulgarians'. It should just be consistent. So that you don't need to go to the Nations tab to learn that 'Team 2' is 'The Bulgarians' or vice-versa.

When a single nation of a team acquires tech by visiting a village, do other members of the team automatically get the tech? Whereas, when a single nation of team steals tech from another team/nation, the other members of the team don't automatically get the tech?

It just seems particularly weird to see these messages in sequence:

The Algerians acquired Seafaring from the English.
Team 5 found Engineering in ancient scrolls of wisdom.
The Spanish stole Gunpowder from the Pirates.

#3 Updated by Marko Lindqvist 6 months ago

  • Tracker changed from Task to Bug
  • Category set to General
  • Target version set to 2.6.2

I think messages should use team name when team pooled research is enabled, i.e., when everyone in the team gets the tech, and nation name when not, i.e, when only one nation gets the tech.
I'm not sure about the case where team pooled research is enabled but the team has only one nation. From nation name user directly sees what nation it refers to whereas from Team name one has to check what nations is in that team. This is not an rare corner-case, but a typical situation in a ruleset that enables team pooled research. By default every nation forms a separate team.

If you see those messages in sequence, we should check that construction of those strings is consistent.

#4 Updated by Chippo Elder 6 months ago

Yes! Agreed! Consistency first.

I would go for 'if pooled_research && nations > 1, then use team_name, else use nation_name', but if it is chosen 'if pooled_research, then use team_name' I wouldn't complain. It just must be that:
- researching a tech
and
- finding tech in ancient scrolls
should give the same text in Messages. Which it doesn't right now.

Right now, starting a default-esque game in 2.6-latest and 3.0-latest both have the following behaviours:
- researching leads to nation_name
- ancient scrolls leads to team_name

#5 Updated by Jacob Nevins 6 months ago

I think the discrepancy is because the "ancient scrolls of wisdom" message comes from Lua (default.lua), and the other messages do not.

Lua scripts ultimately get their naming of research groups from the C function research_name_translation(), which always uses the team name if team_pooled_research is enabled.

Other bits of the C code (such as that responsible for "The Algerians acquired Seafaring from the English") use research_pretty_name(), which is more nuanced; in particular, for 1-player teams, it uses the player name even if team pooled research is enabled. (Which is I think the right thing to do.)

Perhaps we should arrange that Lua Player:research_name_translation() ends up calling research_pretty_name()?

(Almost nothing uses research_name_translation(); apart from Lua, it's only used in some error messages. Probably we should get rid of it.)

#6 Updated by Jacob Nevins 6 months ago

Perhaps we should arrange that Lua Player:research_name_translation() ends up calling research_pretty_name()?

Attached patch does that.

Tested with attached savegame (multi-player; get the Apaches and Arabs to pop huts until they find a science, and watch the Americans' messages).

This could technically be construed as a data format change, since the grammatical role of what the Lua function returns changes (from singular proper noun to plural common noun); it's not possible to write a script whose output is entirely grammatical with old and new code. The most common use is in our supplied default.lua, but other rulesets can and do use it. So there's an argument for postponing this to 3.0; but I'm inclined to just go ahead and commit it to 2.6 anyway.

(The Lua format strings now once again look like they did prior to bug #689470... hm, perhaps someone else had the same idea.)

Almost nothing uses research_name_translation() ... Probably we should get rid of it.

I haven't got rid of it, because research_pretty_name() is quite inconvenient to use in random error messages. I added a comment discouraging its use.

(I'm a bit dubious about the technique of returning a pointer to static string to Lua, but it is already in fairly wide use, e.g. api_server_setting_get(), api_utilities_fc_version().)

#7 Updated by Jacob Nevins 6 months ago

Examples of new messaging:
  • "The Apaches have acquired Masonry from ancient scrolls of wisdom." [1-member team]
  • "The members of team 2 have acquired Bronze Working from ancient scrolls of wisdom." [multi-member team]

#8 Updated by Jacob Nevins 6 months ago

  • Status changed from Resolved to Closed

This could technically be construed as a data format change [...]

No-one screamed...

Also available in: Atom PDF