Development FAQ

Colors (SDL vs classic):

d - 0  Black        w - 1  White        s - 2  Slate
o - 3  Orange       r - 4  Red          g - 5  Green
b - 6  Blue         u - 7  Umber        D - 8  Light Dark
W - 9  Light Slate  P - 10 Light Purple y - 11 Yellow
R - 12 Light Red    G - 13 Light Green  B - 14 Light Blue
U - 15 Light Umber  p - 16 Purple       v - 17 Violet
t - 18 Teal         m - 19 Mud          Y - 20 Light Yellow
i - 21 Magenta-Pink T - 22 Light Teal   V - 23 Light Violet
I - 24 Light Pink   M - 25 Mustard      z - 26 Blue Slate
Z - 27 Deep Light Blue

How is obj_feeling calculated?
Object feeling is calculated in the calc_obj_feeling() using the formula obj_rating / depth, where obj_rating is the total value of all items on the level. The deeper the level, the higher the expectations for loot quality.

During level generation, the place_feeling() randomly places z_info->feeling_total invisible squares with the SQUARE_FEEL flag on suitable tiles. To receive object feeling, the player must see (not step on!) z_info->feeling_need such squares while exploring the level. A square is considered “seen” when it enters the player’s field of view through movement or illumination. The player_place_feeling() copies these flags to the player’s personal map. During exploration, the update_one() tracks squares transitioning from unseen to seen state. So the constants.txt config setting world:feeling-need:10 means you need to see 10 feeling squares out of the total number placed on the level.

What is era?
The era field is essentially an overflow counter for the turn field. When turn exceeds the value HTURN_ERA_FLIP, the era is incremented and turn is reset (subtract HTURN_ERA_FLIP).

This design allows the game to handle a very large number of turns without overflow issues. The total turn count is conceptually era * HTURN_ERA_FLIP + turn.

ht_div() converts this composite turn count into a single uint32_t value by calculating (era * HTURN_ERA_FLIP + turn) / value.

What is turn.turn?
It is a global variable that represents the current game time. It has two fields: turn.era and turn.turn.

  • turn.turn is the main game tick counter. It increases every game step and is used for timing events like regeneration, day/night cycle, spawning, and more.
  • turn.era is used for larger time tracking or overflow handling, but it’s rarely modified.

The variable is accessed throughout the server to coordinate time-based mechanics.

How to define whether mana depends on INT or WIS?
Class’s mana dependency is determined by the magical realm it can use, as defined in the realm.txt file. Each magical realm specifies which primary stat it uses for spellcasting.

  • Arcane, Shadow, and Elemental realms use Intelligence (INT)
  • Divine, Nature, and Psi realms use Wisdom (WIS)
  • The Common realm uses Constitution (CON)

When you define a class in class.txt, you specify which magical book(s) the class can use, and each book belongs to a specific realm. The class will use the stat associated with that realm for mana calculations.

For classes that can access multiple realms, the game calculates an average of the relevant stats across all accessible realms. Also, some classes have custom mana stat calculations, eg Fighter uses the average of STR and INT and for Paladin CHA effect hardcoded too.

Do we have to modify blows_table @ calc_blows_aux() when we add a new class?
No, there’s no need to modify the blows_table or calc_blows_aux() when adding a new class. The blows table is bound to the max-attacks, min-weight, and strength-multiplier parameters which are defined in class.txt for each class. The class information in the comments near the blows_table[] is just there for demonstration purposes and duplicates what’s already defined in class.txt. When adding a new class, you only need to properly define its parameters in class.txt, and the existing code will handle the calculations correctly.

Is there a way to check FEAT from list-terrain.h?
Eg FEAT(floor_j_farm_field).. which is not in the list-terrain-flags.h…

Is there a way to access it from p struct? 
No, you need to add a new flag in list-terrain-flags for example FLOOR_FARM and add it to your FEAT. Adding it to the end doesn’t require server wipe.

What is the UNLIGHT flag?
1) Allows players to memorize dark squares (from DARKEN_AREA effects by darkness spells, scrolls, etc.) even when they don’t have a light source. It’s the total opposite of other characters, who memorize the map while walking around with a light.
2) Grants extra infravision based on character level

How to generate Ring of Power or Stormbringer?
Put them in a test monster as a drop (in T such monster called “Test Drop”)

At https://github.com/draconisPW/PWMAngband/pull/608 there is a re-compilation of SDL libraries with command like this implib.exe -a -c SDL2.lib SDL2.dll , why doing so?

Originally SDL put to their release binary libs compiled with VS (Visual Studio); while PWMA/Tangaria need to compile stuff via Borland (Embarcadero C++). That’s why we use implib to re-compile .dll into .lib with this utility.

It’s better to compile libraries from scratch (from source files) and do not store binaries in the repo, but SDL2 doesn’t compile with C++ Builder 6, the libs shipped with it aren’t compatible (SDL2 uses directX version that is bigger than directX files in /vcl). Even after removing the “declaration not allowed” errors + “keyword is reserved” errors because there were a lot of variables called “this” or “class”.. so even after removing all compile errors – there were unsolvable linker errors due to wrong version of directX. If you managed to solve this issue – please report to #dev channel at our Discord.

Difference between PARALYZED and OCCUPIED?
When you’re paralyzed, you don’t do safe throws and other stuff, so occupied less harsh. Your char is occupied with something, but still can act somehow and react on events, while during paralysation it stay still as a statue and roll eyes around 😉

When I compile under Linux, I’ve got an error in sound.prf: Parse error in /tmp/Tangaria/etc/pwmangband/customize/sound.prf line 66 column 1: bient_wind_1 ambient_wind_2 ambient_wind_3: undefined directive
This is due limit which can be increased at sound-core.c#L23 MAX_SOUNDS_PER_MESSAGE 16

What is m$M in some classes spells?

Depends on spell, eg in “Meteor Swarm” it’s number of meteors:
expr:M:PLAYER_LEVEL:/ 20 + 2

How to generate ego item, eg Lantern of True Sight?
& 4 2 k Lantern e true sight

How to generate non-identified item?
Try putting DM on non-droppable terrain (eg building wall) so the item is not assessed because it falls under the DM

When I close server with Ctrl+c, my IDE (eg C++ Builder) gives error: Exception Code: C0000005

It might happen if you modified something wrongly. Eg you added new spell in class.txt, but didn’t increment spell’s number in particular spellbook.

Is there way to generate cursed item?
Use curse scroll.

# Depth where labyrinths start to be generated unlit/unknown/with hard walls
...
dun-gen:lab-depth-soft:35

Hard walls – it’s permawalls vs regular walls in labyrinths. All walls will become perma at such level?
It’s 100% soft at 35 then slowly becoming chance of perma.

Character got wrong appearance after reincarnation
Check race/class order in xtra-tan.prf and don’t forget to update this file on server

How to debug Unknown packet type?
Try to add debug  breakpoint to: Packet_printf() in sockbuf.c

I want change color of msg
check message.prf file in lib/customize

I polymorph’ed to certain form, but can’t use it spells
Atm form spells only work for shapechanger class. But.. now you can use special attacks. Eg if form got:
blow:HIT:HURT:1d6
blow:HIT:POISON:1d6
it will be chosen at random when attacking, damage isn’t added when playing with weapon, you just inherit the effect, so just 50% poison effect in this case. Damage only counts for forms without weapons aka dragon/hydra.

How to demolish player’s house (if you are DM)
Sell the house. If it is not owned by anyone – exit the location and it will disappear.
Also building commands -> fill rectangle.. and tunnel to delete blocks manually.

What is NO_PIT monster flag?
Flag to exclude mobs from pits.

What is ‘challenging’ option in cfg?
It used to allow streamers (for example water rivers) to cross pits with probability depending on depth (less chance the deeper).

How FEATHER helps vs traps?
Check trap.exe, save flag

Why monster.txt fruit bat got 120 speed, but in-game this form gives +5 MOVES?
When a form has +speed, you get half the speed as +move from level 1 to level 25 then you get half the speed as +speed

Remember that ego and artifacts inherit flags from base.
Eg you give base Mage Staff +1 mana, then Cobalt Focus (which also got 1) – won’t have 2 mana total.

Effect to light up whole level:
effect:LIGHT_LEVEL:NONE:x will now do:
0: sense objects
1: detect objects
any other value: don’t show objects

There is a file in PWMA repo\lib\customize\sound.cfg which is not up-to-date
sound.cfg is not used it’s a leftover file, sounds are loaded from sound.prf

I’ve added new monsters and now players who use polymorphed forms (eg Dragon, Hydra etc) have wrong appearence what to do?
It’s better to add new monsters in the end of the monster.txt list. But if you already did it, there is a breakpoint/edit k_idx trick:

  • Login with the character which form needs to be restored (eg Hydra race player)
  • In your IDE put the breakpoint upon process_player, right after comment “Process player commands from the command queue…“:
    static void process_player(struct player *p)
  • now inspect “p” → look for k_idx (to find it easier – sort by name)

Also there is another trick: use wand of polymorph on such player to poly it to bat and back. It will require for both players to be hostile to each other.

When I’ve closed the server console window – I had a crash in debug mode
Never stop server with “cross”, it’s unreliable. With Windows you need to always stop server with ctrl-c

Is it possible to use zero min value for items, eg: effect:SUMMON:HOUND:0:-1 dice:0d2
Nope if you want 0-2 you need to do 1d3-1

I saw in patch notes “Disable banishment in dwarven halls“. Where is it?
It’s the ironman towns, you will only see them when you set your server as ironman

Are these new layouts will appear sometimes on random or we need to assign them for dungeons?
It’s dungeon profile so chance is set by cutoff: 1/200 chance for each of them

There are new dungeon layouts…

  • hard centre = a cavern level with a GV in the middle
  • lair = left part of map is regular level, right part is a cavern with a specific type of monster (like in pits), up/down in left part
  • gauntlet is a tricky one — 2 cavern parts with an unmapped/unlit/notele labyrinth in the middle, left part has all up stairs and is ALSO notele, right part has all down stairs

How true artifacts allocation works?
The following in alloc_init_objects():

  • if an artifact has an allocation value (allocation probability on line “alloc: allocation probability : min depth : max depth” in artifact.txt), this value is used
  • if an artifact doesn’t have an allocation value (allocation probability = 0 in artifact.txt), it is calculated proportionnally to the artifact’s value

How new negative stats works?
The result must compel to the minimum value for each one. This means:

  • for MANA, STEALTH, SEARCH, INFRA, TUNNEL, SPEED, LIGHT, DAM_RED, no minimum required unless the underlying stat has to be positive
  • for BLOWS, num_blows must be >= 1 (one bpr)
  • for SHOTS, num_shots must be >= 10 (one spr)
  • for MIGHT, ammo_mult must be >= 1 (multiplier of x1)

Concerning MOVES:
Moves != speed. It just affects the energy needed to move. Energy is 1/1+moves if positive and is 1-2*moves/1-moves if negative

Order of effects for objects?
Object effects are handled bottom to top, eg

name:Enlightenment
graphics:!:d
type:potion
level:25
weight:4
cost:0
alloc:40:25 to 100
pile:25:2
effect:LIGHT_LEVEL:NONE:1
effect:RESTORE_EXP
effect:TIMED_INC_NO_RES:PARALYZED
dice:2d1

First thing that will be active – you will be paralyzed.

Why there is a players file in sever folder?
It’s new feature: game will create a “players” file that will store player names and ids instead of storing them in the “server” savefile, so deleting the server savefile for terrain updates will now be completely safe.

Target dummy doesn’t reappear after ‘server’ wipe (townies numbers changed from -1 to 100)
Town needs to fill the 100 first.

How to generate rod of polymorph with admin char?
To generate an item, you need to pass the exact kind name: “dagger”, “lantern”, “experience”, “polymorph”, … so putting “potion of experience” or “rod of polymorph” won’t work. Problem is: if you use “polymorph” for kind name, the code will pick the FIRST kind with that name, which mean “wand” and never “rod” (same for “strength” for example — you will get a potion and not a ring). To fix this, it’s possible to put a symbol at the beginning of the name so the parser knows what item to generate: !strength for a potion, =strength for a ring. But there’s still a problem remaining: wands and rods use the same symbol “-“. To fix that last problem, the parser uses “*” to recognize rods.

So the answer is: to generate a rod of polymorph from the “&42k” menu, you need to specify “*polymorph”.

From forum oook: You need to set “dice:2”. Currently, setting “dice:1” will trigger the effect and immediately decrease the turn count, setting it to zero and ending the effect without having it last a turn.
So.. is it fixed atm? Eg effect:TIMED_INC:OPP_CONF
dice:1
will work for next turn?
Yes, it’s fixed in pwmang. Decrease timeout occurs just before command processing so each command triggering an effect lasts 1 real turn.

Admin’s Mass Banishment effect doesn’t disappear
All commands in the “summoning” menu are “toggle” commands and work permanently. To stop summoning/mass banishing, you need to press “summoning off” in the menu.

Is there DEC_BY effect?
Not yet: https://github.com/angband/angband/issues/4366

I’ve got error
020720 100233 Cannot place object at row 7, column 49!
020720 100233 Savefile is corrupted or too old -- couldn't load block objects
It’s a problem with object. As temp solution you could edit load.c and remove “return -1;” at line 1348 (near to message “Cannot place object at row %d, column %d!”), so the server will just discard the object without stopping.

How to change gold drop? (gold drop table)
obj-make.c → tic u16b level_golds[]

I’ve noticed that pdcurses.dll didn’t compile via setup.bat , but it’s included to PWMA binaries
pdcurses is not compiled it’s provided as dll

How pits works?
Pits and nests use “fake” granite walls that look like granite walls but are in fact permanent so mobs/players can’t dig them to cheeze the pit/nest.

Should I put it like: stairs:0:2+1d2 or stairs::2+1d2?
0 🙂

What is cavern? What does CAVERN flag do exactly?
Level looks like a cavern, it’s base V level — there are no rooms, just cavernous corridors. Flag adds more chance to spawn cavern lvl.

What means dice there?
effect:BOW_BRAND_SHOT:POIS
dice:5
and there it’s 20:
effect:BOW_BRAND_SHOT:MISSILE
dice:20

Dice is +todam (used in effect_calculate_value)

What the difference between:
EFFECT(BOW_BRAND, false, "dam", 0, EFINFO_NONE, "makes your missiles explode")
and
EFFECT(BOW_BRAND_SHOT, false, "dam", 0, EFINFO_NONE, "brands your missiles")

Bow_brand is flat damage or property (like piercing), bow_brand_shot is a real brand (fire, cold, poison…)

How works this one…
spell:Piercing Shots:30:11:50:50:0
effect:BOW_BRAND:ARROW
desc:Turns your missiles into deadly piercing shots.
and
spell:Explosive Shots:32:12:54:55:0
effect:BOW_BRAND:SHARD:1
dice:10
desc:Turns your missiles into explosive shots.
…is it enhance projectiles (equipment) or applied ‘on fly’ at particular shot?
It’s like any other brand, enhances missiles.

Will DAM_RED flag work as negative? eg will value:1:DAM_RED[-10] for a race make it get 10% more damage from monsters?
in fact yeah it will work heh. DAM_RED is flat though, -10 means 10 more damage not 10%

Does ‘void’ terrain do something? is it simply deco terrain?
‘Void’ is just black terrain… emptiness

Will it be ok to do not use FLOOR flag for floors? Is it important to use it?
You can not drop items on non-floors

Is it possible to assign ego item to admin_stuff.txt? eg: equip:light:Lantern of Brightness:1
Nope, must be regular item

Where pit floor terrain (prevents teleport) used?
It is used in pits obviously (you get a “OUUUUUUUH” sound when you enter). All pits are no_teleport because it’s stupid to have mobs in pits that will all teleport around when you enter so the floor prevents teleportation.

How race attack flags (eg ‘dragons’) will stack with ‘monk’ flags?
When char has race attack + class attack (eg dragon monk) the race attack has 2/3 chance to get picked and the class attack 1/3 chance

How ‘chance’ works at attack?
Chance for attack is simply chance of failure, which applied for EACH attack-stroke. So 30% means you have 70% of doing the attack and 30% chance of game rerolling to do another attack. eg, 70% chance of doing circular attack for hydra means it must have 3 whatever attacks + 7 attacks that are 50:0:CIRCLE

What does mean alloc probability 0? some artifacts got zero: name:of Undeath ... alloc:0:5 to 100 while some got positive value..
Alloc on artifact is not used since it’s recalculated anyway, so the ones with positive are simply the ones from V where I didn’t remove the value

Will this class spell spell:Detonate:30:20:70:60:0 effect:DETONATE works if I’ll assign it to the monster? eg to create monster Kamikaze yeek; something like blow:CRUSH:DETONATE:3d3
No, it only works on summons

Is it possible to assign to monsters HP not like hit-points:2 ; but hit-points:1d2 ?
Nope

I’ve noticed that if player logged off in the dungeon (tested in newbie one) – level becomes static. I’m checking it again and again – and it’s the same lvl. For how long it will remain static?
depends on cfg parameter LEVEL_UNSTATIC_CHANCE, it’s random based on depth and value in cfg file

I’ve got an error in logs:  Unable to (re-)stock store 10. Please report this bug. in a custom bookshop. But it seems in order.
It seems you have too much “always” lines which exceeds the capacity of the store (24) – as books (eg nature book) actually show 3 items, not one. You could change max capacity of store in constants.txt

Also if you got such error:

150420 133235 Server savefile does not exist.

..it could also mean an error in the shop, eg. for example you don’t have ‘normal’ items while have ‘turnover’.

What does ‘FPS = 75’ in config means?
75 FPS = number of frames per second = number of times the game checks for input per second. The default value in the code is… ONE. This means if you forget to put a mangband.cfg file in your directory, ALL players will move ONCE per second. FPS = 75 is the MAngband default (check every 13ms). If you lower to FPS = 60, you’ll make the game slower (check every 16ms).

FRIGHTENED vs SMART flags:
FRIGHTENED just flees; it’s not ai_annoy – just plain afraid.
SMART will use spells intelligently, like use heal when wounded; it’s not ai_learn server option which just will remove bad spells, for example, fire bolt if you’re immune to fire.

How to make trap or spell to decrease the amount of player’s HP from an absolute value?
PLAYER_HP. It’s used in shape.txt for vampire form, eg

effect:DAMAGE
dice:$B
expr:B:PLAYER_HP:- 5

How to change default client options?
Add desirable options to pref.prf file

Why ‘msg_self’ doesn’t work for objects I’ve added?
msg_self is attached to an effect, not to the object. If the object has no effect, use effect:END_INFO as a dummy effect. For example:

name:Blabla
graphics:!:d
type:potion
level:30
weight:4
cost:8000
alloc:30:30 to 100
pile:10:2
effect:END_INFO
msg_self:Blablabla...

This dummy potion just displays a message without doing anything else.

Generate random artifact in admin menu doesn’t work. Only message: “There is nothing on the floor”
To generate a random artifact, you need a normal object on the floor and the option will turn the object into a randart.

What is RAND_25 or RAND_50 flags?
Chance of a monster to stagger (random movement). 

DROP_60 and DROP_90?
Specify probabilities of a single drop.

DROP_1 and DROP_2?
Specify an absolute count for the number of drops.

Hydra has cold vulnerability. Can it be covered with resistance?
Normal cold vulnerability: resistance makes you neutral, you need double resist to be resistant and immunity to get immune.

Vulnerability could be assigned to any element? or only to basic ones?
Need to check. Don’t think it works, since you have hurt_light flag for example and not RES_LIGHT[-1]

Why dragon race to -10 bonus, while it’s listed as -20 in the spoiler?
Polymorphed players only get half bonus/malus from race. And half anything (ent penalty -2 to speed becomes -1 if polymorphed). 

Please note that when you start at char creation, the polymorph is not in effect.

Which is minimum stat possible?
Stat min is 3 no matter what you assign to race. Internally it’s lower but the used stat is min to 3.

How do shapes work for monsters?

  • Shapechange is only one way, you can’t put shapechange on a shape it will not work.
  • Shapechange is one time — mob stays like that until death.
  • If monster A will shapechange to monster B; monster B can not shapeshift to monster C (B becomes just a placeholder).
  • so if A -> B … B can’t have flag for shapechange into C. You will need 2 monsters B1 and B2 (for new one to transform – allocation and shapechange spell)
  • if monsters don’t have shapes, the game uses type of monster from the “summon” spells, eg druid has s_animal so he can shapechange into any animal
  • when a monster changes right now – they just change their race, but keep their current HP, status effects, and inventory, but takes new parameters from race: spellcasting and other abilities, hearing, smell, AC. Please note that speed is a special case because, while average speed is defined in the race, speed for an individual monster is allocated at birth, and may be a couple of points above or below average (details: struct monster_race → struct monster in monster.h.)

It’s written that monsters immune to certain elements (eg IM_FIRE), but I don’t see RES_ flag there. Why?
Even if monster IMMUNE – you still can damage it. It will get ~10% of damage.

Will it work in stores:
normal:potion:Healing:1:500
normal:potion:Healing:1:500
normal:potion:Healing:1:500

Nope, no duplicates.

What is max-min normal slots in shops?
You can’t have less slots for turnover, then normal items. eg:
We have 14 normal items and 12 always:
slots:13:14 will do (as you need at least one slot for  drops – even at no_selling server people could ‘sell’ items to stores to ID them).

I wanna add a new monster, a new hydra
base:hydra and base:dragon should not be touched, you would break the races

How does rule and rule-flags works in dungeon.txt?
Let’s examine this example:

rule:50:0
rule-flags:ORC
rule-symbols:koO
rule:30:0
rule-flags:TROLL
rule:20:1

It means that it’s 50% to spawn ORC flag monsters and “koO” symbol monsters; 30% to spawn TROLL flag monsters; 20% for anything else

How to change password if player forgot it?
1) create new account with a password
2) open the account file and copy new password hash
3) paste hash to needed account in account file and also in character save file

How to prohibit certain monster (eg death golem) to appear in pit?
Pits have flag restrictions for this.

What is the number after curse, eg curse:hallucination:100 ?
It’s the chance to remove curse.

How to solve problem with player who block entrances to buildings?
Here’s how ‘bumping/switching places’ code works: each time a player moves, the direction he faces is saved into a “last direction” variable; if the last direction of a player is equal to the opposite of the last direction of another player, they “switch places”; otherwise, they “bump” into each other. It’s the same in MAngband. There is a problem possible if players move you around by switching places while you’re AFK or switch places while you’re in a shop (imagine a fire immune player switching place with someone not fire immune in Carn Dum and putting the other player upon a lava tile!).

What’s about new lighting system in PWMA?

  • torch: used in corridors for torchlight grids ONLY (‘view_yellow_light’ option is turned off by default in Tangaria)
  • los: used in rooms when in los
  • lit: used anywhere else
  • dark: not used

Some monster flags:
CHAR_CLEAR – monster looks like the floor (for example a lurker or a trapper will be a ‘.’ on floor)
ATTR_CLEAR – monster looks like the background (for example a clear hound on red background will look red and on green background will look green)
ATTR_MULTI – multi-hued monster 
ATTR_FLICKER – shimmering monster

STUPID – rarely wake up

Terrain flags:
NONE – empty flag
LOS – line of sight (not in-game yet)
PROJECT – allow projectiles to pass through the feature
PASSABLE – allow to creature or player to pass through the feature
INTERESTING – when we use look – it’s a grid which will be shown without p
PERMANENT – permanent wall; can’t be destroyed // && ROCK ?
EASY – easily passed through (not in-game yet)
TRAP  – feature can hold a trap
NO_SCENT – doesn’t carry player scent
NO_FLOW – doesn’t carry monster flow information (True if the cave square doesn’t allow monster flow information.) ???
OBJECT – can hold objects

TORCH – can be lit by light sources (becomes bright when torch-lit)
/*HIDDEN, “Can be found by searching”)*/
GOLD – is a mineral wall with treasure (magma/quartz) // && INTERESTING to become treasure
CLOSABLE – can be closed
FLOOR – clear floor
WALL – solid wall (not rubble)
ROCK – diggable; gives messages: You dig in the rubble / You have removed the rubble
GRANITE – normal granite rock wall. Essential for dungeon creation! Without it dungeon will reset all walls features and will use default walls.
DOOR_ANY – any door
DOOR_CLOSED – closed door
SHOP – shop entrance
/*DOOR_JAMMED, “Is a jammed door”)*/
/* DOOR_LOCKED – locked door*/
MAGMA – is a magma wall
QUARTZ – is a quartz wall
STAIR – stair
UPSTAIR – up staircase
DOWNSTAIR – down staircase
SMOOTH – should have smooth boundaries (for dungeon generation)
BRIGHT – internally lit (like a lantern)
FIERY – is fire-based; V terrain for lava stream in dungeon // islava, isfiery

/* PWMAngband */
LAVA – pwmang terrain (lava pool), in wilderness  // islava
FLOOR_SAFE – safe floor
FLOOR_OTHER – other floor
BORING – to make terrain elements not be visible in the dark // square_isnormal()
PIT – pit // should be FLOOR
BORDER – is a border
ARENA – ispermarena()
DOOR_HOME – ishomedoor()
TREE – istree()
WITHERED – withered tree iswitheredtree() // && TREE
DIRT – isdirt()
GRASS – isgrass()
CROP – iscrop
WATER – iswater
MOUNTAIN – ismountain
FOUNTAIN – isfountain
DRIED – is dried out // isdryfountain
NOTICEABLE – is noticed when pathfinding // must be something from V that is unused in pwmang
PREFIXED – adds in prefix in look targeting // isprefixed
PLOT – part of a plot; don’t build on other buildings or farms // square_isplot
METAMAP – only displayed on the metamap
SAND – sand wall // ismineral_other
ICE – ice wall // ismineral_other
WEB – isweb
DARK – dark wall // ismineral_other
NETHER – nether mist // isnether
VENDOR – prefix for “the entrance to the ” // is_vendor

square_isstrongtree = TF_TREE && !TF_WITHERED

rubble = !TF_WALL && TF_ROCK

NOPIT – flag to prevent monster to appear in pit (for Death Golems, Bloody Falcons etc).

Digging complexity for terrain elements:
info:0:1 – tree
info:0:2 – rubble, sand wall, web
info:0:3 – magma, ice wall
info:0:4 – quartz
info:0:5 – granite
info:0:6 – door
info:0:7 – high mountain

Dungeon Master Commands

Level Commands

  • Static your current level
    Makes the current level permanent, as if there were players on it.
  • Unstatic your current level
    Resets the current level, as if there were no more players on it.
  • Enter manual design (new level)
    Wipes the current level and makes it suitable for editing.
  • Enter manual design (same level)
    Makes the current level suitable for editing without starting anew.
  • Exit manual design (create town)
    Saves the modifications on the current level and checks if it’s suitable for a town.
  • Exit manual design (create level)
    Saves the modifications on the current level and checks if it’s suitable for a normal level.

Building Commands

  • Set Feature
    Defines the feature for building commands.
  • Place Feature
    Places the feature at the current location.
  • Draw Line
    Draws a line of the feature from the current location.
  • Fill Rectangle
    Fills a rectangle of the feature from the current location.
  • Build Mode On
    Starts placing the feature while moving around.
  • Build Mode Off
    Stops placing the feature while moving around.

Summoning Commands

  • Depth
    Summons a monster from a specific depth.
  • Specific
    Summons a monster from a specific race.
  • Mass Banishment
    Banishes all monsters while moving around.
  • Summoning mode off
    Stops banishing all monsters while moving around.

Generation Commands

  • Vault
    Generates a vault at the current location.
  • Item
    Generates an item at the current location.
  • Random artifact
    Generates a random artifact at the current location.
  • Random artifact (reroll)
    Rerolls a random artifact at the current location.
  • True artifact
    Generates a true artifact at the current location.

Player Commands

  • Self
    Changes the Dungeon Master’s permissions.
  • By Name
    Changes another player’s permissions.

Visual Commands

  • Display PROJ_XXX types
    Displays bolts, beams and balls for each projection effect.

Manage XBM orders

  • Previous
    Selects the previous order.
  • Next
    Selects the next order.
  • Cancel order
    Cancels the selected order.

Debug Commands

  • Perform an effect (EFFECT_XXX)
    Performs an effect given by name and parameters.
  • Create a trap
    Creates a trap at the current location.
  • Advance time
    Advances time by 1 to 12 hours.

How to connect server console

Using PuTTY:
“- create a session with parameters: host name = localhost, port = 18346
(or whatever value you have set for TCP_PORT in mangband.cfg), connection type = Telnet”
– if this works, a window will open with the text “Connected”
– enter the console password (value set for CONSOLE_PASSWORD in mangband.cfg)
– if the password is correct, you will see the text “Authenticated”
– press “help” to see a list of commands
– press “Enter” after each command to go back to the left of the window (it’s not automatic)

There are few commands right now. The most used are “who” to list the players currently online, “whois” to get a detail of a player, “kick” to kick a player out of the game, “wrath” to kill cheaters and “shutdown” to shut the server down. The complete list of commands is in control.c.

help
listen
who
shutdown
msg
kick
wrath
reload
whois
rngtest
debug


About console from MAng git manual:

MAngband server provides an admin console interface, which uses plain telnet connections.

To use it, you must first edit the mangband.cfg file and tune the following options:

CONSOLE_PASSWORD = "your secret password"

You MUST change this value!

The second config value you should take care of is

CONSOLE_LOCAL_ONLY = true

If set to true, the console will NOT be accessible from the outside world. This is the recommended default.

When the server starts, it will bind to TCP_PORT+1, so if you’re running your server on port 18346, the console interface will be available on port 18347.

It supports both telnet (\r\n terminated strings) and netcat (\n terminated strings) connections.

telnet localhost 18347
Connected

The very first thing you must send it is your CONSOLE_PASSWORD as specified in the config file. It will then reply with “Authenticated”, meaning you’re good to go.

From then on, you can issue console commands like shutdown or whois Playername.

For the full list of commands use help. To get more information about a specific command, run help with its name, e.g. help shutdown.

Common commands

  • shutdown [MINUTES] – shutdown the server. If MINUTES is provided, the server will wait for a bit, giving players a chance to properly disconnect and/or recall to town.
  • who – returns a list of active players.
  • whois Player – returns interesting information about specified Player.

Dungeon allocation test

MAngband server can perform an “allocation test”, to provide statistics on item/monster/vault rarities. Note, that this feature is currently very crude.

Never run this on production or live servers!

  1. Compile the server in the DEBUG mode.
  2. Redirect stdout to file (mangband.exe > log.txt) as you run the server.
  3. Connect via admin console.
  4. Execute the “dngtest” command.

The server will then generate each dungeon level N times, and report everything to the ‘#cheat’ channel, and ALSO to the game log, which we already write to a log file.

Now you have a file, log.txt, with many entries like those:

121219 005559 +o An Amulet of Wisdom (+2)
121219 005559 +v Mini-vault
121219 005559 +m Giant centipede

You will have to post-process this file, to collect meaningful stats. +o stands for object, +a for artifact, +m for monster, and +v for vault. A simple script could strip this and calculate the number of occurrences for each item, and a percent out of total items.

Note, that “dngtest” takes 2 optional arguments, number of iterations, and dungeon level. “dngtest 2” will generate every dungeon level 2 times. “dngtest 2 4” will generate only dungeon level 4 (200 ft), 2 times.

Fonts

How to convert/resize raster fonts properly?

Convert with a program Sib Font Editor (another algorithm) and found a function Fony program (http://hukka.ncn.fi/?fony) Edit > Resize > Double size. Converted Sib Font Editor Options > Modify Font pref. > (v) Variable pitch , 21×31, Zero level: 21

OR

FontForge export to png, or svg (vector image) convert svg to png https://mapsvg.com/blog/svg-to-png-converter proxy or vpn https://www.freeconvert.com/svg-to-png with ⚙️ Advanced Options (optional) Resize Output Image width, height


NotEye installation (temporary does not work!)

  1. Download Necklace of the Eye (NotEye+Hydra Slayer package)
  2. Unpack it to \Tangaria\noteye
  3. Run noteye.bat (it’s in \Tangaria)
  4. In opened window paste the way to \Tangaria\noteye , eg “C:\games\Tangaria\noteye” (without quotes)
  5. Confirm updating files: ‘y’ (yes)
  6. After updating finishes you would see ‘Necklace of the Eye’ window
  7. ‘p’ would open the game with ‘noteye’ mode
  8. to change graphic modes press ‘F4’ -> ‘m’
  9. Enjoy 3D, isometric projection and third-person view! 😀

After install you don’t need to run noteye.bat anymore; you could just start \Tangaria\noteye\noteye.exe

Also you could save your log/pass to \Tangaria\noteye\pwmangband\pwmangband.ini for auto-login


Etc dev notes

Leftovers after Necro design:
fire_ball(who, PROJ_MISSILE, 0, 300, 2, false, true); <<< wrong dir
effect_simple(EF_BLAST, who, "300", PROJ_MISSILE, 2, 0, 0, 0, &context->ident); <<< wrong source (only around p)
// (index, source, dmg, subtype, radius, other, y, x, ident)


MIN(a,b)      (a > b) ? b : a
MAX(a,b)     (a < b) ? b : a
ABS(a)          (a < 0) ? -a : a
SGN(a)          (a < 0) ? -1 : a != 0
CMP(a,b)      (a < b) ? -1 : (b < a) ? 1 : 0

Housing

Important note: Y goes from top! It’s not traditional 2D graph, but graph which starts on top left corner of the map!

   

struct house_type
    struct loc grid_1;          Location of house
    struct loc grid_2;
    struct loc door;            Location of door
    struct worldpos wpos;       Position @ world map
    s32b price;                 Cost of buying
    s32b ownerid;               Owner ID
    char ownername[NORMAL_WID]; Owner name
    byte color;                 Door color
    byte state;                 State
    byte free;                  Bought with Deed of Property
State of a house:
0 = unallocated
1 = normal
2 = extended
3 = custom

Which characters are allowed to be used in string literals of C program except numbers and letters?

!  "  #  %  &  '  (  )  *  +  ,  -  .  /  :
;  <  =  >  ?  [  \  ]  ^  _  {  |  }  ~

Also space character and control characters representing horizontal tab, vertical tab and form feed.


In C language */% got equal precedence, but evaluate left to right:

x * y / z is the same as (x * y) / z and x / y * z is the same as (x / y) * z


1 / 10 == 0;


chunk_get()


struct dice_s
{
    int b, x, y, m;
    bool ex_b, ex_x, ex_y, ex_m;
    dice_expression_entry_t *expressions;
};

typedef struct dice_s dice_t;

dice_parse_string(effect.dice, dice_string);

Leave a Reply

🇬🇧 Attention! Comments with URLs/email are not allowed.
🇷🇺 Комментарии со ссылками/email удаляются автоматически.