World

The term **World** refers to a single playthrough of *YODA STORIES*, including its specific randomly-generated environment and mission. Due to the number of random factors involved, each **World** is completely unique.

Whenever *YODA STORIES* is opened, the game creates a new **World** for you to play. This World persists until you quit the game, load a previously-saved World, or replay the current World. Selecting the "Replay World" option does allow playing the same World again from the start, but does not guarantee the exact same experience (due to randomized Variants which are not tied to the World itself).

## Details Unique to a World

A "World" consists of the following elements:

1. The position of  Yoda on Dagobah, and whether a special Dagobah Mission will play out at the start.
2. The Mission given to  Luke by  Yoda, as well as the specific Variant of that Mission.
3. The type of Planet that Luke will travel to during the game: Ice, Desert, or Forest.
4. The specific layout of the Planet, as created by the World Generator. Changing the "World Size" option does not affect an existing or saved World - only future Worlds.
5. The specific Cells used at each location on the Planet, along with the Quest Items required and/or provided in each Non-Empty Cell.

All other details, including Cell Variants, Loot dropped from Enemies, Equipment found in each Cell, as well as additional minor details, are generated during gameplay and may change when the same World is replayed.

### Dagobah

Each playthrough begins with  Luke Skywalker landing his X-Wing on the planet Dagobah.

Dagobah is nearly identical in each **World**, with a few exceptions:

1. Yoda may be found in one of four different positions, selected at random. A fifth option (no Yoda) exists for the Lokondo Mission, and will only occur during that mission.
2. If the player has won exactly 5, 10 or 15 games, a Dagobah Mission is set up at the start of the new World, completely overriding the above.

### Mission

When starting a new **World**, the game selects a new Mission for  Luke Skywalker. There are 15 Missions in total to choose from, and one will be chosen completely at random.

The selected Mission sets the following details:

1. Yoda's dialog when giving the Mission, as well as the Quest Item he provides immediately.
2. The type of Planet that  Luke Skywalker will travel to when he boards his X-Wing at Dagobah.
3. The  Objective Cell placed on the Planet, specific to the selected Mission.
4. The specific Objective Variant used for the Objective Cell. This also determines which Quest Items will need to be brought to the Objective Cell in order to complete the Mission.

### Planet and Layout

The selected Mission sets the type of Planet that  Luke Skywalker will spend most of his time on during that mission.

Once the mission is selected, the World Generator can finalize the current World:

1. The general type of Planet is selected based *directly* on the chosen Mission. A Planet can be Ice, Desert or Forest.
2. The World Generator randomly places the appropriate  Landing Cell near the center of the Planet's map. It then places the selected  Objective Cell some distance away.
3. A Locator Puzzle Cell and Force Puzzle Cell are placed down, close to the Landing Cell.
4. The World Generator populates the Planet with  Puzzle Cells, creating a specific chain of exchanges that would turn  Yoda's starting item into the Quest Items required by the Objective Cell. Freebie Cells are placed down as necessary.
5. The World Generator adds  Empty Cells,  Gate Cells and  Blockade Cells to connect all Puzzle Cells back to the Landing Cell. Additional Freebie Cells are placed for each Gate and Blockade, and potentially more Puzzle Cells (space permitting).

With this, the current World is completed. All of the details determined so far are *permanent* to this World, will persist as long as the World exists, and will be saved along with it.

## Saving and Loading

When saving a World, and later loading it, the following details are preserved:

1. The complete layout of the world map, including the position of all Cells on the Planet. Variants are only saved if the cell has been visited, otherwise they remain undetermined.
2. The exact condition of each Cell that has already been visited, including the positions of all Moveables, Enemies, Items, and other interactive elements.
3. The exact condition of  Luke Skywalker, including his position, his inventory, and his health.

All other details are not saved. As a result, reloading a World before entering a new Cell may cause that cell to have a new Variant each time.

## Replaying

Choosing the "Replay Story" option from the menu causes the current World to reset to its original condition, preserving most details, but leaving others randomized.

1. Luke Skywalker is reset to full health. His inventory contains only the starting items.
2. The same Mission is selected, including the same Objective Variant.
3. Yoda provides the exact same starting Quest Item.
4. The Planet has the exact same map layout. Nevertheless, each individual Cell may have a different Variant when visited.
5. The contents of each cell are reset to their original positions, or re-randomized as appropriate.
6. The same chain of Quest Item exchanges will occur during this playthrough of the World, as in the original playthrough.