Wednesday, May 16, 2012

I parse your milkshake!

I've begun work on Weapon M's data parser. It's recognizing all the important prompts between the initial TWGS connection and the player's arrival at the Command prompt.

The trickiest part was detecting which game letter the player selected from the TWGS prompt. SWATH has a weakness where if you enter the wrong game, it'll happily go on parsing data until it encounters something like a sector number that's too high for the current database. Weapon M detects which game letter the player has chosen, and if it's the wrong one, the parser puts the lexer in a state without any data rules. This seems to work well, but I'm sure I'll discover a bug as soon as I publish it. Also, this method is not foolproof; it will fail if the sysop changes the game letter. Still, it should prevent a lot of accidental data corruption.

Completing Weapon M's data parser will be a large amount of easy work. I may focus on capturing sector and warp data first, and then begin work on the graphical map.

No comments:

Post a Comment