Repository navigation
Add ACK!MUD and DSA dialects; read ROM 2.3 and ROM OLC/ROT variants - #20
Merged
Merged
Conversation
Read and write ACK!MUD areas: the letter-keyed #AREA header (K/L/N/I/V/X/F/U/O/R/W plus text flag lines), two-number rooms with raw exit bits, "!"-line mobiles with inline MOBprograms, four-value objects with A/E/L records, and #OBJFUNS. Detected by an #AREA name string followed by a "K keyword~" line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LsTyuYeZHogKAnGhufs9gN
ROM 2.3-era areas keep Merc's one-string "#AREA {levels} Author Name~" header,
write a literal "S" where ROM 2.4 writes the mob group, and end M/P resets after
the third argument. Detect them from the race string on the first mobile, record
the header and group layouts so the native writer reproduces them, and read an
M/P fourth argument only when it is present on the line.
Dice also accept a flat number (e.g. mana "100") and a "+-" negative bonus.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LsTyuYeZHogKAnGhufs9gN
ROM OLC and ROT write a keyed #AREADATA header (Name, Filename, Builders, VNUMs, Credits, Security, Zone) over ROM bodies. Detection sent these to GodWars, which rejected Credits; route #AREADATA files with a Credits line or a race string on the first mobile to the ROM reader, which now reads and writes the header itself. ROT mobiles carry a shielded_by flag between affected_by and alignment; read it when the line holds the extra word and keep that line together on write. The ROM writer also emits #MOBPROGS instead of dropping them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LsTyuYeZHogKAnGhufs9gN
Keep room sector numbers outside SECTOR_TYPES as raw ints instead of failing, since several dialects extend the sector table. Treat unknown ROM object condition letters as perfect (100), as ROM's loader does, and consume a numeric condition whole so the record stays aligned. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LsTyuYeZHogKAnGhufs9gN
DSA is a ROM derivative marked by a "DSA Format~" string at the top of #AREA. Its header, mobiles, objects, rooms, and exits end in keyed lines up to "End", which are kept verbatim; the area help is bare text ended by "-1 $~"; and resets are "Reset" lines inside each room, read as typed DsaReset records. Mobiles reuse the ROM reader, including ROT's shielded_by word. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LsTyuYeZHogKAnGhufs9gN
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extends dialect coverage using a 321-file corpus of MUD areas (
mud-areas/+rom/). A corpus sweep (detect, then parse with the detected reader, falling back to ROM/Merc/SMAUG) went from 221 ok / 100 fail with 44 fallback rescues to 295 ok / 26 fail with 0 fallback rescues. Every file now parses with the readerdetect_area_typepicks.New dialects
AckAreaFile#AREAname string followed by aK keyword~lineDsaAreaFile#AREAstring isDSA Format~K/L/N/I/V/X/F/U/O/R/Wplus text flag linesT/P/B/M/S), rooms with two numbers (sector may be missing) and raw exit bits, mobiles with a!line and inline>trigger ... ~ |MOBprograms, four-value objects withA/E/Lrecords,#OBJFUNS.Endon the header, mobiles, objects, rooms and exits. These lines are kept verbatim, since their meaning is DSA-specific. The area help is bare text ended by-1 $~. Resets areReset ...lines inside each room, and they are read as typedDsaResetrecords on the room.Both come with native writers (
dumps()/write()), and every one of the 37 corpus files round-trips to an equal model.ROM variants read by
RomAreaFile#AREA {5 15} Author Name~). These were detected as Merc because the header has one string. They are now routed to ROM when the first mobile has a race string.RomArea.header_formatrecords"merc".RomMob.groupisNonewhere the file has ROM 2.3's literalS. M/P resets read a fourth argument only when one is present on the line.#AREADATA(Name/Filename/Builders/VNUMs/Credits/Security/Zone). These were detected as GodWars, which rejectedCredits. They are now routed to ROM when aCreditsline or a race string on the first mobile is present. ROM reads and writes this header (header_format == "areadata", plusbuilders,securityandzone). ROT mobiles carryshielded_bybetween affected_by and alignment.#MOBPROGS. Before this, it dropped them on write.Leniency
Diceaccepts a flat number (mana100) and a+-negative bonus (1d5+-1).SECTOR_TYPESare kept as raw ints instead of raising.Remaining corpus failures (26)
rom/group.are,help.are,rom.are,social.are). They fail cleanly with "no rooms".keep.arealso has no rooms.court(dice with no bonus)aliens2andgrail(dice written where the wealth number belongs)olympus2,templofm,templofs,elvandargnome,graghandgrave(unterminated strings)ephradle(broken header)rom/proto.are(a template withXX00vnums)E .trigger~records (alice,deathdun)''(mirror2,ocean,zoo)>MOBprograms inside ROM mobiles (swroad)lhouse,AsylumGrounds,pagesvisited,dethkeepTests
Small trimmed fixtures are under
test/ack,test/dsa,test/rom23andtest/rot, with tests intest_ack.py,test_dsa.py,test_rom23.py,test_rom_areadata.pyandtest_lenient_values.py. The full suite gives 1064 passed and 1 failed. The failure istest_medievia.py::test_loads_standalone_medievia_world_file, which already fails on master becausecli.load_areais missing; the concurrent CLI PR fixes it.🤖 Generated with Claude Code
https://claude.ai/code/session_01LsTyuYeZHogKAnGhufs9gN