Archived from groups: rec.games.roguelike.nethack (
More info?)
Alexis wrote:
> andykerr@SPAMGUARD.blueyonder.co.uk wrote:
>
>>YANI - standard bones file format across platforms. Surely such a thing
>>has been discussed before?
>
>
> Many, many times. But those sort of discussions never seem to result in
> anything getting done. Which is a pity because it *is* a good idea,
> just a shedload of work.
>
> Take something like Hearse, which is pretty straightforward - searching
> Google, I found discussions of a 'bones file exchanger' back in 1995.
> It was probably discussed before that as well, but I wasn't interested
> enough to spend hours looking into it.
>
> Seems that there's lots of good ideas out there which everyone thinks
> someone else should code
I was working on it but then I stubled into a problem that no-one seemd
to know what was the cause so I've stopped working on it.
But to recap:
I have made a program that takes the native bones format and translates
it to a 8-bit proprietary coded format. Or takes the proprietary coded
format and translates it back to the native bones format.
The problem lies on the look of the dungeon.
Now in rm.h the structure rm is defined. This structure is what holds
all the information on a coordination position on the map of nethack and
it is:
*
* The structure describing a coordinate position.
* Before adding fields, remember that this will significantly affect
* the size of temporary files and save files.
*/
struct rm {
int glyph; /* what the hero thinks is there */
schar typ; /* what is really there */
uchar seenv; /* seen vector */
Bitfield(flags,5); /* extra information for typ */
Bitfield(horizontal,1); /* wall/door/etc is horiz. (more typ info) */
Bitfield(lit,1); /* speed hack for lit rooms */
Bitfield(waslit,1); /* remember if a location was lit */
Bitfield(roomno,6); /* room # for special rooms */
Bitfield(edge,1); /* marks boundaries for special rooms*/
};
Now the bones saving code before it saves the map does the following:
/* Clear all memory from the level. */
for(x=0; x<COLNO; x++) for(y=0; y<ROWNO; y++) {
levl[x][y].seenv = 0;
levl[x][y].waslit = 0;
levl[x][y].glyph = cmap_to_glyph(S_stone);
}
So when the level information is saved every seenv and waslit are 0 and
every glyph is stone. My translator program doesn't save this info into
the proprietary format but the retranslation restores the cleared
information to the rm structures before saving the native code format.
The other fields:
schar typ; /* what is really there */
Bitfield(flags,5); /* extra information for typ */
Bitfield(horizontal,1); /* wall/door/etc is horiz. (more typ info) */
Bitfield(lit,1); /* speed hack for lit rooms */
Bitfield(roomno,6); /* room # for special rooms */
Bitfield(edge,1); /* marks boundaries for special rooms*/
are converted to unsigned chars by copying so schar -127 will become 255
before saved into the proprietary format file. Upon retranslation they
are read as unsigned chars and cast to the proper format.
The problem is that when the retranslated bones file is read in then no
left and bottom room walls are shown unless you see them from the other
side and the (cannot remember which way it was but either or) the
downstairs looks like upstairs (or vice verse cannot remember).
Everything works alright but doesn't look good.
If somebody can shed some light to this issue I'd certainly open up that
project.
Topi
P.S. I've actually succeeded to translate bones files to the itermediate
format and back even though they've got very problematic object <->
monster combinations. A monster is carrying a statue of the quest leader
that had when stoned a robe (or whatever).
Same
--
"The whole problem with the world is that fools and fanatics are
always so certain of themselves, but wiser people so full of doubts."
- Bertrand Russell
"How come he didn't put 'I think' at the end of it?" - Anonymous