Project

Profile

Help

HostedRedmine.com has moved to the Planio platform. All logins and passwords remained the same. All users will be able to login and use Redmine just as before. Read more...

Bug #861509

Middle-click tile popup very confused in rulesets where multiple activities can create/remove a single extra

Added by Jacob Nevins over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Client
Sprint/Milestone:
Start date:
Due date:
% Done:

0%

Estimated time:

Description

(This patch is really a refactor on the way to solving bug #861460, but on the way I found what is arguably an actual bug, albeit a rather obscure one.)

It's possible for a ruleset to have two separate activities that are valid simultaneously to cause the creation or removal of a particular extra, say (um) irrigation and mining both producing an Artesian Well extra. If the activities take different times, the actual behaviour is that the two activities proceed independently in parallel, and the first one to complete wins (and units doing the slower activity stop it afterward, since it's no longer valid).

However, if such activities are happening simultaneously on a tile, the middle-click tile info popup erroneously pools activity points from the two activities together in a confusing way, often showing completion times that correspond to neither activity, and activities that are not occurring.

This patch will change concat_tile_activity_text() to keep track of progress per-extra and per-activity, to fix this. Also, it will:
  • Stop allocating big arrays on the stack (with this change the allocation was going to be something like tens of kilobytes)
  • Split out the calculation into a separate function (as I am about to need it for something else)

The effect is that the tile popup will display the two activities separately, with correct completion times. It makes no attempt to signal that one activity is going to make the other one moot.

26-classic-multicause.diff (4.88 KB) 26-classic-multicause.diff Tweak to S2_6 classic ruleset for testing this (not for commit) Jacob Nevins, 2020-02-23 03:48 PM
26_multicause.sav.bz2 (15.1 KB) 26_multicause.sav.bz2 Savegame relying on 26-classic-multicause.diff Jacob Nevins, 2020-02-23 03:49 PM
m-multi-cause-middleclick.patch (10.1 KB) m-multi-cause-middleclick.patch Jacob Nevins, 2020-02-23 05:20 PM
30-multi-cause-middleclick.patch (10.2 KB) 30-multi-cause-middleclick.patch Jacob Nevins, 2020-02-23 05:20 PM
26-multi-cause-middleclick.patch (10.2 KB) 26-multi-cause-middleclick.patch Jacob Nevins, 2020-02-23 05:20 PM

Related issues

Blocks Freeciv - Bug #861460: SDL activity button tooltips say activities will take far more turns than they really willClosed

<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>

History

#1 Updated by Jacob Nevins over 1 year ago

(My initial example was "Clean Pollution" and "Pillage" both removing the Pollution extra, but I ran into bug #861508.)

Attached ruleset diff / savegame allows for exploring the behaviour.

#3 Updated by Jacob Nevins over 1 year ago

  • Blocks Bug #861460: SDL activity button tooltips say activities will take far more turns than they really will added

#4 Updated by Jacob Nevins over 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF