I’m almost at the point where v1.8 is ready to go. I’m feeling like I trust the code again and back to working on the game. I made so many substantial changes that it dented my confidence, but I’m feeling good about it again.
As per my previous post @item
is no longer a basic element but has become an alias of the @card
element. In practice items now require a content:
template attribute and can be used directly in a scene. That’s working well and has given me some more ideas.
I suspect if I had known how much effort it would be going in I wouldn’t have started. But the result is the codebase is in a much better place and the convoluted and unpleasant NodeValidator
has been replaced by the much more elegant @schema
system.
I have further extended @schema
to support rules that pattern match on attribute names. For example the @inventory
schema now includes the following rule:
@schema inventory {
?/^initial_/: {kind: :list, coll_kind: :elem_ref}
}
to ensures that @inventory
attributes with an inital_
prefix must be a list of element references.
This was motivated by changes to inventory initial contents arising from the removal of table
attribute value. So now, instead of writing:
@slot topics_slot {
accepts: :topic
}
@slot backpack_slot {
accepts: :item
}
@inventory player_inventory {
slots: #{#topics_slot #backpack_slot}
initial_contents: {
#topics_slot: [#topic_1 #topic_2 ...]
#backpack_slot: [#item_1 #item_2 ...]
}
}
you would write:
@slot topics_slot {
accepts: :topic
accessor: :topics
}
@slot backpack_slot {
accepts: :item
accessor: backpack
}
@inventory player_inventory {
slots: #{#topics_slot #backpack_slot}
initial_topics: [#topic_1 #topic_2 ...]
initial_backpack: [#item_1 #item_2 ...]
}
Is this better? I think so. I certainly don’t think it’s worse, even with the implicit link being made through the @slot
accessor:
. Overall, I claim a win!
Inch-by-inch Rez gets closer to the tool I imagined.