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
*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
*TTRPGs General
*Pathfinder & Starfinder
EN Publishing
*Geek Talk & Media
Search forums
Chat/Discord
Menu
Log in
Register
Install the app
Install
Community
General Tabletop Discussion
*TTRPGs General
Designing a Random Table Generator
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="Janx" data-source="post: 5904794" data-attributes="member: 8835"><p>I probably wouldn't use the word Generator, but that's because I have a specific meaning for Block.</p><p></p><p>Both a Table and a Block produce a result. Tables by default generate a short fragment of text (due to the way 1 line defines 1 result in the table definition, there's just no room.</p><p></p><p>A Block is a big pile of text, rich text, html, vBulletin formatted text, makes no difference. Think of putting a whole statblock in there or Monster Manual entry, including image tag for the picture. You can't fit that in a table, but you can make table entry 2 for orc point to [OrcStatBlock] which would cause the Parsing Engine to getch the block and return that as the result for the table.</p><p></p><p>As for working with vBulletin, I don't have experience coding for it. But generically speaking, we define the Parsing Engine (or Generator as it is do-er of things) to recieve some text (from a wiki, vbulletin post, new web form, whatever), and it parses for those [] and {} tags. It then does whatever we mean for those to do.</p><p></p><p>The parsing action is a recursive behavior. Meaning that it reads a string "Results from the dragon table = [dragon]" and it finds the dragon table, rolls on it and then parses THAT result which might refer to another table or block (so we can display the stat block). From the parsing engine's perspective, each result, is new content to parse and deal with. </p><p></p><p>This is how the nesting of tables works in any of these table systems.</p><p></p><p>Now for explaining the infinite loop-check concept (which is a rough idea I made up and if it was unique and clever I'd patent):</p><p></p><p>First off, we know EVERY table is going to have a unique name. and each result row in the table MIGHT refer to another table. Ideally, we want to avoid a circle or infinite loop. </p><p></p><p>When we're in the editor for a signel specific table, we should perform a number of validation checks. Make sure the table name is unique in the system. Fix any other tables that refer to this one if we renamed it (that's called Refactoring in programmer speak). We also want to see if our table is called anywhere else in our chain of tables.</p><p></p><p>Let's make up some fake tables. Pretend that MyTable is the one we're currently editing and thus will be checking for infinite loops from its perspective.</p><p></p><p>[code]TABLE MyTable: 1d2</p><p>1: [Devils]</p><p>2: [Demons]</p><p>ENDTABLE</p><p></p><p>TABLE Devils:1d3</p><p>1: Satan</p><p>2: Santa</p><p>3: Beelzebub</p><p>ENDTABLE</p><p></p><p>Table Demons:1d4</p><p>1:Balor</p><p>2:Baatezu</p><p>3:Sucubus</p><p>4:[Ridethebus]</p><p>ENDTABLE</p><p></p><p>TABLE Ridethebus:1d3</p><p>1:Short</p><p>2:Long</p><p>3:[MyTable]</p><p>ENDTABLE</p><p></p><p>TABLE Unrealted:1d1</p><p>1:Dude, this is totally unrelated</p><p>ENDTABLE</p><p></p><p>[/code]</p><p></p><p></p><p>Let's pretend all this is defined as 1 file per table (ex. MyTable.txt). </p><p></p><p>Before I save MyTable.txt, I can scan all the files for the previous name of the table (let's say I just renamed it from JanxTable to Mytable). I can find all instances of [JanxTable] and replace with [MyTable]. That will make sure tables don't break when somebody renames a table for whatever reason makes sense at the time. This is a HUGE problem in code, and very valuable to help with.</p><p></p><p>Using a similar trick, with the help of the Parsing Engine put into a debug mode, we can get a list of ALL the tables that chain from MyTable.</p><p></p><p>Here's what we find, aranged as a tree:</p><p></p><p>MyTable</p><p>..Devils</p><p>..Demons</p><p>....Ridethebus</p><p>......MyTable</p><p></p><p>If we find our table name "MyTable" undeneath the top of the tree, we have an infinite loop scenario.</p><p></p><p>the idea is that you do this detection IN the editor, before it saves, allowing you to nip the problem in the bud.</p><p></p><p>You can also use this trick to validate that a table refers to other valid tables, preventing dead-ends that won't resolve.</p><p></p><p>Though, as I explained about the Parsing Engine, it is recursive (self-referencing). Each tag instantiates a nested call to itself. The operating system handles the problem quite well if it goes too deep, so it will throw an exception (an error that is trappable so we can gracefully terminate the work, without completely dying). An infinite loop of this sort hits that limit much sooner than infinity and won't hog all your CPU or memory.</p></blockquote><p></p>
[QUOTE="Janx, post: 5904794, member: 8835"] I probably wouldn't use the word Generator, but that's because I have a specific meaning for Block. Both a Table and a Block produce a result. Tables by default generate a short fragment of text (due to the way 1 line defines 1 result in the table definition, there's just no room. A Block is a big pile of text, rich text, html, vBulletin formatted text, makes no difference. Think of putting a whole statblock in there or Monster Manual entry, including image tag for the picture. You can't fit that in a table, but you can make table entry 2 for orc point to [OrcStatBlock] which would cause the Parsing Engine to getch the block and return that as the result for the table. As for working with vBulletin, I don't have experience coding for it. But generically speaking, we define the Parsing Engine (or Generator as it is do-er of things) to recieve some text (from a wiki, vbulletin post, new web form, whatever), and it parses for those [] and {} tags. It then does whatever we mean for those to do. The parsing action is a recursive behavior. Meaning that it reads a string "Results from the dragon table = [dragon]" and it finds the dragon table, rolls on it and then parses THAT result which might refer to another table or block (so we can display the stat block). From the parsing engine's perspective, each result, is new content to parse and deal with. This is how the nesting of tables works in any of these table systems. Now for explaining the infinite loop-check concept (which is a rough idea I made up and if it was unique and clever I'd patent): First off, we know EVERY table is going to have a unique name. and each result row in the table MIGHT refer to another table. Ideally, we want to avoid a circle or infinite loop. When we're in the editor for a signel specific table, we should perform a number of validation checks. Make sure the table name is unique in the system. Fix any other tables that refer to this one if we renamed it (that's called Refactoring in programmer speak). We also want to see if our table is called anywhere else in our chain of tables. Let's make up some fake tables. Pretend that MyTable is the one we're currently editing and thus will be checking for infinite loops from its perspective. [code]TABLE MyTable: 1d2 1: [Devils] 2: [Demons] ENDTABLE TABLE Devils:1d3 1: Satan 2: Santa 3: Beelzebub ENDTABLE Table Demons:1d4 1:Balor 2:Baatezu 3:Sucubus 4:[Ridethebus] ENDTABLE TABLE Ridethebus:1d3 1:Short 2:Long 3:[MyTable] ENDTABLE TABLE Unrealted:1d1 1:Dude, this is totally unrelated ENDTABLE [/code] Let's pretend all this is defined as 1 file per table (ex. MyTable.txt). Before I save MyTable.txt, I can scan all the files for the previous name of the table (let's say I just renamed it from JanxTable to Mytable). I can find all instances of [JanxTable] and replace with [MyTable]. That will make sure tables don't break when somebody renames a table for whatever reason makes sense at the time. This is a HUGE problem in code, and very valuable to help with. Using a similar trick, with the help of the Parsing Engine put into a debug mode, we can get a list of ALL the tables that chain from MyTable. Here's what we find, aranged as a tree: MyTable ..Devils ..Demons ....Ridethebus ......MyTable If we find our table name "MyTable" undeneath the top of the tree, we have an infinite loop scenario. the idea is that you do this detection IN the editor, before it saves, allowing you to nip the problem in the bud. You can also use this trick to validate that a table refers to other valid tables, preventing dead-ends that won't resolve. Though, as I explained about the Parsing Engine, it is recursive (self-referencing). Each tag instantiates a nested call to itself. The operating system handles the problem quite well if it goes too deep, so it will throw an exception (an error that is trappable so we can gracefully terminate the work, without completely dying). An infinite loop of this sort hits that limit much sooner than infinity and won't hog all your CPU or memory. [/QUOTE]
Insert quotes…
Verification
Post reply
Community
General Tabletop Discussion
*TTRPGs General
Designing a Random Table Generator
Top