A little toy

After that angsty interlude, I now return you to scheduled programming. heh. “That’s the joke”.

The following is a 2D, text mode crossover of a ‘little’ game called Minecraft and a littler game called Paradise Fort, by Hempuli. It started off only as a map generator, which I hacked together with revolting code in about an hour, based on the wisdom of Petri Purho to “build the toy first” and make it into a game later.

Flush with success at having a working build, I set about rewriting it in beautified object-oriented code, so that I could add a moving player and enemies. Enough words; here are some pictures of what I have so far:

World Generator generatingThis one isn’t very exciting. The generator makes worlds until it has one with the desired amount of water, wood, and stone blocks. This is very fast. This more colourful picture is the world into which you’re propelled. It has land, some of which is below the water table. It has trees of various shapes and sizes, a cave, and a lake. You are the @ sign, as is convention in ASCII games, and can walk around this world with the ‘m’ and ‘n’ keys. I’ll take me to the other side of the lake:

A World Generator World

World Generator zoomed in

We can then dig and change the landscape with the wasd keys.

Not yet implemented is building with Shift+wasd. Digging in World GeneratorEventually, the game will be pretty much Minecraft, but more “stay in base” and a little faster-paced. Each level will have an objective, such as escaping the screen via the left, right, top or bottom, gathering x number of a certain block, fending off x enemies, etc.

This necessitates enemies, which will likely take one step to every couple of yours.

Materials will be valued as they are in MC: Wood will be required in order to gather stone, which will be necessary to gather the as-yet-unadded iron. This progression also represents sequentially better weapons. Also like Minecraft, I plan an infinitely long sandbox level.

I’m writing it in VB out of ease. It will be releasable quite soon, and if I never work on it again, I’ll put it out in its current form, for the laughs.

Godspeed netizens!

New Programming Frontiers

I have recently decided to stop feeling guilty about programming in Visual Basic .Net. Not only is it the language in which I feel most comfortable, I can assert that the coding practices which I maintain in it are sound and viable. Contrastingly, as much as I try to structure C-style code nicely, I tend to end up making some messy judgements. I also enjoy the ease of working in Visual Studio, and know that porting to C# would be a breeze; while VB is not popular in industry, .Net certainly is, and in that, I find solace.

I decided that I would learn network programming in VB. There is a (reasonably) nice .Net library called System.Net.Sockets, which — I have been told — is a fairly low-level wrapper for the old Winsock API. So far, I have gotten along with it, and wrap most things in my own functions anyway.

What have I made, though?

In short, a bot for the 5 day old Multiplayer Survival mode of Minecraft, of course! With a little help from some patient friends, I have puzzled out how to successfully send and receive packets to a Minecraft server, and developed a bot which can, so far:

  • Log in
  • Receive player list
  • Receive chat
  • Send chat

… a result with which I am very pleased, for my first foray into that area of speciality.

Today’s work will involve trying to move the bot around the server, and perhaps even recognising block placements.

It’s all very exciting.