Serialisation – JSON in C#, using Json.NET

Last week we compared a number of different data-interchange formats and I explained why my current favourite is JSON.

JSON’s syntax is very simple. So easy in fact, that it can be expressed on a single page.

This makes it easy to remember and write. Further, it makes writing a JSON parser very easy as well.

However, there already are many solutions for all major, and many smaller languages and environments.

So instead of reinventing the wheel, today I would like to give an introduction to Json.NET, the library I have been using to read and write JSON for about two years now.

Continue reading →

OpenGL in C# – an object oriented introduction to OpenTK

OpenGL and C# are two of my favourite technologies.

In this post I would like to give a small intro on how to develop games or other 3D accelerated applications using them together.

We will go over:

  • how to create a window with an OpenGL context that we can render to;
  • how to create vertex buffers, load shaders, and render vertices.

Continue reading →

Pages: 1 2 3 4

Lidgren.Network – explaining NetDeliveryMethod and sequence channels

Last week I posted a little tutorial on how to get get started with Lidgren.Network, the popular C# networking library. We covered the basics on how to set up a connection and how to send and receive messages.

Today I want to cover another useful feature of the library.

We will first discuss Lidgren’s usage of UDP, and then look into delivery methods and sequence channels, which allow us to send messages with different sorts of guarantees for arrival and ordering.

Continue reading →

Lidgren.Network – an introduction to networking in C# games

Ten or so days ago I started working on a new project – a game prototype currently called Syzygy. You can find the code for the entire project on GitHub, so feel free to take a look!

The game will have, and is from the start built around multiplayer gameplay. Since I want to get to work on the gameplay as quickly as possible, I did not want to spend any time writing my own networking library.

When searching online for what other people are using for their C# multiplayer games I came across Lidgren.Network by Michael Lidgren. The library had been used in another project I was part of several years ago, and I did not find any obviously better alternatives, so I decided to give it a try.

Continue reading →