Level editor – The Basics – Part 1

by SeuJogo 2. March 2010 22:45

For most of my games, I have created a level editor. I usually create a Silverlight page, at the top I edit the levels and at the bottom I embed the game to test the level. This way it’s very easy to test your game for bugs, and to test whether a level is actually playable. How a level editor works, depends on the game you are creating. For “Mineral”, I created a different level editor than I did for “Avios”. The Avios editor clearly is much more complex than the Mineral editor. However, some things are basically the same.
I’m creating a new game, let’s take the reader along the path. The game I’m creating is called “Slengo”, highly inspired by the game “Pengo”. So the basics of a level is clear, it is a two-dimensional grid, like Mineral, and everything happens in there.

After creating a solution and a Silverlight application (Slengo.App), with ASP.Net Web Application Project (Slengo.Web), we can add our own things. Highly inspired by the SOA-model programming, I usually split things up top-down. The Silverlight application itself does not contain much code, everything is done in the Silverlight libraries.

The way of creating a level editor, is the same way I did for my first game “Tilez”. The editor is a Silverlight page, which reads all levels from the webserver when started. If I press the button “save” in the editor, I want to save the level I am currently editing. When I close the application and start it tomorrow, I want to see all levels I’ve saved before. Those are my basic requirements.

The image shows the basic setup. In the project “Slengo.Visuals”, I will put all my sprites, all my basic visual things. Currently the project has one usercontrol, “IceCubeBlue”. This control displays an IceCube, which is a level building block. Note the name of this usercontrol, I will create a “IceCubeRed” in future, or another item if I want to. An icecube acts like a wall, and where there is no icecube, there is a path for player and enemies to walk.

The project “Slengo.Web” has a webservice called “Levels.svc”. You create this by selecting the project, Add new item and under the Silverlight templates, you’ll find the Silverlight-enabled WCF service. Currently this service is empty.

Next is to focus on your level data-model. The data-model is created on the server, not in the Silverlight application! There are two reasons for this:

First, if you want to store level data, you need to serialize the level data, for example to XML. Silverlight does not have full capabilities to serialize or deserialze data, but your server does. If you are serializing the data on your server, the data-model needs to be known on the server anyhow.

Second, if you want to send level data from your Silverlight application to the server via Soap (to your WCF service), then you are limited to the data-types supported by Soap. If you do not know all the types which are and which are not supported by Soap - like me - then you will discover your own errors very quickly if you do something wrong. A good example of a data-type which is not supported by Soap is the two-dimensional array.

The good thing is, that if you create the level data-model on your server, this model will be available in your Silverlight application later.

 

Tags: , ,

Research | Technical

Blog Crush

by SeuJogo 27. February 2010 21:15

A lesson learnt. I added the Youtube extension to my BlogEngine.Net software. Then I published it to the website. This operation flushed all the articles I have written so far. Fortunately, I didn't write very much articles until now. The articles will be republished at a later moment in time.

Tags:

SeuJogo News

The Beauty and the Bandwidth - Bumper

by SeuJogo 27. February 2010 20:47

I was exploring the idea of adding a SeuJogo bumper to my games. When a game has loaded, a little movie is displayed about the manufacturer, before the titlescreen of the game being displayed. Many online games have such a movie. It helps to remember the manufacturer’s name.

For the bumper not to get irritating, it must be a short visual sequence and it may not consume too much bandwidth. There are two options. Either you create some sequence with images, while your software is in charge of moving the images around. Or you create a little movie in which you do all the displaying. It is obvious that a software movie consumes less bandwidth than a real movie, but with a real movie you can do much more.

I created a short movie for the test. The original movie size is 78 Mb, uncompressed, with a resolution of 320x240. Using Windows Media Encoder it became 214 Kb, with a resolution of 160x120. A further compression would heavily destroy the quality.

That’s what it all is about, quality versus bandwidth. The bumber is shown in the player below. Its only 8.5 seconds and has no sound. Still, for a first movie made ever, I think the result is not that bad.

Tags:

Research

SeuJogo blog online!

by SeuJogo 28. January 2010 05:42

Not very big news, but SeuJogo Weblog is online. The software I use is BlogEngine.NET, customized a little to the SeuJogo website look.

I have been working on a new website look, while developing the game "Bloq". I looks better than before. I hope everybody agrees.

Tags:

SeuJogo News

Powered by BlogEngine.NET 1.5.0.7

About the author

SeuJogo is portugese for "Your Game". After contributing to several websites, the day had come for my own site. It has been my passion to create games for many years. Microsoft Silverlight became the right tool to pick up an old hobby.