[MODULE] RifE: Underworld

Swinkscalibur

Prince
Joined
Apr 15, 2009
Messages
332
Location
Oshawa, ON, CA
This module is strictly in the planning phase but a lot of the details and problems have been worked out. I am releasing the plan to enlist feedback and to hopefully convince Valkrionn to add the few code mechanics necessary (some workarounds could still be possible if he stubbornly declines :p)

Without further ado, the details:

Purpose, Lore and Availability:
Spoiler :

  • Purpose: To add a new "layer" of "depth" to the strategy of RifE, by incorperating the ability to develop an underground network of tunnels and improvements. Units will be given the capability of moving within these tunnels unhindered by the world above.
  • Lore: During the ages past, including the Age of Ice, the dwarves made their homes in the heart of the earth. They were experts at mining and built networks of tunnels the world over. Since then some of these tunnels have gone into disrepair or have been lost to history. Who knows? They may yet be rediscovered.
  • Availability:
    • This mechanic will be available to all units with the Dwarven racial promotion.
    • The Archos as a civ have a lot of experience underground as well. They will be able to enter tunnels in their capital and crawl out wherever they want.
    • The Mechanos as a civ have gain access to the underground with the tech Engineering.
    • Any unit with the promotion "Tunnel Expert" can gain access to the underground.
    • Units with the ability to enter the underground may do so through a mine or a dwarven improvement.

Implementation:
Spoiler :

  • Tunnels - will be represented as tile features. They will not replace roads and do not connect resources. They cannot be built directly but rather spread passively from existing tunnels or as they are "discovered".
  • Spells and Abilities
    • Enter Tunnels - Requires one of the above availabilities to be true. Adds "Underground" promotion. Transforms the unit type to UNDERGROUND_UNIT, preserves name and art of the original unit (using sdToolKit).
    • Exit Tunnels - Requires being underground and on a mine or dwarven improvement. Removes "Underground" promotion returns the unit type to the type before going underground (again using stored data from the sdToolKit)
    • Divine Tunnels - (spell) replaces Earth's Boosom (which has art issues). Just like Bloom, but "discovers" (creates) tunnels on the tile (same non-improved requirement). (2 turn delay)
    • Discover Tunnels - same as Divine Tunnels, but its an ability, requires the "Tunnel Expert" promotion, costs 100 gold and takes 5 turns.
    • Connect Tunnels - same as Discover Tunnels, but only requires no tunnels or destroyed tunnels and a mine or dwarven improvement on the tile. Costs 20 gold.
    • Tremor - Earth II/Fire II spell, requires the tech Elementalism and does small AoE damage (flying units immune) and destroys all tunnels (creates a destroyed tunnel feature, so tunnels can't be re-spread) in a range of 1, with the exception that it does more damage with a volcano in range (including to flying units).
    • Repair Tunnels - Requires "Tunnel Expert" repairs destroyed tunnels. Costs 120 gold and takes 6 turns.
  • Promotions
    • Underground - autoacquired by "Underground" unit. Disables casting while underground.
    • Underground Worker - requires a Dwarven worker to go underground. Allows building the "Underhome" improvement.
    • Lost in Tunnel - gained randomly by units underground. 33% chance to wear off each turn, unit is held.
    • Tunnel Expert (Dwarven) - requires the Dwarven racial, the tech Construction and a unit of level 3. Decreases negative effects underground, +20 to workrate, available to all units.
    • Tunnel Expert (general) - requires the tech Engineering and a unit of level 4. Decreases negative effects underground, +20 to workrate.
    • Ground Shifter - Autoaquired with Fire II and Earth II, requires tech Elementalism. Allows the spell "Tremor"
    • Improvements
    • A new line of upgrading improvement buildable by Dwarven workers in peaks (can build underhomes).
    • Underhomes grant +1 :food: and upgrade to Under-villages (30 turns)
    • Under-villages provide +2 :food: and upgrade to Under-towns (30 turns)
    • Under-towns provide +2 :food: and +1 :commerce:
  • Underground Units - will be invisible to all players but the owner, through a new invisibility, "INVISIBLE_UNDERGROUND." (The units will even be invisible to each other, representing the maze-like nature of tunnels). Units underground will also be prevented from attacking and must move only on tiles with tunnels (through FeatureNative).
  • Balancing Effects - to balance the strength and safety of the underground, being underground will carry a small chance per turn for negative effects:
    • Getting lost (temporarily held)
    • Being caught in a collapse (unit damaged by physical damage)
    • Getting lost forever or dying from a collapse (death).
  • Art - since all of the above is representing things under the surface, no art is added. This should help allow the tunnel feature to co-exist on tiles which already have surface features.
  • Modularity - given a few small base code changes (outlined later) this should be completely modular.

Future Possibilities:
Spoiler :

  • Inability to See Surface Units - depending on feedback I may also make underground units unable to see surface units (by adding another invisibility "INVISIBLE_SURFACE", which can only be seen by units not underground). This would be done in order to prevent scouting in perfect safety as the underground unit wouldn't be able to see things surface units can't.
  • Events - a set of events that are the direct effect of tunnels or affect tunnels. Could modify some existing events as well.
  • Mapscripts - depending on the reception of this module, perhaps the base map scripts of Erebus Continent and World of Erebus could be modified to include a few base tunnels as well as an un-owned ancient dwarven mine or two.
  • New Civ - a new civ (likely dwarven/but not necessarily) which is given the synergy with this mechanic (instead of Khazad).

Required Code Changes:
Spoiler :

  • From Xienwolf: "Ideally you would have a <bOverlap> tag in the XML or similar to restrict which features can share location with others (ie - don't have a graphic). This same tag would be used to ignore the graphic lines for that entry."
 
This looks good. I had a lot of the same ideas planned for Guns, Wyrms and Steel. Although I feel tunnels should really be simply roads that Dwarves can use to traverse peaks. The Khazad used to live underground but they do not anymore. And the Luchuirp have not been tunnelers for a long, long time.

Since it looks like you're going to bring us back underground before I will, I'll post the rest of my notes. I wanted anyone to have access to tunnels so long as they were lead by a dwarf. So the two RoK heros and the Lizardman/Dwarf event have other uses.

Subterranean - Automatically gained once requirements are met and lost when requirements are no longer met. Unit must be in a tunnel and have a friendly unit with the Dwarven promotion in the tile. Flat movement costs. Grants invisibility: Subterranean. Grants see invisible: Subterranean.
Lost in Tunnel - Automatically gained once requirements are met and lost when requirements are no longer met. Unit must be in a tunnel and no friendly unit with the Dwarven promotion in the tile. Grants invisibility: Subterranean. Unit may not move and has no visibility. 20% chance of unit being destroyed at the end of each turn. Promotion is lost once Subterranean is gained.
Mountaineering - Available to recon units. Unit may climb peaks. Requires Guerilla II and Drill II. Units with this promotion may not take the Subterranean promotion.

EDIT: Almost forgot this part. The only thing I really had working was that Dwarves could no longer climb peaks, but the workers could. Once the worker was in a peak they lost their ability to make roads but gained their ability to make tunnels. And, unless there was a tunnel in the tile, they also lost the ability to climb peaks. So basically workers could move through peaks, but not from peak to peak unless they built a tunnel first.
 
I was expecting this to appear if this game going to become somewhat similar to Age of Wonder's or Heroes of Might and Magic. I thought It be impossible to make because there is no special code that allows us to make two different layer's of map... just everything on the surface, no underground, no space colonization and going to a different world.

Good luck on trying to make this happen, also I recommand adding in some... Obstacles... I'm talking lava, water and flooding issues, cave-in's and pit holes that can possibly affect the surface (imagine collapsing a whole city in one big hole!).
 
Interesting. I suppose it could be possible to add events that respond to tunnels or have effects on them. I'm thinking a volcano erupting should definitely destroy the tunnels in the tiles immediately adjacent to it and perhaps damage/kill any units inside them at the time. Much easier to do now that events are completely modular. Will add it to the possibilities section.
 
Interesting stuff.

[*] Earthquake - Earth II spell, does small AoE damage in a range of 1, destroys tunnels on the casters tile (creates a destroyed tunnel feature, so tunnels can't be re-spread)

I'd rename that to Tremor. This frees up the possibility for Earthquake (a major version of the same spell) if you want to go down that path.

Also all flying creatures ought to immune to Tremor and the spell should cause additional fire damage if cast within 1 space of a Volcano.

[*]Getting lost forever or dying from a collapse (death).

Any unit with Hero or high level unit ought to be immune to this effect. It's frustarting as a player to lose a Hero from such an ignoble death.

The Archos spent a lot of time underground in the AoI, so maybe they should be able to find tunnels, though not as well as the dwarves can. The Mechanos could have some kind of tunneling unit at the end of the Machinery line (or you could give Goliath the capacity to create Tunnels) Also creating a tunnel might be a Lair Effect if the Lair is located on a hill.
 
I've created a promotion which gives invisible_outdoors (or Surface) and see invisible_outdoors, but I wasn't able to give this promotion to ALL units. does anyone knows how?
 
I've created a promotion which gives invisible_outdoors (or Surface) and see invisible_outdoors, but I wasn't able to give this promotion to ALL units. does anyone knows how?

Make it cost no XP, automatically gained, list all unitcombats and set the tag that allows no unitcombat units to gain it...

As far as I know, that should give it to all units. If not, say which units don't.
 
Interesting stuff.



I'd rename that to Tremor. This frees up the possibility for Earthquake (a major version of the same spell) if you want to go down that path.

Also all flying creatures ought to immune to Tremor and the spell should cause additional fire damage if cast within 1 space of a Volcano.



Any unit with Hero or high level unit ought to be immune to this effect. It's frustarting as a player to lose a Hero from such an ignoble death.

The Archos spent a lot of time underground in the AoI, so maybe they should be able to find tunnels, though not as well as the dwarves can. The Mechanos could have some kind of tunneling unit at the end of the Machinery line (or you could give Goliath the capacity to create Tunnels) Also creating a tunnel might be a Lair Effect if the Lair is located on a hill.

Great ideas, and great points. I will allow Achosian units to enter tunnels as well, but only from within their capital. Tunnels will automatically be placed in their capital.

Make it cost no XP, automatically gained, list all unitcombats and set the tag that allows no unitcombat units to gain it...

As far as I know, that should give it to all units. If not, say which units don't.

This is what I planned.
 
I think the biggest problem is, to prevent that units in tunnels can leave them everywhere.
I've tried it with the mechanism of the mechanos mobile fortress which can only move on railways, but the code can't be included in a promotion. If you use features (instead of routes) for tunnels there is the same problem. Anyone knows a PROMOTION (not a unit) which force to go on a feature or a route?
 
I can think of one workaround:

Two promotions: "In Explored Tunnel" and "Exploring Tunnels"

In Explored Tunnel does nothing in particular other than degrade to Exploring Tunnels when the unit moves away from the tunnel feature and overwrite Exploring Tunnels when the unit moves back.

Exploring Tunnels sets the unit to a 1 leash range.

You'd be able to hop between tunnel features as long as they were only one tile apart and it plays havoc with the path finding system.
 
Add an "explore tunnels" command (worker action? recon only? do we want to mess with the dwarven recon line?) which converts a basic "unexplored tunnel" to a "mapped tunnel". Mapped tunnels would have reduced/removed chances for random bad effects.

Personally, I would remove random tunnel growth and give the "explore tunnels" command a chance at finding new tunnels. Also add worker commands to reopen destroyed tunnels (at Construction).

Mechanos should be able to get into the tunneling thing by Blasting Powder, at the latest.
 
I think the biggest problem is, to prevent that units in tunnels can leave them everywhere.
I've tried it with the mechanism of the mechanos mobile fortress which can only move on railways, but the code can't be included in a promotion. If you use features (instead of routes) for tunnels there is the same problem. Anyone knows a PROMOTION (not a unit) which force to go on a feature or a route?

This is the big thing: I have asked Valk if he would consider given promotions access to affect FeatureNatives, or at least allow python to adjust them. If he does it solves a lot of problems. If not I might have to do something like Odalrick suggested. Or dive into the dll myself (ugh on both counts).

Add an "explore tunnels" command (worker action? recon only? do we want to mess with the dwarven recon line?) which converts a basic "unexplored tunnel" to a "mapped tunnel". Mapped tunnels would have reduced/removed chances for random bad effects.

Personally, I would remove random tunnel growth and give the "explore tunnels" command a chance at finding new tunnels. Also add worker commands to reopen destroyed tunnels (at Construction).

Mechanos should be able to get into the tunneling thing by Blasting Powder, at the latest.

I will think about the active discovery of new tunnels, perhaps I will give it a tech requirement, but I don't want it to be highly control-able for everyone.

I agree about the Mechanos though. Will give them access at some point. Have to think about where.

This is certainly intriguing, but isn't RoK strong enough as it is?

Well the true power of this is in dwarven workers, RoK don't give dwarven workers. RoK only gives access to the transportative and stealth aspects of the tunnels. And then only for the Dwarven units, namely Soldiers of Kilmorph and Paramanders. Any other troops still need to move over land. Also the drawbacks of tunnels will be slightly stronger for non-dwarven civs.
 
Another work around is to have the ability which puts the unit underground actually transform the unit into another unittype. This new unit would have the same name as the old unit, all the same promotions, the same experience. Since units underground are bNeverHostile, combat isn't an issue. This unittype would be able to have the FeatureNative for tunnels. The last thing it would need is a set of promotions for all the types of units I want to allow access to tunnels. One promotion per unit? Or some other way to keep track of the units original type (I prefer this method but don't know how to do it). That way when the unit uses the exit tunnels ability it can be transformed into an identical copy of the original unit.

In fact, if there is a simple enough way of tracking the input unittype on the created unit, I would probably use this method until FeatureNatives could be added to units with promotions/python. The only downside I can see is that there would be issues with lost minions (when the original unit is killed)
 
The only downside I can see is that there would be issues with lost minions (when the original unit is killed)

If you use the convert function, it transfers the summons too.

The main problem I can see is that you have to explicitly allow each unit to access the tunnels rather than just make it dependant on the the Dwarf promotion.

Come to think of it, you could use a spell to transform the unit into the new unit, store the old unit type on the unit using the sdtoolkit and then restore the unit with a spell that reads that data. Then all you have to worry about is telling the player what kind of unit it is and the AI.
 
If you use the convert function, it transfers the summons too.

The main problem I can see is that you have to explicitly allow each unit to access the tunnels rather than just make it dependant on the the Dwarf promotion.

Come to think of it, you could use a spell to transform the unit into the new unit, store the old unit type on the unit using the sdtoolkit and then restore the unit with a spell that reads that data. Then all you have to worry about is telling the player what kind of unit it is and the AI.

Where is this convert function and what is it used for currently? The second is what I was hoping to do, but I don't know how to use sdtookkit, is there a tutorial available somewhere?

Why not just change the artstyle ?

The point is that FeatureNative is a property of a unit. It currently cannot be changed in game by anything. Therefore, if you want to change a units ability to walk on a specific type of feature or route etc. you need to actually change its unittype to one with the specified property. In fact I would prefer to be able to keep the artstyle of the unit the same, even though the actual unittype would be different. Essentially I want to create a dummy unittype that can essentially look and act like any desired unit, but with the ability to only walk on tunnels.
 
Where is this convert function and what is it used for currently?

It is used to convert units into other units, like when you upgrade a unit. I think it links to the same code that upgrades units normally. Look at the lich spell, if I remember correctly that uses the python function; or the various upgrade spells Doviello have for their melee, those use the xml variant.

I did something similar in my Golem Workshops, too. Change units to and from a placeholder unit. I only had to account for two different units, so I just used a promotion, not the sdtoolkit, though.

The second is what I was hoping to do, but I don't know how to use sdtookkit, is there a tutorial available somewhere?

This appears to be the original post, but really: just read the source.
 
Is there an example where the sdTookKit is used in the code? I am not sure I understand how to use it.

there is ...
iirc i put it into zip file along with Launcher in RifE Launcher thread
anyway, i'm posting that module in attachment

edit: (( note: i read only the last post, so this might be out of context :D ))
 

Attachments

  • DataStore.zip
    3.5 KB · Views: 69
Top Bottom