Thursday, March 14, 2013

code restructuring, again

I applied the CK patch my kernel last night to give the Brain Fuck Scheduler and Budget Sector Queue I/O scheduler a try.  I'm more interested in the I/O scheduler since disk access is much slower than context switching, though in theory, BFS should give me ~2% better performance... 2%... yay!  Also, I know more about storage than CPU architecture, so I have a better idea about what's going on.  I gotta say though, I'm impressed with how quickly BFQ hits my external drive.

Moving on...

It's a sad day in Boston.  The Pats traded Wes Welker.  Everyone's pissed.

Moving on...

I came up with a better way to do code restructuring.  First, techniques can stay in their crazy switch block.  You can only do one technique at a time anyway, so there's no point in using function pointer madness.  However, none should return inside their case, rather, they should just break out instead and a single return will be placed at the end of the function.  Each should also specify their own timeouts.  Some do, some use the timeout at the end, some don't even have timeouts:



This is true of techniques and magical effects in general.  Being effects, all they do is modify data, so they can return void.  If it matters whether you succeeded or not, you can always check the condition after it returns.  Instead of linked lists for weapon effects, it will just be a dynamically sized array of effects, and I can loop over the switch blocks and apply each effect in turn.

3 comments:

  1. i Modifed the Monst.c
    The Only thing that might caused
    problem's is the return of the \*OBOSOLETE
    quest leader's/ nemesis's

    ReplyDelete
  2. I Modifed Kougut's Potion.c And loaded it up

    ReplyDelete