Saturday, August 27, 2011

Water, acid, blood and lava in JADE

The next version of JADE will have yet another feature that never existed in ADOM (and would be quite hard to code): liquids that move around the map.
The liquids currently (almost - more of that below) implemented are water, acid, blood and lava. Each of these liquids flows around the map if produced in larger quantities. Next I'm going to add fountains producing the liquid in predefined time intervals. This allows for interesting things like lava fountains that will flood a level and impose time limits on the player or the risk to slowly drown. Acid traps on doors will not just harm the player but might create a dangerous puddle of acid harmful for anyone moving through it. The possibilities are endless.

Also interesting is that there will be artificial means to create such fountains. Currently I am thinking of elemental gems that can be imbued with power points. When activated they will create an elemental fountain that produces the element in question. For how long and with what intensity will depend on the number of power points used to imbue the gem.

Additional I envision locations sometimes to be attuned to the elements (e.g. a dungeon close to a volcano has a high likelihood of being attuned to elemental fire, a dungeon close to the ocean to water, etc.). When the PC starts mining walls he might discover such elemental gems in attuned dungeons.

What's the overarching theme behind this? Interesting tactical possibilities arise for the PC who might use a lava fountain to endanger larger number of opponents, etc. I'm sure that folks will come up with creative ideas.

I still have quite a bit of work ahead of me though:
  • Elemental gems currently are missing as well as attunement for locations.
  • Elemental fountains are missing.
  • Monsters still need to avoid dangerous liquids.
  • Damage effects are still missing.
The first three points are rather simple to add, just a bit of work. The last one is more difficult as the height of the liquid has special effects during the game. Just imagine acid that is but 2 inches in height: bad for your boots, bad for your feet but not deadly right out. Then imagine 100 inches of acid... *ouch* And then consider that hurthlings are much smaller than trolls and thus will face much higher risks than trolls right away.

Finally there probably will be interesting effects when liquids collide... e.g. masses of water might turn lava into walls, etc.

Below you find a screenshot showing water on the ground:


  1. It would be cool if water might have a slight change of being cursed/blessed, so you happen to fall into a cursed spring and everything your wearing gets cursed that would be fun. Or dip a few of you items into a blessed spring to give them a little boost. I don't know if that would throw of the balance of the game to much... But it would be cool ;)

  2. I love the idea, and to add an idea/add injury to awesome; just imagine Zapping your epic digging spell to find two(!) Lava Gems and A GIGANTIC ROOM OF LAVA THAT STARTS POURING ALL OVER THE LEVEL :O

    Of course, if you happen to somehow be immune to lava then you could swim into that room, dive down and search for gems in the lava itself. Also, of course, if you manage to create enough water you can make lava into Obsidian, which you can, of course, mine and make awesome gear from.

    From the acid you could fall into it and become like Two-Face*.

    *Does not confer bonuses.

  3. I must remember to keep an eye out for some Eternium Waders of Insulation, then....

  4. Yes, this is fantastic! Making dungeons more likely to be fire-aligned if near a volcano and so on is a fantastic idea to really make the world 'feel' more unique. I also think the way water and depth is shown in the screenshots looks good too.

    It would be really exciting to have to do an objective in a dungeon that is slowly filling with water. I'm not sure how this would be done though, I can imagine the dungeon already being flooded by the time the PC gets around to doing it.

    Sounds like it's quite complex to code, but keep at it!

    You probably don't want to spend too much time on liquids this update, but I would also like to see:

    Mud - Fairly safe, only gives you movement penalties for walking, mudmen/mudsnakes are faster/more dangerous, and items are more difficult to find/pick up. A smart archer might use an elemental gem to flood the corridor in front of him with mud.

    Quicksand - Standing in the same spot becomes cumulatively more and more dangerous, and a smart PC will drink speed potions/become unburdened first. Getting stuck is basically death, but there is a tiny 1% chance that you'll fall through the floor to a secret room instead of dying. It's way too dangerous to stand in quicksand looking for secrets, but a lucky PC will be very happy to have not died :) (actually on second thoughts, maybe quicksand would work better as a "floor type" instead of a liquid).

    Any plans to differentiate between running water that is sea water and running water that is fresh water? But I can't think of any in-game differences that this would make.

    This was a great update, keep up the good work!

  5. Few more ideas to make this more intricate and difficult to implement:

    * Items of Levitation with low/mid/high levitation latitude (and risk being smashed into the ceiling if cursed). This allows to walk over low/mid/high liquids.

    * The ability to break a hole in the floor and let the liquid pour down. When the lower level is generated, the liquid keeps pouring down.

    * The ability to heat/cool liquids. Turn water into ice, lava into earth. Produce steam and cause fogs.

  6. Cool ideas, thanks. Noted. This level of detail will get added over time (I see a lot of this stuff coming once the spell system is added to the game, but that's probably about two major releases away).

    @Lyle: The time limit caused by water (or lava) on level exploring is rather easy to add due to one slightly unrealistic (but intended) feature of JADE: Once you leave a level time stops on that level. Thus I just need to add an activation event that states "continuously add water to the current level once the PC first enters it" and the level will get flooded all the while the PC is exploring it but nothing will change when he is elsewhere. While this is not quite realistic I believe that it's good for the enjoyment of the game (and implementation-wise many things are a lot easier to add).

  7. In Adom, there are magic pools that grant effects when drunk - what happens when a flood reaches such a pool? Does all the water become magic?

    Can water (or other liquids) be bottled in potion bottles?

    When potions are consumed, can the bottles be retained (it might be best to rinse them before use - keeping them as 'dirty bottles' until cleaned, unless of course the last liquid was (uncursed or holy) water)?

    Drinking might have different effects for sea water vs. fresh water. Will fish be able to travel through a flood?

    If you have acid immunity, is there any benefit to drinking acid? Nutritional or otherwise?

    Can drakelings drink lava for a temporary but long-term speed boost (presumably with damage, as in the Tower of Eternal Flames)? Will drakelings get a speed penalty for drinking ice water?

    Can a flood be poisoned? The diluted poison may be less effective, but it can reach more targets - poisoned acid would be particularly lethal.

    If adding a cururia mancox herb to a potion of water makes a potion of healing, then what happens when a flood of water hits a cururia mancox bush? (A good time to have potion bottles handy, perhaps).

  8. Amazing ideas that I've wanted to see implemented in a roguelike for a while!

    I don't know how exactly you've implemented it, but water levels should probably be expressed in several distinct steps relative to the default height of the race PC belongs to (because, as you said, what is shallow for one race may not be for another). This will avoid some complexity issues as well as make the player able to identify depth by visual cues. Such as:

    1) shallow — PC gets their feet wet (protective boots might be needed with aggressive substances), water monsters can be seen from distance, little to no speed penalty induced depending on the liquid (water/oil is easy to traverse, mud and lava are viscous among other things);
    2) knee-deep — PC's boots are flooded, water monsters are hidden better, small to average speed penalty induced, bottles can be dipped;
    3) waist-deep — backpack equipment and some of the equipped items may become wet, water monsters are invisible until very close, average to heavy speed penalty induced;
    4) chest-deep/neck-deep — all equipment (except helms?) gets wet unless protected, PC starts swimming if it gives any speed benefit (otherwise very heavy speed penalty is induced), water monsters are invisible until adjacent;
    5) height-deep (my English is probably insufficient here) — PC is completely covered and will drown unless can swim or is otherwise protected, but can slog through if they don't know how to swim or their equipment is too heavy for them to, sight distance is heavily reduced for humanoids (but maybe there can be a See Underwater spell?);
    6) abyssal/bottomless — largely same as above, but PC will have to swim through here, as being very strained or overburdened will quickly drown them. PCs that can't swim will drown instantly. Items that don't float are permanently lost here.

    Say there are arbitrary depth units (I guess it may as well be inches), so for an average human shallow will be, say, 1–6, small races 1–3, high races 1–10; knee-deep will be 7–30 for humans, 4–15 for small races, 11–40 for high races; waist-deep 31–45 for humans, and so on, until over 100, which should probably cover PCs of any race. This should make digging pits and flooding them with water an interesting (and useful!) tactical idea for ranged fighters, as well as a safety measure against possible lava flows and such.

    PC should also be able to identify at least changes in water level by audial cues: something like "you hear rushing water" for rising water level or rivers with strong currents; "you hear water lapping on peacefully" for static water level or rivers with no significant currents; "you hear flushing sounds" or "you hear water splashes become quieter" for receding water level.

    Btw, how about things that do float (logs, some food/corpses)?

  9. (When I talked about depth units, I meant they should be strictly internal, with PC only being able to appraise depth relative to their height as described above for simplicity's sake.)

  10. One quick warning about cutting drains in floors:

    Maybe Ive been playing too much Dwarf Fortress (and holy shit do I think that the combo of Tarn's world/civ builder and Thomas's Rougelike explorer would be AMAZING! Just a thought) but if you can cut a hole down to the next floor, you should logically be able to jump down to the next level.

    In Adom, this would have had some serious consequences. It would let you get below a level where the staircase is guarded or trapped too heavily for you to proceed, but a series of 45 or so trenches, dug one space apart, that gets you to the metaplane in seconds, with hardly any fighting.

    I guess that's ok, but: if you dig into a wall on the lower level, you will probably make a big pile of rubble that you could slide down safely (and maybe climb up?) but if you dig into the ceiling of a room you should fall, hurt yourself, and have some stuff randomly break. The breaking is important, it would be the only thing that would make me think twice about abusing digging.

    Maybe if you model the floors to be made of the same stuff as the walls, so the floors can be undiggable along with/independently of the walls? In Adom I'm thinking specifically of the Metaplane, the portal, and the eternal guardian. Also what would that mean for levels with more than one level directly below them? I.e. the blue dragon caves, the random split level early in the CoC, or the Dwarven halls/Animated forest?

    Also, one fun thing to add, would be ceiling height. If I remember the big room description correctly, digging into that ought to be an instakill. Another thing to keep people from using trenches as their own personal escalator system.

  11. Nah, digging down sounds way too exploitable to implement I'd think. Not sure what's Thomas's stance on the matter, but it would make stairs largely useless for certain classes. Breaking equipment won't stop you if all you're wearing is artifacts, easily replenishable junk (food, herbs, certain potions), and certain stuff that shouldn't break (scrolls, bandages, blankets; armor made out of cloth, wool, or leather, etc.).

  12. As for digging down, first thing that needs to be said is that the dungeon floors in ADOM must be pretty far from each other. Otherwise, how could you put a pit trap on the upper floor without dropping you below? Portable holes?

    So, first, we might make a difference between "sparse" dungeons and "packed" dungeons. The second type would be mostly buildings. If you, say, dig a pit on third floor of the department store, it really makes more sense that you open way down to the second floor than that you make a deep pit.

    In the sparse dungeons, digging a hole to next floor could still be possible, but would require lots of time and dedication (and once you got deep enough, you'd have to continue since you could no longer climb out). But the important thing is that this would be only one-way, unless you get the ability to fly or something. So, in downwards dungeons you could get to lower floor without finding the stairs, but it would take longer and you would STILL have to find the stairs to go back. And in upwards dungeons (like ADOM Pyramid), these would be nasty traps, dropping you to previous floors.

    As for more liquids, a poison is of course possible (basically, anything that has a jelly-type monster should also exist as liquid). I'd like to see milk and honey, if only so we could get some thematical levels :) (Milk can be drink for satiation, honey is edible, but falling in it makes you very sticky and attracts bees and bears.)

    Another fun liquid would be liquid nitrogen to deal freezing damage (if too sciencey, how about "liquid ice"? :) Basically water that is still liquid FAR below its normal freezing point).

    Some liquids could be conductive for electricity, meaning that any electric attack that hits a square with such liquid will spread and deal its damage evenly to all squares covered by the liquid (maybe an electrical engineer could have more precise idea?).