Peter's Blog

Redefining the Impossible

Posts made during August 2007


Double Trouble

Sissle and Maezyn met up and went for some killing fun.

images/SisAndMaez.jpg

(If any of this seems a lttle weird then I agree, what am I doing?).

It was interesting play, I set up the focus follows mouse thing so I only have to move the cursor from one window to the other to switch characters. I set up a macro on Sissle to follow Maez and this works to a fashion, but moving Sissle breaks it so I have to be careful that Sissle is following. I tried setting up an assist macro but it didn't work and I was too engrossed playing to fix it.

Fights went like this:

  • Maez targets distant beast
  • She shoots at beast and goes into autofire
  • Beast runs at Maez
  • Switch to Sissle
  • Press tab to target beast
  • Wand
  • Wait for it to die

Sissle usually pulled agro but neither needed any healing. The fights were no more complicated than if I had to throw in a Serpent Sting or Power Word: shield. The most complex thing was remembering to loot with Maez who was after Crag Boar Ribs, I kept looting with Sissle as her window was normally active at the end of a fight.

All very smooth. It may be because fighting level six monsters Sissle at 11 is already overpowered. Still this easy stuff is good practise. In one or two fights an add would come along but then I just split and have each character fight a different target.

I put them in a group and the experience gains were disproportionate: Maez got about 18 XP per kill, Sissle 50 or 60. Maez did ding to level 6 but mainly through quest turnins which seems to give full experience (typically 650). Maez did the weird thing of dinging just by discovering the Grizzled Den.

I wouldn't say the levelling was rapid as I was still on the learning curve. Sissle got half way to twelve so overall they did well.

It will doubtless get more interesting at higher levels, when a clothy priest can no longer tank. At level 10 Maez gets a pet, then that can tank while the girls blast away. Muahaha as they say on Thott.

UPDATE: another nice thing: while Sissle was busy cooking 22 lots of boar meat, Maez was free to do something other than wait.

UPDATE2: I've decided that it will get really weird when they start whispering each other.

Trial Account Blues

As Maezyn is on a trial account I have come across a few problems:

  • she cannot receive email: there is 10g and a nice gun in the post to her, she has the mail waiting icon up but when she goes to the post box there is nothing there
  • she cannot trade with Sissle
  • her armory profile is broken, keeps giving an error

The email/trading limits are probably in there to stop gold farming shenanigans.

I think I have to actually go out and buy a copy of the game to register her properly, I can't just do it online. I then have to buy another Burning Crusade pack for her but I'm going to leave that for fifty levels or so.

Sissle is kinda raking it in as a skinner. She's on the way to making 1.7g through auctioning light leather which is nice cash for a lowbie. I'm not sure if Maez can auction anything, otherwise I can get her some cash by making her a skinner too.

I might move Pook to the new account once it is set up. This would balance out the two accounts, both would have a high level character and both would have a healer/resurrecter. Priest/Paladin could be a good partnership and hunter/hunter I've got to try. Oh bum: if I want to move pook I'll have to buy the Burning Crusade sad


Filed under: games warcraft wow

10 Comments

Ruby gave me a little puzzle. What gives?

def GetWidgets
  oWidgets = []

  ['a', 'b', 'c'].each { |x|
     oWidgets << x + 'y'
  }
end

This returned

['a', 'b', 'c']

rather than

['ay', 'by', 'cy']

Huh? Well the problem was I forgot to put in return oWidgets at the end. Any stricter language would have complained that I didn't return anything or Python would return None but ruby returned the result of the last expression in the function. This is probably a feature borrowed from perl or php (son of perl) where typing 'return' is a massive strain on the metacarpels.

Still lovin, ruby though. Blocks ftw.


Filed under: noob ruby

Add a comment

Getting Weirder

images/SisAndMaez2.jpg

This dual play is really fun, a nice new angle on the game. I've been developing the attack:

  • target beast with Maez
  • serpent sting to pull and leave Maez to drop into auto-shot
  • switch to Sissle
  • target same beast (still not macroed this but not big prob thus far)
  • Shadow Word: Pain
  • Wand to death

Using Mind Blast instead of Shadow Word: Pain took a big chunk out of the foes health but always drew agro, hence the two DoT's. Only now writing this do I remember the 'Fade' spell: this would help Sissle drop agro and put it back on Maez, leaving Sissle free to cast without interruption. Fade is a poor man's feign death but is not much use for soloing as the monsters don't have any other targets to turn their wrath upon. With Maez around this isn't a problem.

I find the priestly Auto-wanding thing to be annoying: it repeatedly auto-casts but while it is casting you cannot instantly switch to casting some other spell (Mind Blast/Healing/PW: Shield etc). I'd rather have a low damage, instant cast spell to spam. It's normally safe to leave Maez on auto and do the fiddly stuff with Sissle. Maybe I could write a load of macros that start with /stopcasting but that seems like hassle.

When I have to do two fights at once things do become a struggle, due to both my priestly noobness, dual-play noobness, hunter-without-a-pet struggles and sheer weight of options to skim through. Ressurection works nicely smile A res and a heal and Maez is up and running again. Having a priest on the team is highly recommended.

Consider the situation where Sissle has pulled agro, the logical thing to do is take Maezyn back to range and start blasting. Problem here is Sissle will auto-follow Maez and bring the enemy they are fighting with her. The net result is they are still fighting but Sissle has stopped auto-wanding.

While Maez has reached level 8 she is facing a situation where there are not a lot of quests left in Dun Murogh: getting less XP from monster kills is taking it's toll. However, killing is easy and XP grinding is an option. Sissle is nearly 12, she has benefitted more from the kills. As Maez catches up in level with Sissle this should balance out and we should really start rocking when they are both on the same quests. While collection quests (kill X monsters and get Y monster parts) are notoriously more tedious in this kind of play, straight killing quests are easy XP as both characters are getting clocking quest kills at the same time.

Playing like this there is no way could I ever be as effective as two players and probably not as effective as one player that knew what she was doing. I think I'm more effective than I am solo though smile

Maez's Future

Looking forward to getting the hunter pet. Apart from the coolness of three characters running round, play will be more like standard hunter play, with a side order of priest.

I was planning to make Maez a Marksman but I would really miss having an awesome pet. I need something that will hold agro while a priest blasts away. I'll think about this some more.

Pet wise, Maezyn will definitely pick up an Elder Crag Boar as they have charge and gore. For the other pet slot an interesting option could be a wolf: these have 'Furious Howl' which is a buff to group damage, useful with our little group. Small problem with this is it only has a 15 yard range and I'd hope to keep Sissle more than 15 yards from the fighting pet at all times.

I think I'm now settled on Engineering for Maez. So many good things:

  • guns
  • shot
  • scopes
  • Jumper Cables, giving her a one in three chance of ressurecting Sissle should the worst happen.
  • goggles
  • lots of other toys.

I'm in two minds about sending my duo off to Darkshore to get Darnassus rep while they are still low enough for the XP to be useful and for the quest markers to be visible. Is rep split between group members? Having the two of them on elekks would be fun.

Warcraft Addiction

It's a struggle but I have still played less than I used to and this blog post is longer than I intended mainly because I find this stuff so interesting.


Filed under: games warcraft wow

2 Comments

Not sure any of this is recommended practise but it appears to work so I'm noting it here.

Overriding Array Methods

   1   class MyArray
   2     #
   3     # Initialise array
   4     #
   5     def initialize
   6        @zog = []
   7     end
   8  
   9     #
  10     # Read from array
  11     #
  12     def [](x)
  13         return @zog[x]
  14     end
  15  
  16     #
  17     # Assign to array
  18     #
  19     def []=(x,y)
  20       @zog[x] = y
  21     end
  22   end

Used thus:

   1  irb(main):021:0* a = MyArray.new
   2  => #<MyArray:0x30d8074 @zog=[]>
   3  irb(main):024:0> a[0] = 1
   4  => 1
   5  irb(main):025:0> a[0]
   6  => 1
   7  irb(main):026:0> a[1] = 2
   8  => 2
   9  irb(main):027:0> a[0]
  10  => 1
  11  irb(main):028:0> a[1]
  12  => 2
  13  irb(main):029:0>

Interesting that ruby doesn't seem to be fussy about array indices:

irb(main):031:0* g = []
=> []
irb(main):032:0> g[5] = 2
=> 2
irb(main):033:0> g[2]
=> nil

Contrast to python:

>>> a = []
>>> a[5] = 2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
IndexError: list assignment index out of range

I think if I had the choice I would rather have my wrist slapped: the ruby way looks like an opportunity for obscure bugs.

Method Missing

It took me ages to work this out but it's simple. You have a class and you want to hook into calls to any undefined methods. Maybe you want to determine the method names at runtime. The hook is called 'method_missing':

   1  class Klack
   2    def method_missing( strName, *args)
   3      print "Calling undefined method #{strName} with arguments #{args.inspect}"
   4    end
   5  end
   6  
   7  irb(main):054:0> k = Klack.new
   8  => #<Klack:0x309dd84>
   9  irb(main):055:0> k.wibble( :wobbles, :banana)
  10  Calling undefined method wibble with arguments [:wobbles, :banana]=> nil

args appears to be a simple array holding the arguments the method was called with.

Note how useful the .inspect method is. It's equivalent to repr in python in making anything into a human readable string. Also gotta love how easy it is to insert the values of variables into strings.

UPDATE: this does seem to make for very fragile code. Just about any problem in your method_missing method can lead to a stack overflow. Or maybe it's a rails problem?

Wots the colon?

The colon thing is handy:

b = :blah

:blah is like a string constant, something like a string, easier to type but less complex in it's implementation. Have to be careful with them though:

   1  irb(main):058:0> b = :blah
   2  => :blah
   3  irb(main):059:0> b[1]
   4  NoMethodError: undefined method `[]' for :blah:Symbol
   5          from (irb):59
   6  irb(main):060:0> b == 'blah'
   7  => false
   8  irb(main):061:0> b == :blah
   9  => true
  10  irb(main):062:0> b.to_s == 'blah'
  11  => true

They don't have common string functions and :blah is NOT comparable to 'blah'.

Regular Expression Gotcha

The =~ operator for testing a string against a regular expression returns the offset of the match.

irb(main):086:0> o = "poop1" =~ /poop(\d+)(=?)/
=> 0

In this case the result is zero as the match starts at character offset zero. The operator would return nil if there was no match.

If you want access to the expression match object then this does the job:

irb(main):088:0> o = /poop(\d+)(=?)/.match( "poop1")
=> #<MatchData:0x3085748>
irb(main):089:0> o[1]
=> "1"
irb(main):090:0>

o is the expression match object where you can examine the juicy details of the match. These are also available in global varibles such as $1, $~ etc but everyone knows that using global variables is sloppy.

Zero is True

The =~ result works nicely with an if operator to detect a match because of the strangest ruby design decision: zero is true:

irb(main):095:0> if 0
irb(main):096:1>  print 'true'
irb(main):097:1> else
irb(main):098:1*  print 'false
irb(main):099:1> end
true=> nil

nil is false but 0 is true.

This is totally at odds with python where 0 and None are both False (with a capital F). I think even basic has 0 as false.

Processing Arrays

The collect method looks useful for writing one-liners:

irb(main):103:0> [1,2,3].collect { |x| x + 1}
=> [2, 3, 4]

Each item in the array is processed by the block and the results returned in a new array. To me this is more readable than the python version:

[ i + 1 for i in [1,2,3]]

Filed under: noob python ruby

2 Comments

Dynamic Duo

I wanted to get Maevyn to 10 asap so she could get her pet. Few quests around so mostly grinding. I decided to run her with Sissle following, not grouped but with Sissle only helping in emergencies and doing a bit of healing. Maevyns first kill gave about 150 XP but after Sissle had healed her once or twice and given her Power Word: Fortitude her XP on each kill went down to around 75 and this was persistant through the remaining kills, even without Sissle's assistance. It's as if Maezyn was tainted by being helped: the assistance from a high level extends to being healed between fights, it doesn't just effect the XP for assistance during one fight. It might be that when that friendly passing priest gives you a buff they are actually crippling the rate at which you gain XP for half an hour. I will have to test this theory out properly. It will be nice to find a way to get back at people that wind me up: give them rank 1 Power Word: Fortitude (+3 stamina !!) and hope they don't dispel it by right clicking the icon.

Ultimately I realised that it was more productive XP wise to simply have both girls fighting ungrouped: Maez got about half the experience rather than the 25% she would get if grouped and the enemies died so much quicker it was overall better than levelling Maezyn solo. The only downside to not grouping was that Power Word: Shield can only be cast on group members.

Tried it on with a level 11 elite, using Maezyn to melee and Sissle healing but Sissle kept drawing agro and died on two attempts. She tried Fade but it was no use. In retrospect I think I should have had Maezyn fire arcane shot rather than just using auto-shot to try to pull it back. Hey, I'm learning group play here!

Got Sissle to 12 and Maezyn to 10. When the hunter gets the pet it is such a change in fortune, I was immediately back in the hunter groove, ploughing through beasts. No time to try running the three, Sissle had died outside Gnomeregan in a fight with three enemies and she was still on the Spirit Healer debuff. Fighting multiple adds gets very complicated very quickly and my brain seizes. I need to learn some set-piece moves for these situations.

I've been thinking about how having a healer around will improve my Hunter play. Apart from a bit more DPS and having Sissle heal the pet to save Maez's mana, how can I improve the fights where things go wrong? The main reason for Maevyn having to run away was when the pet drew too much agro and was going to die. It remains to be seen whether extra healing from Sissle will make the pet able to tank four or more monsters. However, I think it will be very difficult to control two characters running away. If Sissle ever draws agro I hate to think how I will handle it. Have her Fade, hope it works, then have Maezyn blast the mob is probably the best tactic. There's scope here for either brilliant play or spectacular wipes.

Interesting times.

I'm planning to go out and buy another copy of WoW and get Maezyn licenced properly so I can twink her with some cash. She's so poor that a rusty grey vendor trash gun she got dropped was an improvement to what she was carrying.

I'm hooked on this style of play now, I can't imagine having Maezyn running around alone. Can I resist running Maevyn and Pooky together? Probably not now I've realised I could do it. That will make Outlands less tedious. Oh no, that idea is too tempting..... respec Maevyn to Marksman for mega ranged dps and respec Pook protection as her pet smile Crusader Aura works with parties! AAAAARRRRGGGGHHHH stoppit brain. Chill, cool it, Calm blue ocean, Calm blue ocean, Calm blue ocean.... think of those interesting ruby projects.


Filed under: games warcraft wow

9 Comments

Teamwork

I've had a proper chance to play with Hunter, Pet and Priest.

images/TheTeam.jpg

Here is the preferred attack:

  • target foe with Maezyn
  • send in pet
  • serpent sting and drop into autoshot
  • switch to Sissle
  • target foe
  • Mind Blast
  • Wand to death

Normal fights last seven or eight seconds.

The Pet is an Elder Crag Boar called Cedric. As soon as he was tamed he was trained in Growl and he never seems to drop agro, he can hold on like glue. He has a lovely charge ability and zooms into fights. I can already pull a mob with Maezyn and intercept it with a charge from Cedric once the mob is away from his mates. Sweet pulling. Sissle is free to Mind Blast, Heal or whatever, she doesn't seem to pull agro from Cedric. The trio have killed both level 11 elites in Dun Morogh, just tank with cedric, the girls blast and Sissle casts lesser heal and renew on Cedric. I think Hunter/Priest is actually a good pairing, we have two lots of ranged dps, a healer (two if you include Mend Pet) and a tank. The Hunter herself is easy to control in a fight, just leave her on autoshot and concentrate on the priest, Mind Blasting, Smiting, Wanding or Healing as appropriate. The pet is on defensive and will largely take care of itself. The Priest can cast Power Word: Fortitude to boost everyone's stamina, including the pet.

I've had some spectacular fights, usually they turn into chaos with at least one character standing doing nothing. It needs another order of mental dexterity. I've had all three of them in one-on-one fights at once. The group seem to be able to handle pairs of adds, something a solo player may have trouble with.

Maezyn has died once, Cedric went crazy and agroed a whole camp. I made Sissle run away, let Maezyn die and have Sissle resurrect. When Maezyn dies, Cedric is automatically dismissed and so he won't die himself. Resurrecting Maezyn seem quicker than Maezyn resurrecting a Pet, Maezyn doesn't need feeding to make her happy again. However, letting Maezyn die will incur the 10% durability loss.

There is one thing about it that is really getting annoying: having to put Sissle back into follow mode. She keeps dropping out and it is getting to me. Sissle follows about five yards directly behind Maezyn which leads to a few problems:

  • sometimes Maezyn starts a fight with Sissle out of range
  • if Maezyn is in range to loot a corpse, Sissle is sometimes a little too far behind

Correcting these is easy enough but it breaks the follow and I have to engage it again (and again and again). I need to bind it to a key.

Her following is buggy, going through doors she can get stuck in doorways etc. I've seen her refuse to stop climbing steep hills and stop dead. I don't understand why the hunter pet works fine but follow doesn't, don't they use the same code?


Filed under: games warcraft wow

3 Comments

New Expansion Pack

I've read about the new expansion pack due whenever Blizzard feel like releasing it. Features:

Cap raised to level 80
not of interest to me, haven't managed 70 yet
New Northrend area
not of interest for me, prob for > 70's
New 'Death Knight' class
no use to me, only accessible through raiding
Can program own dance moves
no use to me, I'm not into choreography
Easier levelling up to 60
diminishing any achievement gained from levelling to 60 now

Bye Maezyn

Maezyn's life is going to be a short one. I haven't converted her trial account to a full one, I am going to let it lapse. The dual play was fun but it left me feeling guilty, it felt too much like cheating and I was ashamed to be near other players.

/bye


Filed under: games warcraft wow

2 Comments

Legible Blocks

Thus far I have been using this syntax for blocks:

blah.each { |n|
  print n
}

But I've found the following syntax is more legible because the do and end are syntax highlighted:

blah.each do |n|
  print n
end

Maybe the braces can be syntax highlighted but I'm ok with typing big fat words.

What's Not in a Hash

If you address an item that is not in a hash you get a nil value:

?> oHash = {1=>2, 3=>4}
=> {1=>2, 3=>4}
>>
?> oHash[5]
=> nil

python raises an exception in this case. I prefer the ruby way, I'm not a great fan needing exception handlers all over the place. It can be done in python without an exception handler with a little more typing:

>>> o = {1:2, 3:4}
>>> o.get(4, None)
>>>

There is one little quirk in the ruby way:

?> oHash[3] = nil
=> nil
>> oHash.keys
=> [1, 3]
>> oHash[3]
=> nil
>> oHash[4]
=> nil
>>

No simple difference between an item of value nil and a non-existant item. However I cannot imagine this ever being a problem.

Aptana Syntax Highlighting Oddity

I was having some weird problems with syntax highlighting in aptana. Some lines were indented more than others and I was having to fiddle about adding and deleting spaces. I finally traced the problem to the way that keywords were highlighted in bold. Because the bold made the font slightly larger it seemed to alter the size of the spaces before the keyword, making them wider. The result was that lines that started in a keyword were indented more than lines without.

The font I was using is called 'Andale Mono', a nice clear readable font except it seems to have this problem, the spacing on bold characters is different to normal characters. I changed the font back to nasty Courier New and the problem went away. However, as I prefer Andale Mono I will simply avoid using bold in the highlighting.


Filed under: noob ruby

Add a comment

I had some work done on the TV aerial in my house, moving it from inside the loft to outside. I didn't do it myself due to extreme vertigo. The digital TV signal is now much stronger, no more artifacts and stuttering on BBC channels. This was a good excuse to dig out my old Slingbox which has been sitting on a shelf since I moved last september.

I have set it up with it's internal DVB TV tuner which allows me to watch something vaguely interesting on the pc while my daughter watches 'In the Midnight Garden' on the main TV in the computer room. This TV is connected to my Humax PVR which is very good for recording kids tv to repeat ad-infinitum. She's been watching the same episodes of Balamory since christmas, they sing christmas songs between the episodes.

The picture is very good on the whole. If I maximise it on my 24" widescreen monitor it is pretty pixellated and nasty but I watch it in a little box, maybe 4", in the corner of the screen and there is still plenty of space to work. Alternatively I can watch TV wirelessly at the bottom of the garden on the laptop. I did a proof of principal at the weekend but not for long as watching TV in the bright sunshine in the garden just seems wrong.

During my slinging haitus Slingmedia seem to have started selling the Pocket PC version of the player software in the UK. It's £20. I dug out my old Dell Axim v51 as it is in the compatibility list, I charged it up and all the programs are still there, stored in flash but it had lost the current time. I haven't installed the sling player software on it, I'll see how riveting TV has become during my nine months of televisual apathy.

Another option to investigate is the BBC's new streaming video service, only available to UK licence payers (ya boo). This has the advantage of being PVR like, being able to choose when to watch something. This is the main limitation of the slingbox, it cannot record or timeshift unless you connect it to a PVR. Channel 4 have a similar service and more interesting programs (none of those endless talent shows with judges, one of them a baddy), must investigate that too.

Now I have a strong TV signal and a powerful pc I may investigate the options for recording, timeshifting and streaming on the PC. Hopefully the technology has moved on from the awful state it was in last time I tried a few years back now.

UPDATE: fate succombed to the temptation and the signal was too weak when I got home to watch anything but BBC. OK next morning. Slingbox's aerial feed is chained after the Humax PVR which was working fine. An inline booster may fix the problem but that's more power consumption and cables.


Filed under: axim dell slingbox

2 Comments

Endless Ends

Ruby terminates just about everything with the end keyword:

def SillyExample
  if a == 3
    10.repeat do |n|
      if n == a
        print n
      end
    end
  end
end

Maybe I am nesting too deep but the endless ends become quite confusing after a while, especially with ruby's official two space indents. Visual Basic 6 (ugh) at least has end if, loop, end sub etc so you know what you are looking at the end of.

Then again, python has no equivalent to end:

def SillyExample():
    if a == 3:
        for i in range(10):
            if n == a:
                print n

but python's indentation standard is four spaces rather than two making it a bit easier to follow.

Maybe I should just defy convention and indent my ruby with four spaces? Who cares apart from the indentation Nazis?

More Scope for Errors

So why wasn't this loop doing what I thought it would?

Mytable.find( :all, :order => "serial_number") do |oRecord|
    print oRecord.serial_number
end

Mytable is a rails ActiveRecord class and I'm using it to load records from a table. But nothing is printed although I am sure there are records there.

Hum, turns out I missed the call to the 'each' method:

Mytable.find( :all, :order => "serial_number").each do |oRecord|
    print oRecord.serial_number
end

and now it iterates through the recordset correctly. It seems that the first form silently does nothing, it doesn't seem to execute anything inside the block. It gives no errors either.


Filed under: noob ruby

1 Comment