Opened 11 years ago

Closed 10 years ago

#1075 closed bug (fixed (in master))

Make -r option work properly again

Reported by: magnate Owned by: magnate
Milestone: 3.2.0 Keywords: monster
Cc:

Description

The -r runtime option rebalanced the monsters, wrote the results to monster.raw, and put a rebalanced monster.txt in lib/user/. Now that raw files have gone, the monster.txt file still goes in user/ ... but the game continues with non-rebalanced monsters ...

One solution is for the new monster.txt file to be placed directly in lib/edit, with any existing one renamed. This could cause problems on multi-user systems since the FHS cleanup, since a normal user may not have write access to edit/. So an alternative is for -r to do what it does now, and output a new monster.txt to user/, but then to exit with the message "Rebalanced monster.txt file written to [dir]. Copy it to your lib/edit/ directory to play with rebalanced monsters."

Given how rarely it is used, the latter seems safest to me. Does anyone really want the former, or a third solution?

Attachments (1)

0001-Correct-colour-attributes-on-writing-out-rebalanced-.patch (1.3 KB) - added by noz 10 years ago.
[PATCH] Correct colour attributes on writing out rebalanced monster.txt

Download all attachments as: .zip

Change History (7)

comment:1 Changed 11 years ago by magnate

  • Milestone changed from 3.1.2 beta to Triage
  • Resolution set to invalid
  • Status changed from new to closed

Kudos to UnAndrew?: -r still works perfectly despite the removal of .raw files. It writes a new monster.txt in the lib/user dir, *and* proceeds with rebalanced monsters in memory. No need to do anything.

comment:2 follow-up: Changed 11 years ago by SilverD <alex.shershukov@…>

Rebalance does not export 'v'-colored monsters

N:307:Draebor, the Imp
G:u:

comment:3 in reply to: ↑ 2 Changed 11 years ago by magnate

  • Milestone changed from Triage to 3.1.3
  • Resolution invalid deleted
  • Status changed from closed to reopened

Replying to SilverD <alex.shershukov@…>:

Rebalance does not export 'v'-colored monsters

N:307:Draebor, the Imp
G:u:

Thanks for spotting that - that's very interesting. I wonder where it is getting the colours from then. Reopened pending further investigation.

comment:4 Changed 10 years ago by magnate

From Timo: "Just for information: that violet (v) in 3.0.9 colors is purple (P) in 3.1.2 colors, and v in 3.1.2 is color that doesn't exist in 3.0.9."

That's almost certainly the problem - the colours are stored in the output code somewhere. I ought to replace this with a reference to the actual colour table.

comment:5 Changed 10 years ago by noz

init1.c:emit_r_info_txt() uses color_attr_to_char[] to output the attribute character, and this is the only reference (other than the definition) to this array. Will search for the right thing to use.

Changed 10 years ago by noz

[PATCH] Correct colour attributes on writing out rebalanced monster.txt

comment:6 Changed 10 years ago by magnate

  • Resolution set to fixed
  • Status changed from reopened to closed

[a1a3ee6] (SVN r1974) - thanks.

Note: See TracTickets for help on using tickets.