blue_anna's page

se la cambiar q quieres ver en el mundo.


My ideas

Ring of Charms

see patch

casket of three fates

see patch


explanation of mon-pick use

The way to think about the general framework here is that, it is writing the whole map at once. Your creatures are being injected into that. The rarity function and the level function give you control over the distribution of monsters in the level, and all levels surrounding that level (in the same branch), simultaneously.

What you want to imagine is that, if you increase the rarity, you increase the size of the entire distribution curve over the level you specify in the level function:

normal_distribution.jpg

Suppose the distribution (independent of other creatures), looks like the red curve – that is, the curve maps out that monster's chance to get placed, if it is considered for placement, on some position in some banch, with the left side being the early levels of the branch, and the right side being the deep levels.

If you increase the level return val for a creature, it moves the central axis for the curve for that monster deeper into the branch. If you increase the rarity return val for a creature, you get a larger curve. it doesnt sharpen (become like the blue curve), it doesnt change shape.

you probably want to do that. You want

  • sharp curves – for monsters that should more or less only spawn around a specific level.
  • soft curves – for monsters that are fairly rare, so the don't only show up basically on the one level from the level function. (the natural distribution is several levels wide, and should be regarded as a wide distribution imho)
  • asymetrical curves, with a sharp curve before the level you target – so the monster basically doesnt show up too early, but comes on in force once you get to that level
  • sharp curve after the target level – so that another creature that shows up later in enum.h doesnt lose slots to a high-frequency creature with a slightly smaller level func ret val for this creature.

Here's how to do that in your custom rarity function:

int mons_MYBRANCH_rare(int mcls)
{
	int rarity;
	int sharp_before; // cutoff applied on levels shallower by <= than
	int soft_until;   // cutoff artificially applied on levels deeper by >= than
	bool sharp_curve = false;
	bool soft_curve  = false;

    switch (mcls)
    {
    case MONS_WITH_SOFT_UNTIL:
	soft_until = 1;
    case MONS_WITH_NORMAL_ASYM_CURVE: // high-frequency monsters benefit more from a sharpbefore/soft-after curve
    	rarity = 205;
		break;
    case MONS_WITH_SYMMETRIC_SHARP: // this monster would lose slots to NORMAL_ASYM if a few levels above it,
        rarity = 105;               // but not to SOFT_UNTIL if it was at the same place.
                break;
    case MONS_WITH_SHARP_BEFORE:  // this monster has an inflated distribution before the target level, and on the
	sharp_before = 2;         // level above that, but it reverts to a noraml sharp distribution further up.
    	rarity = 40;
		break;
    case MONS_WITH_SYMMETRIC_SOFT: // rarer creatures benefit more from a soft curve
        soft_curve = true;
        rarity = 30;
                break;
      default:
        return 0;
    }
    
    if (soft_curve)
        return rarity;

    const int mlev = mons_dwarf_level(mcls);
    const int diff = mlev - you.absdepth0;
    if ( ((diff > soft_until) or ((diff < 0) and (abs(diff) > sharp_before)) and
            ((soft_until > 0) or (sharp_before > 0))) or (diff >= 0) )
        sharp_curve = true; // its a shadow-reuse, sorry :( 

     // by default, this section makes rarity much higher for placing monsters 
     // above their level
    if (sharp_curve)
    { // fake integer sqroot
        int i=0;
        while( (i*i) <= rarity )
        {
         i+=1;
        } 
        rarity = i;
    }

    return rarity;
}

Obviously you can tune the specific decrease, should you want to do that. For most purposes, this aught to suffice.

The code uses two functions, a level function and a rarity function both functions are allowed to (but neednt) take into account the current level the player is on (or anything in the you object, in fact). The formula looks something like this:

  • limit = abs( actual_level - level_func(monster) )
  • limit *= limit /* limit is squared */
  • chance = rarity_func(monster) - limit
  • if random(100) < chance /* generate the monster */

It loops through every grid-cel on the map, and decides if a thing can be placed, and gives a small chance of placing a creature, selected by that frequency formula (odds are such that on most autogenerated maps around 25 monsters will be placed). It loops through all monsters for each placement, regardless of their likelhood – even though the bulk of all monsters will never be placed. It does this in a specific order, I think, and this means that a highly likely creature will steal slots from another highly likely creature if it is earlier in the list.

If it finds no monster that beat the odds of that last step in the fromula, it then relaxes the limit .. this introduces the chance to get any monster (tuning this can be done by not setting the default return val for the level func to an absurd level. Don't forget to add monsters deeper than the max depth for the branch, for OOD monster generation!


my crawlrc

my crawlrc – IMHO mostly nice for its monster glyph replacements

# includes
lua_file = lua/stash.lua
lua_file = lua/wield.lua
lua_file = lua/runrest.lua
lua_file = lua/gearset.lua
lua_file = lua/trapwalk.lua
lua_file = lua/pickup.lua
# kills.lua yields more information at the cost of huge dumps.
# lua_file = lua/kills.lua
# autofight.lua allows binding both movement and attack a single key.
# # Use at your own discretion! See options_guide.txt for details.
# # lua_file = lua/autofight.lua
include = autopickup_exceptions.txt
include = runrest_messages.txt
include = standard_colours.txt
include = food_colouring.txt
include = menu_colours.txt
include = messages.txt

char_set = unicode

morgue_dir       = ~/.crawl/morgue
save_dir         = ~/.crawl/save
macro_dir        = ~/.crawl/macros

travel_delay     = 17
view_max_width   = 53
clear_messages   = false

flush.failure    = false
flush.command    = true
flush.message    = true
macro_meta_entry = true
bindkey          = [,] CMD_PREV_CMD_AGAIN

hp_colour = 67:yellow, 33:red
# Colouring of autoinscribed god gifts
menu_colour = pickup:green:god gift
# Highlight (partly) selected items
menu_colour = inventory:white:\w \+\s
menu_colour = inventory:white:\w \#\s
menu_colour = notes:white:Reached XP level

feature = wall {#} 
feature = shop|portal|gate|mporium|entrance {x221A}
# portals √
feature = closed door {+} 
cset_unicode = item_weapon:x262D, item_gold:x20AC, item_book:xBF, item_misc:x3BC
# weapon: ☭ gold: €  book: ¿ misc: µ

mon_glyph = efreet : x13f1
# efreet:Ᏹ
mon_glyph = dancing weapon : 7
mon_glyph = queen bee : lightyellow Q
mon_glyph = queen ant : lightgrey Q
mon_glyph = goblin : lightblue
mon_glyph = Crazy Yiuf : lightred
mon_glyph = Ijyb : lightgrey
mon_glyph = giant cockroach : cyan
mon_glyph = hobgoblin : cyan
mon_glyph = centaur : C
mon_glyph = centaur warrior : C
mon_glyph = yaktaur : C
mon_glyph = yaktaur captain : C
mon_glyph = jackal : c
mon_glyph = hound : c
mon_glyph = warg : c
mon_glyph = wolf : c
mon_glyph = war dog : c
mon_glyph = hell hound : c
mon_glyph = dwarf : d
mon_glyph = deep dwarf : d
mon_glyph = deep dwarf scion : d
mon_glyph = deep dwarf necromancer : d
mon_glyph = deep dwarf artificer : d
mon_glyph = deep dwarf berserker : d
mon_glyph = deep dwarf death knight : d
mon_glyph = deep dwarf unborn : d
mon_glyph = hill giant : G
mon_glyph = fire giant : G
mon_glyph = frost giant : G
mon_glyph = stone giant : G
mon_glyph = ettin : G
mon_glyph = titan : G
mon_glyph = wyvern : H
mon_glyph = cyclops : G
#mon_glyph = giant eyeball : O
mon_glyph = giant eyeball : x19F 
#x19F  Ɵ 
#mon_glyph = eye of draining : O
mon_glyph = eye of draining : x19F
#mon_glyph = giant orange brain : O
mon_glyph = giant orange brain : x553
#x553  Փ
#mon_glyph = great orb of eyes : O
mon_glyph = great orb of eyes : xD6
#xD6   Ö
#mon_glyph = shining eye : O
mon_glyph = shining eye : x19F
#mon_glyph = golden eye : O
mon_glyph = golden eye : x19F
#mon_glyph = eye of devastation : O
mon_glyph = eye of devastation : x19F
mon_glyph = kenku : K
mon_glyph = necrophage : u
mon_glyph = ghoul : u
mon_glyph = rotting hulk : u
mon_glyph = naga : n
mon_glyph = naga warrior : n
mon_glyph = water moccasin : xDF
#xDF   ß
mon_glyph = sea snake : xDF
mon_glyph = black mamba : xDF
mon_glyph = anaconda : xDF
mon_glyph = human : h
mon_glyph = slave : h
mon_glyph = vault guard : h
mon_glyph = halfling : h
mon_glyph = trollkonor : x2640
#x2640  ♀ 
mon_glyph = witch : x2640
mon_glyph = huldra : x2640

: if (you.race() == "Troll") then
    mon_glyph = player : brown T
: end
: if (you.race() == "Kobold") then
    mon_glyph = player : yellow K
: end
: if (you.race() == "Kenku") then
    mon_glyph = player : K
: end
: if (you.race() == "Ogre") then
    mon_glyph = player : brown O
: end
: if (you.race() == "Orc") then
    mon_glyph = player : O
: end
: if (you.race() == "Centaur") then
    mon_glyph = player : brown C
: end
: if (you.race() == "Ghoul") then
    mon_glyph = player : G
: end
: if (you.race() == "Naga") then
    mon_glyph = player : green N
: end
: if (you.race() == "Spriggan") then
    mon_glyph = player : green i
: end
: if (you.race() == "Mummy") then
    mon_glyph = player : M
: end
: if (you.race() == "Merfolk") then
    mon_glyph = player : lightcyan M
: end
: if (you.race() == "Minotaur") then
    mon_glyph = player : lightblue x3A3
# minotaur Σ
: end
: if (you.race() == "Vampire") then
    mon_glyph = player : magenta V
: end
: if (you.race() == "Human") then
    mon_glyph = player : H
: end
: if (you.race() == "Halfling") then
    mon_glyph = player : yellow x29C
# halfling ʜ
: end
: if (you.race() == "Mountain Dwarf") or (you.race() == "Deep Dwarf") then
    mon_glyph = player : brown D
: end
: if (you.race() == "Draconian") then
    mon_glyph = player : D
: end
: if (you.race() == "Demonspawn") then
    mon_glyph = player : lightred &
: end
: if (you.race() == "Demigod") then
    mon_glyph = player : yellow x394
# demigod Δ
: end
: if (you.race() == "Sludge Elf") then
    mon_glyph = player : lightgreen E
: end
: if (you.race() == "High Elf") then
    mon_glyph = player : yellow E
: end
: if (you.race() == "Deep Elf") then
    mon_glyph = player : E
: end

# friend_brand       = hi:green
# neutral_brand      = hi:lightgrey
 stab_brand         = hi:blue
 may_stab_brand     = hi:yellow
# heap_brand         = reverse
# feature_item_brand = reverse
# trap_item_brand    = reverse

: if (you.race() == "Hill Orc") then
    priest = Beogh
: end

: if (you.race() == "Hill Orc") or (you.race() == "Ogre") then
    prefer_safe_chunks     = true
: end

autoinscribe = distortion:!w

#autopickup_no_burden    = true
pickup_mode              = multi
drop_filter              = skeleton, rotting, corpse
: if (you.race() == "Mummy") then
    autopickup = $?+"/
: else
   autopickup = $?!+"/%
: end
stash_filter           = scroll of paper
stash_filter           = ring of hunger, amulet of inaccuracy
show_inventory_weights = true
sort_menus = inv: true : equipped, art, ego, freshness, charged, qty, basename, qualname

trapwalk_safe_hp       = dart:20,needle:15,arrow:35,bolt:45,spear:40,axe:45,blade:95
auto_exclude           = statue,curse skull,roxanne
runrest_ignore_message = pray:
runrest_ignore_message = You feel.*sick
runrest_ignore_message = disappears in a puff of smoke
runrest_ignore_message = engulfed in a cloud of smoke
runrest_ignore_message = standing in the rain
runrest_ignore_message = engulfed in white fluffiness
runrest_ignore_message = safely over a trap
runrest_ignore_message = You feel.*sick
runrest_ignore_message = A.*toadstool withers and dies
runrest_ignore_message = toadstools? grows
runrest_ignore_message = You walk carefully through the
runrest_ignore_poison  = 2:30
runrest_ignore_monster = butterfly:1
# runrest_ignore_monster = swamp worm:3
travel_stop_message = HP restored
force_more_message = smite your foes
force_more_message = gain orcish followers
force_more_message = recall your orcish followers
force_more_message = walk on water
force_more_message = and supports the use of ponderous armour.
force_more_message = bend time to slow others
force_more_message = inflict damage to those overly hasty
force_more_message = step out of the time flow
force_more_message = provide lesser healing for yourself and others
force_more_message = purify yourself
force_more_message = provide greater healing for yourself and others
force_more_message = restore your abilities
force_more_message = call upon Elyvilon for divine vigour
force_more_message = induce evolution
force_more_message = call sunshine
force_more_message = cause a ring of plants to grow
force_more_message = spawn explosive spores
force_more_message = control the weather
force_more_message = request a jelly
force_more_message = turn your foes to slime
force_more_message = call upon Jiyva to remove your harmful mutations
force_more_message = receive cadavers from Kikubaaqudgha
#force_more_message = Kikubaaqudgha is protecting you from some side-effects of death magic.
#force_more_message = Kikubaaqudgha is protecting you from unholy torment.
force_more_message = invoke torment by praying over a corpse
force_more_message = depart the Abyss
force_more_message = bend space around yourself
force_more_message = banish your foes
force_more_message = corrupt the fabric of space
force_more_message = gate yourself to the Abyss - for a price
#force_more_message = gain power from killing
force_more_message = harness Makhleb's destructive might
force_more_message = summon a lesser servant of Makhleb
#force_more_message = hurl Makhleb's greater destruction
force_more_message = summon a greater servant of Makhleb
force_more_message = draw cards from decks in your inventory
force_more_message = peek at two random cards from a deck
force_more_message = choose one out of three cards
force_more_message = mark four cards in a deck
force_more_message = order the top five cards of a deck, losing the rest
force_more_message = give your body great, but temporary strength
force_more_message = haste yourself
force_more_message = tap ambient magical fields
force_more_message = freely open your mind to new spells
#force_more_message = Sif Muna is protecting you from miscast magic.
#force_more_message = You and your allies can gain power from killing the unholy and evil.
force_more_message = call upon the Shining One for a divine shield
force_more_message = channel blasts of cleansing flame
force_more_message = summon a divine warrior
force_more_message = go berserk at will
force_more_message = call upon Trog for regeneration and magic resistance
force_more_message = call in reinforcements
#force_more_message = gain magical power from killing
#force_more_message = Vehumet is aiding your destructive magics.
#force_more_message = Vehumet is extending the range of your conjurations.
#force_more_message = Vehumet is reducing the cost of your destructive magics.
force_more_message = animate remains
force_more_message = recall your undead slaves
force_more_message = animate legions of the dead
force_more_message = drain ambient lifeforce
force_more_message = enslave living souls
force_more_message = recite Zin's Axioms of Law
force_more_message = call upon Zin for vitalisation
force_more_message = call upon Zin to imprison the lawless
force_more_message = call upon Zin to create a sanctuary
force_more_message = You have reached level
force_more_message = Your scales start
force_more_message = You fall through a shaft

ood_interesting   = 8
note_hp_percent   = 5
note_skill_levels = 1,5,10,15,27
#note_all_skill_levels = true
#note_skill_max   = false
#note_all_spells  = false
#note_xom_effects = false
note_items        = rod of, acquirement, preservation, running, of Zot
note_messages     = You pass through the gate
note_messages     = cast .* Abyss
note_messages     = Your scales start
note_messages     = protects you from harm
note_messages     = You fall through a shaft
note_monsters     = orb of fire, ancient lich, Sigmund

Guest book

feel free to drop me a note here. :)

Logged in as: Anonymous (VIEWER)
user/blue_anna.txt · Last modified: 2010-09-19 23:35 by blue_anna
 
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki