Allow setting skill 'goal level'


Although the central place for design discussion is ##crawl-dev on freenode, some may find it helpful to discuss requests and suggestions here first.

User avatar

Snake Sneak

Posts: 115

Joined: Friday, 6th June 2014, 19:49

Location: South Africa

Post Wednesday, 20th April 2016, 19:26

Allow setting skill 'goal level'

Accessible from the 'm' screen, an option to set a level at which a skill will stop training.

Is there some way to do this already?

Would save many future trips to the 'm' screen to check on skill progression, and would prevent overtraining. Also I'm really obsessive about getting levels to whole numbers...

For this message the author milo has received thanks: 8
duvessa, ManMan, nago, Rast, runewalsh, Shard1697, WingedEspeon, ydeve

Tartarus Sorceror

Posts: 1694

Joined: Tuesday, 31st March 2015, 20:34

Post Wednesday, 20th April 2016, 19:30

Re: Allow setting skill 'goal level'

It would be nice sometimes, but whole numbers in skills generally aren't as important as you might expect. Of course, there are still some breakpoints, and it would be nice to have skills automatically stop training at those points.

I know a while back, Sandman was talking about a mod or rc file setting where the game would indicate when a skill reached a certain level. Unfortunately I don't have any more detail than that...

Ziggurat Zagger

Posts: 4432

Joined: Friday, 8th May 2015, 17:51

Post Wednesday, 20th April 2016, 19:39

Re: Allow setting skill 'goal level'

I am not sure it was me, but there is a way to achieve it indeed.

Something like
  Code:
force_more_message+=skill increases

or
  Code:
{
skill_list = {"Fighting","Short Blades","Long Blades","Axes","Maces & Flails",
              "Polearms","Staves","Unarmed Combat","Bows","Crossbows",
              "Throwing","Slings","Armour","Dodging","Shields","Spellcasting",
              "Conjurations","Hexes","Charms","Summonings","Necromancy",
              "Translocations","Transmutations","Fire Magic","Ice Magic",
              "Air Magic","Earth Magic","Poison Magic","Invocations",
              "Evocations","Stealth"}

function record_current_skills(maxlev)
  c_persist.skill_list = { }
  for _,sk in ipairs(skill_list) do
    if you.train_skill(sk) > 0 and you.base_skill(sk) < (maxlev or 27) then
      table.insert(c_persist.skill_list, sk)
    end
  end
end

function check_skills()
  if not c_persist.skill_list or not c_persist.target_skill then
    return
  end
  for _,sk in ipairs(c_persist.skill_list) do
    if you.base_skill(sk) >= c_persist.target_skill then
      crawl.formatted_mpr(sk .. " reached " .. c_persist.target_skill
                          .. ".", "prompt")
      crawl.more()
      c_persist.target_skill = nil
      set_new_skill_training()
    end
  end
end

function set_new_skill_training()
  c_persist.set_target_skill = 1
  crawl.sendkeys('m')
end

function set_target_skill()
  record_current_skills()
  local str = "Currently training: "
  local first_skill = true
  for _,sk in ipairs(c_persist.skill_list) do
    val = you.base_skill(sk)
    if first_skill then
      str = str .. sk .. "(" .. val .. ")"
    else
      str = str .. ", " .. sk .. "(" .. val .. ")"
    end
    first_skill = false
  end
  str = str .. "."
  crawl.formatted_mpr(str, "prompt")
  crawl.formatted_mpr("Choose a target skill level: ", "prompt")
  c_persist.target_skill = tonumber(crawl.c_input_line())
  record_current_skills(c_persist.target_skill)
end

function control(c)
  return string.char(string.byte(c) - string.byte('a') + 1)
end

function save_with_message()
  if you.turns() == 0 then
    crawl.sendkeys("S")
    return
  end
  crawl.formatted_mpr("Save game and exit?", "prompt")
  local res = crawl.getch()
  if not (string.char(res) == "y" or string.char(res) == "Y") then
    crawl.formatted_mpr("Okay, then.", "prompt")
    return
  end
  crawl.formatted_mpr("Leave a message: ", "prompt")
  local res = crawl.c_input_line()
  c_persist.message = res
  crawl.sendkeys(control("s"))
end

function first_turn_of_game()
  for key,_ in pairs(c_persist) do
    if key ~= "record" then
      c_persist[key] = nil
    end
  end
  set_new_skill_training()
end

local did_first_turn = false
function ready()
   DmgTrack()
  if not did_first_turn then
    did_first_turn = true
    if you.turns() == 0 then
      first_turn_of_game()
    end
    if c_persist.message and c_persist.message ~= "nil"
       and c_persist.message ~= "" then
      crawl.mpr("Message: " .. c_persist.message)
      c_persist.message = nil
    end
  end
  check_skills()
  if c_persist.set_target_skill == 0 then
    set_target_skill()
    c_persist.set_target_skill = nil
  elseif c_persist.set_target_skill then
    c_persist.set_target_skill = c_persist.set_target_skill - 1
  end
end
}


Edit. It will prompt player to input a number and then automatically opens 'm' screen when any skill reaches the number.
Underestimated: cleaving, Deep Elf, Formicid, Vehumet, EV
Overestimated: AC, GDS
Twin account of Sandman25

For this message the author VeryAngryFelid has received thanks:
dowan

Dungeon Master

Posts: 625

Joined: Thursday, 23rd October 2014, 03:08

Post Wednesday, 20th April 2016, 19:41

Re: Allow setting skill 'goal level'

gammafunk has this set up in his games, you can ask him about how he did it (assuming it isn't what was just posted above.)

Ziggurat Zagger

Posts: 8786

Joined: Sunday, 5th May 2013, 08:25

Post Wednesday, 20th April 2016, 19:49

Re: Allow setting skill 'goal level'

dowan wrote:It would be nice sometimes, but whole numbers in skills generally aren't as important as you might expect. Of course, there are still some breakpoints, and it would be nice to have skills automatically stop training at those points.
For what it's worth, every whole skill level is actually still a breakpoint, because skill cost still only increases on the level boundaries. The addition of "fractional" levels introduced even more breakpoints for skills that affect AC, EV, SH, and HP, as well as all spell skills because the spell success formula is really stupid (there's a breakpoint at every 0.5 levels of effective spell skill).

Probably the best skills-related change you could make to crawl right now is to change the spell success formula. It's awful.

Tartarus Sorceror

Posts: 1694

Joined: Tuesday, 31st March 2015, 20:34

Post Wednesday, 20th April 2016, 20:06

Re: Allow setting skill 'goal level'

That's a good point about the costs following the whole numbers. I mean, of course with armor, dodging, and fighting the breakpoints are the time when your AC, EV, and HP increases, but I certainly can't predict when those things will happen, so I'm not aiming for a specific number when I train them.

So... how does effective spell skill differ from actual spell skill? Is it just spell skill + 1/4 of spellcasting skill for one school spells? Does that mean I should actually shoot for whole or half levels of each spell skill?

Tartarus Sorceror

Posts: 1694

Joined: Tuesday, 31st March 2015, 20:34

Post Wednesday, 20th April 2016, 20:07

Re: Allow setting skill 'goal level'

VeryAngryFelid wrote:I am not sure it was me, but there is a way to achieve it indeed.

Something like
  Code:
force_more_message+=skill increases

or
  Code:
{
skill_list = {"Fighting","Short Blades","Long Blades","Axes","Maces & Flails",
              "Polearms","Staves","Unarmed Combat","Bows","Crossbows",
              "Throwing","Slings","Armour","Dodging","Shields","Spellcasting",
              "Conjurations","Hexes","Charms","Summonings","Necromancy",
              "Translocations","Transmutations","Fire Magic","Ice Magic",
              "Air Magic","Earth Magic","Poison Magic","Invocations",
              "Evocations","Stealth"}

function record_current_skills(maxlev)
  c_persist.skill_list = { }
  for _,sk in ipairs(skill_list) do
    if you.train_skill(sk) > 0 and you.base_skill(sk) < (maxlev or 27) then
      table.insert(c_persist.skill_list, sk)
    end
  end
end

function check_skills()
  if not c_persist.skill_list or not c_persist.target_skill then
    return
  end
  for _,sk in ipairs(c_persist.skill_list) do
    if you.base_skill(sk) >= c_persist.target_skill then
      crawl.formatted_mpr(sk .. " reached " .. c_persist.target_skill
                          .. ".", "prompt")
      crawl.more()
      c_persist.target_skill = nil
      set_new_skill_training()
    end
  end
end

function set_new_skill_training()
  c_persist.set_target_skill = 1
  crawl.sendkeys('m')
end

function set_target_skill()
  record_current_skills()
  local str = "Currently training: "
  local first_skill = true
  for _,sk in ipairs(c_persist.skill_list) do
    val = you.base_skill(sk)
    if first_skill then
      str = str .. sk .. "(" .. val .. ")"
    else
      str = str .. ", " .. sk .. "(" .. val .. ")"
    end
    first_skill = false
  end
  str = str .. "."
  crawl.formatted_mpr(str, "prompt")
  crawl.formatted_mpr("Choose a target skill level: ", "prompt")
  c_persist.target_skill = tonumber(crawl.c_input_line())
  record_current_skills(c_persist.target_skill)
end

function control(c)
  return string.char(string.byte(c) - string.byte('a') + 1)
end

function save_with_message()
  if you.turns() == 0 then
    crawl.sendkeys("S")
    return
  end
  crawl.formatted_mpr("Save game and exit?", "prompt")
  local res = crawl.getch()
  if not (string.char(res) == "y" or string.char(res) == "Y") then
    crawl.formatted_mpr("Okay, then.", "prompt")
    return
  end
  crawl.formatted_mpr("Leave a message: ", "prompt")
  local res = crawl.c_input_line()
  c_persist.message = res
  crawl.sendkeys(control("s"))
end

function first_turn_of_game()
  for key,_ in pairs(c_persist) do
    if key ~= "record" then
      c_persist[key] = nil
    end
  end
  set_new_skill_training()
end

local did_first_turn = false
function ready()
   DmgTrack()
  if not did_first_turn then
    did_first_turn = true
    if you.turns() == 0 then
      first_turn_of_game()
    end
    if c_persist.message and c_persist.message ~= "nil"
       and c_persist.message ~= "" then
      crawl.mpr("Message: " .. c_persist.message)
      c_persist.message = nil
    end
  end
  check_skills()
  if c_persist.set_target_skill == 0 then
    set_target_skill()
    c_persist.set_target_skill = nil
  elseif c_persist.set_target_skill then
    c_persist.set_target_skill = c_persist.set_target_skill - 1
  end
end
}


Edit. It will prompt player to input a number and then automatically opens 'm' screen when any skill reaches the number.

Wait... you can put scripts like that into your RC file? Or is that an external program?

Ziggurat Zagger

Posts: 4432

Joined: Friday, 8th May 2015, 17:51

Post Wednesday, 20th April 2016, 20:09

Re: Allow setting skill 'goal level'

Yes, I copied it from my online RC.
Underestimated: cleaving, Deep Elf, Formicid, Vehumet, EV
Overestimated: AC, GDS
Twin account of Sandman25

Ziggurat Zagger

Posts: 8786

Joined: Sunday, 5th May 2013, 08:25

Post Wednesday, 20th April 2016, 20:13

Re: Allow setting skill 'goal level'

dowan wrote:So... how does effective spell skill differ from actual spell skill? Is it just spell skill + 1/4 of spellcasting skill for one school spells? Does that mean I should actually shoot for whole or half levels of each spell skill?
By "effective spell skill" I mean the average of the skills for all the schools in the spell, plus 1/4th of spellcasting skill. If you divide that by 0.5 and take the remainder, that remainder is the amount of effective skill that's "ignored" for spell success purposes. It's not necessarily optimal to aim for whole or half levels of the skills themselves (at least if you ignore the skill cost breakpoint I mentioned earlier), since 4 spellcasting + 2.25 fire + 2.75 conjurations still comes out to an effective 3.5 for sticky flame success. Also, spell power doesn't have the same breakpoints as spell success.

Tartarus Sorceror

Posts: 1739

Joined: Tuesday, 13th March 2012, 02:48

Post Wednesday, 20th April 2016, 21:33

Re: Allow setting skill 'goal level'

VeryAngryFelid wrote:It will prompt player to input a number and then automatically opens 'm' screen when any skill reaches the number.


Yes, but you can still risk going over the desired skill level if you kill a monster that gives a lot of xp.

For this message the author Rast has received thanks:
VeryAngryFelid

Dungeon Master

Posts: 585

Joined: Sunday, 9th June 2013, 17:13

Post Thursday, 21st April 2016, 05:27

Re: Allow setting skill 'goal level'

The target skill code is originally by elliptic, I cleaned it up some and put it in my repo. You can find instructions here:

https://github.com/gammafunk/dcss-rc#target_skill

We've talked about adding it into the default lua somehow, but it still has some issues menu-wise and probably should get a better in-game treatment.

For this message the author gammafunk has received thanks: 2
genericpseudonym, milo

Return to Game Design Discussion

Who is online

Users browsing this forum: No registered users and 58 guests

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.