Darkness Spreads: A Wesnoth Scenario Guide

by Admin 43 views
Darkness Spreads: A Wesnoth Scenario Guide

Hey guys! Today, we're diving deep into the creation of a thrilling Wesnoth scenario: "Darkness Spreads." This scenario, part of "The Forbidden North" campaign, places Frostwhisper in a tough spot, forcing them to choose between fleeing or fighting against an encroaching darkness. It’s all about ancient powers, strategic decisions, and unlikely alliances. So, let's break down how to bring this epic battle to life!

Scenario Details

Before we get our hands dirty with the code and design, let’s lay out the essentials:

  • Campaign: The Forbidden North
  • Scenario Number: 12
  • Filename: 12_Darkness_Spreads.cfg

The core idea? Frostwhisper faces a moral and tactical dilemma as a dark power grows stronger. This scenario, "Awakening the Dark", is all about deciding whether to retreat further inland or stand firm against the shadows. We'll see cooperation between former enemies as orcs and ice folk band together. Exciting, right? Let's get started!

Tasks Breakdown

Implement WML Scenario Structure

First, we need to set up the basic structure using Wesnoth Markup Language (WML). Think of this as the skeleton of our scenario. We'll define the scenario's ID, name, map file, turns, and basic objectives. This is where the magic starts!

To kick things off, open your favorite text editor and create a new file named 12_Darkness_Spreads.cfg. Here's a basic WML structure to get you started:

[scenario]
 id=12_Darkness_Spreads
 name= _ "Darkness Spreads"
 map_data= {~add-map-data~}
 turns=30
 next_scenario= {CAMPAIGN_NEXT_SCENARIO}

 [story]
 [part]
 show_title=yes
 image=wesnoth-icon.png
 text= _ "Frostwhisper must decide whether to flee further inland or make a stand against the spreading darkness."
 [/part]
 [/story]

 [objective]
 side=1
 text= _ "Defeat all enemy leaders!"
 condition=win
 [/objective]

 [event]
 name=prestart
 [/event]

 [event]
 name=turn 1
 [/event]

 [event]
 name=last breath
 [/event]

 [event]
 name=victory
 [/event]

 [event]
 name=die
 [/event]

[/scenario]

This snippet includes the essential tags like [scenario], [story], and [objective]. We've defined the scenario ID, a placeholder for the map data, the number of turns, and the next scenario in the campaign. The [story] section introduces the scenario's premise, and the [objective] clearly states the win condition: defeat all enemy leaders. The [event] tags are hooks where we'll add more complex behaviors later on. Make sure the name attributes match the functions.

Design Scenario Map with Expanding Darkness Mechanic

Now, let's craft the battlefield! The map should visually represent a land threatened by encroaching darkness. Consider using dark terrain like caves, swamps, or corrupted lands that gradually expand as the game progresses. This isn't just cosmetic; it’s a core gameplay element.

  • Create the Base Map: Start with a balanced map layout, ensuring fair starting positions for both the player and the AI. Include strategic chokepoints, villages for resource gathering, and varied terrain to influence unit movement.
  • Implement Expanding Darkness: This is where it gets interesting. Use WML events to gradually change the terrain in specific areas to a "darkness" type. You can use [terrain_mutation] to transform terrain over time.

Here’s how you can implement the expanding darkness using WML events:

[event]
 name=turn 1
 [terrain_mutation]
 x=1-5
 y=1-5
 terrain=Ke,Xv
 [/terrain_mutation]
 [/event]

[event]
 name=turn 5
 [terrain_mutation]
 x=6-10
 y=6-10
 terrain=Ke,Xv
 [/terrain_mutation]
 [/event]

In this example, during turn 1, the terrain in the specified coordinates (x=1-5, y=1-5) changes to a combination of cave (Ke) and void (Xv) terrains, representing the initial spread of darkness. By turn 5, the darkness expands further to coordinates x=6-10, y=6-10. You can adjust the coordinates and turn numbers to control the pace and direction of the darkness, making it a dynamic threat that forces the player to adapt.

Implement Frostwhisper Choice Mechanics

This is where the moral and tactical choice comes into play. At a certain point, present Frostwhisper with a dialogue choice: either make a stand or retreat. This choice should significantly impact the scenario's progression.

  • Create Dialogue: Use the [message] tag to present the choice. Make sure the options are clear and have distinct consequences.
  • Branching Events: Based on the player's choice, trigger different event sequences. For example, choosing to stand might trigger reinforcements, while retreating could lead to a different map section or objective.

Here’s a sample implementation using WML:

[event]
 name=turn 3
 [message]
 speaker=Frostwhisper
 message= _ "We cannot hold out much longer! Should we make a stand or retreat further inland?"

 [option]
 label= _ "Make a Stand!"
 [command]
 [message]
 speaker=Frostwhisper
 message= _ "We will fight to the end!"
 [/message]
 [set_variable]
 name=frostwhisper_choice
 value=stand
 [/set_variable]
 [/command]
 [/option]

 [option]
 label= _ "Retreat!"
 [command]
 [message]
 speaker=Frostwhisper
 message= _ "We must live to fight another day! Fall back!"
 [/message]
 [set_variable]
 name=frostwhisper_choice
 value=retreat
 [/set_variable]
 [/command]
 [/option]
 [/message]
 [/event]

[event]
 name=turn 4
 [filter_variable]
 name=frostwhisper_choice
 equals=stand
 [then]
 [unit]
 type=Elvish Hero
 x=5
 y=5
 side=1
 [/unit]
 [message]
 speaker=narrator
 message= _ "Reinforcements arrive to aid Frostwhisper in their stand!"
 [/message]
 [/then]
 [else]
 [move_unit]
 type=Elvish Hero
 x=10
 y=10
 side=1
 [/move_unit]
 [message]
 speaker=narrator
 message= _ "Frostwhisper retreats to a more defensible position."
 [/message]
 [/else]
 [/filter_variable]
 [/event]

In this code, on turn 3, Frostwhisper presents the player with a choice: “Make a Stand!” or “Retreat!” Based on the selection, the frostwhisper_choice variable is set to either “stand” or “retreat”. On turn 4, the game checks this variable. If the player chose to “stand,” an Elvish Hero unit appears as reinforcement. If the player chose to “retreat,” Frostwhisper moves to a new location. This illustrates how a player's decision can alter the course of the scenario.

Configure Dark Entity Forces

The dark entities should be a formidable threat. Design their units with abilities that complement the spreading darkness, such as increased attack power in dark terrain or the ability to corrupt adjacent tiles.

  • Unit Types: Use a mix of melee and ranged units, some with special abilities like poisoning or draining life.
  • AI Behavior: Set the AI to aggressively expand and utilize the darkness to their advantage. Make them relentless!

Here’s an example of configuring dark entity forces with specific traits and abilities:

[side]
 side=2
 controller=ai
 team_name=dark_entities
 user_team_name= _ "Dark Entities"
 color=darkred

 [unit]
 type=Dark Warrior
 x=15
 y=15
 [/unit]

 [ai]
 aggression=0.8
 caution=0.2
 [/ai]
 [/side]

[unit_type]
 id=Dark Warrior
 name= _ "Dark Warrior"
 race=monster
 image=units/monster/dark_warrior.png
 hitpoints=45
 movement=5
 attack=8
 defense=60
 cost=25

 [attack]
 name=claw
 description= _ "Claw"
 type=blade
 damage=8
 number=3
 range=melee
 [/attack]

 [abilities]
 [ability]
 id=dark_affinity
 name= _ "Dark Affinity"
 description= _ "Gains +25% attack damage in dark terrain."
 affect_self=yes
 [affect_location]
 [filter_location]
 terrain=Xv,Ke
 [/filter_location]
 effect=apply_attack_modifier
 percentage=125
 [/affect_location]
 [/ability]
 [/abilities]
[/unit_type]

In this example, we define a side for the dark entities with an aggressive AI. The Dark Warrior unit gains a significant attack bonus (25%) when fighting on dark terrain (void Xv or cave Ke), making them a formidable threat in areas consumed by darkness. This configuration ensures that the dark entities are not only powerful but also synergize with the expanding darkness mechanic, enhancing the strategic challenge for the player.

Configure Mixed Orc/Ice Folk Alliance Against Darkness

To emphasize the theme of unlikely alliances, have orcs and ice folk fighting alongside Frostwhisper. This can be achieved by adding them as allied sides with specific units and behaviors.

  • Ally Setup: Use the [side] tag to create additional sides controlled by the AI but allied to the player. Set their team names appropriately.
  • Unit Variety: Include a mix of orcish and ice folk units to provide diverse tactical options.

Here’s how you can configure a mixed Orc/Ice Folk alliance to fight alongside Frostwhisper:

[side]
 side=3
 controller=ai
 team_name=good_guys
 user_team_name= _ "Orcish Allies"
 color=darkgreen
 canrecruit=no

 [ai]
 aggression=0.6
 caution=0.4
 [/ai]

 [unit]
 type=Orcish Warrior
 x=2
 y=18
 [/unit]
 [/side]

[side]
 side=4
 controller=ai
 team_name=good_guys
 user_team_name= _ "Ice Folk Allies"
 color=lightblue
 canrecruit=no

 [ai]
 aggression=0.5
 caution=0.5
 [/ai]

 [unit]
 type=Ice Troll
 x=3
 y=18
 [/unit]
[/side]

[relation]
 side1=1
 side2=3
 alignment=ally
[/relation]

[relation]
 side1=1
 side2=4
 alignment=ally
[/relation]

In this setup, we define two additional sides: Orcish Allies (side 3) and Ice Folk Allies (side 4). These sides are set to be controlled by the AI and cannot recruit new units (canrecruit=no). The Orcs and Ice Folk have different unit types, such as Orcish Warrior and Ice Troll, respectively. The [relation] tags ensure that both sides are allied with the player (side 1), creating a cooperative fighting force against the dark entities. This setup highlights the theme of unlikely alliances and provides diverse tactical options for the player.

Balance Gameplay for All Difficulty Levels

Balancing is key to ensuring a fun experience for everyone. Adjust unit stats, enemy numbers, and resource availability based on the difficulty level. Use [difficulty] tags to specify different configurations for each level.

  • Easy Mode: Fewer enemies, more starting resources, and weaker dark entity units.
  • Normal Mode: A balanced experience with moderate challenges.
  • Hard Mode: Overwhelming enemy numbers, limited resources, and stronger, more aggressive dark entities.

Here’s an example of how to balance gameplay across different difficulty levels using WML:

[difficulty]
 id=easy
 name= _ "Easy"

 [modifications]
 [side]
 side=2
 gold=50
 income=10
 [/side]

 [unit]
 type=Dark Warrior
 hitpoints=35
 [/unit]
 [/modifications]
[/difficulty]

[difficulty]
 id=normal
 name= _ "Normal"

 [modifications]
 [side]
 side=2
 gold=70
 income=15
 [/side]

 [unit]
 type=Dark Warrior
 hitpoints=45
 [/unit]
 [/modifications]
[/difficulty]

[difficulty]
 id=hard
 name= _ "Hard"

 [modifications]
 [side]
 side=2
 gold=90
 income=20
 [/side]

 [unit]
 type=Dark Warrior
 hitpoints=55
 [/unit]
 [/modifications]
[/difficulty]

In this code, we define different difficulty levels: Easy, Normal, and Hard. For each difficulty level, we adjust the starting gold and income for the dark entities (side 2). On Easy mode, the dark entities start with less gold and income, and their Dark Warrior units have fewer hitpoints. On Normal mode, these values are moderately increased, and on Hard mode, the dark entities have the most gold, income, and hitpoints, making the game significantly more challenging. This setup ensures that players of all skill levels can enjoy the scenario with a difficulty that suits their experience.

Test Scenario Completion

Testing is crucial! Play through the scenario multiple times on each difficulty level. Look for bugs, balance issues, and areas where the gameplay feels unfair or uninteresting. Gather feedback from other players if possible.

Requirements Deep Dive

Let's make sure we've hit all the key requirements:

  • Major Moral/Tactical Choice: Frostwhisper's decision to stand or flee should have significant consequences, affecting the story and gameplay.
  • Expanding Danger Zone Mechanics: The spreading darkness must be a tangible threat, influencing unit movement and combat.
  • Cooperation Between Former Enemies: The orc and ice folk alliance should feel genuine, with their units complementing each other.
  • Proper Integration with Campaign Story Flow: The scenario should seamlessly fit into "The Forbidden North" narrative, with clear connections to previous and future events.
  • Victory and Defeat Conditions Clearly Defined: Players should know exactly what they need to do to win, and what leads to defeat.

Final Thoughts

Creating a Wesnoth scenario like "Darkness Spreads" involves careful planning, creative map design, and a solid understanding of WML. By focusing on player choice, dynamic mechanics, and thematic consistency, you can craft an unforgettable experience. Good luck, and have fun bringing your vision to life! Remember, it’s all about creating something engaging and fun for the players. Happy coding, guys!