Spode's Bash Godville

From GodWiki
Jump to: navigation, search

Wouldn't it be great if you had your own little Godville to fiddle about with as you please? Don't you wish that your hero was much better than he by rights ought to be? Want to see your shockingly bad ideas appear in the hero's diary? You've come to the right place! God Spode has taken all his knowledge of Godville, and used it to write his own version of it, in a scripting language called bash (that stands for 'bourne-again shell' by the way - look it up if you must). Why not write it in a higher-level language though like the ever-reliable perl or python, or even a compiled language like java? Spode has taken note that the vast majority of Godville players have no programming knowledge, but still may wish to sample the fruits of Spode's wisdom (ok, I'm getting a bit too poetic about myself now, sorry). Bash is extremely simple and very easy to learn, enabling the newbie to get to grips with Spode's Bash Godville all the more quicker, opening up the experience to the masses!

I havn't taken the time to explain every single bit of detail, but the script is divided up into sections (by uninterpreted comments) as follows: 'MAIN MENU' - the home page, as it were; 'ACTIVITIES' - things like questing and going to town that the hero does of his own accord and that the god has no control over; 'UTILITIES' - useful little functions that prevent me having to repeat chunks of code over and over again; 'REMOTE CONTROL' - the only way the god can interact with the game (while playing it of course) & the 'START UP' section - the bit of code at the very bottom which starts the whole script. In bash, all functions must be defined before use so this section is at the very bottom.


Current Version: 1.1.2

Rough outline of the gameplay mechanics so far:

main menu - check if hero levels up. experience needed equals next level multiplied by 100 (arbitrarily chosen formula).If levelled up, +1 level,exp reset to zero, inventory space increases by one every even level, and then max health +4. Personality is decided by the number of influences used (good is + and bad is -). Now display stats and menu. If picked 'encouragement', random health addition then continue quest. If picked 'punishment, random health subtraction then continue quest. Both influences have a 50% chance of forging a gold brick if you have at least 3000 gold coins. If picked 'do nothing', continue with quest.If picked 'change motto', change motto.

quest - randomly chosen number decides whether 'searching for path...' and +4 quest completion (2/3 chance of happening), or monster fight (monster health=40-60) until either hero or monster dies. During the fight, if the hero's health reaches 15 or less hp and he is still alive, he flees the battle, heals, then returns to the quest anew on his own. If hero died, resurrection. Otherwise, hero gets either randomly selected gold (0-40) or artifact (25% of getting a bold one), and some exp (0-100) to go with it. If the inventory is full, the hero will just get the gold and exp, then head back to town to sell his stuff. If quest completion=100% then +1 gold brick, add '(completed)' to quest title and make the hero go to town. Then if hero's health is 30% of maximum or less, go to town, otherwise go back to main menu.

town - check if hero levels up first (like in main menu) then 'approaching town' stage,then 'healing' stage. Now if there is at least 1 artifact in the hero's inventory, he visits the trader and sells the artifacts one by one (normal artifacts fetch random gold 1-200 and bold artifacts fetch 200-500). There is a 25% chance of the trader getting an artifact for free. He then leaves the store. Now if hero has 3000 or more gold coins then 1/3 chance of forging a gold brick (only use of gold coins so far), then check if hero needs new quest, if so then quest number +1, quest completion=0 and new quest title selected. Now hero wastes time (with changing 'earthly news') then after this loses random amount of money (0-100 -i'm kind) at pub or inn,etc. Hero then goes through 'praying' stage and leaves town, back to main menu.

Missing Features:

  • Temples and pets
  • voice of god
  • Equipment -(useless anyway)

The Actual Game

You need to open a text processor and then paste it into a new file. Save it as a bash script (for example godville.sh), in Notepad++ preferably (link to it in the next section of this article)and make sure to set the EOL conversion to UNIX Format before you save the file. (In Notepad++ this in the Edit menu).

If you are using a distribution of Linux or any version of Mac OS X, just make the file executable (right click on it > properties > tick the box) and then run it in terminal. If you are using windows, you will need to quickly download a UNIX emulator. I recommend cygwin (http://www.cygwin.com/) since it is quick to set up. Make sure that you select the custom set-up option and then tick as many features as you want, in particular 'ncurses' (or your screen will quickly become a mess). When you've installed cygwin, go into your C drive and all the things you'll want to be concerned with are in the 'cygwin' folder that you'll find there. Place the 'godville.sh' script (the one you downloaded at the link below) into your the 'home/*your name*' folder (found inside that cygwin one), run cygwin itself and then type in ./godville.sh before pressing enter. The game will then start. Other than that, there's nothing much to say so enjoy!

Important: Before downloading the latest version if you already have a version of the game, delete the current save-data folder so that everything can be rewritten (with new text files etc).

The Script

Since the wiki is a terrible way to distribute source code, Spode's script can be retrieved from a public gist at Github (link below). If that link is no longer working for whatever reason, the article's revision history still contains older versions of this article with the script included. (Note that the script was last updated at 22:09, 3 June 2012 (UTC) — this mirroring does not change that.)

Script download: spodes-godville.sh at gist.github.com

So then, How do you go about tinkering with it?

All the save-data is stored in text files (in the "/home/Godville" directory that is created when you first run the game) but you can't use just any word processor because you'll corrupt the file. I recommend using Notepad++ (http://notepad-plus-plus.org/), but just remember that you must use a word processor designed for programming. It is important that each seperate piece of data is stored on a seperate line in its file. When starting a new game, I have already loaded the script with tons and tons of default data (eg. diary entries and town names) to write to these newly created files so you don't have to modify data if you don't want to. However, here is a guide to the different text files and what they contain if you do want to (despite the fact that I have kindly named them to suit their function).

Constantly edited

  • hero_data.txt ---All the stats of the hero and some of their god's
  • diary.txt ---This is the hero's diary.
  • news.txt ---The current 'earthly news' being displayed.
  • inventory.txt ---The hero's inventory, where artifacts are stored


  • monsters.txt ---List of monsters
  • quests.txt ---List of quests
  • towns.txt ---List of towns.
  • artifacts.txt ---List of normal artifacts.
  • bold_artifacts.txt ---List of bold artifacts.

Earthly news

  • healing.txt ---while the hero is being healed.
  • battle_begin.txt ---announces the start of the battle. ---\${monster}
  • hero_damaged.txt ---Displayed during a monster fight ---\${monster} \${h_damage}
  • monster_damaged.txt ---Displayed during a monster fight ---\${monster} \${m_damage}
  • navigation.txt ---during quests while hero is not in battle
  • town_return.txt ---hero is going to a town.
  • praying.txt ---engaged in prayer
  • artifact_sell.txt ---trader bought artifact off hero ---\${gold} \${artifact}
  • artifact_free.txt ---trader got an artifact off the hero for free ---\${artifact}
  • town_time.txt ---hero is wasting time in town


  • diary_fun.txt ---Random diary entries
  • money_waste.txt ---hero wastes money in town ---\${lost_money}
  • encouragement.txt ---diary entries for encouragement influence
  • punishment.txt ---diary entries for punishment influence
  • victory.txt ---Defeat of monster if gold is the reward ---\${monster} \${gold} \${exp}
  • victory_artifact.txt ---Defeat of monster if artifact is the reward ---\${monster} \${artifact} \${exp}
  • new_quest.txt ---hero is assigned a new quest in town ---\${quest}
  • diary_monster.txt ---random diary entries in middle of battle ---\${monster}
  • battle_begin_diary.txt---diary entry for the beginning of a battle ---\${monster}
  • trader_diary.txt ---while hero is dealing with the trader ---\${gold} \${artifact}
  • flee.txt ---hero flees from a battle ---\${monster}

The stuff in hero_data.txt is confusing you? Now you can cheat by changing the data:

  • line 1 - name of god
  • line 2 - name of hero
  • line 3 - motto
  • line 4 - level
  • line 5 - current exp
  • line 6 - maximum health
  • line 7 - current health
  • line 8 - gold coins
  • line 9 - quest number
  • line 10 - death count
  • line 11 - number of influences
  • line 12 - bricks for temple
  • line 13 - monsters killed
  • line 14 - quest completion percentage
  • line 15 - quest title
  • line 16 - godpower