xNetHack icon indicating copy to clipboard operation
xNetHack copied to clipboard

Fix: correct roomtype of oracle-1

Open RojjaCebolla opened this issue 3 years ago • 10 comments

This is to display delphi in blue, not white, and may have other small side effects (for the better).

RojjaCebolla avatar Oct 01 '21 05:10 RojjaCebolla

Thanks for catching this, but what side effects do you mean?

copperwater avatar Oct 01 '21 17:10 copperwater

But the subroom with the oracle is already "delphi"/DELPHI, not sure if the larger enclosing room should also have that roomtype. The current setup is the way it is in vanilla I think.

https://github.com/copperwater/xNetHack/blob/1e736ab724487b4d4595d3120a956957cdfa0f34/dat/oracle-1.lua#L13

fixuporacle(bones.c) puts the oracle into the DELPHI room when saving bones (if she has been repositioned somehow) so it seems like having two rooms with DELPHI type could mess that up... I guess if the subroom is exactly centered in the large room it may not make a difference, but it seems a little dangerous to me.

The "welcome to Delphi" message would also be given as soon as the hero entered the larger room, rather than upon entering the subroom that actually contains the oracle.

entrez avatar Oct 01 '21 17:10 entrez

Thanks for catching this, but what side effects do you mean?

Ah, was just handwaving at the possibility of other effects in your codebase, effects that would work differently depending on whether it was oracle1 or oracle2/3

RojjaCebolla avatar Oct 01 '21 17:10 RojjaCebolla

The "welcome to Delphi" message would also be given as soon as the hero entered the larger room, rather than upon entering the subroom that actually contains the oracle.

seems like that's not true? maybe you have to be in sight of the oracle? here's results on this branch: image yay it's blue 😁

RojjaCebolla avatar Oct 01 '21 18:10 RojjaCebolla

Oh yeah, you're right, the Oracle must be inside the current room for the message to be given, and I guess being inside a subroom of the current room doesn't count.

It feels like the subroom should be blue already, since its type is already DELPHI. This seems to be not working because the the coloration depends on the walls having a distinct roomno, but the walls of the subroom are SHARED, so getroomtype doesn't work. Did the colored walls patch ever work for the vanilla oracle subroom?

entrez avatar Oct 01 '21 18:10 entrez

Not sure the colored walls patch ever colored Delphi (it's not in my original commit for it). Yeah, if the oracle is in a subroom, that'd be wrong to have the outer room be delphi type, you don't want any odd behavior even if her saying "welcome" is suppressed.

Proper behavior is, I guess, making the subroom in oracle-1 render as blue, not the outer room.

copperwater avatar Oct 01 '21 23:10 copperwater

Another alternative: The inner room's walls could just be lua'd into place as part of the main room instead of being a subroom. Then oracle 1, 2, and 3 would all be the same size.

But at this point it sounds like you want to implement your own solution? Just let me know if there's an edit you're waiting on me to do, so that I can do that edit.

RojjaCebolla avatar Oct 02 '21 16:10 RojjaCebolla

I can't think of a solution to make the inner wall blue without the outer one, so if this accomplishes making the outer wall blue but not the inner and it doesn't mess with the oracle greeting the hero, then it's fine as is. I'll probably merge it after tnnt work.

copperwater avatar Oct 03 '21 13:10 copperwater

update: ring of walls approach not so great. image

               -- Make a square of walls around the Oracle, 2 spaces out (same shape as old subroom)
               local ring = selection.new()
               ring = selection.rect(3,2,7,6)
               -- Remove one wall near the Oracle so she is reachable
               notwall = {  {4,2},{5,2},{6,2},
                            {3,3},{3,4},{3,5},
                            {7,3},{7,4},{7,5},
                            {4,6},{5,6},{6,6} }
               shuffle(notwall)
               ring:set(notwall[1][1], notwall[1][2], 0)
               des.terrain({ selection=ring, typ="-" })

                -- The 4 fountains are adjacent to the Oracle
               des.feature("fountain", 5, 3);
               des.feature("fountain", 4, 4);
               des.feature("fountain", 6, 4);
               des.feature("fountain", 5, 5);
                -- and in the center:
                des.monster("Oracle", 5, 4)

RojjaCebolla avatar Oct 05 '21 04:10 RojjaCebolla

Further findings:

  1. The approach in this PR of changing the larger room to type DELPHI as well misplaces a dislocated Oracle when saving and loading bones, as entrez pointed out. She winds up off-center.
  2. The "ring of walls" approach, while I think it could fix the corner issue by placing an empty doorway instead of leaving it a floor space, makes the Oracle greet you when stepping into the large room - this is fine in oracle-2 and oracle-3, where she's not behind interior walls, but it doesn't make sense in a room where you probably don't have a direct line of sight to her first thing.

copperwater avatar Feb 13 '22 13:02 copperwater