Error: Config file validation failed

I’m getting the following error on starting up the game. Doesn’t crash but I worry it might create some problems later on. The game right now is just working through the steps of the first game tutorial in the docs.

Config file validation failed.

data/audio must be string, data/audio must have required property ‘audioTriggers’, data/audio must have required property ‘options’, data/audio must match a schema in anyOf, data/common must have required property ‘layout’, data/audio must be string, data/audio must have required property ‘audioTriggers’, data/audio must have required property ‘options’, data/audio must match a schema in anyOf, data must have required property ‘gameTitle’, data must have required property ‘saveFileName’, data must have required property ‘layout’, data must have required property ‘hudStats’, data must match a schema in anyOf

common config error: Error: data must have required property ‘layout’

Browser is firefox, OS is windows 10
I tried looking over the logs but because I’m new to this I couldn’t find any problems myself

The files I have edited…
common.yaml:

gameTitle: 'Narrat Basics Tutorial'
saveFileName: 'Narrat Demo'
dialogPanel:
  overlayMode: false
  rightOffset: 0
  bottomOffset: 0
  width: 400
  height: 720
  textSpeed: 20
  animateText: false
  timeBetweenLines: 100
hudStats:
  money:
    icon: img/ui/money.webp
    name: $
    startingValue: 200
    minValue: 0

screens.yaml

screens:
  default:
    background: img/backgrounds/default.webp
  harbor:
    background: img/backgrounds/harbor.webp
  hunt:
    background: img/backgrounds/hunt_departure.webp
  road:
    background: img/backgrounds/windswept_road.webp

characters.yaml

config:
  imagesPath: './img/characters/'
characters:
  game:
    name: ''
    color: white
  player:
    style:
      color: orange
    sprites:
      idle: none
    name: You
  francis:
    sprites:
      idle: francis.webp
    style:
      color: white
    name: Francis
  isaac:
    sprites:
      idle: isaac.webp
    style:
      color: white
    name: Isaac
  philip:
    sprites:
      idle: philip.webp
    style:
      color: white
    name: Philip

audio.yaml

files:
  vivaldi:
    loop: false
    src: music/vivaldiConcerto.mp3
  mozart:
    loop: false
    src: music/mozartQuintet.mp3
  click:
    src: audio/click.ogg
  game_start:
    volume: 0.9
    src: audio/game_start.ogg
  failure:
    src: audio/failure.ogg

the demo.narrat file is just

main:
  "Example text."
  "More example text."

Any insights appriciated

I’ve had this issue too! I don’t think my way is the most elegant to fix it, but basically the game is looking for all the things where it says “must have required property”.

So for example, "data/audio must have required property ‘audioTriggers’ " means that in your audio.yaml, the game is looking for audioTriggers and not finding it, and is very unhappy about it. My solution was to add audioTriggers again, and add just one that was never going to be triggered. (audioTriggers are like, the little sounds like at game start, on a click, etc).

In my own audio.yaml, I simply added:

audioTriggers: {}

For the game title and the save file name, go in your common.yaml and remove the ’ ', so that the first two lines look like this:

gameTitle: Narrat Basics Tutorial
saveFileName: Narrat Demo

For the HUDStats, I’m not sure, because it looks like what I have in my own code. I didn’t to use HUD for my little game but couldn’t find a way without, so I hid it with the CSS.

The “layout” that the game is looking for is also to be added in the common.yaml. Mine looks like this, although I don’t know if it will be accurate to what you want for your own game:

layout:
  backgrounds:
    width: 1280
    height: 720
  dialogBottomPadding: 70
  mobileDialogHeightPercentage: 60
  verticalLayoutThreshold: 600

I hope this helps!

1 Like

Thank you! This helped me find the solution.

For anyone else having these problems, this documentation page especially the examples of each config file helped me.

https://docs.narrat.dev/config/all-config-files.html

Basically if it says data/audio then something is missing from the audio.yaml file and you can look for that keyword in the example audio doc and just copy it.

Big thanks again, wouldn’t have figured it out on my own.

1 Like

Oh I’m so glad this helped! Somehow I didn’t think about linking you to the relevant docs, my bad. I’m glad your issue was sorted, happy deving!!