February 29, 2012
The new MCP mod system (1)

Important: this system is not yet released, so don’t ask me where you can get it :)

As some of you may already know, the MCP team is not just working on the decompiler and deobfuscation tools for Minecraft. We also work on an API to modify the game without touching the minecraft.jar file at all.

The first iteration of this system was more a proof-of-concept project, but it led to the development of “the new mod system”. We can still mod the game without any changes to any Minecraft jar files at all, but in a much more flexible way.

Our first attempt to create this kind of system is released as MCPMF (MCP Mod Framework) and available from our wiki pages. It only work for client side modifications, but it’s compatible with most “classical” mods.

To explain what the new mod system is and how it works, I’ll have to talk about our goals first. The most important feature of this new system is that we do not want to have a different API for multiplayer mods than for singleplayer mods.

Right now all example mods for our system are working in singleplayer and multiplayer mode. The same code, even the same jar file, runs on the client and and on the server. And of course our mods are in jar or zip files and you do not need to modify the minecraft.jar file in any way to use them.

There is still some code in each mod that is a bit different for singleplayer than for multiplayer, but usually that is only necessary for 2-4 classes. All other code in a mod is exatly the same for both modes.

As you can also create mods that are only meant to run on the client or only on the server, these will of course have more specialized code that is targeting only one of both sides. An example for client side mods could be a rendering related mod like optifine, a server side mod could be some kind of cheat protection or admin tools.

But the real advantage of this API, the ability to create mods that run on both sides, allows to make some awesome mods that need much more effort with any of the already existing solutions. To add new content, for example a new block type, all you need to do is to create a class and register the block type with one of the methods in our API. The system will take care of the ID and the client- and server-side changes.

This allows you to easily add new blocks, items, entities, etc. and you only have to write the code once. Of course you can write code that run differently on client and server, because some mods will require this. We try to provide an open system and do not want to have any unnecessary restrictions in the system.

The next important feature is of course the API itself. It’s a stable API that wraps access to all important internals of the existing minecraft classes. What that means is, even when a new minecraft version is released, your mods will still work without changes. No need to wait for anyone to update their mods anymore, all that needs to be updated is our API.

Our API is injected into the bytecode of the game, so we can add methods directly to existing classes, without changing the minecraft.jar, because this happens in memory, after the game is started. This bytecode manipulation also allows us to do things that needed changes in the base classes before, we can basically override any method in any class, no matter if something is declared public, protected, private or even final.

That is a first, quick overview. I’ll soon post more details about this modding system, especially about some parts that I think are really useful a lot of fun to work on.

12:49am  |   URL: http://tmblr.co/ZabSBwHCR17t
Filed under: minecraft mcp mods api 
February 12, 2012
The 2nd magi48h compo is over

This time the themes were “vegetarian zombies” and “war”. I made a small RPG-like game with the OpenTK framework and C# using OpenGL and OpenAL for graphics and sound.

My entry is called Zombieland

It’s an oldschool 2D game, I did not want to deal with 3D graphics and pixel art is something I’m just more familiar with.

Instead of explaining how to play here, take a look at the instructions that you can also read when you select “About” in the main menu:

There are enough features in the game to make it playable, but I could not finish the dungeons anymore. Because all levels are randomly generated it’s easy to create a lot of content, but creating the algorithms to generate levels is a lot of work.

Even now there are some bugs left in the generator for the main world. Sometimes roads are not connected properly and you get this kind of strange roads:

In this program I use a simplex noise generator which is a bit faster than perlin noise. It does not really matter, because worlds only need to be generated when you start a new level, but I had the algorithm in the framework, so I used it.

It generates a level like this:

After the basic layout is generated I randomly place all kinds of buildings in the world and connect them all with roads.

When you die, you will see a score. Let me know if you beat mine :)

I guess it was a mistake to fight about 40 zombies at once…

The game can be downloaded here and the soucecode is also available here.

6:34pm  |   URL: http://tmblr.co/ZabSBwGIr33c
  
Filed under: magi48h gamedev 
February 7, 2012
Another magi48h competition

I’ll make another game in less than 48h next weekend. This time I’ll use the new OpenTK based framework that I created for this very purpose and I hope it will allow me to focus more on content and less on technology.

If everything works as expected, we will decide if we should make this rather small competition more open in the future. It would be fun to have more people and games in the competition, but on the other hand we do not intend to compete with LD48 or other similar events.

Basically this is just for fun, if more people ask me if they can participate, I’ll not send them away. But I don’t think that we have the experience and tools to deal with too many people at once.

If you are interested in more details about magi48h, contact me on twitter or join one of the MCP channels on IRC.

12:39pm  |   URL: http://tmblr.co/ZabSBwG1a5xl
Filed under: magi48h gamedev 
January 26, 2012
OpenTK Framework

It’s finally in a state that I think is useful enough for a first release. It only contains the most important base features that I need to create a game with it. So if you miss anything, and you will miss a lot, keep in mind that this libraries purpose is not to become the next full blown, feature creeping, Unity killer game engine.

I’ll use this library in competitions like magi48h or ludum dare to create a game in less than 48h. So, the more features are available in the library already, the less I have to create during the competition. And to be honest, using too powerful tools and libraries takes the fun out of it. If I really wanted that, I’d rather use Unity.

The project source code can be found on my bitbucket account.

Keep in mind that I made this for myself, I just decided to share it with anybody interested in it. So do not expect any documentation or examples how to use the framework. It’s not too complex and it should be easy to figure out, but if you don’t understand how to use it, it’s probably not the right tool for you.

January 14, 2012
OpenTK

I’m currently creating a framework for a game, based on OpenTK. If you don’t know it, OpenTK allows you to use OpenGL and OpenAL from C#.

It’s actually very easy to use, in just a few hours I got 2D rendering, font rendering, sound playback and keyboard input handling done. I’ll probably add some more features to the framework, but it should also be small and simple.

This new framework will be used in the next magi48h competition. I’ll make it available for everyone before the competition starts, so that everyone can decide to use it and I do not have an unfair advantage over participants who do not have something similar that they could use.

I was first considering to use XNA, but it has some disadvantages for me. The main problem with XNA 4.0 is that a lot of functionality I used in the past is not easily available anymore and you are basically forced to use the content pipeline.

OpenTK is much better suited for my needs. I do not really need to support XBox360 or Window Phone 7 at the moment, but I want my program to run on Linux and OSX. I have made a compatible game before, but it used WinForms, so it was slower and did not provide a good way to play back sound.

I can use OpenGL now to draw hardware-accelerated 2D graphics and using OpenAL to play sound is really painless. It will also be possible to add some 3D rendering without much hassle in the future.

My framework will eventually be released with full source code, either with the first magi48h game I create with it, or independently on a public repository. I’ll decide how to release it later, when it’s “done”.

4:47pm  |   URL: http://tmblr.co/ZabSBwElVs_a
  
Filed under: gamedev magi48h 
January 13, 2012
Minecraft and MCP

We are currently working on the update of MCP for Minecraft 1.1 and I will post progress every now and then on twitter.

As always, every new follower on twitter will boost our motivation and help us to make the MCP update faster :)

Also, let me know if you would like to see MCP updates for the weekly pre-releases of Minecraft. We are discussing this option and need some feedback from our fans.

1:11am  |   URL: http://tmblr.co/ZabSBwEgaTmy
  
Filed under: minecraft mcp 
January 12, 2012
Elsewhere

Last weekend, starting from friday 8pm to sunday 8pm, we were doing our own small private competition to make a game in less than 48h. All participants missed the last LD48 and so we decided to make our own competition, just for fun.

The themes were “supernatural” & “parallel universe”, this is my entry:

The game was created from scratch with VS2010 for the code and Paint.net to draw the graphics. I also used bfxr to make some sound effects, but only 3 or 4 of them made it in the game because sound playback was not working properly.

I decided to make the game in C# and set up some limitations. It only uses Winforms and the .NET framework (version 2.0). That’s also the reason why sound was not working as expected, the SoundPlayer class is the worst I’ve ever seen and I expected more from the .NET framework.

Basically the screen is just an 320x240 array of integers, each one representing one pixel on the screen. The value of the integer encodes the RGB values of the color.

The graphics are created with 8 shades of grey (from black to white). Each object can have it’s own palette of 8 colors, so that the game will not be gray scale, but colored instead.

I decided to create isometric tiles for the level graphics, in retrospect it was a bad decision because making those tiles was too time consuming.

Another decision was to use a bitmap to design the levels with Paint.net and this was also not working too well, because I had to use a 2D image to describe a (kind of) 3D level.

In the end I could only make 2 dimensions (levels) before I ran out of time. I had used the first half of my time budget to get the basic technology running before I could start creating actual game content.

For the next competition I will not use the same limitations. I was thinking to use XNA, but now finally decided that OpenTK will be the better library to use. I should be able to get some graphics on the screen with OpenGL quickly and using OpenAL to play sound will definitely work much better than the SoundPlayer class in the .NET framework.

It will still be a 2D game, but with OpenGL it’s really easy to render some textured quads. Hopefully next time I will be able to put more time into creating actual game content and less into getting the base technology done.

Downloads: Game & Source

After the competition I still work a bit on the game to improve it, first update is here: Update1

3:03pm  |   URL: http://tmblr.co/ZabSBwEf6J3E
  
Filed under: elsewhere magi48h gamedev 
January 12, 2012
Blogging

Let’s see if this blog will be used more than twice a year to post something useful or interesting. Usually if I start something like this, I post 2-3 news before I forget to update it. Some time later it can be declared dead :)

1:10pm  |   URL: http://tmblr.co/ZabSBwEezUtb
  
Filed under: general 
Liked posts on Tumblr: More liked posts »