Building my custom framework. Criticism welcome. :)

Talk about whatever topic you'd like, RPG related or not. (But please discuss things related to our software in the Tools section, below.)

Moderators: dorpond, trevor, Azhrei

Post Reply
Elyre_Elan
Kobold
Posts: 22
Joined: Tue Feb 14, 2017 5:33 pm

Building my custom framework. Criticism welcome. :)

Post by Elyre_Elan »

Hello Everyone;

Looking for framework design tips or at least some validation that my approach is not utterly dumb.

I run a Judges Guild Wilderlands-influenced Pathfinder campaign that is fairly customized. As a rather new campaign (and new maptools user), I started with just putting some standard combat macros, health bars, states and utility stuff to move combat along while players navigate my various (and somewhat primitive) maps.

Behind the scenes, I am working on a more robust system that, while not providing much utility yet, I envision to transform the framework's utility.

A key component to this design is the use of library tokens that act as "databases". Properties of these library tokens are data items (skills, weapons, feats, races, etc.) whose attributes are stored in a json array of objects. For instance, Acrobatics, a skill, is stored as a property in Lib:SkillsDB and has a json array as an attribute that stores the various data associated with Acrobatics (source, ability, class, short_description, etc.).

Each library token possesses a series of macros. The "utility" functions (generally create, read, update and delete (CRUD)) have their own section and are GM only. The "interface" functions are those that the player and/or GM may add to use in their own macros. These interface functions allow searching for a property, obtaining a property's attributes or even formatting such properties as a quick display.

The goal is to store all of the relevant game rule information in these various library tokens and call the data when required (for a character sheet for instance). My goal is to only have static data stored once anywhere, and minimize stored derived data. I understand that I will need to make a few compromises for performance sake.

Any comments on my approach?

Elyre_Elan
Kobold
Posts: 22
Joined: Tue Feb 14, 2017 5:33 pm

Re: Building my custom framework. Criticism welcome. :)

Post by Elyre_Elan »

Well, I downloaded Imarkus001's framework, and... I'm humbled. My approach is not at all the approach that is used in this framework, and the level of detail and complexity is somewhat breathtaking. I may have to rethink mine (I still need to build my own as my ruleset is heavily customized... dangit).

User avatar
aliasmask
RPTools Team
Posts: 9024
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Building my custom framework. Criticism welcome. :)

Post by aliasmask »

Lindsays' FW has been in the works for many many years and with several collaborators. It's a good base to do any customizations from.

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Building my custom framework. Criticism welcome. :)

Post by wolph42 »

lol, I know even if I look back at my own framework which have been developed over the last 7 years with several people, I'm staggering at the complexity of it...
Don't be put of by it. Ive read you're initial post and thought: that looks good.
Point here is: you need to just get starting, which is the best way to learn mt script and its do's and don'ts.
Looking at FW that have been developed over years can be a bit too daunting and I would not let you be scared of by that too much. Have a look, pick some things that you think is neat and useful, set yourself reachable targets (e.g. core combat rules implement only or spell lib of these books only or ...etc.) and execute that. When done see if you want to do more.

User avatar
Full Bleed
Demigod
Posts: 4736
Joined: Sun Feb 25, 2007 11:53 am
Location: FL

Re: Building my custom framework. Criticism welcome. :)

Post by Full Bleed »

wolph42 wrote:lol, I know even if I look back at my own framework which have been developed over the last 7 years with several people, I'm staggering at the complexity of it...
Don't be put of by it. Ive read you're initial post and thought: that looks good.
Point here is: you need to just get starting, which is the best way to learn mt script and its do's and don'ts.
Looking at FW that have been developed over years can be a bit too daunting and I would not let you be scared of by that too much. Have a look, pick some things that you think is neat and useful, set yourself reachable targets (e.g. core combat rules implement only or spell lib of these books only or ...etc.) and execute that. When done see if you want to do more.
This is good advice.

In fact, chances are you will come up with some better ideas along the way and "course-correct" as needed. The good thing about building your own framework instead of trying to adopt something as complex/massive as lmarkus' is that you're going to be able to focus on what's important to you and your game.

Some things I would suggest for any new framework builder:

1) Start with Wolph's BoT in your framework. It really includes a good number of the "greatest hits" of MT macro coding.
2) Start with Alias' RPedit in your framework. Get comfortable using it.
3) Explore storing as much player/token information on Lib tokens as possible (it sounds like you're leaning that way). I prefer to have unique "data base" Lib tokens for each Player Character these days. I wish I'd focused on this method even earlier in my development.
4) Use a single Code level as much as possible (two levels are convenient and sometimes unavoidable, but it is the single largest performance hit in my experience and can get in the way later).
5) Get comfortable with UDF's and document your work.

Have fun!
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Building my custom framework. Criticism welcome. :)

Post by wolph42 »

Full Bleed wrote:4) Use a single Code level as much as possible (two levels are convenient and sometimes unavoidable, but it is the single largest performance hit in my experience and can get in the way later).

pssst, there's a trick to use more than two nested {} in your code. I've been using it for 5 years now without any issue, you can find it in the wiki article concerning more than two nested levels. Don't tell the others :wink:

User avatar
Full Bleed
Demigod
Posts: 4736
Joined: Sun Feb 25, 2007 11:53 am
Location: FL

Re: Building my custom framework. Criticism welcome. :)

Post by Full Bleed »

wolph42 wrote:pssst, there's a trick to use more than two nested {} in your code. I've been using it for 5 years now without any issue, you can find it in the wiki article concerning more than two nested levels. Don't tell the others :wink:
Yeah, I know. ;) I've looked at that before... I remember it being a little hacky though. But, mainly, I was just commenting on the performance hit I often see with using 2 code levels.
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."

Elyre_Elan
Kobold
Posts: 22
Joined: Tue Feb 14, 2017 5:33 pm

Re: Building my custom framework. Criticism welcome. :)

Post by Elyre_Elan »

Thank-you, Full Bleed, Wolph42 and Aliasmask. Really appreciate the advice!
Full Bleed wrote: Some things I would suggest for any new framework builder:

1) Start with Wolph's BoT in your framework. It really includes a good number of the "greatest hits" of MT macro coding.
2) Start with Alias' RPedit in your framework. Get comfortable using it.
3) Explore storing as much player/token information on Lib tokens as possible (it sounds like you're leaning that way). I prefer to have unique "data base" Lib tokens for each Player Character these days. I wish I'd focused on this method even earlier in my development.
4) Use a single Code level as much as possible (two levels are convenient and sometimes unavoidable, but it is the single largest performance hit in my experience and can get in the way later).
5) Get comfortable with UDF's and document your work.

Have fun!
I've been a bit cautious about incorporating others' work into the framework due to my inexperience, but I think I will "take the plunge". :)

I will also start converting to UDFs. Thank-you. I do document every Library token including the design philosophy, data structures and its macros and distribute this documentation to my players for comment. This documentation is mostly useful for me, however, since I tend to forget things rather frequently (why did I enter this room again?).

As an old one-time C coder, I try to build small, useful macros and then call them as needed to do stuff. I had hoped that that would improve performance and avoid significant nesting. It does mean, however, that I write a ton of small macros...

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Building my custom framework. Criticism welcome. :)

Post by wolph42 »

some remarks from my side:
the bot will initially make it hard as its a tough nut to crack if you want to use its full potetial. however i did do significant documentaion on the general udfs i created which should make your life easier to employ them.
as for nesting, i dont really have performance issues with those, ive never tested the impact of deep nesting but in my experience using lots of json and loops are the critical performance hogs that csn happen. coding those smartly is key, and being able to deep nest makes your code a lot easier to read, but thats my opinion. if you look at the work of aliasmask you will see the other 'flat coding philosophy' and am is 'a coding force of note' :D.

the best advice i can give you is to at least read the 'read this' linked in my sig and to check out the first link in my sig as it gives you an introduction and overview in maptools and its script.

next to that, post here so we can give feedback.

lastly you might also want to check out the 'how to speed up my macros' also linked in sig. ive developed tools in the bot for that to swiftly test different approaches and the article gives insight on key performance indicators.

Post Reply

Return to “General Discussion”