Tuesday, 24 January 2012

DarkBasic and Notepad++

Syntax highlighting is my #1 requirement from an editor.  If anyone else wants to view DarkBasic source code in Notepad++, you can use the following UDL to get most of the way there.

  1. Save the XML below to "something.xml". If you mouse over the top right hand corner of the highlighted source area, you can find buttons that let you view the source and copy/paste it.
  2. Open "User-Defined Dialogue" in the view menu.
  3. Dock it.
  4. Click on the "Import" button and select the saved XML file.
  5. Close any open DarkBasic files and reopen them to ensure they get the hightlighting (needed? dunno).

            ' - ! " # $ % & ( ) * , . / : ; ? @ [ \ ] ^ { | } ~ + < = >
             1 2 0`
            dim as dword for to rng rnd sync on rate skipsyncmode set display mode desktop width height autocam hide next position inc prepare matrix texture trim make object box sphere update add delete rotate limb offset do loop if endif else text end curvevalue camera point constant function create bitmap endfunction ink get image save and or write memblock from atanfull sin cos circle wrapvalue mouse color backdrop aspect tile show mesh

Oh Darkbasic..

If you're looking for a Basic and are tired of having your time wasted by all other kinds of broken and disfunctional software, do not try DarkBasic.

They do offer DarkBasic Professional for free download, but good luck locating it on their website between the myriad of different products and add-ons for sale, and the huge amounts of advertisement.

Still, it's free.  Let's give it a shot.  Write some code.

And it compiles.  But enjoy it, chances are that is an accidental successful compilation.  Make a change, and suddenly you get a "Compilation Failed (Syntax Errors)".  What does this mean?  Where are the syntax errors?  Beats me.

I've compiled newly entered source code successfully, made a trivial and undoubtedly correct change, and then gotten a failed compile.  Then reverted the changes, and the compilation continues to fail!  Searching the DarkBasic forums yields helpful suggestions like reinstalling DarkBasic.

One potential source of problems is that DarkBasic creates new projects under "Program Files" on Windows 7.  Then it has no write access and seems to still manage to compile and run (falling back to the temp directory), although leaving a broken project if any at all.  But this is actually good, because it is the only way to be able to edit a DarkBasic project without getting the mystical compilation failures after the first change to the code..

I hear FreeBasic is pretty good.

Monday, 23 January 2012

Roguelike MUD progress

Starting up my MUD framework today for the first time in a long time, I forgot where I was at.  My telnet client of choice, Windows Telnet, no longer works reliably.. at least on a Chinese language Windows 7 computer.

Is there still a reason to support Windows Telnet?

Wider accessibility is one reason, so that people with older computers who already use it for other MUDs can continue to use it.  At one point in the past, Kavir analysed the connections to his MUD and came up with a quick rundown of how many users were using which client.  The rundown is somewhat lacking and I am not convinced it is correct enough to be representative, there's no Windows Telnet, and the large number of "Unknown" needs to be dealt with.

I think I'll leave it for now.  A better investment would be a web-based client.

Sunday, 22 January 2012

Mud progress

It has been a long time since I've worked on my MUD code-base.  Most recently, which is to say not that recently at all, I've been concentrating on the roguelike game code.  Today however, I managed to get myself to spend a little time on the standard text-based game code.


I was playing around with my container code, and for some reason, that got me motivated to add a 'weight' property to objects.  This is of course pretty straightforward.  For now, a player can gauge the weight of an object by using the 'consider' command on it.  And a player can see how much weight he is carrying, and capable of carrying, but looking at himself.  Not sure if there is a standard way to expose these two pieces of information, but if there was I'd prefer to go with it.  For now, this will do, as will my use of kilograms as the unit of measurement.

Message formatting

My message interpolation pretty much works for the purposes I put it to, but I started to wonder why this wasn't something better documented out on the web.  Ideally there would be a MUD wiki somewhere which would define the standard approaches which everyone took.  The agreed upon rules for pluralisation, verb conjugation or whatever.  Yeah, standard libraries are available for this these days, but they come at a cost.  Most that I located are overly complicated and surprisingly arcane.

In any case, looking at the text I generate when someone 'looks' at another object, I found myself expanding the message formatting.

vo = ViewedObject(viewer=actor, object=self, verb=self.containerVerb)
"{0.Pn} {0.v}: {1}".format(vo, "...")
viewing self: "You carry: ..."
viewing other male: "He carries: ..."
viewing object: "It contains: ..."
I already handled 's' (short description) and 'v' (verb).  Now after adding a 'gender' property to objects, I also support 'pn' (pronoun).  Something resembling verb conjugation is also supported, where the viewer gets a pluralised verb if he is not viewing himself.  Good enough, and quick and straightforward is the goal.

Procrastination led to some web browsing:

  • mudconnect.com: Message Expansion.
    This thread has several parties discussing the approaches at use in their MUDs.  Some are prohibitively complicated, but there are some good points made.
  • gamedev.stackoverflow.com: Generating grammatically correct MUD-style attack descriptions.
    The question is from someone completely new to the topic, and the answer gives a great breakdown of the various aspects which need to be addressed.
Nothing I am interested in looking into. A good approach for me is to look back at these when issues arise, and to stay straightforward.

Next steps
  • Finish implementing encumbrance concept.
  • No idea!  Trying to balance resisting feature creep, and not having a MUD code-base that isn't complete enough to use.