Browsing articles in "Labyrinth Lord"

Labyrinth Lord Treasure Updates

Apr 21, 2011
Mark
Comments Off on Labyrinth Lord Treasure Updates

Unprotected Treasure based on the Labyrinth Level has now been added to the Treasure and Treasure Book generators. The results are based on the table in Labyrinth Lord on page 124 in the hard copy variant.


Comments Off on Labyrinth Lord Treasure Updates

Labyrinth Lord Treasure Bugs, Part II

Apr 20, 2011
Mark
Comments Off on Labyrinth Lord Treasure Bugs, Part II

Black Wyvern found yet another bug in the treasure generation system. His post on the Goblinoid Games Forums correctly identified that magical armor wasn’t being generated properly. Additionally he pointed out that extraneous commas were still be shown in certain situations. Part of that was the armor issue and part of it was a database issue.

Those issues have been corrected. Thanks Black Wyvern.

Tags: ,

Comments Off on Labyrinth Lord Treasure Bugs, Part II

Treasure Book Tweaking

Apr 16, 2011
Mark
Comments Off on Treasure Book Tweaking

After several hours of tweaking and poking at the implementation of the Treasure Book on Demand, I’m declaring a temporary failure. No matter what I attempted, the production time is still limited by the PDF creation library. My routines are a minimal fraction of the overall time. I’m not certain what to try next. For now, I’ll leave it alone.

As a trade off, I added a daily production of the book that is available for immediate download. A 100-entry PDF is generated nightly. With seven days available, most people are probably covered. For a sample, you can grab the Treasure Book of the Day. The other six issues are available on the generator page.

Additionally, I added HTML and text output methods for people that would rather not have the results in PDF format. The non-PDF generation is far faster. I left the HTML very simple so it isn’t cluttered if someone chooses to print it.

Tags:

Comments Off on Treasure Book Tweaking

Bottlenecks: Not the friendly top of a longneck

Apr 14, 2011
Mark
Comments Off on Bottlenecks: Not the friendly top of a longneck

We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil – Donald Knuth

My Treasure Book generator has serious speed issues. It’s slower than frozen molasses. PHP isn’t my language of choice and my experience is limited. When I wrote the generator, I made quick and dirty decisions. Mostly I just wanted a proof of concept to demonstrate the functionality of the idea. Now, I need to address the fact that it’s slow.

The first issue I tackled was single-returns per hoard type. Shifting it over to array value returns resulted in next to nothing. It had worked previously for the Modern Name Generator. The difference is that the name generator was IO bound. The treasure book is not. Most of the calls are pretty lightweight and quick. Something was sucking up serious resources and my ad-hoc approach to fixing the application wasn’t producing results.

I really needed to figure out what the issue was. Like many programmers, I was quick to jump on prior knowledge without looking. When that failed, I was forced to find out how to profile php code. Turns out its not that hard. Enter Xdebug and KCacheGrind ( For the Windows folks, WinCacheGrind is the equivalent to KCacheGrind.). The former is a quick install and the latter is packaged with KDE. Tweak php.ini as described and you can profile php easily.

TreasureBook Profile

LLTreasureBook's Profile

My code isn’t really the issue. How I used TCPDF is the heart of the problem. If I’d bothered to RTFM, I’d have known I was doing it wrong. As the Performances (sic) page states,

Avoid using the HTML syntax (writeHTML and writeHTMLCell methods) if not strictly required;

It isn’t. It was convenient at the time. Now I have to rework to do a new layout.

Tags:

Comments Off on Bottlenecks: Not the friendly top of a longneck

Labyrinth Lord Utilities Feedback

Apr 12, 2011
Mark
Comments Off on Labyrinth Lord Utilities Feedback

Found something wrong with one of the utilities? Typos? Layout issue or complaint? Have a suggestion for an enhancement?

Feel free to note them here. You can always use the Contact Page as well.

If you do choose to comment, please indicate which of the utilities you are referencing to aid me in tracking down the problem.

Thanks for the feedback (and thanks to the person who suggested a feedback thread).

Tags:

Comments Off on Labyrinth Lord Utilities Feedback

Oops! LL Utility Errata

Apr 5, 2011
Mark
Comments Off on Oops! LL Utility Errata

Seems I had the code for Hoard Classes VIII and IX transposed. I fixed the problem in the generators but both the Treasure and Treasure book utilities were effected since they rely on the same general code. Anything prior to this post is in error.

My apologies for the error. If you see others, just let me know. Plus I added something new within the Labyrinth Lord treasure utilities.

Tags:

Comments Off on Oops! LL Utility Errata

Labyrinth Lord: Spellbook / Known Spells Generator

Apr 5, 2011
Mark
Comments Off on Labyrinth Lord: Spellbook / Known Spells Generator

Another day, another simple utility.   The Spellbook / Known Spell generator randomly selects a list of spells, ordered by level for a specified class and level.   Lists of spells can be tedious to generate by hand for utility NPC’s who are unlikely to ever use them or are not major players within a plot.   Player characters have the ability to shift the bit players into something more critical in the strangest ways.  Having even the bit parts more fleshed out is now easier with the Spellbook Creator.

The script uses the spell progression tables from the Labyrinth Lord Advanced Edition Companion for the base number of spells to generate.  For example, a 4th level Illusionist has two 1st and two 2nd level spells he can cast per day.   The generator will at a minimum generate those four spells.

Limiting the generator to the minimal number would be sufficient but would provide only a bare bones spell book.   Many individuals have access to more spells than they cast per day.   To allow for extra spells, the generator also  randomly adds between 0 and (Spell Count for level X)/2 (rounded down) additional entries.   If a mage could cast 9 1st level spells, the generator would produce 9-13 spells based on the original 9 plus  0 to (9/2)=4  add-ons.

Even with the add-ons, the generator is too simplistic.   If and when I get to it, version 2 will pre-fill the minimal spell counts and allow the user to specify how many additional spells desired per level.   Such a configuration would be much more functional and allow easier tuning to fit the needs of the game master.


Comments Off on Labyrinth Lord: Spellbook / Known Spells Generator