Commit Graph
19156 Commits
Author SHA1 Message Date
nhw_cron a24a0240ce This is cron-daily v1-May-7-2026. 000files updated: Files 2026-05-29 15:40:37 -04:00
nhw_cron 526ffaa582 This is cron-daily v1-May-7-2026. 005guidebook updated: doc/Guidebook.txt 2026-05-29 15:40:22 -04:00
nhmall 0c7070037d yet another Guidebook follow-up 2026-05-29 06:42:39 -04:00
nhmall d676206200 follow-up bit Contributing.md 2026-05-29 06:31:01 -04:00
nhmall 898a430617 follow-up bits for Guidebook.mn processing 2026-05-29 06:27:02 -04:00
nhmall 942f34c883 fix file name in header line 2026-05-28 21:11:38 -04:00
nhmall 287d3f60b5 tone down header lines on GitHub Contributing pg 2026-05-28 21:06:39 -04:00
nhmall 883620699f Guidebook.txt update
Created from make. The cron repo did not have today's updates.
2026-05-28 17:43:02 -04:00
Ingo Paschke 5f817fe9ad glyphs: code-review fixes and parse_id off-by-one
- cmap_offset was calculated on every compose_glyph_name() call;
    calculate it once with a static function.
  - Drop parse_id's G_ auto-populate: an unbracketed lookup allocated
    the index with no matching free.  Linear-scan instead when absent.
  - compose_glyph_name: require bufsz >= BUFSZ, build names with
    bounded Snprintf instead of Strcpy/Strcat, drop the dead memchr.
  - parse_id's permonst scan used i <= pm_count, reading one past the
    SYM_MON block (S_nothing) and matching it as a monster; use <.
  - Drop a stale NO_GLYPH empty-bucket comment from the open-addressed
    table.
2026-05-28 21:08:54 +02:00
nhmall 29380dfdb9 follow-up: TeX doesn't require special handling for ']' 2026-05-28 11:32:06 -04:00
nhmall f47edf59c3 Guidebook update
Make it clear that the *DIR options are not available on Unix.

Related to discussion on GitHub Issue #1552
2026-05-28 11:17:46 -04:00
nhmall a9401fd78a Guidebook bits for Jon Wätte (Jon W{tte)
There is no unintentional spelling mistake.
Close #1523
2026-05-27 23:02:19 -04:00
nhmall 6c950d958f util project needed strutil.c and alloc.c
It was using dupstr(), so strutil had to be added to the project.
2026-05-27 20:58:29 -04:00
nhmall 4e80fda312 build fix for util 2026-05-27 20:51:51 -04:00
nhmall f88d410ba2 typos 2026-05-27 20:14:50 -04:00
nhmall 38d8d2972d README 3.6 vestige 2026-05-27 20:05:59 -04:00
nhmall 0bf0498155 add dirs-perms.500 and a default build change
The directories and permissions portion of the linux.500 and macOS.500
hints files and their included files has been consolidated to
dirs-perms.500.

The builder can edit that one file now, to identify
the folders that will be utilised as part of the build.

Alternatively, you can set those folders and permissions in a
make.perms file in the top of the NetHack folder tree and
they should take precedence over the ones in dirs-perms.500
because dirs-perms.500 uses '?=' variable assignment, which
means "set the value of the variable if no value has been set."

* NOTE: BUILD CHANGE *

This also makes WANT_SOURCE_INSTALL=1 the default over
WANT_SHARED_INSTALL=1, if neither is explicitly set.
The new default is the safer and less-impacting default,
but it will change where things get installed over earlier
Makefile builds. You can be explicit with WANT_SHARED_INSTALL=1
in your make command to get that..

These are the differences between the two:

make WANT_SHARED_INSTALL=1    Place the results of the install/update portion
                              of the build into a shared area on a multiuser
                              system.

make WANT_SOURCE_INSTALL=1    Place the results of the install/update portion
                              of the build into a subfolder of the source
                              tree, rather than in a system-wide shared area.

Also note that the macOS hints file behaves slightly differntly depending
on whether WANT_SOURCE_INSTALL=1 was set versus letting it be the default.
That's not new, it behaved that way before.
2026-05-27 19:32:40 -04:00
nhmall 5d2dc1c85e update tested versions of Visual Studio 2026-05-27 2026-05-27 19:25:11 -04:00
nhw_cron e31a104542 This is cron-daily v1-May-7-2026. 000files updated: Files 2026-05-27 17:49:25 -04:00
nhmall 94d3946ef1 follow-up: fix a couple of paste errors 2026-05-27 17:09:43 -04:00
nhmall d7d0e9061a follow-up: trailing whitespace 2026-05-27 16:44:51 -04:00
nhmall ce31feb231 add some foundational work for uplifts
Be able to carry out uplifts during minor release
lifetimes.

Document a way to be able to uplift struct content
without incrementing EDITLEVEL and breaking existing savefiles.
Use the mechanics outlined to uplift the contents instead, where
it is feasible to do so. The uplift is currently one-way only. An
uplifted savefile cannot be used with an earlier build of NetHack
, one built with a lower SAVEFILE_REVISION_LEVEL, than the one which
wrote the savefile.

The final byte (byte 79) of the 80 critical bytes in the savefile,
of which 10 are reserved for future expansion and not currently
used, will now be used for holding the savefile revision level
(SAVEFILE_REVISION_LEVEL in include/patchlevel.h) at the time
the savefile was written.

That leaves 9 of the bytes available for future use.
2026-05-27 16:14:20 -04:00
nhmall e352048612 include MAXTCHARS in --dumpenums 2026-05-26 22:00:12 -04:00
Ingo Paschke 598253eac8 glyphs: rotate-5 in glyph_hash eliminates true collisions
The previous rotate-1-xor put consecutive characters' bits in
adjacent positions, so short similar names like fox/bat or
jaguar/lichen collided -- 164 colliding buckets across the 9577
named glyphs.  Rotate-5 spreads each character across a 5-bit
window: zero true collisions, one m68k ROL.L, no multiplication.

The 16 remaining same-hash buckets are name duplicates from a
separate compose_glyph_name bug, addressed by its own fix.
2026-05-25 15:45:25 -04:00
nhw_cron b4f417f2ca This is cron-daily v1-May-7-2026. 005guidebook updated: doc/Guidebook.txt 2026-05-25 15:41:24 -04:00
nhmall bd67f3d0d6 merge bit 2026-05-25 15:33:54 -04:00
nhmall fee9516d9b Merge branch 'fix-piletop-generic-obj-prefix' of https://github.com/ingpaschke/NetHack into pr1549 2026-05-25 15:30:40 -04:00
Ingo Paschke 95d70ef5d8 glyphs: add piletop_ prefix to piletop-generic-obj canonical names
parse_id's glyph_is_object branch only emitted the "piletop_" prefix
when glyph_is_normal_piletop_obj(glyph) was true.  Piletop-generic
objects (the GLYPH_OBJ_PILETOP_OFF + 1 .. + LAST_GENERIC range) hit
glyph_is_piletop_generic_obj() instead and got no prefix, so they
produced the same canonical name as their non-piletop generic
counterparts.

For example glyph 3449 (GLYPH_OBJ_OFF + GENERIC_STRANGE) and glyph
7993 (GLYPH_OBJ_PILETOP_OFF + GENERIC_STRANGE) both yielded
"G_generic_strange".  14 such pairs exist; the piletop variant is
unreachable by name from nethackrc, and the runtime hashtable's
"assume no id occurs twice" populate loop silently dropped them.

Emit "piletop_" for both piletop predicates so each glyph gets a
distinct canonical name.  --dumpglyphnames now shows the 14
"G_piletop_generic_*" entries (and the count goes from 9577 to 9591;
the existing off-by-one in glyph_is_normal_piletop_obj still hides
slot GLYPH_OBJ_PILETOP_OFF + FIRST_OBJECT - 1, which is addressed by
its own fix).
2026-05-25 21:19:51 +02:00
nhmall 503355bb11 yet another function and date name update
Related to the overhaul of glyphname hash indices
2026-05-25 14:44:32 -04:00
nhmall 8b3eb77305 cherry-pick pr #1548 52e0404 glyphname indexes 2026-05-25 14:30:02 -04:00
Ingo Paschke be9e430ebb glyphs: replace open-addressed glyphname hashtable with sorted index
The open-addressed glyphname_hashtable stored each canonical
"G_xxx" name as a dupstr'd string in its bucket: ~9577 small heap
allocations and ~290 KB of resident name strings, on top of ~256 KB
of 32768-bucket scaffolding kept at <50% load for probe performance.
On classic Mac OS the populate cost (quadratic small-allocation in a
fragmented Memory Manager heap) dominated startup time -- many
seconds on an SE/30 -- and ~800 KB resident is meaningful on the
small machines the port targets.

Switch to a sorted (hash, glyph) index sized exactly to the number
of named glyphs:

  struct glyphname_hashtable_entry_t {
      uint32 hash;
      int glyphnum;
  };

populate_glyphname_hashtable() allocates one block of MAX_GLYPH
entries (no per-name strings), fills it via compose_glyph_name() +
glyph_hash(), and qsort()s ascending by hash.  Lookup binary-searches
the hash column, then walks any equal-hash neighbours verifying each
candidate by reconstructing its canonical name and strcmpi'ing it
back -- collisions are rare with 9577 uniformly-distributed 32-bit
hashes.

Other changes that fall out:

 * Extract compose_glyph_name() from parse_id's bulk-iteration switch
   so it is the single source of truth for "glyph number -> canonical
   name".  Called by find_glyph_in_hashtable for collision
   verification, by populate_glyphname_hashtable, by the
   --dumpglyphnames path, and by wizcustom_glyphnames.
 * empty_glyphname_hashtable() reduces to free(ptr); no per-entry
   strings to release.
 * Drop find_glyphname_in_hashtable_by_glyphnum (no longer used --
   wizcustom_glyphnames iterates compose_glyph_name directly).
 * Drop the res_fill_hashtable parse_id mode; populate iterates
   directly.

Memory drops from ~800 KB to ~75 KB.  One allocation instead of
~9578.  Lookup goes from O(1) to O(log N) but N ~ 9577 means ~14
comparisons per probe -- well under what the upstream cache ever
cost in practice.

Function names (populate_glyphname_hashtable, etc.) are kept for
extern.h compatibility; the data structure is now a sorted index,
"hashtable" in the names is historical.

--dumpglyphnames output is byte-identical.
2026-05-25 14:22:19 -04:00
nhmall b7c7f051b4 update Guidebook to refer to glyphname 2026-05-25 13:49:44 -04:00
nhmall 752af5b435 add fixes5-0-1.txt entry for pr #1547
fix off-by-one in glyph_is_normal_piletop_obj
2026-05-25 12:19:47 -04:00
Ingo Paschke 87a0bdf26c display: fix off-by-one in glyph_is_normal_piletop_obj
glyph_is_normal_object includes its boundary slot
GLYPH_OBJ_OFF + FIRST_OBJECT - 1 via >=, but its piletop sibling
glyph_is_normal_piletop_obj used > and excluded the matching
GLYPH_OBJ_PILETOP_OFF + FIRST_OBJECT - 1 slot.  That leaves
exactly one glyph (the would-be G_piletop_generic_venom) matching
neither the piletop-generic nor the piletop-normal predicate, so
parse_id never builds a name for it and --dumpglyphnames emits a
blank line for the slot.

Change > to >= so the two ranges are inclusive on the same side.
--dumpglyphnames now produces (8009) G_piletop_generic_venom.
2026-05-25 17:06:24 +02:00
nhmall 0e39c11be9 update --dumpenums
Include the glyph_offsets from display.h
2026-05-24 22:24:50 -04:00
nhmall 7a38d29363 nomenclature: glyphids
glyphids shall be known as glyphnames henceforth
glyphid_cache shall be known as glyphname_hashtable
2026-05-24 18:30:46 -04:00
nhmall 7996090a19 Merge branch 'no-bees-in-these-trees' of https://github.com/copperwater/NetHack into NetHack-5.0 2026-05-24 15:57:03 -04:00
copperwater c1697c0042 Don't print "low buzzing" for bee-less trees when kicked
Noticed this when testing a level with some barren trees which were set
in the special level to not contain bees; the barren trees are still
able to produce a low buzzing. This may convince players that they can
get bees from the tree if only they kick it enough times, which will not
happen.

To avoid that, only print this message when the tree can release bees,
augmenting the existing check for killer bees being non-extinct.
2026-05-24 15:37:35 -04:00
nhmall 0a332657f1 methods of disabling glyphid cache prefill
Two methods are now provided for slow ports/platforms that
need to do this for performance reasons.

Hopefully, this will avoid proliferation of more platform-specific
conditional code within initoptions_init().

Method (1): #define DISABLE_GLYPHID_CACHE_PREFILL in platform/OS's
            include/*conf.h.

or

Method (2): set gd.disable_glyphid_cache_prefill = TRUE in startup code
            after decl_global_init(), and prior to initoptions_init().
	    It has to be done after decl_global_init() because
	    decl_global_init() sets the value to its initialization
	    default.
2026-05-24 12:40:24 -04:00
nhmall c22b21e3bd follow-up: spelling fix in comment 2026-05-24 11:49:12 -04:00
nhmall c506c73fbe X11 bit 2026-05-24 00:21:40 -04:00
nhmall 05371dd481 some tipping fixes
- adjust the surface name in prompts (resolves a TODO in the code).
- be more player-friendly with the prompting, and don't prompt a
second time if the floor/surface is the only tip-destination, as
that can be annoyng and viewed as unnecessary. Instead, include
that information in the first decision prompt.

Resolves #1537
2026-05-24 00:01:50 -04:00
nhmall 7025945d2a Get CROSSCOMPILE defined earlier in the Makefiles 2026-05-23 22:50:12 -04:00
nhmall 2680476825 fixes entry for the big-endian fix 2026-05-23 21:37:56 -04:00
nhmall 58f2ef3a9e Merge branch 'lua-coordxy-bigendian' of https://github.com/ingpaschke/NetHack into NetHack-5.0 2026-05-23 21:31:44 -04:00
Ingo Paschke 4470ce348e lua: read coordxy fields with the right width (big-endian fix)
Add ANY_INT16 to any_types and use it for u.ux/uy/tx/ty and uz
dlevel/dnum.  These are coordxy (int16_t) but the Lua bindings were
treating them as 1-byte fields, so on big-endian m68k Lua read the
high byte (0) instead of the actual value.  Symptom: place_object
off map <0,0> in the tutorial.
2026-05-24 02:55:57 +02:00
nhmall ff4abc9b8c 3rd time is the charm3rd time is the charm3rd time is the charm 2026-05-23 20:05:54 -04:00
nhmall d7726e6069 follow-up grammar bit 2026-05-23 20:03:30 -04:00
nhmall 94e7d0bcf3 fixes5-0-1.txt catch-up 2026-05-23 20:01:06 -04:00
nhw_cron 0536318099 This is cron-daily v1-May-7-2026. 000files updated: Files 2026-05-23 19:16:10 -04:00