Custom level creation/meta.txt: Difference between revisions

From Turing Complete
No edit summary
(→‎Dialogue: Include a simple example)
 
(3 intermediate revisions by the same user not shown)
Line 18: Line 18:
* <code>tests: SInt</code>
* <code>tests: SInt</code>
** Number of tests to run, defaults to 1
** Number of tests to run, defaults to 1
** Will stop after first time <code>check_output()</code> returns <code>fail</code>.
* <code>title: String</code>
* <code>title: String</code>
** Pretty name for display in game
** Pretty name for display in game
Line 40: Line 41:
** Exclude these Components from the build menu
** Exclude these Components from the build menu
* <code>tick_past_fail: SInt</code>
* <code>tick_past_fail: SInt</code>
** Run this number of ticks, even after detecting a failure.
** <code>check_output()</code> must <code>return win</code> on the last tick or the level cannot be completed. An early return win ignores this and can cause the level to succeed before then.
* <code>output_history_pins: SInt</code>
* <code>output_history_pins: SInt</code>
** Legacy, '''DO NOT USE''' for new levels.
** For older levels that do not use [[Custom_level_creation/ui.txt|ui.txt]] configures the display of IO pins on the bottom panel.
* <code>copy_solution_to_level: [String]</code>
* <code>copy_solution_to_level: [String]</code>
** Note: Potentially broken parsing code, might copy stuff to weird locations on small mistakes
** Note: Potentially broken parsing code, might copy stuff to weird locations on small mistakes
* <code>copy_solution_to_architecture: String</code>
* <code>copy_solution_to_architecture: String</code>
* <code>save_solution_as_custom: String</code>
* <code>copy_solution_to_factory: String</code>
* <code>unlocks_info: String</code>
* <code>unlocks_info: String</code>
* <code>input_labels: [(String,)|(String,String)|(String,String,String)]</code>
* <code>input_labels: [(String,)|(String,String)|(String,String,String)]</code>
Line 62: Line 67:


=== Dialogue ===
=== Dialogue ===
The <Dialogue> format is TODO.
Dialogue describes a list of pages. Each page consists of an image and some formatted text.
 
As an example
<code><pre>dialogue = [
  (alien_centered, "We measure the universe with numbers. So your machine must learn to count."),
  (info, "Treat the inputs as [ZERO] or [ONE] depending if they are [OFF] or [ON]. Add them together in binary, such that the result is either [ZERO] or [ONE].
 
As with normal addition, if the result cannot be described with one digit, set the carry to [ONE]."),
]</pre></code>
 
The "image" maybe one of:
* <code>alien_centered</code>
* <code>alien_smile</code>
* <code>info</code>
** a placeholder for no image, just left justified text.
* <code>info_centered</code>
** a placeholder for no image, just text centered on the page.
* <code>overture</code>
** Reserved for the Overture levels.
 
====Formatting====
Some basic text formatting is available.


== Hints ==
== Hints ==
To disable all custom components specify <code>components_available</code> with all of the allowed built-in components, excluding the IO pins.
To disable all custom components specify <code>components_available</code> with all of the allowed built-in components, excluding the IO pins.

Latest revision as of 14:18, 12 July 2025

wip
wip

This page descibes the early access verion 0.1346 save_breaker. It may not be completely correct for the the current stable version, nor the latest unstable version. Help us update it, and you get a cookie.

meta.txt is a text file that lists a number of fields that describe the level, each field should start on a new line. While most of these are optional you should set at least:

  • kind
  • size
  • title
  • dialogue

Fields[edit | edit source]

  • kind: LevelKind
    • One of misc, combinational, sequential, architecture, factory
  • immutable_program: Bool
    • Player cannot edit the program in assembley enabled RAM & ROM
  • immutable_spec: Bool
    • Player cannot edit the spec.isa
  • overwrite_assembly: Bool
  • no_score: Bool
  • tests: SInt
    • Number of tests to run, defaults to 1
    • Will stop after first time check_output() returns fail.
  • title: String
    • Pretty name for display in game
  • default_isa_spec: String
  • default_assembly: String
  • no_panel: Bool
  • no_state_ui: Bool
  • no_controls: Bool
  • size: (S16,S16,S16,S16)
    • Coordinates of the edges of the allowed draw area (left, top, right, bottom)
    • Ignored for architecture levels
  • unlocks_components: [ComponentKind]
  • components_available: {ComponentKind: SInt}
    • This overrides the default component list based on the level progression
    • Maximum number of allowed instances of ComponentKind
    • -1 means unlimited
    • If this option is specified then custom components will NOT be available unless the IO pins (com_cc_input: -1, com_cc_output: -1) are also listed.
  • add_components: {ComponentKind: SInt}
    • This adds to the default component list based on the level progression
    • -1 means unlimited
  • remove_components: [ComponentKind]
    • Exclude these Components from the build menu
  • tick_past_fail: SInt
    • Run this number of ticks, even after detecting a failure.
    • check_output() must return win on the last tick or the level cannot be completed. An early return win ignores this and can cause the level to succeed before then.
  • output_history_pins: SInt
    • Legacy, DO NOT USE for new levels.
    • For older levels that do not use ui.txt configures the display of IO pins on the bottom panel.
  • copy_solution_to_level: [String]
    • Note: Potentially broken parsing code, might copy stuff to weird locations on small mistakes
  • copy_solution_to_architecture: String
  • copy_solution_to_factory: String
  • unlocks_info: String
  • input_labels: [(String,)|(String,String)|(String,String,String)]
    • Same Note, but less danger, just messed up names
  • output_labels: [String]
    • Same Note
  • unlocks_pages: [String]
    • Same Note
  • unlocks_special: [String]
    • Same Note
  • background: UInt
  • arch_input_word_size: SInt
  • next_level: String
  • dialogue: Dialogue
  • post_mortem_first_win: Dialogue
  • post_mortem: Dialogue

Dialogue[edit | edit source]

Dialogue describes a list of pages. Each page consists of an image and some formatted text.

As an example

dialogue = [
  (alien_centered, "We measure the universe with numbers. So your machine must learn to count."),
  (info, "Treat the inputs as [ZERO] or [ONE] depending if they are [OFF] or [ON]. Add them together in binary, such that the result is either [ZERO] or [ONE].

As with normal addition, if the result cannot be described with one digit, set the carry to [ONE]."),
]

The "image" maybe one of:

  • alien_centered
  • alien_smile
  • info
    • a placeholder for no image, just left justified text.
  • info_centered
    • a placeholder for no image, just text centered on the page.
  • overture
    • Reserved for the Overture levels.

Formatting[edit | edit source]

Some basic text formatting is available.

Hints[edit | edit source]

To disable all custom components specify components_available with all of the allowed built-in components, excluding the IO pins.