Source editing: removing items

G

Guest

Guest
Archived from groups: rec.games.roguelike.nethack (More info?)

I've been looking for instructions on how to remove items from the
game; in this case, worthless glass. I don't want to increase the
number of valuable gems generated, however. Can anyone give me some
info or direct me to instructions on the subject?
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.nethack (More info?)

taramnos@gmail.com wrote:

> I've been looking for instructions on how to remove items from the
> game; in this case, worthless glass. I don't want to increase the
> number of valuable gems generated, however. Can anyone give me some
> info or direct me to instructions on the subject?

You mean you want to remove them from a particular game while you're playing
it (a cursed bag of holding springs to mind in this case), or you don't
want them to be generated in the first place? (if the latter, I don't know
the answer and I'm too lazy to look at the source code. Why would you want
to do this, btw?)

--
Benjamin Lewis

A small, but vocal, contingent even argues that tin is superior, but they
are held by most to be the lunatic fringe of Foil Deflector Beanie science.
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.nethack (More info?)

"Taramnos" <taramnos@gmail.com> wrote:
>I've been looking for instructions on how to remove items from the
>game; in this case, worthless glass. I don't want to increase the
>number of valuable gems generated, however. Can anyone give me some
>info or direct me to instructions on the subject?

Um. There are some problems with this idea. First, this releases 591
points of item probability in the gem category; since you don't want to
make valuable gems more common, this means that all that extra
probability has to be given to flint stones and rocks. (luckstones,
loadstones, and touchstones are all highly (un)desirable things that
shouldn't really be made more common). You'll see a *lot* of
flint and rocks in your variant.

There's also a trivial change to make_corpse() in mon.c, to deal with
the fact that glass golems no longer have anything to leave behind (I
suppose you could leave the glass gems in with generation probability
zero).

Furthermore, if you delete the glass gems entirely, you have to edit the
level definitions for minend-1 to remove the explicitly generated
worthless glass, remove a no-longer-useful special case from readobjnam()
in objnam.c, remove some stuff from get_cost() in shk.c, knock out some
code in end.c, ...

Oh, and in fact, you have rather more work to do; giants are generated
with a mixture of valuable gems and glass; if you delete the glass gems,
they will have only valuable gems.

Also, in a dungeon with no glass gems, it's much easier to use unicorns
to max your luck, because there's no glass to pad out the real gems.

In short: Nice idea, but ultimately misguided.
--
Martin Read - my opinions are my own. share them if you wish.
My roguelike games page (including my BSD-licenced roguelike) can be found at:
http://www.chiark.greenend.org.uk/~mpread/roguelikes.html
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.nethack (More info?)

Benjamin Lewis <bclewis@cs.sfu.ca> writes:
> taramnos@gmail.com wrote:
>
> > I've been looking for instructions on how to remove items from the
> > game; in this case, worthless glass. I don't want to increase the
> > number of valuable gems generated, however. Can anyone give me some
> > info or direct me to instructions on the subject?
>
> You mean you want to remove them from a particular game while you're playing
> it (a cursed bag of holding springs to mind in this case), or you don't
> want them to be generated in the first place? (if the latter, I don't know
> the answer and I'm too lazy to look at the source code. Why would you want
> to do this, btw?)

It's easy enough to do in theory (just comment them out in objects.c),
but you'd need to decide what you wanted to be generated in their
place; if not valuable gems, then _something_, and set probabilities
accordingly. Getting the game to generate nothing when it otherwise
would have generated worthless glass would be hard.

(There'd also be a certain amount of tidying up to do: what to drop
from glass golems, in particular, and what you get if you wish for
"glass". Some code would become redundant (eg, what happens when glass
is thrown to unicorns), but that won't cause problems.)

--
: Dylan O'Donnell http://www.spod-central.org/~psmith/ :
: "Nothing matters very much, and few things matter at all." :
: -- A.J. Balfour :
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.nethack (More info?)

Taramnos wrote:
> I've been looking for instructions on how to remove items from the
> game; in this case, worthless glass. I don't want to increase the
> number of valuable gems generated, however. Can anyone give me some
> info or direct me to instructions on the subject?

(Heh, most people want to add objects.)

Just a few hints, surely incomplete...

objects.c:
See the entries for GEM(...) and ROCK(...).
Remove the "worthless piece of ... glass" entries.
Adjust the probabilities of the other GEM's and ROCK's. The probabilities
are the 3rd (for GEM's) and 4th (for ROCK's); they must add to 1000.
(Note that you now will have more precious gems or rocks generated, so you
must adjust also the gem-class probabilities... see below.)

mkobj.c:
Find the data: const struct icp mkobjprobs[].
The first element is the probability of the class.
Adjust the probability of the GEM_CLASS so that the overall sum remains 100.
There are some other probability tables (e.g. for generation rate in hell);
adjust the GEM_CLASS entries in these tables accordingly.

There are some more subtle things to consider, code that depends on 9 glass
gem items following the precious gems, e.g. (likely there are more):

mon.c:
case PM_GLASS_GOLEM:
num = d(2,4); /* very low chance of creating all glass gems */
while (num--)
obj = mksobj_at((LAST_GEM + rnd(9)), x, y, TRUE, FALSE);
mtmp->mnamelth = 0;
break;

mthrowu.c:
singleobj->otyp <= LAST_GEM+9 /* 9 glass colors */

objnam.c:
typ = LAST_GEM + rnd(9);

In one word you will have to look/search through the code to find all these
locations. There are hard coded dependencies.

Janis
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.nethack (More info?)

Janis Papanagnou <Janis_Papanagnou@hotmail.com> writes:
> objects.c:
> See the entries for GEM(...) and ROCK(...).
> Remove the "worthless piece of ... glass" entries.
> Adjust the probabilities of the other GEM's and ROCK's. The probabilities
> are the 3rd (for GEM's) and 4th (for ROCK's); they must add to 1000.

True as far as it goes, but note that valuable gems are a special
case: for them, the defined oc_prob does _not_ get used as the
individual probability permillage. Instead, it gets reset according to
dungeon depth by setgemprobs() in o_init.c every time a new level is
created. See gems-343.txt for a discussion.

--
: Dylan O'Donnell http://www.spod-central.org/~psmith/ :
: "Nothing matters very much, and few things matter at all." :
: -- A.J. Balfour :
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.nethack,misc.misc (More info?)

"Taramnos" <taramnos@gmail.com> wrote:

> I've been looking for instructions on how to
> remove items from the game; in this case,
> worthless glass. I don't want to increase the
> number of valuable gems generated, however. Can
> anyone give me some info or direct me to
> instructions on the subject?

The short answer is: it's really difficult,
"worthless glass" is very much embedded into the
thinking that created NetHack, and thus into the
code.

The wise answer is: don't do this. It makes the game
so much easier to know that all gems will be
acceptable to unicorns, all gems are worth an ID
before selling to shopkeepers, that no one will give
you any credit for ascending.

Beside, worthless glass isn't worthless, it makes
great curse catchers.

xanthian.




--
Posted via Mailgate.ORG Server - http://www.Mailgate.ORG
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.nethack (More info?)

Janis Papanagnou wrote:
> dogscoff@eudoramail.com wrote:
> > Martin Read wrote:
> >>In short: Nice idea, but ultimately misguided.
> > I have to say that I find this comment- and others like it
throughout
> > this thread (I'm not just pickingin you MR)- a little harsh.
> "Misguided" has several flavours (in my non-nativ-EN-speaking
opinion).
>
> I've read Martin's "misguided" in the sense of "misdirected" - not as
> "foolish" or so. So I do not find it harsh. What Martin's intention
> was can therefore only be derived by context.

Well yes, but in either of your interpretations, the meaning is that
there's something "wrong" with the proposed code changes. I would put
forward that *any* attempt to mod the code is good, whatever the play
balance implications, since it will ultimately result in more
code-literate nethackers.

>As I know him, he was not talking to offend. Kent's comment was also a
>friendly suggestion.

Oh, I agree totally, please don't misunderstand that. I'm not
suggesting anyone is trying to offend, just that the comments might be
a little discouraging to someone trying to break into nethack
source-modding.
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.nethack,misc.misc (More info?)

dogsc...@eudoramail.com wrote:

> it's also worth remembering that the OP's opinion
> is as valid as anyone else's

Ummm, let's just say the concept that all opinions
have equal validity isn't universally shared:

Excuse me.
You're not entitled to your opinion.
I copyrighted all of
the stupidest opinions in the universe,
so they can never again be uttered.
-- Dogbert, courtesy of Scott Adams,
in "Dilbert" 20050322

xanthian.
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.nethack (More info?)

Janis Papanagnou <Janis_Papanagnou@hotmail.com> wrote:
> Taramnos wrote:
>> I've been looking for instructions on how to remove items from the
>> game; in this case, worthless glass. I don't want to increase the
>> number of valuable gems generated, however. Can anyone give me some
>> info or direct me to instructions on the subject?
>
> (Heh, most people want to add objects.)
>
> Just a few hints, surely incomplete...
>
> objects.c:
> See the entries for GEM(...) and ROCK(...).
> Remove the "worthless piece of ... glass" entries.

As a suggestion, you could just add a touchstone to everyone's starting
inventory. It's better overall -- it outright identifies the gems and
makes them saleable, rather than just making it so you have to use ?oID
or the like first.

OTOH, it's way easier to implement.


Keith
--
Keith Davies "English is not a language. English is a
keith.davies@kjdavies.org bad habit shared between Norman invaders
keith.davies@gmail.com and Saxon barmaids!"
http://www.kjdavies.org/ -- Frog, IRC, 2005/01/13
 
G

Guest

Guest
Archived from groups: rec.games.roguelike.nethack (More info?)

Janis Papanagnou wrote:
>
> [How to remove glass from the game?]
>
> objects.c:
> Remove the "worthless piece of ... glass" entries.

As a side effect, this breaks file compatibility. If the
original poster doesn't use Hearse, that should be fine: he just
has to finish any games in progress before he moves to his new
version.


--
Rob Ellwood