Enner's river

https://attnam.com/topics/Enner-s-river

The Cathedral of Attnam > IVAN Development

#1 Jul 1, 2016, 3:54 am Hide

red_kangaroo

I added a new pull request adding an underground river to enner level.

I remember discussing it somewhere here, I'm not sure where and when. Anyway, enner talks about fishing (if you can survive talking to him) and I think it adds a nice flavour for him to simply be sitting there and peacefully fishing, everyone dying just because he likes to sing. It also makes his level a bit more interesting, as it doesn't differ at all from all other levels exept for its one deadly inhabitant. There is also a striking lack of rivers in Ivan I'd like to address a bit with this change.

Feel free to criticize the necessity and/or implementation of such a change.
#2 Jul 1, 2016, 5:26 am Hide

fejoa

Looks cool red, lots of cunning script tricks used here
I wonder if you could use BoundedRandom to place the room within a certain horizontal band to make it appear randomly in the level? Then you could use another Square BoundedRandom to put the stairs down on the other side of the river room? That way the player would still need to cross the river to get to the other side, but could never be certain just where the river would be.
#3 Jul 1, 2016, 7:16 am Hide

red_kangaroo

Actually, I tried just that before I ended with the downstairs in the room with the river. It didn't work well. :/

The problem is with AttachRequired messing up the dungeon generation. The generator probably doesn't recognize the two staircases as attached if there is a river intersecting the way, thus it resulted in strange corridors being generated over the room with the river. At first, I thought maybe the liquidterrain is not recognized as passable, thus making it impossible for the generator to attach the stairs, however, even with the bridge, as long as there is a room across the whole width of the level, it results in strangeness if the staircases are on different sides of the room. With shorter room, it always generates a tunnel around the room to connect the two staircases. That is also why so many squares with specified OTerrain are there in the script, to ensure no glitches will build a corridor or a wall over the river room.

Without AttachRequired, it works just fine in generating BoundedRandom-ly placed staircases on different sides of the river - I just doesn't attach the staircases to the rest of the dungeon, resulting in impassable level with nearly no tunnels. I guess that's expected.

Anyway, I wasn't able to figure out how to make the randomly placed river work. I'm not exactly happy with fixed place for the downstairs, but in my humble opinion, in works and looks rather good.

If any of you are able to give me some insight into how to make the generator cooperate without ruining my river or placing the stairs in the middle of a wall, I'd much appreciate it.
#4 Jul 1, 2016, 11:13 am Hide

capristo

I love it!

I think that rivers are where IVAN's block graphics style fall a little short.. I wish there were a way to make the edge of the river smoother. Not requesting that right now, just wishful thinking.
#5 Jul 1, 2016, 6:09 pm Hide

Serin-Delaunay

Smooth boundaries between terrain types isn't too difficult. One option is to assemble each tile from four quarters, marching-squares style. With two terrain types this needs one terrain type to be "dominant" over the other - floor graphics intruding on wall tiles or vice versa. I'm not sure how this wouod work with multiple terrain types - it might need them to be ordered.
A more complex option is to use corner Wang tiles. See the Civilization 3 terrain tilesets for an isometric example. Each graphic tile is made of the adjoining corners of four geographic tile, and the display is offset by half a tile in each direction. So similar geographic features might be displayed differently, and the visual boundary between sea and ground could cross the tile boundaries.
The problem with these solutions is the number of tiles needed. With N terrain types and no constraints on terrain placement you would need N^4 corner Wang tiles to cover all possibilities. That number can be decreased by constraining which terrain types can be adjacent.
#6 Jul 2, 2016, 12:55 am Hide

fejoa

red_kangaroo wrote
Actually, I tried just that before I ended with the downstairs in the room with the river. It didn't work well. :/

...

Anyway, I wasn't able to figure out how to make the randomly placed river work. I'm not exactly happy with fixed place for the downstairs, but in my humble opinion, in works and looks rather good.

In the river room script, how about replacing
Square, Pos 8, 0;
{
  OTerrain = stairs(STAIRS_DOWN);
  EntryIndex = STAIRS_DOWN;
}
with
Square, BoundedRandom 1, 1, 9, 32, HAS_NO_OTERRAIN;
{
  OTerrain = stairs(STAIRS_DOWN);
  EntryIndex = STAIRS_DOWN;
}

That way the stairs down generates in a random position inside the room?
#7 Aug 17, 2016, 11:23 am Hide

red_kangaroo

Unfortunately, that would result in the stairs occasionally generating in the middle of the river... I'll have a look if I can come up with something when I have a time, but the dungeon generation code screws with me good.

BTW, thanks to whoever fixed and merged this on Git and sorry for the screwed up indention - I was abroad and couldn't fix it until now.
#8 Aug 18, 2016, 4:11 am Hide

fejoa

red_kangaroo wrote
BTW, thanks to whoever fixed and merged this on Git and sorry for the screwed up indention - I was abroad and couldn't fix it until now.

It was zenith, better known as Emil. I looked at the pull request the other day before it was merged and felt bad that it was still hanging. He picked it up though.

Glad you're back
#9 Aug 18, 2016, 11:52 am Hide

Batman?

Sorry to be late to the discussion, doesn't having enner stay in a fixed location make him easier to defeat? Also if the bridge gets destroyed would the level become impassable without teleportation? If the bridge is destroyed does water fill in the empty space?
#10 Aug 20, 2016, 3:46 am Hide

red_kangaroo

The bridge cannot be destroyed, it's a part of the floor which is indestructible as of now.

Enner should wander around, so it's not exactly in the same place every game. Let's see whether it will make him easier to defeat, because that's not something I was aiming for.
#11 Aug 25, 2016, 4:44 am Hide

fejoa

red_kangaroo wrote
Enner should wander around, so it's not exactly in the same place every game. Let's see whether it will make him easier to defeat, because that's not something I was aiming for.

Say red, what happens if you make Mr. Enner able to swim?

#12 Aug 25, 2016, 11:20 am Hide

Batman?

should swimming be a status you can gain?
#13 Aug 25, 2016, 7:43 pm Hide

4zb4

Enner doesn't swim, his screams are simply powerful enough to part the water so he can walk along the bottom.

Also while I think it would be neat if the player could learn how to swim at some point, that's something you can already accomplish by polymorphing into an amphibian or just bypass entirely by gaining some means of flight.
#14 Aug 26, 2016, 12:53 am Hide

chaostrom

As stated above, the player learning to swim is redundant right now. That said, I can see some potential in letting the player swim if we make underwater levels possible, with diving/surfacing acting as descend/ascend stairs.
#15 Aug 26, 2016, 11:36 am Hide

red_kangaroo

fejoa wrote
Say red, what happens if you make Mr. Enner able to swim?

It's definitely possible to let him swim, he'll catch you slightly faster, taking the straight way rather than walking over the bridge. However, you guys think spawning him in a set place makes him too much of a predictable threat, we might leave the river as is, only make Enner spawn randomly anywhere on the level.

Thoughts?

chaostrom wrote
As stated above, the player learning to swim is redundant right now. That said, I can see some potential in letting the player swim if we make underwater levels possible, with diving/surfacing acting as descend/ascend stairs.

That would be awsome! If we're adding new dungeons in the future, underwater dungeon would definitely be a nice niche.

It would also be nice to have a drowning system rather than instadeath whenever you touch water pool. You could still sink like an anvil if you don't know how to swim, but giving the player eg. End-based number of turns to save himself as he slowly drowns sounds fair.
#16 Aug 26, 2016, 11:47 am Hide

capristo

It definitely shouldn't be instant.

Also, to be realistic, if they are in water that goes above the waist, the player should unequip their weapons while swimming, and hand/foot combat attacks should be much weaker.

I like the thought of having a narrow tunnel to swim through. It leads to an area with some nice valuables, but will you risk getting grabbed by a shark on the way there? Can you distract the shark by throwing some meat at the opposite end of the pool?
#17 Aug 26, 2016, 6:29 pm Hide

Serin-Delaunay

Beowulf fought a bunch of sea monsters, while swimming, in the sea, with a sword. Presumably an IVAN character with nice artificial limbs could do the same. I think an increased strength requirement for all weapons while swimming would make sense.
#18 Aug 26, 2016, 7:16 pm Hide

4zb4

You could make each weapon have different properties underwater.

For example, a spear or dagger would be much easier to use underwater than a scimitar or warhammer.
But then there's the issue of rust... I imagine going underwater is going to coat all of your stuff with water, leading to metal items rusting very quickly. But that could be interesting because it means you'd be encouraged to seek out or SoCM some weapons of non-standard materials for underwater use, such as ceramic blades/spearheads.

As it is swimming creatures should get mild lashings of water on all their bodyparts, but as far as I remember there isn't a single humanoid that can swim so there's no reason for the code to exist.
#19 Aug 27, 2016, 2:25 pm Hide

fejoa

I was pretty sure priests could swim...
#20 Aug 27, 2016, 5:48 pm Hide

4zb4

fejoa wrote
I was pretty sure priests could swim...

Huh! You're right, they've got the swim flag set.
Weird. I guess the priest of Valpurus jumps in the dolphin pool every now and then, and there's plenty of beach around New Attnam for the priestess of Silva.

#21 Aug 27, 2016, 11:59 pm Hide

chaostrom

You know what this means? Do you?!

It means swimming is a divine ability derived from gods.
#22 Aug 29, 2016, 5:29 am Hide

fejoa

Should be able to use a tame priestess of Silva and a saddle to get to Attnam.
#23 Aug 29, 2016, 11:42 am Hide

Batman?

4zb4 wrote
Huh! You're right, they've got the swim flag set.
Weird. I guess the priest of Valpurus jumps in the dolphin pool every now and then, and there's plenty of beach around New Attnam for the priestess of Silva.

Hmmmm if you poly into a priest can you still swim?
#24 Aug 29, 2016, 12:02 pm Hide

Serin-Delaunay

Batman? wrote
Hmmmm if you poly into a priest can you still swim?
Yes. But if you can't levitate then you don't want to revert to your true form while you're swimming!
#25 Aug 29, 2016, 5:06 pm Hide

red_kangaroo

Serin-Delaunay wrote
Yes. But if you can't levitate then you don't want to revert to your true form while you're swimming!

Another reason we need amulet of unchanging.