Sign in to follow this  
Vallar

Another MUD question?

Recommended Posts

Hello there everyone:), I know that this forum as much as all others has seen its share of the "I want to make a MUD help pl0xtnxbai". I can't by any means state that this won't be another one. However i know what to do but need some directions that is all. I was thinking of making my MUD with Python, simple, easy and fast (not faster than C++ so i could escape the flaming). I know how to program in Python but simple things, I haven't delved in OOP. The second solution is Visual Basic*, I know a fair share of it. I think I can pull off something with it. The question stands as... I know that using Visual Basic i could make something and produce alot of code fast (User register/login forms, Client form, characters and some areas. Don't know how i will make those now, but i think i can figure out how by myself). My heart is however is with Python, i spent about a year learning about loops, functions, sequences and so.. While it took me about 3 days to learn the equivalent in Visual Basic. Is there any resources that can get me up and running in Python? If the answer is yes, i am going to switch to Python, but i need something solid, something related to MUDs or at least Text-Based games. I have almost 3-4 books about "general" Python programming and currently learning Python from one of them. *An example of a MUD made by VB is www.kaldana.com. It is a great game if you want to play too. That is what i invention mine would be like. But much better since this is heavily PL gaming and less RPing.

Share this post


Link to post
Share on other sites
Follow your heart. :-)

For GUI I would recommend Qt4 for python. Take a look at this: http://wiki.python.org/moin/PyQt

The python tutorial should get you up and running pretty fast: http://docs.python.org/tutorial/

Writing a MUD server requires some knowledge about network programming. I would google for a simple chat client/server tutorial for python, and go from there. Maybe take a look at the twisted library as well. (http://twistedmatrix.com/trac/) It might save you a lot of coding, network-wise.

Good luck! Hope to hear from you soon,

c.

Share this post


Link to post
Share on other sites
Quote:
Original post by Vallar
If the answer is yes, i am going to switch to Python, but i need something solid, something related to MUDs or at least Text-Based games. I have almost 3-4 books about "general" Python programming and currently learning Python from one of them.

Unfortunately you are hoping for something too specific, ie. to find an article about a rare type of game being coded on a language not often used for such games.

If it helps, a MUD is basically a combination of two things:
- a chat server
- a text adventure

The first, you can find Python advice on. (There is even an asynchat module in the standard library to help with this, although writing one from scratch with just sockets and select is easy too.) The second, you will probably have to work out yourself, but is simple enough. Once you have worked out the basics of these, you just have to join it together.

Share this post


Link to post
Share on other sites
I hope my reply came soon ;).

As I see it, all favor Python. It goes with my heart's desire. But as Kylotan said it may be too specific. I searched Google more than 14 times with different combinations (basically containing Python, mud, guide/tutorial).
Nothing dare I say was helpful save one article I came on by chance. http://paranoid-engineering.blogspot.com/2008/11/python-mud-game-example.html

The engine looks good. I think (I have no experience). But building one from scratch would be more valuable to me. At least I would learn more about the language and programming as a whole.

On the other side. I started in VB (just to remind me of the language since last i checked it was like a year ago). In the past 3 hours i could make a web browser with little problems.

I also read the Eternal Lands guide in here. Speed and fast coding is something essential. Maybe VB isn't the best language but so is Python (in terms of communication speed between servers and clients). Also using a low-level language isn't that great. It takes lots of time because you have to handle alot of variables that can be just over looked in others. In VB's case I think placing things around (Like the windows and buttons, tiles and objects) would be easy. Just a click and drag with my mouse. No coding lines would be needed as in Python.

All in all, If i find one more guide with anything related to this topic. I would do it in Python. That article and the guide would help me understand how things work.

@Kylotan
The problem is in the coding of the later. I don't think there is anything that i can use in Pygame for reference. The chat client would be a little easier. But i can manage it (one of the books i have, had a project in the end which was a chat program like MIRC)

But not to forget... Thanks for the rapid reply. I will use the forums to issue out my progress. May others find such a topic as a guide on how to get a MUD done by either of those languages and save you some more of those questions.

Share this post


Link to post
Share on other sites
Question: Are you more interested in making a MUD from the ground up for its own sake or are you interested in making a game that is a MUD?

If your goal is to make it from the ground up then use whatever you please. If you are more interested in making an actual game as quickly and effectively as possible then perhaps you should look into some existing code bases and languages.

LPC is a language specifically designed for making MUDs and many mud code-bases (called mudlibs) use it. It's quite easy to pick up if you are familiar with programming in general. Currently, I'm working on a project that uses an LPC driven mudlib called Dead Souls.

Share this post


Link to post
Share on other sites
Both! That way i can learn programming and at the same time have a game that i would run...

The Idea of having a pre-made code crossed my mind. But then it rules out the learning curve. Also i don't plan to keep it a MUD for eternity. It has to develop at some time. I am just starting with a MUD because it is the easiest (I mean in the hierarchy of MMOs not in games as a whole). So getting a pre-made code might not be the best solution. I need to be familiar with the core programming for THE plan:

The plan goes as follows...
1- Create MUD
2- Use 2D elements in it (Like display characters on the user panels)
3- After sustaining the game and running it for some time i delve into a whole 2D overhaul.
4- 2D/2.5D conversion.
5- 3D MMORPG capable of hosting thousands of players.

Call it day dreaming or a nut job all you like. However that is the goal i am starting with. Unless i get a job with some company or some team that already having a MMORPG working around, I won't try to quite. That way i can at least support myself economically while doing what i love most. Economically of course being a long run from this point and haven't even thought about it yet.

Share this post


Link to post
Share on other sites
It sounds like you want to use Python and the only thing holding you back is the lack of a visual designer for GUIs a-la VB.

If that's the case, maybe this Python Gui Programming page will help. Looks like it lists a bunch of Python GUI libraries. IF you scroll down to the GUI Design Tools section you might find a visual designer you can use.

I'm not a Python user and cannot really vouch for anything listed on that page, maybe someone more familiar with the language can.

Hope that helps.

Share this post


Link to post
Share on other sites
It does help thank you. However what is hindering me really is the lack of documents that would teach you the technical things about making MUDs in Python. At least something that goes in the line.

Share this post


Link to post
Share on other sites
I can only repeat my recommendation for Qt4. It has a powerful designer which can be used. Now that Nokia is going to release it under the LGPL license, it can be used in commercial applications as well.

http://www.qtsoftware.com/images/products/qt-designer-screenshot-linux/image_view_fullscreen

c.

Share this post


Link to post
Share on other sites
Quote:
Original post by Vallar
However what is hindering me really is the lack of documents that would teach you the technical things about making MUDs in Python.


Honestly you're probably not going to find a lot of documentation on creating a MUD server in any language because, quite frankly, there isn't much to document. A MUD server is just something that accepts connections and sends and receives text; the vast majority of your code will deal directly with your game mechanics.

If I had to guess I would say that a lot of the appeal of MUDs from a programmer's perspective comes from this fact, and in turn they appeal to users because the programmers can focus purely on their game mechanics and usually offer innovative gameplay experiences that more complicated games simply cannot afford to.

For example, here's a bare minimum "mud server" in Ruby:

(Disclaimer: This isn't production quality code by any stretch of the imagination, it's only an example.)
require 'socket'

port = (ARGV[0] || 25).to_i
server = TCPServer.new(port)

breakhandler = proc { print "Shutting down\n"; server.close}
trap("INT", breakhandler)
trap("TERM", breakhandler)

print "Server started.\n"
begin
while (session = server.accept_nonblock)
Thread.new(session) { |arg|
Thread.current[:client] = arg
Thread.current[:client].print "Welcome to MyMUD!\r\n"
Thread.current[:client].print "Enter your username: "
Thread.current[:name] = Thread.current[:client].gets.chop
Thread.current[:client].print "Welcome back #{Thread.current[:name]}!\r\n"
names = Array.new()
Thread.list.each { |thr|
if (thr != Thread.main and thr != Thread.current)
names.push(thr[:name])
end
}
Thread.current[:client].print "The void\r\nYou are standing in a void, there are no exits.\r\nYou see here: #{(names.empty? ? "Nothing" : names.join(", "))}\r\n"
while (message = Thread.current[:client].gets)
case (message)
when /\/quit/i
Thread.current[:client].close
when /\/name (.*)/i
Thread.current[:name] = $1
when /'(.*)/
print "#{Thread.current[:name]} says, \"#{$1.chop}\"\n"
Thread.list.each { |thr|
if (thr != Thread.main and thr != Thread.current)
thr[:client].print "#{Thread.current[:name]} says, \"#{$1.chop}\"\r\n"
end
}
else
Thread.current[:client].print "Huh?\r\n"
end
end
}
end
rescue Errno::EAGAIN, Errno::EWOULDBLOCK
retry
rescue IOError
end



As you can see, it's little more than a chat server with a bit of flavor. Anything beyond this is really getting into the mechanics of your specific MUD. Try looking up chat server examples, sockets in general, and general game design and you'll likely find a wealth of information you can use in the process of writing a MUD server.

[Edited by - Puck on January 20, 2009 1:23:02 PM]

Share this post


Link to post
Share on other sites
That is if i am just making a simple Telnet Mud. In that case even chat between players would be somewhat limited or none.

However i am thinking of making it with the same structure as Revelation (www.kaldana.com).

The game has a custom interface. It might use a Telnet client/server connection in the end. But however its design is more intensive from the way i see it.

Ruby seems an interesting language, however from the way i see is near C++, it is kind of hard to make anything from the server.

@ uggwar
I took a look over at PyQT. it looks interesting. From this point i can say it similar to VB's own GUI capabilities. I am downloading it while writing the post. The documentation however is a mess couldn't understand anything. But looking forward to give it a go.

Thank you alot.

Now i decided i will go with Python, i might change that but anyway the code over at the site i posted before was a little help. If i manage to supply a GUI to that Engine (i am going to rewrite it nonetheless. Can't just go copying other people' work) and figure out the techies of a network connection (Thanks to uggwar for that as well)

Wish me luck... I will be starting today for two hours or so. I will try to keep a diary of what i do here if it would be helpful... If not,or not allowed please do inform me.

Thanks for the help and wish me all the luck... HERE WE GO !!!!!

Share this post


Link to post
Share on other sites
Hmm, typically the term MUD brings up a basic image in my mind of a text-based only game. What you seem to be interested in making is a completely graphical online multi-player game.

The trouble stems where you say you want to make a MUD, then you want to make it 2D whereby I assumed you meant "using a GUI running on a custom telnet client". From there you moved straight to 2D, 2.5D and 3D which to me means something entirely different and conjures up images of players directly controlling their avatar through fully graphical realms.

The chances are nearly 100% that you will not be building this as a single growing piece of software. The tasks that a text-based MUD server and its potential clients perform is very different from that of a fully graphical 2D or 3D mmo game. On top of that, as you grow as a programmer you are certainly going to come to a point where all the software you've written before that point will be deemed 'crap'.

I think your best bet is to decide what kind of game you want to make now. Ask yourself: Do you want a text-based game, and will it require a custom client or not, or both? Perhaps you want to make a fully graphical online game, essentially skipping the 'text-based' part but sticking with the server and a required client? Either way, you shouldn't focus on what this software will become down the road because the answer is, "It will be the same." If you want to make a different style of game later you are just going to have to re-write it ;)

Also as a side note, keep in mind that your server and your client don't need to be made in the same language or using the same tools. All that matters is that the data sent back and forth interfaces between them. Good luck!

Share this post


Link to post
Share on other sites
Hopefully this won't be really boring, for this post is going to be long ;)
First, Hi and how is everyone o/ ?

@ lack o comments
The truth is, I wanted to make a game just like WoW and Anarchy Online and the sorts. However let's face it. I am not a "one man army" nor i would be able to create a speck of what they did while working alone.

Settling with a MUD for now was a great sacrifice in terms of what my heart desires. At any rate i wasn't intending it to be a plain MUD. The custom interface you mentioned is what i seek.

Anyway the transition from MUD to 2D or from 2D to 3D i have no idea about at this point. I can't tell because I don't have any experience in it. But it will be more or less like what happened with Runescape. They changed their 2D graphics into 3D. Still I would be pleased if I could still use Python, it is a very interesting language to say the least.

@ Landshark

Thank you for showing up in this post. I would really hope to teach anyone that has the same dream as mine anything in that career and would use it.

Now for the real hard stuff. I know nothing about OOP in general same as in Python. Now the example engine I posted before used Classes and Functions. I don't really like Functions. First because it "slices" up the program, second because it slows down the transition between blocks. I am thinking of using dictionaries and simple stuff. so here is an example of what i started to do, hopefully you will like it and direct me even further:

Quote:

ObjectProperties = {}
ObjectProperties("Simple Sword") = "A beginner sword. It might not hit hard, but you know that it would save your life"


That above code would simply process all the "Examine" commands of any object.

Quote:

ObjectStat = {}
ObjectStat("Simple_Sword") = 2


Now i would do something like this... But i haven't yet made the code for the player.

Quote:

if player uses Simple_Sword:
Add +2 to attack stats


The player's inventory i thought to be a list of all items he gathered.

Quote:

Character_inventory = []
Players = []
#example that a player would be called Foo has just registerd.
Players.append(Foo)


Now the problem would be how to make python recognize Foo and make an inventory that goes by the name Foo_inventory and add it for example to a variable called Inventories.

As you already see the downside to such an approach would be the too many lists and dictionaries.

Tell me what you think...

Share this post


Link to post
Share on other sites
Quote:

I don't really like Functions. First because it "slices" up the program, second because it slows down the transition between blocks.

A) You will want to use functions. Trust me, they are your friend ;) The fact that it 'slices up' the program is exactly the point of functions, and objects for that matter. When you tackle a hard task do you try to take on the whole thing at once or do you break it down into smaller sections and deal with them one at a time? Rhetorical question, the answer is the latter. It makes it easier to create, test, append to, modify, change, and maintain your programs.
B) Well, actually I have no idea what 'it slow down the transition' nor what these 'blocks' are to which you refer? I have a hunch that you are worried it will slow down your code. Don't worry about that. It's not an issue and functions wouldn't exist if they were that horrendous to use.


And now on to more of your hard stuff!

It's definitely seems that you don't really have a true grasp on the fundamentals of building software beyond the basic 'how to write code' part. But I'll try my best to start you in a direction. If you are going to program in an object-oriented manner then you might as well start with objects. What you have there are a bunch of disparate variables. Your first step should be to clump some of them together in a related way as single, coherent, objects. The next step would be to flex some OO muscles and try to find what they have in common so that they can share it.

In many cases a MUD could simply start with a basic object, let's call it a 'thing'. What properties do these 'thing's have in your world? In most cases, they at least need a way of identifying them and they also usually exist in some place. This brings up another question: How are you going to identify what a 'place' is. Some MUDs treat things and places differently at a fundamental level. I tend to prefer the case where they are both rooted in the same object. So in this example I would say that you would want to make a 'place' a 'thing' itself.

(warning: this code is untested and written by a python infant)


class Thing(object):
def __init__(self,id):
self.ID = id

class Place(Thing):
def __init__(self,id):
super(Place,self).__init__(id)






What this does is create a single key object 'Thing' and then derive another object from it with essentially the same properties. You can create a generic thing and pass any type of identifier you wish, as well you can create a place the exact same way. The nifty part is that any changes to the code for Thing will be reflected in Place. From here you could perhaps derive two other classes from Thing, perhaps 'Item' and 'Entity'. Currently the difference between them is none but the idea is that any special properties that should be shared need only be coded once within a base class shared by those objects. For example, in my MUD's codebase, nearly all objects, players, NPCs, weapons, and items share a base that provides a name, short description, and long description. All objects actually derive from a base that provides a basic ID. Items derive from weapons so that all items can be used as though they are weapons. Neat, huh?

Obviously this is a very basic example and not much use right now. You are going to have to take it further, develop it, learn from your success and mistakes and rebuild accordingly. Anyway I hope this helps you towards a direction. Good luck and have fun!

Share this post


Link to post
Share on other sites
Thanks alot!. The idea seems easy to do and i think i grasped what you wanted to say. The only thing made me to say functions slow programs was from a book that i was learning from. By no means i know nothing more or less outside that book.

I have got one question though about the code you wrote. It seems that all classes' functions start their __init__ constructor with "self".. I couldn't understand what does it mean?
Does it refer to the selfness of the constructor? like instead of each time typing __init__ i type self?

I started to read a little about OOP and through your code and the book i am reading i think a class to define objects (whether weapons, items, or armor) would be like:

Quote:

#Objects:
class Object:
def __init__(self , name , examine , stat , room)
self.name = Name_Object
self.examine = Examine_Object
self.stat = Stat_Object
self.room = Room_Object
#Areas:
class Area:
def __init__(self , name , container, examine)
self.name = Name_Area
self.examine = Examine_Area
self.container = {}

from Object import *
Simple_Sword = Object("Simple Sword" , "It is not the best weapon but it could be a life savior" , "Adds +2" , "Start Room")

from Area import *
Start_Room = Area("Start Room" , "NPC1 /n Box /n Simple Sword" , "You see nothing but white all over the place.")



If the above code works then i am off to use OOP. :D thanks for opening my eyes out o/ off i go.


*I will be offline almost permanently starting from Thursday till Sunday I guess. My internet connection isn't fixed and i am moving out through places much. Till Thursday (probably after 10:00 o'clock) i will be online almost all day. So I will be checking the forums all the time. Once I finish something solid i will post right here :)

Again thanks alot.


Share this post


Link to post
Share on other sites
Ok, looking at your example I see a few problems. The first basic one (If I understand correctly myself) is that all classes in newer versions of python should derive from something. Usually 'object'. I also noted the variables of both the objects were being set to stuff like 'Name_Object' and so forth which first of all doesn't have any definition anywhere and second of all looks suspiciously like you are going to be using global variables for something devious ;)

The 'self' reference refers to the instance of object in which the function exists. In the case of 't = Thing("id1")' it would refer to 't'


There is an inherent issue (no pun intended) with that last code you posted. You are avoiding one of the main benefits of having classes and inheritance! Check out inheritance especially. In my example the whole point was to show you that one object can be based on another's existing code. Look at your 'Area' object and your 'Object' object. What do they have in common? A name, a description, the list can go on. For example if you use my example you can do this:

a = Place("areaID")
t = Thing("thingID")

print a.ID #prints "areaID"
print t.ID #prints "thingID"

Do you see how both objects have a property called 'ID' yet only the class Thing ever declared one. On the other hand, Place was derived from Thing so any object based on Place inherits all of Thing's properties and functions.

So for your sake it would be better to create a basic object that represents the minimal amount of info any valid object should have. In this case it might be a name, and some descriptions, perhaps a unique way of identifying it from all other objects in the game. From there you would derive new classes that build on top of this with data pertinent to their purpose. Another thing I was getting at with my example was that you could stick a couple references in 'Thing' that point to its contents as well as its container. Now you have a way of representing the inventory of anything. It could be a player's inventory, a bag's contents, a chest's contents, or a Places's contents. The interesting part is since Place is derived from Thing, technically it means that a Place could be contained within something else... like say a bag of holding ;)

Share this post


Link to post
Share on other sites
Ok now i understand your point. But i have a tiny question, in your previous code, Super(Place,self).__init__(id)

Super = place
(Place,self) = belong to the Place class and has a referral in Thing Class?
__init__(id) = that id refers to the Thing class id? Or the Place class id?

Share this post


Link to post
Share on other sites
Hehe actually you just opened a big can of worms there that I really don't have the authority to get into since I'm rather new to python myself.

The basic idea is that I wanted, within Place's __init__(), to also call its base class's __init__() function as well. There are a couple ways to do this and none of them are entirely ideal. Suffice it so say that using super() was, in this case, effectively the same thing as calling:

Thing.__init__(self,id)


However, that is not to say that they do the same thing. super() was designed to help alleviate issues with multiple inheritance. You can look up 'The Diamond Problem' for more details. Basically it is a way of making sure each base class's __init__() function gets called only once. In certain situations it honestly doesn't always work out all the well either. Important Stuff About super()

Quote:

Super = place
(Place,self) = belong to the Place class and has a referral in Thing Class?
__init__(id) = that id refers to the Thing class id? Or the Place class id?


1) super() is not Place. It is a built in function for finding the named method
that comes next in the MRO. And as the link above states, it gets really icky somtimes.

2) The "(Place,self)" are the parameters of the built in function super().

3) 'id' is the parameter being passed to Place upon creation eg. p = Place("placename") means that id = "placename". But Place has no direct use for this so I passed it to Thing's similarly structured __init__() so that it could store it as self.ID.


hth

Share this post


Link to post
Share on other sites
Hello there all;
I am sorry for late replying, I have a slight problem in internet access, but here we go.

Warning!: This is going to be a long post :P.

Thank you lack o comments for that explanation. I thought about the inheritance issue you have been telling me about.
I read also about that Super() thingy. Sadly i couldn't understand anything, it went over my head. I think it is pretty advanced stuff.

So in the time i have been away from this post, i have wrote some classes and the objects. I used the way you provided, but without that Super() thing.

Here is what i have:

Quote:

class Objects:
def __init__(self, examine, value, stat, name, requirements, use, take):
self.name = Name_Object
self.examine = Examine_Object
self.value = Value_Object
self.stat = Stat_Object
self.requirements = Req_Object
self.use = Use_Object
self.take = Take_Object

class Areas(Objects):
def __init__(self, Objects):
self.name = Name_Area
self.examine = Examine_Area
self.value = none
self.stat = none
self.requirments = Req_Area
self.use = none
self.take = none

class Player:
def __init__(self, name, examine, level, agility, strength, intellegence, /
inventory, location, quests)
self.name = Name_Player
self.examine = Examine_Player
self.level = Level_Player
self.agility = Agility_Player
self.strength = Strength_Player
self.intellegence = intellegence_Player
self.inventory = Inventory_Player
self.location = Location_Player
self.quests = Quests_Player

class NPC(Player):
def __init__(self, Player)
self.name = Name_NPC
self.examine = Examine_NPC
self.level = Level_NPC
self.agility = Agility_NPC
self.strength = Strength_NPC
self.intellegence = intellegence_NPC
self.inventory = Inventory_NPC
self.location = none
self.quests = none


Or

class Player:
def __init__(self, name, examine, level, /
inventory, location, quests)
self.name = Name_Player
self.examine = Examine_Player
self.level = 1
self.agility = 2
self.strength = 2
self.intellegence = 2
self.inventory = {}
self.location = Location_Player
self.quests = []


Is is legitimate in Python? I couldn't test them yet. I really don't know how...

I found by the way two engines written in Python, one was an alpha stage, however the other one might be in development i can't remember. If anyone would like to get them, just post here and i will give through e-mail. Provide sites too if someone interested.

If there is a way to upload those engines (Open Source) on the site i would do it gladly...

Thanks again

Share this post


Link to post
Share on other sites
I'm going to add a little to this thread. While I didn't read all the replies, I'm going to add in some background information / general help.

2 weeks ago I started experimenting with C# combined with Lua. I didn't have any ideas for it, but it quickly involved into a fully scriptable MUD engine by accident. I wrote parts of it in C#(which I refer to as the kernel), and the rest is scripted.

The kernel itself basically consists of this:
- A main Server component which initializes and updates all kernel parts
- Script manager
- A connection manager handling accepting / storing of connections and sending data through a certain protocol handler(Only Telnet supported at this moment).
- A User manager holding users containing a Name, IsLoggedIn and a list of attributes
- Rooms, NPCs and Items, all consisting of a Name, Description and attributes.

The reason I went with a part managed code / part scripted code is the sole reason for performance on certain parts(connections + protocols) and basic layout for all vital parts(NPCs, Items, Users and rooms). I guess I could share the code for the kernel(Which is in C# tho) if needed.

However, I don't think it's reasonable to consider the transition from text => graphical to be capable within the same engine. You could probably build a graphical client which interprets the sent text and shows it in graphics(So if a player appears, just show an avatar on a random place, or a bunch of items scathered). However, adding support for it in the matter of REAL movement in 2D space, requires a complete re-write of the underlying server code, because it needs to take player rotation / position in consideration(Amongst other things).

Also, you might want to take into account that you want to be able to reload certain scripts quickly. Most Al of my scripts can be reloaded on a 'per script basis' or on an 'all scripts at once'. This makes it very easy to add new functionality to the server without restarting the entire server. The other advantage is that you don't need to bring down the entire server when you discovered a bug. While not very practical in production(I mean, you won't be reloading scripts on a production server all the time), but for development is very easy. Just reload the just editted script, and test it out. Saves you the hassle of re-compiling / restarting the server(Which can take up to 5 seconds in my case, not including re-connecting with my telnet client).

Toolmaker

Share this post


Link to post
Share on other sites
Toolmaker you bring up some excellent points.

I'm not a programmer (and won't pretend to be here), but I am an old-school MUD player and thought I'd offer up some advice(with question).


Going from text to 2d - I see your point about needing direction (facing, x,y,(possibly z) coords, etc).

I am thinking though, since Vallar is basically just starting this MUD code, couldn't he put those attributes into the code (on a playerID) and use some kind of mapping coordinates or whatever. If he puts them in now, he could use them later for 2d mapping.

I see this done in some muds that use a somewhat graphical map (using text) that shows the players location in a room (or in relation to many rooms) which I have to assume uses a simple x,y status for each character.

Although, this would require x,y type coords to be added to every room as well (which is generally already setup when creating mud rooms, I've written several myself using x,y coords to map them out).


My point is, yes Toolmaker is correct, it'd be a lot of work (re-written code) to change an existing mud from text only to 2d, but in Vallars case, perhaps now is a good time to start adding that attribute to rooms/players/items(as necessary)/etc?

Share this post


Link to post
Share on other sites
*Gets down to his knees in prayer* Thank you for getting this point up, lol.
I kinda was going to implement that co-ordination system in the area class. At the last moment however i reverted back, thought it was too early. I was going to ask too but felt it would be kinda noobish to do so..

Thank you very much for bringing that up. The original version of the class Player had a LocationX, LocationY instances. But i didn't know how to put that in Python.

Anyway Thank you both.

For the second thing about the "reload code" you mentioned. I just read that in a PostMortem for Magic Stones game. I wondered how that means, i know that it would initiate the code and restart the game... I think. But how the code would sound? But since i haven't yet made the game to work... I can't test anything. Maybe it is a little early to implement such a feature? Though it would be cool.

Anyway once i add all the items, NPCs, inventory, and areas i will think about initiating the game for the first time... Or would that be too late?

Too many questions i guess. Well still thanks for anyone that has posted in this thread... It is really helping.
----------------------------------------

I think i found an artist for the game. He would be making my maps and the characters... At any rate that won't be too hard since the characters are only displayed in the stats window... The most work will be on designing those maps. Inventing about 100 areas still irritates me...

Anyway too many things to think off at an early time ;)

Again thank you !!!



Share this post


Link to post
Share on other sites
Quote:
Original post by Vallar
Here is what i have:

Quote:

class Objects:
def __init__(self, examine, value, stat, name, requirements, use, take):
self.name = Name_Object
self.examine = Examine_Object
self.value = Value_Object
self.stat = Stat_Object
self.requirements = Req_Object
self.use = Use_Object
self.take = Take_Object
<...snip...>


Is is legitimate in Python?


No. What are these 'Name_Object', 'Examine_Object' things? They don't seem to exist. Perhaps you meant:

class Object(object):
def __init__(self, examine, value, stat, name, requirements, use, take):
self.name = name
self.examine = examine
# etc


All Python objects should derive from the 'object' base class. It's a bit confusing in this example but just do it anyway. ;)

But even that doesn't really explain what you were trying to do with the other classes, I'm afraid.

PS. use [ source ] tags, not [ quote ] for code.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this