Thursday, September 3, 2009

Running EverQuest and ShadowTeq software in a Virtual Machine

Running EverQuest and ShadowTeq software in a Virtual Machine


Required Software:

* - VMWare is not free, and costs $189 for a single license, though there is a 30-day trial. Please note that I do not promote software piracy.


Introduction:

Described in this document is the method by which you can set up and run EverQuest 2 and ShadowTeq software inside a Virtual Machine. There are several reasons why you might wish to do this. First, if you are running an operating system which ShadowTeq does not support (such as Linux, MacOS, or future versions of Windows), you can run a virtual machine (VM) that runs a supported operating system, such as Windows XP, in order to run our software. Second, running inside a VM means you can use the rest of your computer while our software is running, rather than being locked into keeping the EverQuest 2 window always-on-top.

This process is fairly straightforward, if advanced. None of the steps below requires altering your current installation in any way, except for installing VMWare Workstation. Still, if you are not at least comfortable following a set of advanced instructions, I suggest finding someone who will be willing to help you through this. The good news however is that once your virtual machine is up and running, any changes you make to it do not in any way impact your existing system - so you can feel free to experiment inside the VM as much as you like.

This guide assumes you are using exactly the software outlined above in the Required Software section. Some of these (VMWare Workstation, Windows XP) can be replaced with higher versions, although this may change the steps. Please do not deviate unless you already know what you're doing. ShadowTeq won't be officially providing support for this, but I (Erik) don't mind helping out as much as I can - but if you deviate too far from this set of steps, I may not be capable of helping.


Step 1: Install VMWare Workstation 6.5.3:

After you've obtained a copy of VMWare Workstation, you'll need to install it. Double-click on the installation file to begin the installation process. This is straightforward - there aren't any important options to select, so choose Typical installation.


Step 2: Create a Windows XP Virtual Machine:

Now that VMWare is installed, it's time to create the Windows XP Virtual Machine. I'm using Windows XP Service Pack 2, but SP3 is also confirmed to work as well. To do this, you'll need to have either a physical XP CD in your CD-ROM drive, or have an ISO image of the XP CD you intend to use. When you're prepared, launch VMWare, and go to the File menu, select New, and select Virtual Machine. In the window that appears, select the Custom option and click Next. In the next page, ensure that the Hardware Compatability selection is set to 'Workstation 6.5', then click Next.

The next page allows you to choose where to install XP from. If you have a physical CD in your drive, select the first option button, then click Next. If you have an ISO image of the CD, select the second option button, click the Browse button to tell VMWare where your ISO file is, then click Next. The next page will ask you for your XP CD key, your full name, and an Administrator password. Fill in these details and click Next. The next page will give you an opportunity to name your Virtual Machine. I just left mine as the default, but you're free to use whatever name you wish. Additionally you can change where the Virtual Machine files are stored. By default, there's a 'Virtual Machines' folder in your 'Documents' folder that VMs get stored in. When you're done here, click Next.

The next page that appears will ask you how many processors to expose to the VM. If you have more than one processor available in your machine, choose Two. Click Next. The next page allows you to specify the maximum amount of physical RAM that the VM will be allowed to allocate. Note that this means the VM will consume AT MOST this amount, but probably less. I recommend 1024mb. After setting your desired maximum RAM, click Next. The next page allows you to determine the type of network connection the VM will have. I recommend leaving it at the default of 'Use network address translation (NAT)' as this will simplify configuration later on. Click Next. The next page is for SCSI configuration - nothing needs to change here; click Next.

The next page allows you to configure a hard drive for your VM. In our case, we want to create a new virtual disk, so leave it at the default and click Next. The next page allows you to select the type of virtual drive; this selection is largely unimportant, so choose the default and click Next. The next page allows you to set the maximum size of the virtual disk. I recommend 24gb for everything that will need to be installed, but you can choose more if you like. The other options on this page are fine at their defaults, so after you set the size, click Next. Click Next again to select the default name for the disk.

Now we've come to the end of the Virtual Machine creation; click Finish to have VMWare finalize your choices, power up your machine, and install Windows XP. This process is completely automated (if you've followed the instructions) and, when finished, will leave you at the Windows XP login prompt. To log in, type the Administrator password that you specified earlier in the password box.

If all's gone well, you should be greeted with a Windows XP desktop, and the Windows XP login sound effect. One of the first things you should do here is to increase the screen resolution. Currently it's set to 800x600 - much too small to be useful. To change it, right-click on your desktop and select 'Properties,' then select the Settings tab. Drag the 'Screen Resolution' slider until the resolution is at least 1024x768 - any less than that and the EverHarvest or Golem windows will overlap the game window by far too much.


Step 3: Install Supporting Software:

Now it's time to start installing software in your Virtual Machine. Assuming you've used XP SP2, you'll need to install DirectX 9.0c, Windows Installer 3.1, and the .NET Framework 3.5. You'll find links to these downloads at the top of this document. From inside your Virtual Machine, download the files, then install them in the order listed above. Remember, install them inside your Virtual Machine, not on your physical system! All the default installation options are fine for this software.


Step 4: Install EverQuest 2:

Finally, we can install EverQuest 2. Use the download link at the top of this document to download the EQ2 launcher (again, from inside your VM). Unzip it, then run it, and it'll install the base files necessary for downloading and patching EQ2. You should know the drill here - log in to your Station account, and let the patcher run... This will probably take several hours, but you can do other things while you wait.


Step 5: Install ShadowTeq Software:

Now it's time to get our software running. Using the download links on our home page, download the software you're interested in (again, while inside the VM), and install it according to the usual instructions.
... That's it. Really. =)


Step 6: Run:

This works the same as it does on your physical computer - run the application you're interested in running, and log in. Note that you will probably get a 'No Licenses Found' error - that's okay. Just follow the instructions found on this page and you'll be good to go. Configure the software as usual, and run it as usual - the only difference is that you're running it inside the VM.

Now here's the slick part - the culmination of all your efforts. Once the software is up and running, press Control + Alt - and your mouse will detach from the VM's mouse, and you can minimize VMWare, or tab away from it, or whatever - do anything else you want on your computer. If your system is beefy enough, you can even run another instance of EQ2 on your physical computer - or, even, in another Virtual Machine. Theoretically you can have as many VMs running at once as you want - the only limits of course are CPU power, available RAM, hard disk space, and networking bandwidth.


Step 7: Shutting Down:

Shutting down a Virtual Machine works the same way as shutting down a real computer - go to Start and select Turn Off Computer, then Turn Off. The system will perform its shut-down routine, then turn itself off. To turn the 'computer' back on again, select the VM in the left-most list and press the green 'Start' button in the toolbar on top of the window.


That's it!

No, really, that's it. Now that you've got the hang of this, feel free to experiment around. It's really hard to mess this up - and even when you do, you're just dealing with virtual machines - just reformat it if you do something unrecoverable. For more advanced uses of the VMWare software, you might want to consult their documentation, available from the VMWare website.

Enjoy, and good luck!

Wednesday, September 2, 2009

Late birthday present

One of our users has managed to get EQ2, EverHarvest, and EverCraft working in a VMWare Virtual Machine, and has shared the instructions on how to get it working with me!

Why is this such a great birthday present? Virtual Machines are like full computers running inside your physical computer - which means it gets its own (virtual) keyboard and its own (virtual) mouse. While EverHarvest and EverCraft still require EQ2 to be the topmost window on the computer, this can be true inside the Virtual Machine instance while NOT being true on your physical computer!

This means that you can DO OTHER THINGS on your computer while you run our software! Finally! =P

I'm working on getting the instructions in a more user-friendly form before posting them - which should come in the next day or so. Just wanted to post this to get the pot stirring, so to speak... =)

Monday, August 24, 2009

=)

Happy birthday to me,
Happy birthday to me,
Happy birthday dear... meeeee...
Happy birthday to me!

...

I need a life... Lol

Thursday, August 20, 2009

Lambdas and Anonymous Delegates pt 2

So I did exactly what I suggested to myself, and sent an email to Eric Lippert regarding the inline lambda and anonymous delegate business I blogged about earlier today. He's quick - here's his reply:

Ah, good question.

You can make this work by casting to a delegate type.

((Func<bool>)()=>M()).Invoke();
((Func<bool>)(delegate (){return M();}).Invoke();

For lambdas, we don't know whether the lambda is to be converted to a delegate or an expression tree. Since an expression tree cannot be invoked, we cannot allow you to invoke it before we know what you intend.

For anonymous methods, yeah, I suppose we could have designed C# 2.0 to allow invoking them directly. But what would the point be? Why say (delegate(){return M();}).Invoke()" when you could just say "M()"? I agree that for reasons of generality and consistency it would be nice to have, but I don't think disallowing this actually disables many scenarios.


He's right - it's not like this is some sort of necessary functionality. On the one hand, it's great that I can get exactly this functionality by casting to a delegate type first, but on the other hand it's extra cruft. All the same, if some inspired or courageous EverDroid user needs this sort of functionality, it's there.

Thanks, Eric! =)

Inline execution of a lambda expression or anonymous delegate

I had an idea I wanted to try to exploit that would make my VB.NET expression a bit more, well, expressive.

The way I built my expression builder, essentially you pass in a valid VB.NET expression and the expression builder sticks it onto the end of a Return statement inside a static method of a new class, which it then compiles with the stock VB.NET code compiler. Then I use reflection to dig out the compiled method and returns a Func<bool> that invokes the method, returning the result.

This works great for its intended purpose, but it unfortunately restricts my expressions to being, well, expressions. Boolean expressions. Which means they can't do a whole lot of processing, or whatever. That's okay - I don't really *need* all that much. But I enjoy a challenge, and I thought to myself 'Self, why don't we try to use an inline lambda!'

Great idea - except you can't INVOKE a lambda inline. Example:

bool x = ( () => true ).Invoke();

Doesn't work. Operator '.' cannot be applied to operand of type 'lambda expression'. 'Fine,' says I, 'I'll use an anonymous delegate!'

bool x = ( delegate { return true; } ).Invoke();

Operator '.' cannot be applied to operand of type 'anonymous delegate'. Argh. So as far as i'm aware, this is impossible, probably by design. I'll have to ask Eric Lippert about it, since he's been doing his C# design rationale posts lately.

Progress thus far

Truth be told, at this point, progress is slow going. I've been doing a lot of work for my friend Brian, and as it pays more immediately than Macrocrafter work I have to focus on that. It's been calming down of late (unfortunately) so that should afford me more time to work on this stuff.

I've been slowly organizing the work I need to do on this system. So far I've divided it up into several main components that I'll need to build before I can start stitching them together.

Also I've decided to skip the intermediate step and just make a damned hunter bot out of this, so I'll also need to integrate targeting and walking into the system.

Anyway - one of those systems includes a VB.NET compiler, as I mentioned before. All I need to do with this is to take my proof of concept code and make a proper system out of it - something reusable. I'm going to add it to Autocrat. I'll also need a timer that can produce timing events in 150ms intervals - that's the interval at which I'm going to have the system pull down updated EQ2 data. Any of the .NET timers should be capable of doing this so I'm not too worried here. I'm also going to need a state machine engine that can be configured via XML - this will be responsible for persisting the user-editable 'scripts' that will make up the brains of the bot itself. I've got a schema all figured up; all that remains is actually putting the work into it - and then I get to build a UI on top of it, because the last thing I want to require is for people (or myself) to have to hand-edit XML to get it to work.

Coupled with the timer is going to be a system for describing stateful property changes. Here's the problem: my bot engine is going to be evaluating event trigger expressions every 150ms. The expressions are boolean, so they'll be testing data based on the content of the current tick's EQ2 properties. If an expression looks similar to: "Return EQ2.GroupMember(2).Health < 50" - then when group member 2's health drops below 50%, it will trigger the event. This is desired - BUT it will ALSO trigger once every 150ms tick until group member 2's health rises to or above 50. This is NOT desired, so I need a way to expose the concept of state changes: for example, I'd like to rewrite the same expression as: "Return EQ2.GroupMember(2).Health.DroppedBelow(50)". That would return True if, and only if, the previous tick's Health was at or above 50 AND the current tick's Health is below 50.

So I'll need to figure out an efficient system of encapsulating old state and exposing it via these state descriptors. I'm sure I'll figure it out.

But you can see why I've been making slow progress here. =) In between kids, contract work, looking for full-time work, EQ2 updates, and other life, I don't have much time for experimentation, which is a shame.

Saturday, August 1, 2009

Happy Birthday baby girl =) And some other stuff.

So my daughter just turned 2 years old today. We had a party at CiCi's, and fun, pizza, and cake was had all around. =)

A friend of mine in NYC has a lot of extra work he's unable to do himself, due to having his own full-time job, family, etc., so he's farming it out to me. It's a great situation as I currently have a work deficit, so taking it off his hands helps me out a lot. So far I've updated three websites owned by the same company - took me the better part of a day to get it all completed, but it wasn't terribly hard. Mostly grunt-work, but it pays, and it's not brainless. I am by no means complaining. =)

Finding work in Charleston, SC has been difficult - the two large development companies out here have both rejected me as being "not quite what they want" - I don't have any team-oriented experience, or large enterprise experience, which is all they're looking for out here. My argument is that if everyone wants to hire people with prior team experience, how can anyone who doesn't have it get it? Eventually there'll be nobody left except people *without* team experience, and then what will they do?

Bah. Perhaps I'm bitter - I need a job so I can put food on the table and pay rent and all that rot. It's frustrating. I'm actually hoping I find a computer / network tech job I can do, rather than programming - I think I'll have more fun doing that, since I'll get to work with people, help solve their immediate problems, etc.

Maybe I'll see if I can find investors for that computer recycling business I've been thinking of starting.

Anyway - very little work has occurred on my next EQ2 project, which one of my friends has dubbed EverDroid - a name I think I'll use. I need to build an Eval system into Autocrat, because this is something I'm going to use a lot in projects to come, for the sake of configuration and behavior customization. That won't be hard - I've got a simple console proof of concept working just fine, compiling expressions in VB.NET (which I think non-programmers will find easier to reason about - Microsoft agrees, and has done the same thing for their expression compiler in Windows Workflow 4).

EverHarvest had a good month last month - decent sales, despite the economic issues. Not nearly what it used to be, but then again I never expected it to be. Most people seem to be happy with it, when it works - which it's not at the moment; I've been working on the next update in response to Sony's latest changes, but they're doing their rapid-fire patching again, which always makes me want to wait... I was half-way through the last set of updates when they patched again yesterday, ruining my work. Ah well - such is the price to pay. Overall it's nothing to complain about - I work on it maybe two days total out of every month.

So, that's my update today. I'll get back to the millstone again and crank out the EH update. I really need to write some helper tools for this thing...