bugFreeciv - Bugs: bug #21932, nuke self destructs own city after...

 
 
Show feedback again

bug #21932: nuke self destructs own city after tech loss

Submitted by:  None
Submitted on:  Thu 17 Apr 2014 06:06:32 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalStatus: None
Assigned to: NoneOriginator Email: -unavailable-
Open/Closed: OpenRelease: 2.4.2
Operating System: AnyPlanned Release: 

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Thu 07 Aug 2014 04:31:32 AM UTC, comment #10:

I can confirm this bug is still present in windows 2.5 beta1 using the test file you just added.

There are some issues while doing this.

While trying to give away the tech rocketry to the ai nation; it was impossible unless I also agreed to a cease-fire.

When the nuke exploded my screen shifted to a different area of the map. (next unit in focus) so it looks like the nuke explosion graphic shifted from where it actually exploded to a new area of the map.

I originally tested this with the longturn ruleset where nuclear units are able to achieve veterancy and gain an extra movemement point. In the editor if you promote a nuclear unit after losing the tech rocketry it has the same effect as moving to the next turn. That is a unit with 8 moves remaining even after rocketry is lost, loses all moves by being promoted in the editor.

Anonymous
Tue 05 Aug 2014 10:59:27 PM UTC, comment #9:

> This bug is no longer present in version 2.5.

I don't think it's fixed.

The behaviour you describe sounds like what happens in a turn after the turn you lose the tech, where the unit starts out with 0 move points.

The attached save files allow you to lose Rocketry by giving it to another civ with whom you have contact (techlost_donor=100%), and then try moving the existing Nuclear unit in the same turn (which should work). Behaviour:

  • S2_4 r25827 (+ civ2civ3 2.4-6 10-Apr-2014) and S2_5 r25834
    • arrow keys: move unit (OK)
    • goto: forbidden cursor, "Didn't find a route to the destination!" (bad)
    • explode: explodes without moving first (very bad)
  • trunk r25834
    • arrow keys: move unit (OK)
    • goto: lets you set a route and hover text claims it will move this turn, but when you click, it doesn't follow it this turn (unit stays put with "G" icon, apparently waiting to move next turn) (bad)
    • explode: unit moves and explodes at destination (OK)

On all branches, the behaviour the turn after losing the tech (where the unit has 0 MP) is OK:

  • arrow keys: do nothing (OK)
  • goto: forbidden cursor, "Didn't find a route to the destination!" (OK)
  • explode: "Too far for this unit." (OK)

There have been various changes in pathfinding recently which I guess might affect this. It does seem to be bugs in pathfinding assuming inability to move, rather than actual inability to move.

(I also see "Tileset "amplio2" doesn't support long goto paths, such as -1. Path not displayed as expected." in the client console when I'm playing with this.)

(file #21667, file #21668)

Jacob Nevins <jtn>
Project Administrator
Sat 12 Jul 2014 07:01:19 AM UTC, comment #8:

This bug is no longer present in version 2.5.

Using Explode Nuclear you can point and click the destination tile but will now just get the message 'didn't find a route to the destination' and nothing happens.
Using Goto behaves as before - it is not possible to move at all.
Using the keyboard works as before - you can move and explode.

And to answer I don't think anything here limits pathfinding to looking for single (current) turn paths only.'

With respect to nukes if you try to fire past the current move limit you will get the message 'too far'

Anonymous
Sat 19 Apr 2014 02:29:02 PM UTC, comment #7:

Well, I don't think anything here limits pathfinding to looking for single (current) turn paths only. So, there would be a bug also if we allowed nukes with fuel for more than one turn -> pathfinding would find suitable paths for them, but then they would explode immediately after moving the first part.

Marko Lindqvist <cazfi>
Project Administrator
Sat 19 Apr 2014 01:13:41 PM UTC, comment #6:

> Am trying to upload the test game a second time.

Got it.

And now I understand why tech loss makes a difference to movement -- this is civ2civ3[*], where Nuclear units have a base move_rate of 0, and get their movement from tech-driven Move_Bonus effects.

[*] The version I have installed is "Updated 2013-12-01"

However, that still ought only to affect restoring move points at the end of the turn (unit_restore_movepoints()).

However^2, I wouldn't be surprised if pathfinding / goto / whatever has some assumption where it takes the current move rate rather than moves_left -- I've certainly seen that before. That's probably separate bug(s).

Jacob Nevins <jtn>
Project Administrator
Sat 19 Apr 2014 12:56:43 PM UTC, comment #5:

Yes - the same effect is seen with unitwaittime - self destruction of your own city. I have posted a second bug report for this new error. See bug #21934:

Perhaps this bug report would be better discussing why after techloss the nuke retains its movement points until turn done is pressed.

Anonymous
Sat 19 Apr 2014 12:41:49 PM UTC, comment #4:

> The ruleset is civ2civ3 with techloss artificially created
> using the editor.


When you have last updated civ2civ3 ruleset? It certainly does not fix the actual bug, but may affect reproducibility from your savegame. Ruleset available with modpack installer was last updated just a couple of days ago, so I assume you had played that game with an older version.

Marko Lindqvist <cazfi>
Project Administrator
Sat 19 Apr 2014 12:31:22 PM UTC, comment #3:

The file seems to be loaded this time.

>"I don't think tech loss can affect the ability of extant units to move"


I you want to test this - look at the nukes movement points before and after pressing turn done.

The ruleset is civ2civ3 with techloss artificially created using the editor.

Anonymous
Sat 19 Apr 2014 12:26:19 PM UTC, comment #2:

Am trying to upload the test game a second time.

(file #20521)

Anonymous
Sat 19 Apr 2014 10:59:59 AM UTC, comment #1:

> An example is in the attached file.

I don't see an attachment...

> This situation can occur after tech loss of Advanced Flight. [...]

I'm dubious of this diagnosis -- I don't think tech loss can affect the ability of extant units to move, at least in standard rulesets? I'm guessing something else must be restricting your nukes' ability to move.

However, I see that do_map_click() on the client sends do_unit_goto() bravely followed by do_unit_nuke(); thus it's unable to check that the goto succeeded. If the goto fails for some reason, then I think comedy of the kind you describe will ensue.
(For instance, I think that unitwaittime could cause this?)

The obvious long-term fix is to bring nuking into the orders system, so that the server can abort the mission if the goto isn't successful. I haven't thought hard if it would be practical to backport that to S2_4 protected by some "safer_nukes" capability.

(Sigh. With this and patch #3803, our nuclear command and control is more ropey than the USA's in the 1960s, isn't it?)

Jacob Nevins <jtn>
Project Administrator
Thu 17 Apr 2014 06:06:32 AM UTC, original submission:

Using the shift N command to explode a nuke on an enemy city risks self destruction. An example is in the attached file. Point the nuke in London at the nearby city Berlin and fire it using the shift N command. Nothing happens. Now point it at the German worker next to Berlin. You destroy your own city, London.

This situation can occur after tech loss of Advanced Flight. Nukes that existed before the theft of the tech retain their movement points until the end of the turn. The keyboard arrow commands still function normally. Goto is disabled however in this case. But beware the shift N command appears to function, in reality it causes self destruction.

Anonymous

 

(Note: upload size limit is set to 1024 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #21667:  24c3_nuke.sav.bz2 added by jtn (14kB - application/x-bzip - civ2civ3 savefiles (S2_4 and S2_5/trunk) poised to lose nuke movement enabling tech)
file #21668:  25c3_nuke.sav.bz2 added by jtn (20kB - application/x-bzip - civ2civ3 savefiles (S2_4 and S2_5/trunk) poised to lose nuke movement enabling tech)
file #20521:  nuke-self-destructs.sav.bz2 added by None (20kB - application/x-bzip2)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by cazfi (Posted a comment)
  • -unavailable- added by jtn (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 05 Aug 2014 10:59:27 PM UTCjtnAttached File-=>Added 24c3_nuke.sav.bz2, #21667
      Attached File-=>Added 25c3_nuke.sav.bz2, #21668
      Operating SystemNone=>Any
    Sat 19 Apr 2014 12:26:19 PM UTCNoneAttached File-=>Added nuke-self-destructs.sav.bz2, #20521
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup