Castle Revival - Day 2

Thursday 20 July 2006 at 11:59 pm

Not that much improvement today... I figured out a couple methods to use later on, but I was primarily dealing with the problem of the image disappearing every time I'd minimize the window, and not updating if I resized the window.

So after several hours of reseraching, I found the solution to the problem, and got it all implemented so it would function properly (it was for a while recreating the backbuffer image each time that call was made, which still made it not doing what I wanted it to). a "Load" event for the form, and a Paint event for the drawing area, and then all was good.

Tomorrow I'll move the methods into separate functions (one for redrawing the window and resizing the scrollbars each time it's resized, another for drawing whtever the current map is into the bitmap, so on and so forth), then move on from there.

Castle Revival

Thursday 20 July 2006 at 12:57 am

So I decided I wanted to implement a copy of the old Roguelike Castle of the Winds, which was probably the first RPG I ever played.

I decided, however, to be even more challenging, I wanted to make this remake in C#. Someone tell me if I'm being scary yet.

Anyway, I wanted the convenience of Windows.Forms so I could visually design the window, then add in the function after that. I wanted to RAD it, basically. So I mounted the ISO for Visual C# Express I downloaded when they decided to release all the Visual Studio Express products as free (that way I didn't have to download any of them later), and got to work.

Learned a couple odd things, like AutoScroll doesn't allow manipulation of the scrollbar values manually (which is needed for tiling images), but so I had to dump that code and replace it with separate scrollbars.

So, compare the original:
Free Image Hosting at www.ImageShack.us

to what I have so far:
Free Image Hosting at www.ImageShack.us

I've got it drawing a 25x25 tilemap, which you see the width on that window is wider so the scrollbar isn't needed (its dynamic based on the size of the window :) ), but no actual maps or scrolling yet. That's where I'm leaving off for now, will work on it more tomorrow.

UPnP

Tuesday 04 July 2006 at 1:32 pm

I've been thinking of making a networking library of my own, rather than using someone elses like RakNet or HawkNL or something. Haven't really spent much more thought on it, though, cuz it's not something I need right now.

A friend of mine was talking to me the other day about some router problems he was having, and we got to talking about Universal Plug n Play (one of the things he was having problems with) and whether I was using it or not. I didn't really know anything about it because the only software that I have that uses it is Azureus.

So I began doing some research on UPnP, starting at Wikipedia: http://en.wikipedia.org/wiki/UPnP

Its a rather interesting protocol, actually. It can open and close ports in a firewall, and set them to forward to a specific part in a NAT setting, all with zero user interaction. I actually like this a lot, myself. I for example have all my port forwarding slots filled up in my router (my router has 10 Port Forwarding slots), and have to go remove an entry and put something else in whenever I need to forward something new.

Now from my research neither HawkNL nor RakNet, both libraries I had considered using in the past, have UPnP support. So, when I make a library, I'm gonna make sure there's UPnP support in there.