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.

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.

So after far to many bad places, I finally found somewhere, a new build…
This blog seems to be dead at the moment
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
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.
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
Things I’ve given up on
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.
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?
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.
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
The realisation that the crumpets are burning.
(Google doesn’t know about it)
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.
Powered by WordPress.com