Saturday, July 17, 2010

Running the mud driver on Windows XP

Maintaining a Linux server might be a challenging, especially if the only thing you want is to run the mud locally for development and testing. Or better, for fun.

The driver is not available in a native Windows format, or .exe. as everyone knows it. The genesis Interest Association made it available as a Cygwin executable. cygwin is an Unix environment on Windows and it has a very nice installer.

Here are the steps to have a mud running on your Windows machine in no time.

1. Install Cygwin
2. Download and unpack the Cygwin distro
3. Start the mud driver

1. Install Cygwin

The first step is to download the Cygwin installer:  http://cygwin.com/setup.exe. Save it on your desktop, it might prove useful later, when you get used to it.

Start setup.exe from your desktop.





















Click next and select "Install from the Internet on the next screen





















Choose the defaults on the next screens:























Choose where you will put the packages you download. So you're saying a working mom er... goddess cannot play RPGs ? :D






















Most probably you have a direct connection. Choose this if you are not sure.























Any mirror on the list will do. If you know a mirror that is closer to your physical location, choose it.























Wait until the installation list is downloaded on the next screen





















On the next screen, expand the section "Libs" and select the "crypt" package as circled.














Choose to create icons o the desktop and the Start menu.





















The cygwin installation is done. Look on your desktop for this icon:









 Double click to start cygwin.


2. Download and unpack the genesis cygwin distro.

The cygwin distro ca be found at http://www.genesismud.org/distributions/cygwin-genesis-dist.zip
Dowload it an unpack it under c:\cygwin\home\mud  as shown below















3. Start the mud driver

Double click on the cygwin icon, as shown above.

> cd /home/mud/bin
> ./driver &






















The mud driver is started. Look for the next posts o how to create
the root user ans start building your game.

Saturday, April 10, 2010

Genesis herbs

Here is a list of herbs you can find on Genesis. Telling you where they are will only spoil the fun, isn't it ? :)

I would love to hear from you back with herb maps and "mixes" you would like to make on Genesis.

1pendick_flower
2bergamot
3witch_grass
4ginseng
5morel
6clover3
7sparkweed
8dill
9oakmoss
10w_hallow
11aspen_bark
12pindan
13pindan
14rushwash
15paramol
16yarrow
17moly
18skunk
19seregon
20savory
21blue_gentian
22cord_grass
23surf_grass
24sargassum
25fucu
26eel_grass
27bch_willow
28ss_grass
29poison_ivy
30bch_plum
31lore
32horsetail
33saskatoon
34bloodweed
35bkd_sedge
36grey_willow
37glowshroom
38drudgeworth
39mandrake
40cranberry
41sm_camas
42blk_currant
43mindleech
44kuko
45raspberry
46crocus
47monkshood
48wintergreen
49basil
50morning_glory
51cinquefoil
52clover4
53mint
54blung
55argil
56carlith
57braspberry
58hop
59ronwath
60sage
61thyme
62cladina
63blackberry
64fdlhead
65onoclea
66clove
67fennel
68tuo
69licorice
70laurel
71narcissus
72jewelweed
73ungolestel
74redweed
75myrtle
76parsley
77lothore
78ginger
79brownslime
80mittikna
81strangleweed
82asparagus
83wild_cuke
84coffee
85tarragon
86broccoli
87tomato
88garlic
89attanar
90oregano
91curugwath
92tyelka
93suranie
94chervil
95hemlock
96coccinea
97bpotato
98sumac
99foxglove
100hazelnut
101alfirin
102spinach
103huckleberry
104marjoram
105rosemary
106nightshade
107treemushroom
108nethra
109caraway
110bean_black
111wild_plum
112saffron
113holly
114dandelion
115fireweed
116lianor_berry
117pawnrose
118skullcap
119adillyp
120cattail
121labr_tea
122breadroot
123soapweed
124culkas
125blueberry
126astaldo
127fordinfa
128shamrock
129amanita
130wstrawberry
131chokecherry
132sarsaparilla
133chicory
134chantrelle
135hawthorn
136red_pepper
137bunchberry
138green_pine
139tangleshoot
140solinaith
141sebre
142morgurth
143angurth
144athelas
145angeltear
146belladonna
147madwort
148tiger_lily
149frostheal
150salt_wort
151nightshade
152darkroot
153pumpkin
154dajla
155vinerot
156darfern
157flameroot
158redeye
159catnip
160carrot
161gonion
162blade
163fungari
164handasse
165numbis
166moosho
167ithilgil
168bean_kidney
169sphagnum
170nasturtium
171sea_lettuce
172sea_bubble
173bean_lima
174rpotato
175lady_slipper
176hellebore
177elidross
178locoweed
179columbine
180chives
181bilberry
182bean_green
183nilgu
184kelp
185sea_moss
186emmelti
187cedar_bark
188simbelmyne
189goats_rue
190carrot_wild
191greenslime
192bean_fava
193bur_reed
194elkhorn_kelp
195bull_kelp
196laminaria
197coral_alga
198grass
199lamia
200blackroot
201nettle
202lissuin
203raspberry
204strawberry
205marshmallow
206lukilvor
207whitehorn
208wilcol
209shadow_onion
210bloodcreep
211chartess
212athly
213wildfeather
214streyroot
215strim
216annalda
217khuz
218maroea
219laranthas
220yam
221hensbane
222tansy
223oreste
224niphredil
225calendula
226carrot_black
227daffodil
228mandrake
229beatha
230veronica
231marigold
232glimmer
233peanut
234honeysuckle
235elanor
236borage
237lavender
238angelica
239bee_balm
240cattails
241sun_stone
242bloodfruit
243selevon
244angel_tears
245lorea
246osarni
247maicari
248marymoor
249illavina
250carolden
251ripplebark
252bellarnon
253adildra
254sussur
255firemoss
256ranindir
257vamp_moss

Sunday, March 28, 2010

Useful wizard commands

Here are a number of useful wizard commands.

Emotes without moving
At [yourWizardName] [command] - do something in someone's environment

Give yourself money
(we know it is only for testing purposes;)
money [copper] [silver] [gold] [plat]

Execute some LPC code on the fly
execr find_player("bendis")->command("say Hi");

Tracer tool
    At        Perform a command in the environment of a player
    Call        Call a function in an object
    Cat        Cat the file linked to an object
    Clean        Destruct all non-interactive objects in an object
    Destruct    Destruct a specific object
    Dump        Print various information about an object
    Ed        Ed the file linked to an object
    Goto        Enter the inventory of an object
    In        Perform a command in another object
    More        More the file linked to an object
    Move        Move an object to a destination
    Reload        Update, load, clone and replace an object
    Set        Set a tracer variable
    Tail        Tail the file linked to an object
    Top        Show top cpu statistics


Control
      control [target]

Shops

The mudlib offers support for commerce. A shop is a place or person who can buy or sell items.

The diagram below shows the objects used for the alchemist shop. The alchemist_shop sells athly, streyroot and strim. These herbs are kept in a  store belonging to the alchemist_shop.

Diagrams

The diagrams on this blog are produced using the DIA diagram editor. It is like Visio and it is free software.

In many Linux distributions (e.g. Ubuntu) you can install DIA via the system update.

You can download the source xml files for the diagrams to edit with DIA below.
Please let me know if you find discrepancies, mistakes or if you have an improved diagram. I will post it here with all the due credit.

Saturday, March 27, 2010

Craft guilds

The mudlib provides support for four types of guilds:
  1. occupational guild
  2. layman guild
  3. racial guild
  4. craft guild
This post explains the structure of a craft guild, the services provided and sample code.

In essence a craft guild allows the members to combine a set of objects in their inventory to "produce" another object of some utility to the player. For example potions and buffs.

The example in this post will create an alchemist guild and it will be based on the standard distribution. To create your own sandbox and experiment with the code in this article refer to the Getting Started with LPMud article.

Craft guild services

A craft guild provides the following services:
    1. join services: join and leave the guild
    2. train services: train the special skill of the guild, in our case alchemy
    3. start services: the user can set its start location in a room in the guild
    4. special abilities, for example mix potion or elixir; in our case the guild will mix a potion

Optional a guild could provide an emblem, a shop, a post office or other related services.

Class structure
The classes participating in the guild implementation are shwon in the figure below. The classes in the packages in red are part of the mudlib while the classes in the packages in blue are part of the alchemist guild implementation.

The class diagram is given for reference, helping in understanding the workings of the guild. Click on the image to see a larger version.




Join services
The join/leave services are provided by a game room, joinroom.c , to which 2 actions are added: alcjoin and alcleave.

The diagram below shows what happens when a player joins the craft guild. after the player issues the command, a clone of the craft_shadow class is installed as a shadow for the player if the user is allowed to join the guild. Then the guild emblem and the guild soul and the guild specific player description are added. The guild soul hosts the guild specific abilities.


Train services
The guild allows the player to train the special skills defined by the guild, in this case alchemy. The train services are provided by a game room, train.c. The room inherits the skill trainer behavior from skill_train mudlib component.

Start services
[TODO]

Special abilities
The special ability provided by the alchemist guild is to carve a mortar which knows how to mix a potion. One could argue that the ability itself might be mix potion. In this case, the mortar class is already defined on Genesis and it is a good opportunity to reuse the code.

Friday, March 26, 2010

Getting started with LP Mud

If you are here probably you know what a mud is, and even more what an LP Mud is. If you don't, check the Genesis Mud website and you will get an idea.

If you decided LP coding is for you, this article will explain how to get started. Of course, you can always join Genesis at telnet genesismud.org:3011 and apply for a wizard position.

I believe that learning by doing is the fastest way to learn coding so here are how you start up your own sandbox.

I published a virtual machine on the Amazon EC2 cloud that has anything that you need to get you started. The mud driver and mudlib build are credited to the Genesis Interest Association.

Amazon EC2 is a Amazon service that allows you to run virtual machines ( a kind of computer :)) on demand. You don't need to buy a new computer and install Linux for several hundred dollars and a lot of sweat and time. Here is how to get your own computer or instance on Amazon for about 3 cents per hour.

You can get your mud sandbox up and running in one hour. Here are the steps.

1. Get an Amazon EC2 account.
Go to the Amazon EC2 page and sign up for an account.
Click the “Sign up for This Web Service” button on the Amazon EC2 detail page. You must have an Amazon Web Services account to access this service; if you do not already have one, you will be prompted to create one when you begin the Amazon EC2 sign-up process.
2. Login in the Amazon EC2 administration console.
Go to the Amazon ECS Administration Console login page and enter your credentials.




3. Create a spot request

Click the spot requests menu item. Choose the Community AMI tab. Enter ami-a147a8c8 in the search box to search for the Genesis AMI. Click the Select button.



Enter 0.04 as spot request. This will allow you to obtain an instance faster, in about 30 minutes.



Click continue. On the next screen accept the default values and click continue too.

The next screen asks to create a new key pair. This is an important file that you need to keep securely on your hard disk, as it allows the connection to the server via the root account.



Make sure you click the "Create & Download your Key Pair" and record the location where you saved it.

Click Continue to advance to the security group page. As your computer will be accessible from the Internet, it needs to be locked down for security.

From the bottom drop down select SSH and click the Add Rule button. This will allow only SSH connections to your computer for now. Click Continue.



The next and last screen is the summary screen and it should look like this:



Click submit to create your spot request. The request should be fulfilled in about 30 minutes. Go and drink a coffee and keep a tab on your instances. When your instance is started go to the next steps.

4. Download, install and set up PUTTY.

If you are using Linux you already have all you need. If you are on Windows, you can use PUTTY to establish and SSH connection to your server. You opened the SSH port earlier when you created the security group.

Download PUTTY. Download the whole installation kit for Windows as it has several utilities that will be needed. Run the installer.

5. Log in the "mud" account
Your instance comes pre-configured non-privileged account where you can run your mud. The password for this account is tom!bombadil.

As I posted the password for you to log in here on the blog, the first thing you will do is to change it.

In your AWS console click on the instances menu item. Click on your instance and on the bottom page copy the Public DNS value. It should look like this:
ec2-[yourIP].compute-1.amazonaws.com
Here is how you log in:

PUTTY (Windows)
putty -ssh -2 mud@ec2-[yourIP].compute-1.amazonaws.com
SSH (Linux or Mac)

ssh mud@ec2-[yourIP].compute-1.amazonaws.com

Enter the password: tom!bombadil

6. Change the password for the "mud" user

After login type this command at the prompt:


> passwd
Follow the prompts and change the password.

7. Start the mud driver

The mud driver is in the "bin" folder. Type the following commands to start it:


> cd bin
> nohup driver &
The second command starts the driver in such a way that it will not be shut down after you log off.

8. Open the port 3011

Your mud runs on the port 3011. Our security group configuration blocks everything except ssh. To open the port 3011 go to the AWS console and click on the Security Groups menu. Choose the security group genesis on the right pane.



Leave the select on "Custom" as we are adding a custom rule. Fill in the rest of the fields as in the image above and click Add Rule. The port is not open and you can connect to the mud.

9. Connect to the mud
Use your favorite mud client to connect to the mud. The host name is the public DNS name that you gathered above and the port is 3011. Create a character and look around.

Enjoy.