Biodiversity patch

View: New views
4 Messages — Rating Filter:   Alert me  

Biodiversity patch

by Bugzilla from enderandrew@gmail.com :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm mostly done manually putting in all the hunks from the
Biodiversity patch, and I'm about to try and compile it for the first
time to see what I've broken, which is probably a lot.  I have two
questions.

There are a few places such as: sys/mac/Files.r

Slash'em is pretty different from vanilla Nethack here, in that all
the various level files aren't in Files.r at all, but rather a
separate Levels.make, except they don't list every level here, only
some of them.  For instance, it has Wiz-strt.lev but not Wiz-loca.lev,
Wiz-goal.lev, Wiz-filb.lev, etc.

The only entry I'm seeing for Gehennom levels is this:

"{LibDir}"valley.lev Ä "{Dat}"gehennom.des "{ObjDir}"LevComp
                "{ObjDir}"LevComp "{Dat}"gehennom.des
                SetFile -t "{FileType}" -c "{FileCreator}" Å.lev
                Move -y Å.lev "{LibDir}"

The Biodiversity patch adds a few new Gehennom levels to show off some
new additional types like sky, though quite frankly, I realize if
there is any chance of the biodiversity patch being accepted, likely
the dungeon changes might not make it in.  Either way, I'm trying to
get the entirety of the patch working to begin with.

>From the patch, these lines are supposed to be added to sys/mac/Files.r

+ read 'File' (1165,"heck-a-1.lev") ":lib:heck-a-1.lev";
+ read 'File' (1166,"heck-a-2.lev") ":lib:heck-a-2.lev";
+ read 'File' (1167,"heck-a-3.lev") ":lib:heck-a-3.lev";
+ read 'File' (1168,"heck-a-4.lev") ":lib:heck-a-4.lev";
+ read 'File' (1169,"heck-a-5.lev") ":lib:heck-a-5.lev";
+ read 'File' (1170,"heck-a-6.lev") ":lib:heck-a-6.lev";
+ read 'File' (1171,"heck-a-7.lev") ":lib:heck-a-7.lev";
+ read 'File' (1172,"heck-b-1.lev") ":lib:heck-b-1.lev";
+ read 'File' (1173,"heck-b-2.lev") ":lib:heck-b-2.lev";
+ read 'File' (1174,"heck-b-3.lev") ":lib:heck-b-3.lev";
+ read 'File' (1175,"heck-b-4.lev") ":lib:heck-b-4.lev";
+ read 'File' (1176,"heck-b-5.lev") ":lib:heck-b-5.lev";
+ read 'File' (1177,"heck-b-6.lev") ":lib:heck-b-6.lev";
+ read 'File' (1178,"heck-b-7.lev") ":lib:heck-b-7.lev";
+ read 'File' (1179,"heck-b-8.lev") ":lib:heck-b-8.lev";
+ read 'File' (1180,"heck-c-1.lev") ":lib:heck-c-1.lev";
+ read 'File' (1181,"heck-c-2.lev") ":lib:heck-c-2.lev";
+ read 'File' (1182,"heck-c-3.lev") ":lib:heck-c-3.lev";
+ read 'File' (1183,"heck-c-4.lev") ":lib:heck-c-4.lev";
+ read 'File' (1184,"heck-c-5.lev") ":lib:heck-c-5.lev";
+ read 'File' (1185,"heck-c-6.lev") ":lib:heck-c-6.lev";
+ read 'File' (1186,"heck-c-7.lev") ":lib:heck-c-7.lev";
+ read 'File' (1187,"heck-c-8.lev") ":lib:heck-c-8.lev";
+ read 'File' (1188,"heck-c-9.lev") ":lib:heck-c-9.lev";
+ read 'File' (1189,"heck-d-1.lev") ":lib:heck-d-1.lev";
+ read 'File' (1190,"heck-d-2.lev") ":lib:heck-d-2.lev";
+ read 'File' (1191,"heck-d-3.lev") ":lib:heck-d-3.lev";
+ read 'File' (1192,"heck-d-4.lev") ":lib:heck-d-4.lev";
+ read 'File' (1193,"heck-d-5.lev") ":lib:heck-d-5.lev";
+ read 'File' (1194,"heck-d-6.lev") ":lib:heck-d-6.lev";
+ read 'File' (1195,"heck-d-7.lev") ":lib:heck-d-7.lev";
+ read 'File' (1196,"heck-d-8.lev") ":lib:heck-d-8.lev";
+ read 'File' (1197,"heck-d-9.lev") ":lib:heck-d-9.lev";
+ read 'File' (1198,"heck-e-1.lev") ":lib:heck-e-1.lev";
+ read 'File' (1199,"heck-e-2.lev") ":lib:heck-e-2.lev";
+ read 'File' (1200,"heck-e-3.lev") ":lib:heck-e-3.lev";
+ read 'File' (1201,"heck-e-4.lev") ":lib:heck-e-4.lev";
+ read 'File' (1202,"heck-e-5.lev") ":lib:heck-e-5.lev";
+ read 'File' (1203,"heck-e-6.lev") ":lib:heck-e-6.lev";
+ read 'File' (1204,"heck-e-7.lev") ":lib:heck-e-7.lev";
+ read 'File' (1205,"heck-e-8.lev") ":lib:heck-e-8.lev";
+ read 'File' (1206,"heck-e-9.lev") ":lib:heck-e-9.lev";

What changes if any do I need to make to Levels.make?  Do I do the following:

"{LibDir}"heck-a-1.lev Ä "{Dat}"gehennom.des "{ObjDir}"LevComp
                "{ObjDir}"LevComp "{Dat}"gehennom.des
                SetFile -t "{FileType}" -c "{FileCreator}" Å.lev
                Move -y Å.lev "{LibDir}"

Lather, rinse, repeat, or do I not make these additions at all?

Secondly, this is a pretty stupid/basic question, but at work I'm on a
Windows box, and I'm using Mingw.  I'm used to a Linux box where I can
select various options at configure time.  The biodiversity patch has
plenty of compile-time options, but the build instructions for
Windows/Mingw just says to run setup.bat and then make.  How do I turn
on/off these compile-time options?

-- T. J. Brumfield
"In the beginning the Universe was created. This has made a lot of
people very angry and been widely regarded as a bad move."
--Douglas Adams
"Nihilism makes me smile."
--Christopher Quick

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Slashem-devel mailing list
Slashem-devel@...
https://lists.sourceforge.net/lists/listinfo/slashem-devel

Parent Message unknown Re: Biodiversity patch

by xkernigh :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

T. J. Brumfield wrote:
> There are a few places such as: sys/mac/Files.r

sys/mac contains the Mac OS Classic port. I stopped using Mac OS
Classic about four years ago. Without reading documentation for the
Macintosh Programmer's Workshop or MPW, I will have to guess what .r or
.make files might do. MPW has a home page at
http://developer.apple.com/tools/mpw-tools/

Maybe someone else on the mailing list knows more than I do...

(quote from Levels.make)
> "{LibDir}"valley.lev    Ä "{Dat}"gehennom.des "{ObjDir}"LevComp
>        "{ObjDir}"LevComp "{Dat}"gehennom.des
>        SetFile -t "{FileType}" -c "{FileCreator}" Å.lev
>        Move -y Å.lev "{LibDir}"

I guess that this is a makefile rule for MPW. This rule seems to make
the valley.lev file using gehennom.des and LevComp as dependencies.
Because it runs LevComp, it should also make the other .lev files that
use gehennom.des as the source.

This file looks less weird if you open a UTF-8 terminal and use GNU
iconv to convert it from MacRoman to UTF-8.

$ iconv -f MAC -t UTF-8 Levels.make | less

> "{LibDir}"valley.lev    ƒ "{Dat}"gehennom.des "{ObjDir}"LevComp
>                 "{ObjDir}"LevComp "{Dat}"gehennom.des
>                 SetFile -t "{FileType}" -c "{FileCreator}" ≈.lev
>                 Move -y ≈.lev "{LibDir}"

I guess that ƒ means 'from' and ≈.lev is like *.lev in Unix. The three
commands here run LevComp, set some Mac file attributes, and move any
and all .lev files to {LibDir}.

> From the patch, these lines are supposed to be added to
sys/mac/Files.r
> + read 'File' (1165,"heck-a-1.lev") ":lib:heck-a-1.lev";
> + read 'File' (1166,"heck-a-2.lev") ":lib:heck-a-2.lev";
> ...
> + read 'File' (1205,"heck-e-8.lev") ":lib:heck-e-8.lev";
> + read 'File' (1206,"heck-e-9.lev") ":lib:heck-e-9.lev";

Files.r seems to be a resources file. 'File' is a four-letter resource
type, the numbers 1165..1206 are resource ids. This tells the resource
compiler to copy those .lev files into the resource fork of a Mac
application.

As you said, SLASH'EM is different from NetHack because it does not
list the .lev files in Files.r. However, it still needs to copy the
.lev files to the resource fork somehow. Fortunately, SLASH'EM seems to
take care of this automatically. In Macintosh.make I found this rule:

> "{LibDir}"Levels.r ƒ Levels
>         Set Pwd `Directory`
>         Directory "{LibDir}"
>         Echo "" > "{LibDir}"Levels.r
>         Set index 1200
>         For file in ≈.lev
>                 Echo "read 'File' ({index},∂"{file}∂")
∂"::lib:{file}∂";" >> "{LibDir}"Levels.r
>                 Set index `Evaluate {index} + 1`
>         End
>         Echo "" >> "{LibDir}"Levels.list
>         Directory "{Pwd}"

This seems to generate a Levels.r file with all the .lev files from
{LibDir}. So you would not add any lines to Files.r, because this rule
automatically notices any new .lev files.

> What changes if any do I need to make to Levels.make?  Do I do the
following:

> "{LibDir}"heck-a-1.lev  Ä "{Dat}"gehennom.des "{ObjDir}"LevComp
>         "{ObjDir}"LevComp "{Dat}"gehennom.des
>         SetFile -t "{FileType}" -c "{FileCreator}" Å.lev
>         Move -y Å.lev "{LibDir}"

No, you would not add this, because the rule for valley.lev will
generate heck-a-1.lev too.

I could be wrong. I do not have a Mac OS Classic machine. I have a Mac
OS X machine, but without the Classic emulator, so I cannot run MPW. I
am writing this email from an OpenBSD machine.

> Secondly, this is a pretty stupid/basic question, but at work I'm on a
> Windows box, and I'm using Mingw.  I'm used to a Linux box where I can
> select various options at configure time.  The biodiversity patch has
> plenty of compile-time options, but the build instructions for
> Windows/Mingw just says to run setup.bat and then make.  How do I turn
> on/off these compile-time options?

Edit the include/config.h file. This is the normal way to configure
SLASH'EM if you are not using the configure script.

--Kernigh http://nethack.wikia.com/wiki/User:Kernigh



________________________________________________________________________
Check Out the new free AIM(R) Mail -- Unlimited storage and
industry-leading spam and email virus protection.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Slashem-devel mailing list
Slashem-devel@...
https://lists.sourceforge.net/lists/listinfo/slashem-devel

Re: Biodiversity patch

by Bugzilla from enderandrew@gmail.com :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 9/18/07, xkernigh@... <xkernigh@...> wrote:
> Because it runs LevComp, it should also make the other .lev files that
> use gehennom.des as the source.

Outstanding.  That's what I needed to know.

> Edit the include/config.h file. This is the normal way to configure
> SLASH'EM if you are not using the configure script.

That's what I ended up doing, but I wasn't sure it was right.

I also compiled the vanilla slash'em without the patch to see what
compile warnings I'd get, so I can see which errors I'm causing (which
I'm sure will be a few) and I got three compile warnings, two of which
I was able to fix.  I should make a separate patch for that tiny fix
and submit it.

I also can't seem to fix the third, which is frustrating me.

Oh well, my knowledge of C is minuscule at best, I just started
reading a book, and I'm not even all the way through it.  However, the
first warning I got with the biodiversity patch wasn't a proper
compiler warning, and I didn't recognize the error code.  Eventually I
grepped for the error, and found the spot in code that spits out that
specific error "prob error class foo", and started digging and
realizing that the probabilities for a certain object class weren't
adding up correctly, and it is the spellbook class.  There is only one
item in that class added by the patch, so hopefully I can fix that on
my own.  I imagine that attempting to fix these things will teach me a
few things about the Slash'em source, but my main concern is that I
won't be able to fix all the bugs properly myself.

I'm going to get as far as I can, and then share the patch and let
people see the monstrosity I've attempted to port over.

Oh, I do have another fairly big/important question.

win/share/monsters.txt and win/share/objects.txt

The patch wanted to take a tile number associated with an existing
item and/or monster, and add the new items in, duplicating tile
numbers.  Obviously all of the numbers were off since the patch was
for slash'em.  I saw three possible ways to handle this.

1 - Do exactly what the patch wants.  The sphinx monster should share
a tile number with a tiger for instance, but nothing else shares tile
numbers, and this just seems both lazy and incorrect.

2 - Add everything to the end, which is quick, and easy for anyone to
see the new stuff, and give each item a unique consecutive number like
everything else.

3 - This seems the most correct, but no doubt will be VERY time
consuming, and will make the patch HUGE.  Put the new items with their
groups, so the sphinx will go after the tiger, and then renumber every
tile.

Thank you so much for your help.  I understand these are basic
questions, and I could probably answer the above question on my own by
digging through the code enough, but my main concern tonight is to
spend some time and try to get this puppy to even compile first.  I
also figured that even if I found the code that parsed
win/share/monsters.txt, it wouldn't necessarily answer what was best
to do.  I imagine in practice, any of the above three might work, but
three is best solution in the long run, while options 2 and 3 also
mean more work for adapting graphical tiles for the game to account
for the new monsters/objects.

-- T. J. Brumfield
"In the beginning the Universe was created. This has made a lot of
people very angry and been widely regarded as a bad move."
--Douglas Adams
"Nihilism makes me smile."
--Christopher Quick

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Slashem-devel mailing list
Slashem-devel@...
https://lists.sourceforge.net/lists/listinfo/slashem-devel

Parent Message unknown Re: Biodiversity patch

by Bugzilla from enderandrew@gmail.com :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> Lazy, gives warnings on compile, works fine.  Expected method for
> patches. :-)

I guess this is how I will leave it then for the patch.

> Not time consuming by tile.doc hints, but patch size is prohibitive.
> Correct method for release versions.

The patch is already going to be huge.  The original patch was like
900k, and that would add almost another 800k I figure to basically
erase, and re-do objects.txt and monsters.txt

Of course, smaller, fine-grained patches are no doubt superior, but I
started with that huge patch, and I could have attempted to rewrite it
piece by piece to make smaller patches, but I barely know what I'm
doing as is.  So unfortunately, I'm taking a huge patch, and
converting it to another huge patch.

I feel pretty stupid now for asking, since tile.doc did in fact
include everything I needed to know.

I haven't had much time to work on this (a few hours a day the past
few days) and I cleared up a whole slew of compile warnings and
errors, but last night I already encountered the first I couldn't fix.
 It keeps telling me something isn't declared, when I'm pretty
positive it is.  I kept butting my head into a wall over something
stupid, eventually stepped aside, hit make -k and looked for the next
error to fix instead.

I'm still going to try and fix as much as possible by myself, but I'm
thinking there is a good chance the first version of the patch won't
compile without some fixing.

I'm going to be excessively busy for the better part of next week
training for my new job amongst other things, so tonight I will put a
few more hours into this, and then likely upload the first version of
this patch, errors and all.  It should be enough to look at, though I
suppose for concept, you could just as well look at the original
biodiversity patch as well.  I've done my best to convert it to
Slash'em, and the only major changes I've made so far is tweak the
dragons, rename the wyvern to a zilant, and rename the brownie to a
boggart.  Biodiversity added both those monsters to nethack, but
Slash'em already has monsters by both those names, so I changed the
biodiversity versions to different names.  Biodiversity also tried to
make each dragon a bit unique, and I just continued that, renaming the
deep and shimmering dragons as well, as well as tweaking each dragon
just a bit to make each a little unique.

Once again, thanks to everyone for your help.

-- T. J. Brumfield
"In the beginning the Universe was created. This has made a lot of
people very angry and been widely regarded as a bad move."
--Douglas Adams
"Nihilism makes me smile."
--Christopher Quick

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Slashem-devel mailing list
Slashem-devel@...
https://lists.sourceforge.net/lists/listinfo/slashem-devel