Menu
News
All News
Dungeons & Dragons
Level Up: Advanced 5th Edition
Pathfinder
Starfinder
Warhammer
2d20 System
Year Zero Engine
Industry News
Reviews
Dragon Reflections
White Dwarf Reflections
Columns
Weekly Digests
Weekly News Digest
Freebies, Sales & Bundles
RPG Print News
RPG Crowdfunding News
Game Content
ENterplanetary DimENsions
Mythological Figures
Opinion
Worlds of Design
Peregrine's Nest
RPG Evolution
Other Columns
From the Freelancing Frontline
Monster ENcyclopedia
WotC/TSR Alumni Look Back
4 Hours w/RSD (Ryan Dancey)
The Road to 3E (Jonathan Tweet)
Greenwood's Realms (Ed Greenwood)
Drawmij's TSR (Jim Ward)
Community
Forums & Topics
Forum List
Latest Posts
Forum list
*Dungeons & Dragons
Level Up: Advanced 5th Edition
D&D Older Editions, OSR, & D&D Variants
*TTRPGs General
*Pathfinder & Starfinder
EN Publishing
*Geek Talk & Media
Search forums
Chat/Discord
Resources
Wiki
Pages
Latest activity
Media
New media
New comments
Search media
Downloads
Latest reviews
Search resources
EN Publishing
Store
EN5ider
Adventures in ZEITGEIST
Awfully Cheerful Engine
What's OLD is NEW
Judge Dredd & The Worlds Of 2000AD
War of the Burning Sky
Level Up: Advanced 5E
Events & Releases
Upcoming Events
Private Events
Featured Events
Socials!
EN Publishing
Twitter
BlueSky
Facebook
Instagram
EN World
BlueSky
YouTube
Facebook
Twitter
Twitch
Podcast
Features
Top 5 RPGs Compiled Charts 2004-Present
Adventure Game Industry Market Research Summary (RPGs) V1.0
Ryan Dancey: Acquiring TSR
Q&A With Gary Gygax
D&D Rules FAQs
TSR, WotC, & Paizo: A Comparative History
D&D Pronunciation Guide
Million Dollar TTRPG Kickstarters
Tabletop RPG Podcast Hall of Fame
Eric Noah's Unofficial D&D 3rd Edition News
D&D in the Mainstream
D&D & RPG History
About Morrus
Log in
Register
What's new
Search
Search
Search titles only
By:
Forums & Topics
Forum List
Latest Posts
Forum list
*Dungeons & Dragons
Level Up: Advanced 5th Edition
D&D Older Editions, OSR, & D&D Variants
*TTRPGs General
*Pathfinder & Starfinder
EN Publishing
*Geek Talk & Media
Search forums
Chat/Discord
Menu
Log in
Register
Install the app
Install
Upgrade your account to a Community Supporter account and remove most of the site ads.
Community
General Tabletop Discussion
*Geek Talk & Media
d20Engine: Core Mechanic
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="reanjr" data-source="post: 2137113" data-attributes="member: 20740"><p>Note: I use the term mechanics separate from data for clarity, but the mechanics should be defined as data...</p><p></p><p>Going through the mechanics in the order of the book is a good way of going about it since the authors intentionally tried to avoid forward references of rules. Though I would like to point out that it might be advantageous to start with how you want to represent data (for define all the spells before you define the spell system, so you know everything you are looking at). Keeping the data simple to design is more important than keeping the mechanics simple for the end user.</p><p></p><p></p><p></p><p>I think AOP is a better design paradigm for this than OOP.</p><p></p><p></p><p></p><p>I think embedded script is the best way to go about this sort of thing. The only downfall to embedded script is language choice. I feel .NET as the platform of choice is a good idea because it allows each developer to use their own language. (I just want to point out that .NET IS cross-platform before people start complaining that it isn't; I have created several applications in that run on both Linux and Windows in .NET/Mono).</p><p></p><p></p><p></p><p>I think the trick is to design a way to use XML to create and attach events to different pieces of data. The event handlers can then be in the XML with embedded script to handle it. I've only experimented with this idea so far, nothing concrete. But it seems to be a good direction.</p><p></p><p></p><p></p><p>I assume you meant to put rolls instead of faces in the D20.</p><p></p><p>Any way, I think you should first start with a random number generator. As we are designing this for game use, it is safe to assume that random numbers would be integral to almost any game conceivable, so I have no problem relegating that to the App. The app can always ignore it if it wants (for a program made to simply print character sheets there would be no need). So as part of the contract, an application that intends to support logic (rather than just static representations of data) has to support a number of core functions. Some of these follow:</p><p></p><p><random min-result="..." max-result="..." /></p><p><add>...</add></p><p><subtract>...</subtract></p><p><multiply>...</multiply></p><p><divide options="round-down|round-up|round|float">...</divide></p><p><repeat num-times="...">...</repeat></p><p><set name="...">...</set></p><p><return>...</return></p><p></p><p>The ... represents passed arguments in the form <a>reference</a> or internal commands to run, depending on context.</p><p></p><p>So to define a roll function we might do the following:</p><p></p><p>[CODE]</p><p><function name="roll" face="6" num="1" mod="0"></p><p> <repeat num-times="num"></p><p> <set name="result"></p><p> <add></p><p> <a>result</a></p><p> <a><random min-result="1" max-result="face" /></a></p><p> </add></p><p> </set></p><p> </repeat></p><p> <add></p><p> <a>result</a></p><p> <a>mod</a></p><p> </add></p><p></function></p><p>[/CODE]</p><p></p><p>Note: return is not necessary; it is implied that the function returns the last result calculated (from the add function). Also note that the values set in the function tag are the default values. You can now call <roll face="20" /> to get a d20 roll.</p><p></p><p>You could then further define a d20 function for simplicity:</p><p></p><p>[CODE]</p><p><function name="d20"></p><p> <roll face="20" /></p><p></function></p><p>[/CODE]</p><p></p><p>and now use <d20 /> for a result.</p><p></p><p>Pretend we've now defined all the dice. We now need a check function to make a check of some kind. In this case, it uses context. Whenever the code encounter .whatever it is a reference to the whatever property of the calling context. If it encounters .[whatever] it resolves the whatever value and references that property of the calling context. When a passed paramete is given the "!" default value, then it must be supplied.</p><p></p><p>[CODE]</p><p><function name="check" type="!" dc="!"></p><p> <gte> <!-- greater than or equal to --></p><p> <add></p><p> <a><d20 /></a></p><p> <a>.[type]-mod</a></add></p><p> </add></p><p> <a>dc</a></p><p> </gte></p><p></function></p><p>[/CODE]</p><p></p><p>In the character, of course, we need to define how strength-mod, etc. is determined:</p><p></p><p>[CODE]</p><p><character></p><p> <strength-mod></p><p> <divide options="round-down"></p><p> <subtract></p><p> <a default="10">.strength</a></p><p> <a>10</a></p><p> </subtract></p><p> <a>2</a></p><p> </divide></p><p> </strength-mod></p><p></character></p><p>[/CODE]</p><p></p><p>The default attribute of a specifies that if the calling context does not have a .strength property set, then it should use 10 (to get no modifier).</p><p></p><p>you can now call <check type="strength" dc="15" /> to make a DC 15 strength check.</p><p></p><p>Anyway, some thoughts to bounce around. I know there are some holes in there that need to be plugged (for instace, setting the context - is this done by the application or by further XML script).</p></blockquote><p></p>
[QUOTE="reanjr, post: 2137113, member: 20740"] Note: I use the term mechanics separate from data for clarity, but the mechanics should be defined as data... Going through the mechanics in the order of the book is a good way of going about it since the authors intentionally tried to avoid forward references of rules. Though I would like to point out that it might be advantageous to start with how you want to represent data (for define all the spells before you define the spell system, so you know everything you are looking at). Keeping the data simple to design is more important than keeping the mechanics simple for the end user. I think AOP is a better design paradigm for this than OOP. I think embedded script is the best way to go about this sort of thing. The only downfall to embedded script is language choice. I feel .NET as the platform of choice is a good idea because it allows each developer to use their own language. (I just want to point out that .NET IS cross-platform before people start complaining that it isn't; I have created several applications in that run on both Linux and Windows in .NET/Mono). I think the trick is to design a way to use XML to create and attach events to different pieces of data. The event handlers can then be in the XML with embedded script to handle it. I've only experimented with this idea so far, nothing concrete. But it seems to be a good direction. I assume you meant to put rolls instead of faces in the D20. Any way, I think you should first start with a random number generator. As we are designing this for game use, it is safe to assume that random numbers would be integral to almost any game conceivable, so I have no problem relegating that to the App. The app can always ignore it if it wants (for a program made to simply print character sheets there would be no need). So as part of the contract, an application that intends to support logic (rather than just static representations of data) has to support a number of core functions. Some of these follow: <random min-result="..." max-result="..." /> <add>...</add> <subtract>...</subtract> <multiply>...</multiply> <divide options="round-down|round-up|round|float">...</divide> <repeat num-times="...">...</repeat> <set name="...">...</set> <return>...</return> The ... represents passed arguments in the form <a>reference</a> or internal commands to run, depending on context. So to define a roll function we might do the following: [CODE] <function name="roll" face="6" num="1" mod="0"> <repeat num-times="num"> <set name="result"> <add> <a>result</a> <a><random min-result="1" max-result="face" /></a> </add> </set> </repeat> <add> <a>result</a> <a>mod</a> </add> </function> [/CODE] Note: return is not necessary; it is implied that the function returns the last result calculated (from the add function). Also note that the values set in the function tag are the default values. You can now call <roll face="20" /> to get a d20 roll. You could then further define a d20 function for simplicity: [CODE] <function name="d20"> <roll face="20" /> </function> [/CODE] and now use <d20 /> for a result. Pretend we've now defined all the dice. We now need a check function to make a check of some kind. In this case, it uses context. Whenever the code encounter .whatever it is a reference to the whatever property of the calling context. If it encounters .[whatever] it resolves the whatever value and references that property of the calling context. When a passed paramete is given the "!" default value, then it must be supplied. [CODE] <function name="check" type="!" dc="!"> <gte> <!-- greater than or equal to --> <add> <a><d20 /></a> <a>.[type]-mod</a></add> </add> <a>dc</a> </gte> </function> [/CODE] In the character, of course, we need to define how strength-mod, etc. is determined: [CODE] <character> <strength-mod> <divide options="round-down"> <subtract> <a default="10">.strength</a> <a>10</a> </subtract> <a>2</a> </divide> </strength-mod> </character> [/CODE] The default attribute of a specifies that if the calling context does not have a .strength property set, then it should use 10 (to get no modifier). you can now call <check type="strength" dc="15" /> to make a DC 15 strength check. Anyway, some thoughts to bounce around. I know there are some holes in there that need to be plugged (for instace, setting the context - is this done by the application or by further XML script). [/QUOTE]
Insert quotes…
Verification
Post reply
Community
General Tabletop Discussion
*Geek Talk & Media
d20Engine: Core Mechanic
Top