 |
|
 |
|
Next: Places to play in Johnson City, TN?
|
| Author |
Message |
External

Since: Mar 24, 2005 Posts: 230
|
(Msg. 1) Posted: Thu Apr 20, 2006 6:05 pm
Post subject: stores in [O] [comp] Archived from groups: rec>games>roguelike>angband (more info?)
|
|
|
I ran into a strange thing with the stores in the current comp. I
dove directly [without leaving the stairs] down to, maybe, 850', then
stairscummed my way back to town. Most of the stores had lots of
repeats. E.g. the weapon shop had 3 spears 1d6 in two separate slots,
on different pages. Obviously, things were not sorted as usual.
Anyone else see anything like this?
I wasn't thinking, killed off the char, and overwrote the savefile.
Sorry about that Bahman. At the time, I thought it was some [O]
weirdness rather than a bug.
Eddie >> Stay informed about: stores in [O] [comp] |
|
| Back to top |
|
 |  |
External

Since: Mar 24, 2005 Posts: 230
|
(Msg. 2) Posted: Wed May 03, 2006 9:21 am
Post subject: Re: stores in [O] [comp] [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Bahman Rabii <bahman.RemoveThis@oangband.com> writes:
> Thanks. This has been reported twice now, but I have not been able to
> reproduce it. Very odd.
I looked at the code, and found a possible bug, but I don't think it
is the problem. I am guessing some sort of pointer problem that
overwrote the store counters with random numbers. Then if 5 items got
deleted from the middle from a full store, the last 5 items from
overwriting the store count would be copies of the last 5 legitimate
items.
Anyway, here's what I saw that might be trouble:
In store.c, both home_carry and store_carry have
/* Check existing slots to see if we must "slide" */
for (slot = 0; slot < st_ptr->stock_num; slot++)
{
/* Get that object */
j_ptr = &st_ptr->stock[slot];
/* Objects sort by decreasing type */
if (o_ptr->tval > j_ptr->tval) break;
if (o_ptr->tval < j_ptr->tval) continue;
/* Objects sort by increasing sval */
if (o_ptr->sval < j_ptr->sval) break;
if (o_ptr->sval > j_ptr->sval) continue;
/* Evaluate that slot */
j_value = object_value(j_ptr);
/* Objects sort by decreasing value */
if (value > j_value) break;
if (value < j_value) continue;
}
That's actually pretty dangerous. The store is never sorted. It is
assumed that the items are in sorted order, and works to maintain the
order. The danger is that if things ever get out of order, there is
no re-sort to fix them. It would be better IMO to just add the new
item at the end [if it doesn't merge with an existing item] and
insertionSort. I believe in *guaranteeing* your invariants, even
allowing for the possibility of bugs elsewhere overwriting constant
values like tval or sval, but I digress.
Anyway, it seems that there is a problem with wand stacking. As I
understood it, object_value is usually based on one object, i.e. it
returns the same value for a stack of arrows as for a single arrow.
But for some reason it returns different values for wands/staves with
different numbers of charges. As such, if you have consecutive
entries with the same type of wand because of discounts, buying a wand
could leave the store's list out of order. That could still happen in
rare cases with values depending on the mean number of charges, since
2 wands with 3 charges averaging 1.5 would change to 1 wand with 1 or
2 charges, depending.
I don't see how that could lead to a problem in the alchemist's shop,
so there is probably something else causing trouble. OTOH, the fact
it hasn't been seen in [V] makes me think it might be a wand-stacking
phenomenon since that hasn't been in [V] very long.
Eddie >> Stay informed about: stores in [O] [comp] |
|
| Back to top |
|
 |  |
| Related Topics: | Poll: How much time do you use fo ra win. - Hi all. In "Collected Vanilla wish list" thread I have discussed with Pete and Cliff and then a question raised: How many hours do you usually need for winning the game. Not turns, hours. Real Time. Just playing time, don't count lunchtime....
[Z] arrows of wounding? - I picked up some of these -- arrows of wounding, 3d4, (+1,+3), which struck me as pretty pitiful. Do they have some damage multiplier I know not wot, or are they basically just arrows, +1 to hit, +3 to dam? And if so, what does "of wounding"...
When you really need to kill a lot of monsters... - I have an exception to Cliff's rule of not clearing pits. My current gear, class is NPP rogue. Swap: BoC *Slay Demon*, Acid/Fire brand halberd. Sling of Buckland Barahir(+1) RoSpeed(+8) Elessar [ Heal activation ] Thalkettoth Colannon Anarrion..
[O] shop oddness and some observations - really enjoying the new versoin... recalled back from 700ft...after having drank salt water so weak with hunger. Made it to the general store but...stepped into the doorway and nothing. Wouldnt let me in. I dont have odd options like stores closed or..
Item Choices - what items should one keep and which should one let go ? right now i have a ton of "Resist" and "Sustain" rings in my Home. i also have a DEFENDER broadsword. most often i find myself way down low in the dungeon , all my packslots a... |
|
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|
 |
|
|