Level Packs #55

Closed
opened 2021-12-24 03:52:51 +00:00 by kirsle · 0 comments
Owner

Obsoletes #9

Level Packs will be ZIP files containing levels and possibly doodads that go with those levels. The structure of the ZIP would be like:

/
  index.json
  levels/
    *.level
  doodads/
    *.doodad

index.json

The index.json file describes metadata and cached level details about the levels in the pack, example:

{
  "title": "Boat",
  "description": "",
  "author": "Noah P",
  "created": "2021-12-24T03:12:33.999077226Z",
  "levels": [
    {
      "title": "Lesson 1: Controls",
      "author": "Noah P",
      "filename": "Tutorial 1.level"
    },
    {
      "title": "Lesson 2: Keys & Doors",
      "author": "Noah P",
      "filename": "Tutorial 2.level"
    },
    {
      "title": "Lesson 3: Gizmos and Doodads",
      "author": "Noah P",
      "filename": "Tutorial 3.level"
    }
  ],
  "freeLevels": 1
}

Features worth pointing out:

  • freeLevels is the number of levels unlocked by default in this pack. Zero means all levels are unlocked. Completing one level unlocks one level.

Payment Model

Free versions of the game can't play maps that embed custom doodads so they similarly should not support levelpacks that embed custom doodads.

The built-in levelpacks will NOT embed any doodad, so they will load from the built-in doodads that ship with the game. For free versions of the game, it will only play a levelpack that does this: all doodads referenced by the levels MUST exist locally for the player, either built-in or found in the user's profile folder. Doodads attached to the levelpack are never loaded for free versions of the game.

Story Mode UI

From the game's main menu there will be a button to select Story Mode, where it will list the available levelpacks and provide a UI to browse and select a level to play.

Screen 1: Level Packs

The first screen will show clickable buttons for all the level packs found.

Level packs will be searched in the following order:

  1. Embedded into the Go binary
  2. In the external assets folder of the program ("system files")
  3. In the user's ~/.config/doodle/levelpacks folder.

About 5 packs should be shown per page with a pager widget for multiple.

The packs should be shown sorted by file names.

Screen 2: Levels

Clicking a pack on the main screen shows a detail screen of its levels.

Levels would be shown in a grid (maybe 3 columns per row) with level buttons showing:

  • The title in bold text
  • The author name below it
  • Badges or indicators about if the level is locked or when it was completed.

If the level hasn't been unlocked the button should be greyed out/unclickable/show differently to normal.

A user has the option to unlock a locked level by entering its password. When clicking the locked entry:

  • Load the .level file to look for its password.
  • If it has a password, prompt the user to enter it. If not, give an error that the level is locked and can't be accessed.
  • If the user enters the right password, unlock the level (see Save Game JSON, below)

The level list would have a pager for large levelpacks.

Save Game JSON

A user's progression through a levelpack would be saved in a JSON file in their home folder, see #9 for inspiration.

As the user completes or unlocks a level, insert an entry in their save JSON about the levelpack name and level name and details like:

  • Password (str): the password that unlocks the level
  • Completed At (time)
  • high scores, etc., fastest time clearing the level
Obsoletes #9 Level Packs will be ZIP files containing levels and possibly doodads that go with those levels. The structure of the ZIP would be like: ``` / index.json levels/ *.level doodads/ *.doodad ``` ## index.json The index.json file describes metadata and _cached_ level details about the levels in the pack, example: ```json { "title": "Boat", "description": "", "author": "Noah P", "created": "2021-12-24T03:12:33.999077226Z", "levels": [ { "title": "Lesson 1: Controls", "author": "Noah P", "filename": "Tutorial 1.level" }, { "title": "Lesson 2: Keys & Doors", "author": "Noah P", "filename": "Tutorial 2.level" }, { "title": "Lesson 3: Gizmos and Doodads", "author": "Noah P", "filename": "Tutorial 3.level" } ], "freeLevels": 1 } ``` Features worth pointing out: * freeLevels is the number of levels unlocked by default in this pack. Zero means all levels are unlocked. Completing one level unlocks one level. ## Payment Model Free versions of the game can't play maps that embed custom doodads so they similarly should not support levelpacks that embed custom doodads. The built-in levelpacks will NOT embed any doodad, so they will load from the built-in doodads that ship with the game. For free versions of the game, it will only play a levelpack that does this: all doodads referenced by the levels MUST exist locally for the player, either built-in or found in the user's profile folder. Doodads attached to the levelpack are never loaded for free versions of the game. ## Story Mode UI From the game's main menu there will be a button to select Story Mode, where it will list the available levelpacks and provide a UI to browse and select a level to play. ### Screen 1: Level Packs The first screen will show clickable buttons for all the level packs found. Level packs will be searched in the following order: 1. Embedded into the Go binary 2. In the external assets folder of the program ("system files") 3. In the user's ~/.config/doodle/levelpacks folder. About 5 packs should be shown per page with a pager widget for multiple. The packs should be shown sorted by file names. ### Screen 2: Levels Clicking a pack on the main screen shows a detail screen of its levels. Levels would be shown in a grid (maybe 3 columns per row) with level buttons showing: * The title in bold text * The author name below it * Badges or indicators about if the level is locked or when it was completed. If the level hasn't been unlocked the button should be greyed out/unclickable/show differently to normal. A user has the option to unlock a locked level by entering its password. When clicking the locked entry: * Load the .level file to look for its password. * If it has a password, prompt the user to enter it. If not, give an error that the level is locked and can't be accessed. * If the user enters the right password, unlock the level (see Save Game JSON, below) The level list would have a pager for large levelpacks. ## Save Game JSON A user's progression through a levelpack would be saved in a JSON file in their home folder, see #9 for inspiration. As the user completes or unlocks a level, insert an entry in their save JSON about the levelpack name and level name and details like: * Password (str): the password that unlocks the level * Completed At (time) * high scores, etc., fastest time clearing the level
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: SketchyMaze/doodle#55
No description provided.