Heisenbug

September 21, 2009

Directory of Chess Openings

Filed under: Uncategorized — by jenf @ 7:50 pm

I’ve been trying to learn some chess openings, couldn’t keep them in my head, so I created a mindmap of them all. I find most of the websites about openings unusable as a teaching aid, so much so I sometimes think about writing something myself.

Chess Openings

June 24, 2009

Found a House

Filed under: Uncategorized — by jenf @ 9:26 pm

So after far to many bad places, I finally found somewhere, a new build…

This blog seems to be dead at the moment

April 27, 2009

Moving room to room

Filed under: Backpack — by jenf @ 9:38 pm

It’s taken a little while, as I’ve been distracted with other things, but backpack now has the ability to move room to room.

I think it needs another refactor in it’s core as the system is becoming unwieldly. At the moment the main system is linked together with the following three classes

  • ObjectManager : Looks after all the objects
  • World : Looks after the world view
  • DSLParser : Looks after the DSL parsing

The three of these are tided together using masses of method_missing calls.

There’s also the problem where functions with similar names do widely differeing things

I’m not sure how best to rejig it. There is also the problem of inheritance in the CoreObjects, I’m not sure the best way to model it.

April 22, 2009

House Hunting

Filed under: Uncategorized — by jenf @ 8:29 pm

So, after the yearly round of payrises, I’ve decided to try buy a house

I have a bit of a dilema, in that I only have 22% deposit for 3 times my salary. Below 25% and the interest rates on mortgages jump ~ 2%. So do I try and save to get to 25% or jump in now?

So what am I looking for in a house

  1. Primarily, it’s not in a sink estate, I know I won’t be able to buy a house in the nicest of areas, but staying away from the warzones would be nice.
  2. Must be within 25 minutes drive of work (so Shipley to Skipton)
  3. Must be structurally sound, I can fix cosmetic stuff easily, but fixing roofs is a pain.
  4. Kitchen must be decently sized (I think 3*3 metres is my lower limit)
  5. Must have at least a back yard, something I could plant some raspberries in.

Things I’ve given up on

  1. Drive would be nice, but onroad parking otherwise.I want to be able to walk back from a train station when drunk, so the house needs to be less than 1.5 miles away from any of the Airedale stations.

April 15, 2009

How the object based parser works.

Filed under: Backpack — by jenf @ 10:09 pm

The object based parser is now pretty robust in terms of functionality, it needs more work in terms of error handling.
The following is an example of how to declare the verb ‘help’ and connect it to the help function in ruby, simple enough.

module Backpack
  class SystemObject
    include Parser
    verb "help", :help
    def help
     puts "You need it"
    end
  end
end

And for strings with an object attached:

  class Item < BackpackObject
    verb "examine", primarynoun, :examine
    def examine
      puts self.inspect
    end

    verb "put", noun, ["into","in","inside","through"], primarynoun,:insert
    def insert(x)
      puts "insert %s" % x
    end
 end

It currently doesn’t support multiobjects, but that’s not to difficult to add. Unfortunately it has caused a slight rethink in how exits in Backpack are handled, and is causing a slight rewrite (as well as a tidy up).

The system also exposed an area of ruby which I wasn’t sure of before, inheritance and metafunctionality that is created when the class is loaded, the verb function adds a class variable and this is not visible to the child, this then has to be put back together when the verb is being parsed.

April 13, 2009

Breaking the Tradition of IF

Filed under: Backpack — by jenf @ 9:56 pm

I find most IF games very infuriating, and is likely why the genre died out in the commercial world. Why spend your afternoon trying to phrase things properly when you can blow up aliens.

Three Things annoy me greatly about IF.

1) What direction was I wanting to go in.
Why when I want to go into the Kitchen, do I have to find out what direction the kitchen is in, and then type ‘go east’. In the real world do you think “Hum, I want a yogurt, I’ll go to the kitchen, the kitchen is east, therefore I go east”, you think “Kitchen”

The only game where directions are useful seem to be the original Colossal Cave Adventure, and every game since still takes that design as a good one. I’m tempted to remove directions altogether from the standard setup of adventure backpack.

2) What verb was I looking for?

I needed a parser, so I took inspiration from Inform 6’s parser, but in my world view, I felt that the verb definitions should be done as part of the object (including inheritance).

Why:
You could ask an object what verbs are available for it (avoiding the what verb problem)
The code for declaring the verb would be in the same place as the code for handling the verb, which is much more maintainable.

3) Conversations in the system are very weakly done.

I’ve been exploring various IF games recently trying to find the style I like, all but the choosing a conversation number become very fiddly and difficult to know what you are doing. But the drawback of this (called the Lawnmower effect), is you choose responses randomly.

I’m tempted to take the same approach (as the default), of handling verbs where you can inquire what the person’s topics are, I know it breaks the fourth wall, but it makes it easier to work with.

Should I be doing this at all?

I’ve been reading the following, The Interactive Fiction Authoring System Developer’s Guide 0.99, and it quite correctly says that most people trying to create an IF authoring system will be wasting their time, as the current systems are quite versatile.

So why would I bother?

  • It’s done in a general purpose programming language rather than a specialized one. The number of programmers out there who understand Ruby is probably 1000 times greater than the combined programmers in TADS 2 & 3, Inform 6 & 7. I dislike the idea of creating new languages and having to implement object models where a system is already available. Ruby already has a large amount of logistics behind it, and the mixin ability is rather cruicial.
  • Since it’s based on a real-world programming languages, new options are available. You could have a paper in the game when you read it, would fetch the Guardian’s news stories and include them into the storyline. (Difficult to program realistically, but the option is open)
  • Multiplayer IF is not well done in existing systems, and MUD systems are not really that expressive, and don’t have the advanced abilities that IF does.
  • Graphics IF creation software is ad-hoc and not easy for indie productions. (Adventure Backpack original started out as a graphical IF system, but that was to complex). I intend to extend the system to add graphics (probably AJAX & SVG)
  • It gives me an excuse to program in Ruby and mess around with DSL’s.
  • I find the idea of Natural Language (Inform 7) programming abhorrent, unmaintainable and unartistic. The difficulties with programming are just as difficult with Natural Language programming as Non-Natural Language programming, but you have a new batch of guess the verb problems.

April 8, 2009

Continuing Adventures of Adventure Backpack

Filed under: Backpack — by jenf @ 11:24 pm

I added the inverse path generation (which was a doddle) create a list of directions and their opposite (invert that list) and then loop over the list.

I then added the existence of items, I’m played around with the syntax for creating items, I think my solution of creating the items in the rooms they are in is quite tidy and implies a lot more structure in the script file than inform does, and follows the DRY idiom (Don’t repeat yourself). The current code can be found at http://github.com/jenf/adventurebackpack/tree/master

room :Forest, "Deep in the forest" do
 description "Through the dense foliage, you glimpse a building to the west."
             "A track heads to the northeast."
 exit_northeast :Clearing

 item :Bird, "Baby bird" do
  description "Too young to fly, the nestling tweets helplessly."
  name ["baby","bird","nestling"]
 end
end

 

Object  forest "Deep in the forest"
  with  description
            "Through the dense foliage, you glimpse a building to the west.
             A track heads to the northeast.",
        w_to before_cottage,
        ne_to clearing,
  has   light;

Object  bird "baby bird" forest
  with  description "Too young to fly, the nestling tweets helplessly.",
        name 'baby' 'bird' 'nestling',
  has   ;

The biggest challenge to the system now has to be the natural language parsing.

Pet Project: Adventure Backpack

Filed under: Backpack — by jenf @ 12:06 am

A while ago, I tried making a Ruby based graphical adventure system. As usual I bit more than I could chew. So I’ve decided to go back and try making a text-based system first to explore things, and maybe taking the ideas into a second version of the system. (Alternatively making a system that’d fit both text and graphical adventure games)

I’ve decided to make it as a DSL (Domain Specific Language), after getting my ruby programming back from the rusty part of my brain I managed to do quite a bit for 3 hours work. At the moment it allows you to move from room to room. The following is based on the Heidi example by Roger Firth and Sonja Kesserich

room :BeforeForest do
 description "You stand outside a cottage. The forest stretches east."
 short_description "In front of a cottage"
 exit_east :Forest
end

room :Forest do
 description "Through the dense foliage, you glimpse a building to the west."
             "A track heads to the northeast."
 short_description "Deep in the forest"
 exit_west :BeforeForest
 exit_north_east :Clearing
end

room :Clearing do
 short_description "A forest clearing"
 description "A tall sycamore stands in the middle of this clearing."
             "The path winds southwest through the trees."
 exit_up :TopOfTree
end

room :TopOfTree do
 short_description "At the top of the tree"
 description "You cling precariously to the trunk"
 exit_down :Clearing
end

start_room :BeforeForest

My next steps are

  • Automatically generate the inverse paths
  • Add actions (like on_entry)
  • Add objects
  • Add Natural language parsing (at the moment I can only say east up down)
  • Add NPC communcation
  • I need a better name.

January 29, 2009

Crumupant

Filed under: Uncategorized — by jenf @ 11:17 pm

The realisation that the crumpets are burning.

(Google doesn’t know about it)

December 30, 2008

Christmas Holidays (Trip in my car, and pains with an RCU)

Filed under: Fish, driving — by jenf @ 9:03 pm

I got my car on the 1st of December, so I managed to get the 2.5% VAT change taken into account which saved me a bit of cash, and I drove it down to my parents (Black Country way) at Christmas.

The Aygo seems to be best at 0-30 mph acceleration, the acceleration does rather surprise me at times and I then realise I’m doing 40 in second gear and quickly change up. The 50-70 mph acceleration does take a while, but that’s life. At 70 mph, it is a bit noisey, but all cars like it are. I can get 60 quids worth of food shopping in the boot and wouldn’t want more. I find it difficult to park, but that’s just me being inexperienced. On the M62 summit I could get it to about 65 flat out.

There is a lack of a light in the boot and on the three door model, when you lift the seat it resets its position, which is a pain if you have abnormal leg length like me, thankfully I can use the passenger side to do most things. One thing I’d like is an instantanous mpg reading, especially as this car is billed as the most fuel economical petrol car currently on the market.

I sometimes feel I’m thrashing the engine, especially on the way home my mpg was only 50 mpg, I’m keeping a track for now to see what contributes to higher or lower fuel efficiency, I shall try to be more gentle in the future. In terms of cost it cost me £23.08 in fuel. The cost of a train would have been £47.30 (Crossflatts to Sandwell + Dudley) + £4.80 (S&D to Wolverhampton), plus if I was doing end to end by public transport an extra £6.00 for bus tickets (for two days): all total £58.10.

When I got home I unfortunatly found that there was a power cut and the RCU had cut off the fish tank. By the time I had got home the water was 10 degrees celsius and 75% of them had died.

Next Page »

Powered by WordPress.com