Top Mud Sites Forum Return to TopMudSites.com
Go Back   Top Mud Sites Forum > Mud Development and Administration > Advanced MUD Concepts
Click here to Register

Reply
 
Thread Tools
Old 02-22-2003, 07:46 PM   #1
xanes
New Member
 
Join Date: Feb 2003
Posts: 29
xanes is on a distinguished road
Hello again,

So, I was again thinking about 'Advanced MUD Concepts' and remembered reading something a while ago about a coder who implemented SLang into his game.

I thought it might be worth it to start a thread about such things.  I've done some work with the Python API, but never in a MUD setting.  

Another question might have to do with licensing of these languages?

Anyway, at the risk of insulting the authors, MOBProgs, at least under MERC, are less than streamlined, and not as extensible as using a legitimate programming language.

The major issues I see with this have to do with attaching your language of choice to the MUDs datastructures, concurrently, no less. This, I suppose, could be accomplished with ah run-time library? or perhaps a control server, but that opens a Pandora's box of Security issues.

-Xanes Lone Coder -=- WinterMUTE
xanes is offline   Reply With Quote
Old 02-22-2003, 09:24 PM   #2
Ogma
Member
 
Ogma's Avatar
 
Join Date: Apr 2002
Home MUD: DartMUD
Posts: 86
Ogma is on a distinguished road
On Dartmud, every mob has a brain which is an actual LPC object. The brains read a basic script file which has some reflex/response stuff, attitudes, combat settings and random actions. A lot can be done with this scripting language alone. However, when we want to do anything serious, we simply make a new brain which inherits /std/obj/brain and hack at it to our hearts content in LPC. This gives us a lot of flexibility without making a basic brain too complicated.

That's one of the advantages of an LPmud, the whole mud is written in a real language. As for embedding a scripting language in Merc/Diku/Rom etc...it seems like a monstrous hybrid Seriously though, I think something like Python would do the trick. It's GPL'd and fairly easy to use. Perl or Scheme might also be okay, if you're a masochist.
Ogma is offline   Reply With Quote
Old 02-22-2003, 09:34 PM   #3
xanes
New Member
 
Join Date: Feb 2003
Posts: 29
xanes is on a distinguished road
LPC is certainly the epitome of customizable, since as you say, you can code anything you want in C. However, I've never really had any serious exposure to it, and therefore, my MUD-related thoughts are naturally bias toward the DIKU family.

And BTW, it would be monsterous, but for someone like me, writing monsterous code beats the #### out of RP'ing or something.

-Xanes -=- Lone Coder WinterMUTE
xanes is offline   Reply With Quote
Old 02-23-2003, 04:06 AM   #4
halkeye
New Member
 
halkeye's Avatar
 
Join Date: Jan 2003
Name: Gavin
Location: Vancouver, Canada
Posts: 12
halkeye is on a distinguished road
Send a message via ICQ to halkeye Send a message via AIM to halkeye Send a message via MSN to halkeye
when it comes (well if at the rate i'm going) to the time when i have to implement mob scripting, i think i might try to embed python, as its already a predefined language..

My only issue would be to find out how easy it is for non coder oriented people to learn, as i'm not sure builders would want to try to figure out something confusing.
halkeye is offline   Reply With Quote
Old 03-13-2003, 08:33 AM   #5
noodles
Member
 
Join Date: Nov 2002
Posts: 30
noodles is on a distinguished road
Post

Its been a while since I last programmed in LPC, but while I liked it as one of my first languages I learned, eventually it came to feel limiting.

These days I program for a MMOG in Python and I like it a lot. My current iteration of my own personal project, more a simulation than a MUD, is in Python.
noodles is offline   Reply With Quote
Old 03-14-2003, 06:10 AM   #6
halkeye
New Member
 
halkeye's Avatar
 
Join Date: Jan 2003
Name: Gavin
Location: Vancouver, Canada
Posts: 12
halkeye is on a distinguished road
Send a message via ICQ to halkeye Send a message via AIM to halkeye Send a message via MSN to halkeye
Actually, since my last comment, i've heard good things about ruby. thats another simple thing to look into... and i am pretty sure ruby has a configurable sandbox to prevent users from being able todo maliuous things
halkeye is offline   Reply With Quote
Old 03-21-2003, 03:24 PM   #7
Yazracor
New Member
 
Join Date: Apr 2002
Posts: 18
Yazracor is on a distinguished road
Quote:
Originally Posted by
Perl or Scheme might also be okay, if you're a masochist.
Well, I can only say that my exposure to scheme (which is embedded into our MUD as a scripting language), lead me to read SICP - which in turn lead me to a better understanding of programming. While functional programming might seem alien at first, it also offers very interesting insights. In addition, there are two packages available that directly integrate with java so you can manipulate all java objects from within scheme without much additional code.
Python certainly is a good option, too, because it might look more familiar to those whose only "programming" experience is in mobprogs. By providing your builders with an adequate set of pre-coded functions I am sure it is a nice solution - and easily embeddable into C if that is the language you use for your MUD.
Yazracor is offline   Reply With Quote
Old 04-03-2003, 06:32 PM   #8
LordKiev
New Member
 
Join Date: Apr 2002
Location: Atlanta, GA
Posts: 8
LordKiev is on a distinguished road
Send a message via AIM to LordKiev
I think I understand you correctly.

Two things: You'd have to make sure that they couldn't execute any commands you didn't want them to, and put in the commands you wanted them to use: by the time you're done, just write your own language.

The other problem would be the compiling problems. MProgs are interpreted , not compiled (like BASIC), and I'm not sure whether Python is interpreted or not, but any compiled language could give you problems.
LordKiev is offline   Reply With Quote
Old 04-08-2003, 02:39 PM   #9
Yazracor
New Member
 
Join Date: Apr 2002
Posts: 18
Yazracor is on a distinguished road
Well, the security issue vanishes totally if you do not allow your builders to add scripting-code online but only after one of the implementors has checked the scripts (the approach we take), or have a separate building port as in many LPC-muds. The security issues are very much the same if you use MProgs, with MProgs having many drawbacks: Among a few are no "clean" syntax, no looping constructs, no variables. Add to this, that MProgs are difficult to maintain, because they offer no direct access to the data structures of the MUD, making it necessary to add new if-checks and mob-commands on a regular basis.
Basically, they're a nice little tool for very small tasks, but as soon as a mobile's gets more complex than just walking around a bit, handing out the one or other item and having it say a few lines, they quickly become bloated and difficult to read and debug - using a full-blown scripting language will make a lot of tasks a lot easier there.
As for the compilation-issue, maybe I did not really get your point, but I do not really see any difficulties there, as the difference between compilation and interpretation is blurring more and more in modern languages. Most scripting languages are what one would classically call interpreted, but of course internally compile into some kind of byte-code which is then executed at far higher speed. Python, eg., offers a wide variety of options to execute code, ranging from instantiating a code-object over interpreting a string to executing a pre-compiled bytecode file. In addition, most of these languages offer very extensive bindings for at least C and Java, so there is comparatively little code that needs to be written to incorporate them.
Yazracor is offline   Reply With Quote
Old 04-11-2003, 06:18 PM   #10
Blobule
New Member
 
Join Date: Jul 2002
Location: Canada
Posts: 17
Blobule is on a distinguished road
Late last year I announced my decision to create a new MUD scripting language here. At that time I asked for suggestions (short of object oriented). Since then I have completed (some sugary items are still missing) the new language which I call BlobbieScript. At any rate the thought of embedding a language like PHP crossed my mind before I set out on that endeavour. At the time I had a couple of major problems top consider: security due to the wide array of functions, and backward compatibility. To switch languages would mean losing all of the pre-existing scripts on my MUD. Another thought presented itself too, PHP is a real programming language and to that end not very intuitive to the untrained builder. At WoC we used easyacts, I believe these are the predecessor of MobProgs, and as anyone might tell you, MobProgs are interpretted and (if anything similar to easyacts) macro based. Thus there was no support for real time variable access since variables were calculated then expanded through the script. This was unacceptable. Also there was no support for looping contructs, which brings me back to PHP, controlling infinite loops in PHP would require a thread so as to not affect the MUD itself. This opens up a whole jar of worms since the structure of DIKU was not designed for such things. At any rate my final decision was to make a 100% backward compatible scripting language, BlobbieScript. Having created the engine myself I was able to easily control the execution contexts (for looping) and able to retain 100% backward compatibility with easyacts. Now having had it active on our MUD for 3 months, I don't look back. The engine is tight and builders can create simple scripts that are like issuing the commands at their client whilst advanced builders can create almost anything their imagination can dream up (special procedures are defunct). Incidentally I also add a protected block contruct for emulating mutex/semaphore locking. Really the block just guarantees the block of code runs to completion before returning control back to the MUD server (there are checks in place for scripts taking to long to return control). Another advantage of writing my own engine was how easy it was to add support for stopping the code, stepping through it, and viewing the running scripts variables. The next step on our MUD is to convert all the socials, dreams, spells, and skills to use the new scripting engine. Currently builders can create custom commands or override existing game commands via script. Also on the agenda is to create a new type of zone command script that will deprecate the current zone command system and use scripting instead. Anyways hope this gives you another perspective.

Cheers,
Blobbie.
Blobule is offline   Reply With Quote
Old 05-19-2003, 05:12 PM   #11
halkeye
New Member
 
halkeye's Avatar
 
Join Date: Jan 2003
Name: Gavin
Location: Vancouver, Canada
Posts: 12
halkeye is on a distinguished road
Send a message via ICQ to halkeye Send a message via AIM to halkeye Send a message via MSN to halkeye
Quote:
Originally Posted by (Yazracor @ April 08 2003,11:39)
Well, the security issue vanishes totally if you do not allow your builders to add scripting-code online but only after one of the implementors has checked the scripts (the approach we take), or have a separate building port as in many LPC-muds.
even on a builders port you still have to worry about creating a good sandbox, ie securiing what builders are able todo...

without a proper sandbox, it would be quite easy to have a builder on a builders port to issue a command that executes "rm -rf ~/" and have major problems ensue.

i know both python and ruby are good at preventing that sorta thing, i never did get into looking how well they integtrated though.
halkeye is offline   Reply With Quote
Reply


Thread Tools


Internal Scripting Languages - Similar Threads
Thread Thread Starter Forum Replies Last Post
Which scripting language? Gakusei MUD Coding 9 03-14-2004 08:39 AM
Scripting gutterzombie MUD Builders and Areas 6 01-28-2004 01:30 PM
"Other" Languages for Mud Creation kaylus1 MUD Coding 14 03-24-2003 11:50 AM
Embedding scripting languages Artovil Advanced MUD Concepts 6 09-13-2002 02:01 AM
shell scripting Emit MUD Coding 3 05-26-2002 02:48 PM

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

All times are GMT -4. The time now is 08:27 AM.


Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Style based on a design by Essilor
Copyright Top Mud Sites.com 2014