My acronym decryption skills must be dwindling...
Yo Mama's Mental Violation ?
Preserve mode
Collapse
X
-
Given that Takkaria is spending years focused on taking out bad code to replace it with better code, I think a "first do no harm" policy is in order. If you aren't willing to do it right, IMO you should leave it on the todo list until someone is.
Each time you do it right, you make it easier for the next person to do it right. Each time you do it wrong, you make it harder [or at least less likely] for the next person to do it right. That's why I'm harping on this so much.
Hopefully, patches are coming very soon.Leave a comment:
-
It's not about what you record, but how you record it and access it. The property of whether an artifact can be created in the future ought to be stored in a data structure referenced by the artifact. When deciding whether to create an artifact, looping through the object list is a mistake, even if it happens to work.I just thought of a possible problem with your method. Destruction now causes artifacts to be lost. Is the code currently set up so that your solution works with that? I don't know. If things were done properly, I would know that it works. You could hack the destruction or deletion code, but that's just a sign things were implemented incorrectly in the first place.Anyway, I was trying to be helpful by giving advice. It was not my goal to get on your nerves. I'll stop bothering you now. Well, I'll keep bothering you, but not about this.Leave a comment:
-
It's not about what you record, but how you record it and access it. The property of whether an artifact can be created in the future ought to be stored in a data structure referenced by the artifact. When deciding whether to create an artifact, looping through the object list is a mistake, even if it happens to work.
I just thought of a possible problem with your method. Destruction now causes artifacts to be lost. Is the code currently set up so that your solution works with that? I don't know. If things were done properly, I would know that it works. You could hack the destruction or deletion code, but that's just a sign things were implemented incorrectly in the first place.
Anyway, I was trying to be helpful by giving advice. It was not my goal to get on your nerves. I'll stop bothering you now. Well, I'll keep bothering you, but not about this.Leave a comment:
-
The old code required looping through all objects to check if the artifact is present, when deciding whether to allow an artifact to be created. I don't know if that has been changed, but the obvious method is an array of what not to create on the current level. Once you are doing that, it is natural to go to the two array approach.
I stand by the principle that you shouldn't write even a single line of code that you know will not extend, and that goes triple when the extension seems likely. YMMV.
EDIT:
Ok, I think I finally worked out why you are talking about object creation. As usual we are at completely cross purposes, and you have taken this as a basis for disagreement. Though I have to say in this case I do actually disagree (if I have understood you correctly - the phrase "check if the artifact is present" seems imprecise if I have).
I think you are saying that instead of checking for artifact->created at creation time, you should check both artifact->can_be_created_at_all and artifact->can_be_created_on_this_level, i.e. two separate bools. The second would be set to FALSE once an artifact is generated in a monster inventory, and the first would be set once it hits the floor (if preserve is off), or once it is known.
This seems to me a lot like "recording whether an object has ever been on the floor", albeit only for artifacts. I disagree that it is necessary to implement this now - that would be taking the "you know will not extend" principle to an absurd extreme. We know that we may one day use rune-based ID, yet there are ten dozen things we have changed without making them extensible for that.Last edited by Magnate; May 8, 2011, 08:40.Leave a comment:
-
Initial state of the artifact doesn't matter in either case, except for creating level feeling. If there is a artifact in level, monster carrying or not, it should trigger special feeling in preserve off just in case.Leave a comment:
-
It is true that this change will make preserve off less challenging if monsters can pick up unIDd artifacts from the floor, because those artifacts will be preserved when they should be lost - but I'm content to require an additional fix for that if such a change is made to monster pickup. It would require recording whether an object has ever been on the floor, and that seems a pointless thing to add before it is required.
The old code required looping through all objects to check if the artifact is present, when deciding whether to allow an artifact to be created. I don't know if that has been changed, but the obvious method is an array of what not to create on the current level. Once you are doing that, it is natural to go to the two array approach.
I stand by the principle that you shouldn't write even a single line of code that you know will not extend, and that goes triple when the extension seems likely. YMMV.Leave a comment:
-
Well, I might argue that instead, preserve mode off should be eliminated as an option.
But if that's not going to happen, I think the proposed solution would be fine. If monsters are allowed to pickup artifacts in the future, that bridge can be crossed at a later date.Leave a comment:
-
I have no interest in preserve off, so the behaviour does not matter to me, but I want to point out that some time in the future some maintainer may decide that monsters capable of dropping artifacts should be capable of picking them up. I don't think you should write a solution that depends upon no pickup.
It's one thing to leave code alone because it works for now. It's another to write new code with the same problems.
The whole loop through objects on level change is inelegant. Would it be any more work to maintain two arrays, do_not_create_artifact_again_on_this_level[] and do_not_create_artifact_again[]? Set the second on item creation for preserve on, and set the second only when an item hits the floor for preserve off.
All I'm doing is making the behaviour of preserve off the same as it was before monsters carried their drops. It is true that this change will make preserve off less challenging if monsters can pick up unIDd artifacts from the floor, because those artifacts will be preserved when they should be lost - but I'm content to require an additional fix for that if such a change is made to monster pickup. It would require recording whether an object has ever been on the floor, and that seems a pointless thing to add before it is required.Leave a comment:
-
My suggestion is that artifacts carried by monsters should be preserved even if preserve is off. Since monsters cannot pick up artifacts from the floor, this will only apply to the drops generated at monster creation time, and will therefore bring us back to exactly the previous behaviour of preserve off.
Anyone want to argue for a different behaviour?
It's one thing to leave code alone because it works for now. It's another to write new code with the same problems.
The whole loop through objects on level change is inelegant. Would it be any more work to maintain two arrays, do_not_create_artifact_again_on_this_level[] and do_not_create_artifact_again[]? Set the second on item creation for preserve on, and set the second only when an item hits the floor for preserve off.Leave a comment:
-
Yes, but because of the bug there never were lost artifacts, so you never knew if you just got lucky and didn't lose an artifact. That prevented you from noticing the bug.Leave a comment:
-
Before 3.1.x that's true, but since then lost artifacts should show up in the knowledge menus after fleeing a special level.Leave a comment:
-
Leave a comment:
-
Ok, so the latest autobuild development version (formerly known as "nightly") effectively breaks Preserve-off mode, since artifacts generated as monster drops will be lost if the player leaves the level.
This is only an issue for people playing with Preserve off, and given that nobody noticed the previous bug with it for over two years, we can conclude that this is a very small proportion of people.
There was other bug with "8" -block vaults that didn't force them to have excellent items, and I knew it, so I didn't even expect to see artifacts in vaults.Leave a comment:
-
That solution sounds good to me.
How would artifacts carried by monsters affect level feelings?Leave a comment:
Leave a comment: