Who are you, and what do you want?

My latest App is now live!

“Random NPC Generator” is, as its name suggests, a generator of random NPCs!

GMs, since time immemorial, have had to create characters to populate their game-worlds, often on the spur-of-the-moment. Some take easier to this task than others. I am one of the ones who does not take to it well at all. So to help my gaming, and hopefully other peoples’ as well, I wrote “Random NPC Generator”

An NPC

Now, at the click of a button, you can produce a Character, complete with Name, and a set of Traits, that can easily be used in your Fantasy Role-Playing Games!

If you don’t like any of the values, you can simply click to produce a different one!

Each Trait has many options available, and with literally Billions of combinations possible, you’ll never see the same NPC twice!

And all this available for free, to download to your Android phone!

Never be without an idea for an NPC again!

But wait, there’s more!

A Villain!

For the low, low price of just 99 of your English Pennies, you can upgrade to the PRO version!

The first added feature is Villains! Need an antagonist for your players to defeat? No problem! You can create Evil-named Villains, with Schemes, methods and Weaknesses, along with a location for their Lair!

Also included, as seen in these screenshots, is the ability to export your data! PRO version allows you to save both an image of your results, and also a text file, for easy reference later.

Just one more thing …

The other Feature that PRO brings is the chance to add your own data to the Trait tables! If there is some option that you would like to see, you can simply add it in!

So, if you struggle to know what people inhabit your World, download Random NPC Generator, and never be caught out again!

The Android Invasion (Part Three)

Life gets complicated.

Building Random Lists turned out to be a simple procedure. Buttons to choose which Category. Pick Lists (and grammar). Display in Recycler View.

I added a few extras, such as One Button to choose “Furniture”, with a sub-menu for Kitchen, Lounge, Bedroom etc. Quests included a Reward built from the Treasure Lists. Shops called from the Names Lists.

For the Pay Versions, I added some extra Features:

NPCs. Names became clickable, and built a random Person, with Traits pulled from other Lists. Personality, Valued Possession (Treasure), Mundane Items (new List), etc.

Add Data. This was a tricky one. I added the capability to add to the existing Lists. This data is stored in Text Files on the user’s phone, and added to the Array when the App draws up the Lists. I had quite a job figuring out where these files are stored, how to call them, and how to add them to the Array. In the end it worked though.

But we’re just calling Lists, and combining results.

Rome Wasn’t Built In a Day

And neither were my Apps!

But I did build a City-Builder. Not, unfortunately, a map-creator, although I am working on that. This is another Random Lists app that call up traits and features for a Fantasy City, such as Government Type, Local Features, Main Export, etc.

A Random City
A Random City

Again, each Feature was called from a List (still working with XML String-Arrays). Some used combined-lists (such as Renown). The Export facility was also included, and as can be seen from this picture, Exporting also saves a screen-shot.

A new feature for this App was to allow the User to “re-roll” a Trait. Clicking on one of the results will call up a new Trait.

The City is an “Object” (or “Class”) that holds information about each Trait, and when a Trait is re-rolled, the Class is updated with the new information.  (Only one City is held at any time. Creating a new one over-writes the old one).

The City Names are created from two sections. One is a list of predetermined Names, and the other a prefix-suffix combo. Here we see “Pen” + “dale”.  It could have produced “Pen”+”wood”, “Pen”+”ford”, etc.  (As an aside, I am working on a Planet Creator, and those names can pull from an algorithm similar to the one used in Elite, that combines some syllables to form a real-sounding word. The Starport names draw from combos that include a “mixer” between the prefix and suffix. “Hadley’s Hope” might be “Hadley’s New Hope”, or Hadley’s Last Hope”).

Next …

I am reaching the limits of my imagination, and what can be done with Random Lists. While there are many more “skins” I could put on them (Dungeon, Modern City, Monsters, Furniture, you name it …), I need something to allow me to learn more about programming. One area I have been meaning to investigate is Databases. While I did some simple work on them for my RPG pages, I need to know how to fit them into Android!

An idea soon brews up: Random Loots! D&D has always included random Treasure Tables, so I could write something inspired by the latest version, saving all the raw data in in tables, and calling it as needed!

It turns out that the worst part of this is typing in all of the data! As with all of these apps, there is a lot of information that needs storing.

The main structure of the database was easy enough to build, using “DB Browser for SQLite“, although I did have to keep adding more columns as I realised what code I needed.

There are two types of Treasure: Individuals and Hoard. Individuals just carry Cash, which is easy to define the range (dependant upon Challenge Level) and roll some dice. Hoards can include Gems or Artworks, and the chance of Magical Items (OOooh!!). Roll on the Table to determine what sort of thing is in the Loot Pile, and then on each sub-table to find the details.

A section of the Random Treasure Tables from the Dungeon Master's Guide
A section of the Random Treasure Tables from the Dungeon Master’s Guide

There are sub-tables for each Value of Gems and Artworks, and (as noted) multiple Magic Item tables. These are all easy to produce.

More difficult was deciding how much detail to display! Do the players want to know the full details of each gemstone, its exact value (for I introduced a randomiser for that!), what cut it has, etc, or just a Total Value for selling? I decided to include both! The App presents a Total, and clicks to present a list of details (using the previously-mentioned Recycler View).

New addition for Magic Item details was the Pop-Up window. This does  not change what Activity you are in, but adds a new display over the top of it. Here I included Maker, Minor Power, and Quirks that the Item may have.

Loot!
Loot!

Finally the Export Code was added. Again, I used the Screenshot, but also looked at Formatting the Exported Text, so that it was easier to read. This mainly meant iterating the Treasure List and adding a few Line Breaks, with Section Titles.

With the addition of a few details to prettify the App (background Picture, Icons, nice buttons), it was ready to publish!

Finally

It may sound like a lot of this went smoothly, but I spent an inordinate amount of time struggling with sections of code, hunting typos, retyping functions and searching Google/StackOverflow for error-messages. Eventually, I have some workable Apps! You can download them here.

If you would like more detail about the actual Code I ended up with, or if you have ideas for new Apps you would like to see, ytou can contact me at:

admin@maddwarf.co.uk

Thank you.

 

 

The Android Invasion (Part Two)

Some details

Code: A Summary

I’m not going to publish my whole Code here, but I will present a short explanation of how my App is structured.

Main Files:

  • activity_main.xml – this displays a set of labelled Buttons, one for each Category of List.
  • Main Activity – this contains the control-code for the Buttons, chooses which Activity to launch, and what message to send to it.
  • Several Activities, for different types of List.
  • Several Adaptor (or “Helper”) files, for processing the Lists, and binding them to the Recycler view.
  • A “Class” file for each Category. These define an Object-Type, and show how each Object holds Data*.
  • activity_(category).xml files, with data about how to display each List type
  • (category)_list_row.xml files for showing how each Row of the List should display.

Why Multiple Category Files?

As this was my first real foray into Android Coding, I chose to split the Categories into two main types. Type The First were ones that could be express as “Names”. i.e. two pieces of Data. (Forename and Surname). This applied to Treasures (Type and Amount/Quality), Items (Alchemical, Mundane, Furniture all have Type and Material). Type The Second were ones that did not fit this structure, and each got it’s own set of Files/Classes/Activities/Helpers (Adaptors). e.g. Quests and Locations.

I could have piled up a single set of files with “IF <quest> then <do something different> else IF <Location> do <location code>”, but chose to separate them out for my ease of reading/maintaining.

What Objects Did You Use?

Each “category” was given it’s own Class (type of Object*).

<Deep breath …> Each time an item from a category was needed (each item on a list), I Instantiated a new Object of that Class:

To instantiate a new “Treasure” object:

Treasure thisTreasure = new Treasure();

This calls the Constructor of the Class, to create that instance of the Class (i.e. make that Object.)

e.g. Treasures are randomly chosen from “Coin”, “Art”, “Jewellery” and “Gem”. Each of these has a List of Types (Coins may be gold, silver or copper, Art may be a painting, a sculpture or a vase), and an Amount/Quality (Coins have a number, e.g. 20 Gold Crowns. A painting might be Elaborate or Exquisite, a Gem has a Cut).

Once instantiated, the Object has its set of Values, that can be called (e.g. by the Recycler Helper), to do something with (e.g. Display in a Recycler View).

Are you keeping up?

For the “Name”-type Objects (2 pieces of data each), they are all sent to the Name Adaptor to Display in the Name List (even if they are not names. It’s just what I called the 2-data section).

Quests and Locations got a little more complicated.

Each Quest Object holds several pieces of Data:

A Quest!
A Quest!

As you can see, each Quest is structured:

“You must <activity> the <descriptor> <item> before <time>. If you succeed, you will be rewarded with <reward>”

Each of these is called randomly from its String-Array. The Quest Adaptor must bind each part of this to the appropriate Recycler View.

As a complication, the Reward is called as a Treasure Object!

Locations were built in a similar manner.

Enough!

OK, that will do for today!

Let me know how much of that you understood, or if you would like some more explanations.

————-

*Java is an “Object Oriented Programming” (or “OOP”) language. Most things are “Objects”, that have “Methods” associated with them.

The Android Invasion!

(Or: How I Learnt to Stop Worrying and Love the Code)

How I Learnt to Write Apps (A Summary)

As my regular readers will know, I have been writing Apps for Android Smart Phones. Here is where I share some of my experiences, and technical details. Partly to bring my audience an informative, entertaining insight into my brain-space, and partly to clarify in my own head what is going on!

The Set-up

The first thing I need is an Environment in which to write Code. This can be done with a simple text-editor (such as Notepad, or its big brother Notepad++), but more useful is the Official IDE (Integrated Development Environment) Android Studio. A simple task to download and install.

Simple, but time-consuming. A 758MB download, which, on install, will update itself, and fetch a variety of libraries, the Java SDK, and other assorted extras.

I will also need some way of testing my code. Luckily I have a variety of old Android Phones, and a Tablet. I chose most recent phone that I am no longer using (Samsung J5). This needs drivers finding and installing, and setting some developer Options to allow me to write Apps directly to it, rather than downloading from the Google Play Store.

I could have relied up on the built-in Android Emulator,  but even on Lucretia‘s Power-House Gaming Rig, it is painfully slow to use (an hour to build and transfer a small app, rather than a couple of minutes to a real phone!)

The Inevitable “Hello World” App

Android Studio presents a default App: the ubiquitous “Hello World”. This gives me an opportunity to learn the very basics of what an Android App looks like:

  • A Main Activity file, that stores the main code (Java)
  • A Layout file, telling the App what to display on the screen (XML)
  • A set of Resource files (Pictures – known as “Drawables”, Values – constants for use in the app, codes for Colours and Styles, and many other options)
  • The IDE files – Manifest, Gradle, etc (Do not worry about these yet. Most are automatically created by the IDE)

There are a whole bunch of options when creating an App, such as which version of Android you wish to target, and what is the lowest you will be writing for, how much code you would like the IDE to start with (depending on which Template you choose), and names for your Project, App, and Files. These soon become second-nature.

To test that everything in installed and connected correctly, I hit the “Run” button, and wait for the “Gradle Build Running” message to clear …

The Initial Bug-Hunting

Obviously, things did  not go as smoothly as they should.

The IDE could not detect my phone, so I had to hunt down and install the correct drivers. I had failed to set the Developer Options correctly on my phone. The App was set to a newer version of Android than my phone used …

This was all relatively painless to fix, but put me in the mindset that I was to keep: There WILL be bugs!

But eventually, I had my App!

Hello World!
Hello World!

Writing My Own App

First, I fiddled about with some basics, to get my head around how the IDE worked, and learn the very simplest Java code.

Changing the text from “Hello World!” to “Hello Mad Dwarf!”. Using different colours. Adding a picture. Randomly choosing a Name to say “Hello” to. Inputting a name to be displayed.

None of this was without problems, but Google and Stack Overflow provided some solutions, and soon I was ready to build an actual, functional App!

Idea: an Inspirational App, providing a set of Randomly Generated Lists for use in Role-Playing Games.

Several choices needed to be made: What lists do I include? How complex? What data-structure do I use?

Reading up on data-structures, I chose to store all of my data in XML Arrays in my Resources/Strings file. This uses a very simple syntax:

<string-array name=”clothes”>

<item>Shirt</item>

<item>Trousers</item>

</string-array>

A little experimentation with layouts, and I could display a Button labelled Clothes, and have it react to being pressed.

Technical Notes

When defining the Text Label for the Button, the IDE complains if you enter the text directly. The preferred manner is to define a String, and then call that String as needed.

<string name =”clothes_button”>Clothes</string>

android:text=”@string/clothes_button”

Next, I need to “Start a new activity”, and pass it the chosen List title. To check this actually works, I make sure I have a couple more lists, and label them, and the Buttons need @ID codes, and an OnClickListener that will call the @ID of the pressed Button. So, new File. I already have “Main Activity”, so I create “Display List Activity” … and this is where the “fun” begins …

New Activities

These are launched by defining an Intent, which tells the App which activity you want to launch, and you can add “Extras” to this, which the new Activity can read. I add a “Message” that is the @ID of the button (“clothes”, “alchemy”, “monsters”, etc). This new Activity will  need its own XML Layout File (Advanced: You can define this in the Activity. For now, I don’t).

This new Activity can retrieve the “message” (“Extra”), and call the associated List (I made them the exact same name, for simplicity).

Recycling for Beginners

When I last took a foray into Java/Android, the recommended way of showing a List was to use “List View”. While checking online to remind myself how to build a List View, I found that it has been replaced by “Recycler View”, a way of “recycling” a view, to show lists … It is actually very similar to use, but more flexible (it can display in List, Grid, or Card format!)

I also need the screen to be able to Scroll, if the List goes off the bottom of the screen. Very simple. Define a Scroll View to contain the Recycler View.

I also need to use (according to Stack Overflow!) a Recycler Helper; a secondary file that does the heavy lifting of being sent a list of data. creating holders, binding the list of data to the holder and sending it back to the Activity to display.

Overall, quite a pain to learn, but very useful once done.

In Summary

  • Create several lists (String-Arrays) in Strings file.
  • Display Labelled Buttons
  • “Listen” for a button being pressed, and launch the next activity, telling it which button.
  • New Activity calls the appropriate List, and sends it to the Helper to process.
  • Display the processed List in a Scrolling Recycler View.

    Loot!
    Loot!

    Places!
    Places!

     

With a few added features (like randomising which random list to use: Cash, Jewellery, Gems or Art), I have an APP!

If you feel you’d like to write apps, but are put off by how complicated it looks, why not have a go! Yes, you will hear me screaming into the void about bugs, typos, stupid decisions (by me, the IDE developers, and Google/Android!), and generally pulling all of my hair out, but it is very rewarding!

Inspirational Tools

I get by, with a little help from my friends.

So say the Beatles, and who am I to say they are wrong.

We all need a little help now and then, and GMs writing story-lines are no exception. From the names of antagonists to the location of their lair, from Quests to Completion-Rewards, sometimes our creative juices run dry.

So where do we turn?

Dice.

One Standard Set of Dice
One Standard Set of Dice

Our go-to source of randomness. Mostly our “Standard Set” of d4, d6, d8, d10, d12, d20 and d100. Very useful for creating numerical values. But what if you need something else?

The more resourceful of you may already own some Other Dice. Amongst my easily-to-hand collection, I found Emoji, Rock/Paper/Scissors,

Other Dice
Other Dice

Body Location, Dungeon Maps and more! There are a large range of dice, featuring Weather, Mood, Grammar, and much more!

But what about when you don’t have the right dice to hand? You need to check for Random Weather, but the only dice you have are Body Location and Who-Takes-First-Turn! This is where we turn to:

Tables!

Table of Magical Rings
Table of Magical Rings

Lists of possible outcomes, Tables can hold a huge amount more information than simple dice, and can be chained together to produce complex results. They can also shift the probabilities of results occurring. Usually they are designed to roll dice, and compare the result against the entries, or you can just choose an appropriate one.

The Internet is full of these tables, designed for each different Game System/Setting, and lots of Generic ones.

To make life simpler, and avoid having to hunt around for either dice or sheets of paper, or the right page of the Rule Book, we also have

Apps

A Random City
A Random City

Loaded on to a mobile phone, or tablet, these tend be be combinations of dice and tables. Tell the App what Feature you are wanting, and it will generate a random result, according to how it is programmed.

My current favourite App is (unsurprisingly) the one I wrote!

Combining Lists of Names, Places, Treasures, Quests and others Features, along with a Personality Generator, and lists of Features of a Fantasy City, The Mad Dwarf Inspirational Apps also allow you to add your own entries to the Lists, and save the results for use in later games.

There are Apps designed around most of the popular Games Systems, providing access to as much inspiration as you can handle!

Summary

Other ways of finding inspiration include reaching for a nearby book, and turning to a random page, loading a random Wikipedia page, or asking your Players to make a decision!

Most people will use a combination of methods to produce some interesting results, and the best way is often to interpret them in a way that fits your game.

 

When do you tend to run out of steam? What methods do you have for recharging your Creative Juices?

The State of The App

Now with added NPC details!

As you may have read, I did an App!

The free version is finalised, and will only be receiving security/stability updates.

EDIT: The Pro version is now available for UNDER ONE POUND! A mere 99 pence will get you access to expanded lists, and extra categories!

What it does:

Available Categories
Available Categories

The opening screen shows the different Categories available. This will hopefully grow as more data becomes available, and feedback is received.

I may choose use coloured Icons, but the basic format should be fine.

Currently the data-sets are based around Fantasy/Medieval styles. Treasures include Ornate Goblets and Lifelike Animal Statuettes, but not Smart-Phones, or Alien Artefacts! Quests involve Rescuing the Fairy-Queen, but not flying to other planets or destroying the Moon-Sized Space-Station!

Treasures Abound!
Treasures Abound!

Treasures are pulled from four separate lists:

  • Gems Will  have a Type (Diamond, Emerald etc), and a Cut-Style.
  • Jewellery/Clothing will have a Type (Ring, Earring, Belt), and a Style (Gem-Encrusted, Silver-Plated).
  • Art has a Type (Painting, Sculpture, etc) and a Style (Plain, Gaudy, Cubist, Baroque).
  • Coins have a Type (Gold, Silver) and a value (randomly generated between 1 and 1,000).

The app is clever enough to notice which Category the Treasure is in, and use the appropriate Icon.

Personality Traits
Personality Traits

Furniture is split into four categories: Bedroom, Bathroom, Kitchen and Lounge. Items will all have a Material (Stone, Wood, Tin), and are displayed the same as Treasures.

The new Alchemy section also follows this format, and includes Retorts, Flasks and Crucibles.

Personality takes a slightly more complex route, and calls three World Views and three Personal Ideals. One of each are Prime traits, and the others Secondary.

The (descriptor) (place) of (fate)
The (descriptor) (place) of (fate)

The Location section adds a little more, again, with each location having a descriptor, as well as guardians!

The long list of Guardians have various ways in which they protect the Location, either guarding, watching over, surrounding or holding sacred!

And now we come to the penultimate section: Quests! Different types of Quest are available, Find, Recover, Destroy, Document or even Authenticate! And Maguffins of all varieties! Flying Carpets, Dragon Shields, Saint’s Bones! Kittens! All need Hiding, Exposing, or even Protecting! Each Quest also has a Reward (taken from the Treasures list) associated with it, so our brave adventurers can assess the risk!

Greta Vernon, Adventurer, at your service!
Greta Vernon, Adventurer, at your service!

The last section begins quite simple, but then opens up a whole new area! Names are picked from an ever-growing list, with a 50/50 chance of Male/Female. This is simple enough. But click on any name, and you will be shown their Personality Traits, Prized Possession (Treasure), several Mundane possessions, and what Location they are seeking!

This section is currently unfinished, but should not take too much neatening up to make it Publishable, and I can add to it in later Editions! The Mundane Possessions list is already growing significantly!

From the Dessert Trolley
From the Dessert Trolley

EDIT: I have also added a section for Desserts! All of your favourite fruit (plus a few you may not have heard of!) in pies, cobblers, crumbles and fools! Infused, sprinkled, drizzled and layers with your favourite (mostly cream-based) toppings!

So, if you are ever stuck for inspiration, why not download the Random Lists app from the Play Store!  Who knows what Wonders await you?

Or even splash out on the Pro Version! Only 99p!

If you have any suggestions for new Lists, items that you would like included, or any other feedback, you can contact me on the regular channels!

I Did An App!

OK, it’s not published  yet, but I’ve been busy writing an App for Android Mobile Phones/Tablets.

EDIT: Now available FREE on Google Play: CLICK HERE

All Players (GMs included) run out of inspiration at times. GMs throw us a curve-ball. Players run off in unexpected directions. And someone asks a question:

Random Lists
Which Random List Do You Require, Traveller?

What is their name?

What kind of person are they?

What is in the room?

Is there any loot?

Do they have anything for me to do?

… and you don’t have an answer …

Random Loot!
Random Loot!

Fret no longer! For I have collated a collection of Random Lists! Calling upon my extensive experience on both sides of the GM’s Screen, and my n0v1c3 h4x0r 5k1ll5, I have thrown together an App!

Choose your Category, and it will provide an eclectic list of possibilities!

Liam Islington“. We can already imagine who he is! “Louise Henrick” could be just the NPC you need!

Raw Garnets may form part of your Treasure Haul, along with Rhinestone-Studded Boots and a Gem-Encrusted Torc!

Maybe these items are hidden behind the Brass Fridge, or under the Wooden Mixing Bowl!

You may have to Destroy the Magical Sword before you can claim your prize! Or Protect the Ivory Tower! Complete these tasks and you may claim Rewards beyond your dreams! (or at least a Radiant Emerald, or Silver-Plated Top Hat!)

Soon to be available on the Google Play Store, this Random List App will inspire you to higher and better things than you could possibly imagine!

EDIT: NOW AVAILABLE for FREE:CLICK HERE

Watch this space!

I will be improving this App, with Longer Lists, and more categories! Let me know if there is anything you would like to see in it!