Is there a starter system based on the v10 DataModel?

I'm creating a new system (sci-fi with a cyberpunk theme, battles in space, land vehicles, and close combat, advancement through currency more than levels, more guns and devices with very little "magic" - may throw some psionic stuff in there to make the wizards happy). I'd like to build it up to the current state of the art, but it seems boilerplate, simple worldbuilding, and all the tutorials I can find are built for v9 with all the models in template.json. I can just start from scratch and follow the (scattered) documentation, but if there's already a better starting point, it would help to start from there. Either way, if there isn't, I'll build generically for as long as I can (while avoiding the dynamic no-code approach - there should be a starter project for developers who aren't afraid to code), then publish that as a new minimal starter project before customizing it to my needs.
49 Replies
Zellenon
Zellenonโ€ข16mo ago
That would be awesome! The closest I've found so far is this. I hope it helps you if no one knows of anything better. https://github.com/ghost-fvtt/foundry-factory
GitHub
GitHub - ghost-fvtt/foundry-factory: An interactive command line to...
An interactive command line tool to bootstrap new modules and systems for Foundry Virtual Tabletop - GitHub - ghost-fvtt/foundry-factory: An interactive command line tool to bootstrap new modules a...
wyrmisis
wyrmisisโ€ข16mo ago
I could try to put something together for this. I recently set up a new project, so the steps are still pretty fresh in my mind.
Progor
ProgorOPโ€ข16mo ago
@Zellenon I was looking for something with at least an Actor and character sheet. @wyrmisis if you could find time to do that, it would be a help.
wyrmisis
wyrmisisโ€ข16mo ago
Already on it ๐Ÿ™‚ Taking my current project and stripping stuff out. I'm including the work I've done on web components as well, because I'm just going to shill for them any chance I get
Progor
ProgorOPโ€ข16mo ago
Ideally, a starter system would have a character and npc Actor, an Item, and character sheets for the character and npc. target selection and attack automation would be useful. A compendium or 2 with a few items and npcs. I'm talking sword, bow, staff, staff of fireball, and fighter, archer, mage. All built with the simplest, most up-to-date approach possible.
wyrmisis
wyrmisisโ€ข16mo ago
This is likely going to be at least a little opinionated. I'm hoping to include eslint, prettier, stylelint, stuff like that for code quality
Progor
ProgorOPโ€ข16mo ago
Yeah, I think everybody has to pick something.
wyrmisis
wyrmisisโ€ข16mo ago
It'd be cool to add some testing, both with Quench (for E2E testing) and Jest (for web components)
Progor
ProgorOPโ€ข16mo ago
Maybe I can take what you end up with and make a more extensive foundry-factory template to provide more options.
wyrmisis
wyrmisisโ€ข16mo ago
Heck yeah
Progor
ProgorOPโ€ข16mo ago
Hmmm, an active effect would be useful to demonstrate as well. Maybe the staff of fireball can leave you "burning" in addition to its initial damage. I'm trying to come up with something that is clearly recognizable as an oversimplified d20 system in like 20 files or less so it's not so overwhelming to get started.
wyrmisis
wyrmisisโ€ข16mo ago
I'm starting off with a heavily-commented set of basic building blocks
Progor
ProgorOPโ€ข16mo ago
That sounds like a good start.
wyrmisis
wyrmisisโ€ข16mo ago
Something like
src
โ”œโ”€โ”€ actor
โ”‚ โ”œโ”€โ”€ _entity.ts
โ”‚ โ”œโ”€โ”€ character
โ”‚ | โ”œโ”€โ”€ index.ts
โ”‚ โ”‚ โ”œโ”€โ”€ abilityscore.character.datamodel.ts
โ”‚ โ”‚ โ”œโ”€โ”€ character.datamodel.ts
โ”‚ โ”‚ โ”œโ”€โ”€ character.sheet.module.css
โ”‚ โ”‚ โ””โ”€โ”€ character.sheet.ts
โ”‚ โ””โ”€โ”€ monster
โ”‚ โ”œโ”€โ”€ index.ts
โ”‚ โ”œโ”€โ”€ monster.datamodel.ts
โ”‚ โ”œโ”€โ”€ monster.sheet.module.css
โ”‚ โ””โ”€โ”€ monster.sheet.ts
โ”œโ”€โ”€ assets
โ”‚ โ””โ”€โ”€ .gitkeep
โ”œโ”€โ”€ components
โ”‚ โ”œโ”€โ”€ base-component.ts
โ”‚ โ”œโ”€โ”€ decorators.ts
โ”‚ โ”œโ”€โ”€ ex-form-associated-component
โ”‚ โ”‚ โ”œโ”€โ”€ ex-form-associated-component.css
โ”‚ โ”‚ โ””โ”€โ”€ ex-form-associated-component.ts
โ”‚ โ”œโ”€โ”€ ex-item-component
โ”‚ โ”‚ โ”œโ”€โ”€ ex-item-component.css
โ”‚ โ”‚ โ””โ”€โ”€ ex-item-component.ts
โ”‚ โ”œโ”€โ”€ ex-simple-component
โ”‚ โ”‚ โ”œโ”€โ”€ ex-simple-component.css
โ”‚ โ”‚ โ””โ”€โ”€ ex-simple-component.ts
โ”‚ โ””โ”€โ”€ index.ts
โ”œโ”€โ”€ constants.ts
โ”œโ”€โ”€ css
โ”‚ โ”œโ”€โ”€ sheets
โ”‚ โ”‚ โ”œโ”€โ”€ actor.sheet.css
โ”‚ โ”‚ โ”œโ”€โ”€ item.sheet.css
โ”‚ โ”‚ โ””โ”€โ”€ shared.css
โ”‚ โ”œโ”€โ”€ styles.css
โ”‚ โ””โ”€โ”€ variables.css
โ”œโ”€โ”€ data
โ”‚ โ””โ”€โ”€ dummy.json
โ”œโ”€โ”€ helpers
โ”‚ โ”œโ”€โ”€ dummy.ts
โ”‚ โ””โ”€โ”€ index.ts
โ”œโ”€โ”€ hooks
โ”‚ โ”œโ”€โ”€ devModeReady.ts
โ”‚ โ””โ”€โ”€ init.ts
โ”œโ”€โ”€ item
โ”‚ โ”œโ”€โ”€ _entity.ts
โ”‚ โ”œโ”€โ”€ armor
| โ”‚ โ”œโ”€โ”€ index.ts
โ”‚ โ”‚ โ”œโ”€โ”€ armor.datamodel.ts
โ”‚ โ”‚ โ”œโ”€โ”€ armor.sheet.module.css
โ”‚ โ”‚ โ””โ”€โ”€ armor.sheet.ts
โ”‚ โ”œโ”€โ”€ item
| โ”‚ โ”œโ”€โ”€ index.ts
โ”‚ โ”‚ โ”œโ”€โ”€ item.datamodel.ts
โ”‚ โ”‚ โ”œโ”€โ”€ item.sheet.module.css
โ”‚ โ”‚ โ””โ”€โ”€ item.sheet.ts
โ”‚ โ””โ”€โ”€ weapon
| โ”œโ”€โ”€ index.ts
โ”‚ โ”œโ”€โ”€ weapon.datamodel.ts
โ”‚ โ”œโ”€โ”€ weapon.sheet.module.css
โ”‚ โ””โ”€โ”€ weapon.sheet.ts
โ”œโ”€โ”€ system.ts
โ””โ”€โ”€ templates
โ”œโ”€โ”€ armor.sheet.hbs
โ”œโ”€โ”€ character.sheet.hbs
โ”œโ”€โ”€ item.sheet.hbs
โ”œโ”€โ”€ monster.sheet.hbs
โ””โ”€โ”€ weapon.sheet.hbs
src
โ”œโ”€โ”€ actor
โ”‚ โ”œโ”€โ”€ _entity.ts
โ”‚ โ”œโ”€โ”€ character
โ”‚ | โ”œโ”€โ”€ index.ts
โ”‚ โ”‚ โ”œโ”€โ”€ abilityscore.character.datamodel.ts
โ”‚ โ”‚ โ”œโ”€โ”€ character.datamodel.ts
โ”‚ โ”‚ โ”œโ”€โ”€ character.sheet.module.css
โ”‚ โ”‚ โ””โ”€โ”€ character.sheet.ts
โ”‚ โ””โ”€โ”€ monster
โ”‚ โ”œโ”€โ”€ index.ts
โ”‚ โ”œโ”€โ”€ monster.datamodel.ts
โ”‚ โ”œโ”€โ”€ monster.sheet.module.css
โ”‚ โ””โ”€โ”€ monster.sheet.ts
โ”œโ”€โ”€ assets
โ”‚ โ””โ”€โ”€ .gitkeep
โ”œโ”€โ”€ components
โ”‚ โ”œโ”€โ”€ base-component.ts
โ”‚ โ”œโ”€โ”€ decorators.ts
โ”‚ โ”œโ”€โ”€ ex-form-associated-component
โ”‚ โ”‚ โ”œโ”€โ”€ ex-form-associated-component.css
โ”‚ โ”‚ โ””โ”€โ”€ ex-form-associated-component.ts
โ”‚ โ”œโ”€โ”€ ex-item-component
โ”‚ โ”‚ โ”œโ”€โ”€ ex-item-component.css
โ”‚ โ”‚ โ””โ”€โ”€ ex-item-component.ts
โ”‚ โ”œโ”€โ”€ ex-simple-component
โ”‚ โ”‚ โ”œโ”€โ”€ ex-simple-component.css
โ”‚ โ”‚ โ””โ”€โ”€ ex-simple-component.ts
โ”‚ โ””โ”€โ”€ index.ts
โ”œโ”€โ”€ constants.ts
โ”œโ”€โ”€ css
โ”‚ โ”œโ”€โ”€ sheets
โ”‚ โ”‚ โ”œโ”€โ”€ actor.sheet.css
โ”‚ โ”‚ โ”œโ”€โ”€ item.sheet.css
โ”‚ โ”‚ โ””โ”€โ”€ shared.css
โ”‚ โ”œโ”€โ”€ styles.css
โ”‚ โ””โ”€โ”€ variables.css
โ”œโ”€โ”€ data
โ”‚ โ””โ”€โ”€ dummy.json
โ”œโ”€โ”€ helpers
โ”‚ โ”œโ”€โ”€ dummy.ts
โ”‚ โ””โ”€โ”€ index.ts
โ”œโ”€โ”€ hooks
โ”‚ โ”œโ”€โ”€ devModeReady.ts
โ”‚ โ””โ”€โ”€ init.ts
โ”œโ”€โ”€ item
โ”‚ โ”œโ”€โ”€ _entity.ts
โ”‚ โ”œโ”€โ”€ armor
| โ”‚ โ”œโ”€โ”€ index.ts
โ”‚ โ”‚ โ”œโ”€โ”€ armor.datamodel.ts
โ”‚ โ”‚ โ”œโ”€โ”€ armor.sheet.module.css
โ”‚ โ”‚ โ””โ”€โ”€ armor.sheet.ts
โ”‚ โ”œโ”€โ”€ item
| โ”‚ โ”œโ”€โ”€ index.ts
โ”‚ โ”‚ โ”œโ”€โ”€ item.datamodel.ts
โ”‚ โ”‚ โ”œโ”€โ”€ item.sheet.module.css
โ”‚ โ”‚ โ””โ”€โ”€ item.sheet.ts
โ”‚ โ””โ”€โ”€ weapon
| โ”œโ”€โ”€ index.ts
โ”‚ โ”œโ”€โ”€ weapon.datamodel.ts
โ”‚ โ”œโ”€โ”€ weapon.sheet.module.css
โ”‚ โ””โ”€โ”€ weapon.sheet.ts
โ”œโ”€โ”€ system.ts
โ””โ”€โ”€ templates
โ”œโ”€โ”€ armor.sheet.hbs
โ”œโ”€โ”€ character.sheet.hbs
โ”œโ”€โ”€ item.sheet.hbs
โ”œโ”€โ”€ monster.sheet.hbs
โ””โ”€โ”€ weapon.sheet.hbs
Outside of src I have config for stuff like rollup and whatnot
Progor
ProgorOPโ€ข16mo ago
what's a component?
wyrmisis
wyrmisisโ€ข16mo ago
Web Components - Web APIs | MDN
Web Components is a suite of different technologies allowing you to create reusable custom elements โ€” with their functionality encapsulated away from the rest of your code โ€” and utilize them in your web apps.
Progor
ProgorOPโ€ข16mo ago
(Showing my age here) "Oh! Paper! Got it!" coolcry
wyrmisis
wyrmisisโ€ข16mo ago
I think they're pretty neat! I'd like to raise awareness for them as a tool in our package dev toolbox for style encapsulation and keeping JS smallish and testable I think Handlebars is fine, but it leaves us in a spot where we have to stuff a bunch of functional code into Handlebars helpers or sheet files. Neither are ideal.
Progor
ProgorOPโ€ข16mo ago
Mozilla has been pushing this concept for about 15 years. I wish it had seen greater adoption as well.
wyrmisis
wyrmisisโ€ข16mo ago
Yeah, core has an issue on the books to better support web components: https://github.com/foundryvtt/foundryvtt/issues/8889
GitHub
Unblock Web Components for usage in Foundry ยท Issue #8889 ยท foundry...
Currently, web components are somewhat usable in Foundry, but input elements largely don't work due to the Keybinding system not knowing when a shadow form element is focused. Additionally, we ...
wyrmisis
wyrmisisโ€ข16mo ago
I only just found it this evening
Progor
ProgorOPโ€ข16mo ago
Is it possible to use something like React in foundry?
wyrmisis
wyrmisisโ€ข16mo ago
With enough teeth-pulling. Vueport exists, too (I personally haven't done React in FVTT but I think I remember someone looking into it?)
Progor
ProgorOPโ€ข16mo ago
Figured. MVVMs like handlebars and Vueport have the "I can't put my code where it really makes sense to put my code" problem. Why can't I style="width: {value * 100 / max}%" to create a progress bar, for instance.
wyrmisis
wyrmisisโ€ข16mo ago
Web components to the rescue ๐Ÿ˜„
Progor
ProgorOPโ€ข16mo ago
React solves it too, in a more generic, but perhaps harder-to-integrate way. Web components is a close second in my book.
wyrmisis
wyrmisisโ€ข16mo ago
Yeah, web components definitely have ease of integration down, at the cost of being quite a bit more verbose to create
wyrmisis
wyrmisisโ€ข16mo ago
GitHub
sword-world-2-5/src/components/base-component.ts at main ยท wyrmisis...
An implementation of the Sword World 2.5e TTRPG system for the Foundry virtual tabletop! - wyrmisis/sword-world-2-5
Progor
ProgorOPโ€ข16mo ago
chefkiss is the way.
wyrmisis
wyrmisisโ€ข16mo ago
Thanks. You can see why I'm trying to evangelize them for Foundry dev, hahaha
Progor
ProgorOPโ€ข16mo ago
(for context, 10-year software architect here. I've become slow at building new code from scratch, but recognize good architecture when I see it, and this is that.)
wyrmisis
wyrmisisโ€ข16mo ago
I've got twelve years of UI dev under my belt myself!
Progor
ProgorOPโ€ข16mo ago
I'm 40 years old. Started programming in middle school on some Apple IIe's in the computer lab. facepalmpicard
wyrmisis
wyrmisisโ€ข16mo ago
I didn't start writing code until like 2009, back when the web standards stuff was in full swing, and we needed two different branches to handle AJAX code (thanks IE)
Progor
ProgorOPโ€ข16mo ago
GWBasic on 5 1/4" floppys ๐Ÿ™‚ When I started web ui, it was called Dynamic HTML ๐Ÿ™‚
wyrmisis
wyrmisisโ€ข16mo ago
Hahahaha oh man I remember the tutorials
TyphonJS (Michael)
TyphonJS (Michael)โ€ข16mo ago
I have been working on a very solid library and framework since Oct '21 for using Svelte w/ Foundry that is being used by several devs. It's rather mature with more coming down the pipeline. There are folks using it for game system dev. Re: web components; they are great and I also use Svelte to implement them. Hopefully w/ the v12 mods there may be less restrictions in the server side sanitation (chat messages / journals) to allow them through. A thread opened last year re: WC: https://discord.com/channels/170995199584108546/954877261679566928 Demo I made of how WC could be embedded via RTE / TinyMCE and contain interactive blocks: https://www.youtube.com/watch?v=HMOCgGZFi0A
Progor
ProgorOPโ€ข16mo ago
Where is that thread? I don't currently have access to it. Also, is your system public? Heh, guess I should have googled your name ๐Ÿ™‚ Guess the JS should have tipped me off ๐Ÿ™‚
TyphonJS (Michael)
TyphonJS (Michael)โ€ข16mo ago
I do run a Discord server where folks using Svelte and TRL (TyphonJS Runtime Library) hang out and discuss all things Svelte + Foundry. Several folks have public game systems. Some of the modules you might be familiar with include Wasp's efforts like Item Piles which is pretty popular. Forien is cooking up something new that I'm curious to see what comes from that. There isn't a turn-key starter system setup presently, but I'll be looking into that in the near future. It's not too hard to get started though and there should be ~4-6 public systems using the tech including folks actively working on them. Here is the Discord server: https://discord.gg/mnbgN8f Wouldn't be too hard to get a round up / make a post in the #dev-lounge on who is working on a system and if it's available publicly. The pin in the #welcome channel has more dev starter details. re: google... Still postponing / getting a public site up for all of this and that is coming 1st half '24. The main demo module is essential-svelte-esm and can be found here which has a bunch of demos: https://github.com/typhonjs-fvtt-demo
Progor
ProgorOPโ€ข16mo ago
Understood. I'll probably steer clear of this direction for now - it sounds like it still needs some support from Foundry before it can be fully integrated without workarounds - but will definitely keep an eye on it.
TyphonJS (Michael)
TyphonJS (Michael)โ€ข16mo ago
Not sure what you mean by workarounds. It's been rock solid for quite some time. That is if you want to use the sweet sweet advantage of using Svelte w/ Foundry. TRL provides a managed bridge for Svelte in the application lifecycle and makes everything that can be reactive about app dev so out of the box + has lots of performance improvements / features over the App v1 API. If curious just install the essential-svelte-esm module to take a look.
Progor
ProgorOPโ€ข15mo ago
I read "Hopefully w/ the v12 mods there may be less restrictions in the server side sanitation (chat messages / journals) to allow them through." as "there are lots of things that need workarounds to get around server side sanitation right now"
TyphonJS (Michael)
TyphonJS (Michael)โ€ข15mo ago
That's just the current situation for web components in general being more accepted in some areas like chat messages / journal entries where they could really shine, so a separate issue than whether Svelte is viable in general. I just happen to also use TRL / Svelte to implement web components which brings the best of situations having a reactive library w/ Foundry integration + web components. You can definitely use Svelte aside from web components for module / system dev and 3rd party devs do seem to stick with it when they take the chance to check it out. Checking out some of the demos in essential-svelte-esm module shows off some fancy things that are possible: https://github.com/typhonjs-fvtt-demo/essential-svelte-esm I'll be keeping pace w/ all the Foundry releases forthcoming including the App v2 efforts. The nice thing is that everything works fine now. I'm also working on bringing all of the cool stuff developed while incubating on Foundry to the wider Svelte community as there is no "windowed GUI" solution for Svelte in general now.
Progor
ProgorOPโ€ข15mo ago
about to install it on my server now. I guess I can create Journal "Items" until then ๐Ÿ™‚
TyphonJS (Michael)
TyphonJS (Michael)โ€ข15mo ago
Any RTE text areas are sanitized presently. So no web component tags will make it through on the DB / server side. This likely will change in v12.
Progor
ProgorOPโ€ข15mo ago
Or is the Journal/chat still usable with Svelte, just not web components in Svelte? I'm imagining a Journal Entry that knows where the party is in the story and progressively reveals more information...
TyphonJS (Michael)
TyphonJS (Michael)โ€ข15mo ago
The web component things is separate entirely of using Svelte. Kind of got mixed up in the conversation above. There is a demo in essential-svelte-esm that shows using Svelte for a chat message; granted not a super complex demo, but the basic hookup is shown. The journal entry idea is another can of worms as that is basically a rich text editor / RTE field. Better off making a separate module / app where you can control the UI / progressive revealing of information. This also more fits the idea around a quest log somewhat.. I put in a lot of time to fully build out FQL / Forien's Quest Log module that folks use for progressive story telling and more. FQL is built w/ the Foundry core tech currently though I'm considering using TRL / Svelte to build a very supped up next-gen version, but haven't committed to that quite yet. I'm definitely putting in the time on the underlying framework / library though.
Progor
ProgorOPโ€ข15mo ago
@TyphonJS (Michael) [UTC-7] Does TyphonJS use SvelteKit or just Svelte (learning Svelte now).
TyphonJS (Michael)
TyphonJS (Michael)โ€ข15mo ago
SvelteKit is a separate web app framework. TRL uses Svelte / Vite / NPM (Node) including support for fancy HMR for all live editing of Svelte components while running Foundry. I am working towards re-architecting TRL to work on top of SvelteKit / Svelte without Foundry; ETA on that first half of '24. Yeah.. If you have questions do decide to move ahead w/ things do drop by my server as I can help answer questions and you can get input from other folks working on game systems as well. A good first step though as I'm sure you found already is working through the excellent Svelte interactive tutorial that covers what Svelte in general brings to the table: https://learn.svelte.dev/tutorial/welcome-to-svelte TRL is basically a set of libraries and frameworks 1st & 3rd party that all work well together along with Foundry integration points including a "standard" library of components I'm building out for app dev. Lots there, but you can optionally use what works. It's kind of like a supped up version of Svelte more or less.
Want results from more Discord servers?
Add your server