SeuJogo.com
 
 
 
 
 
 
 
 
 
Free Online Games HeavyGames
KickinGames
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Getting to know your tools

by SeuJogo 9. May 2010 23:52

I have made some progression since the last time I wrote an article about my new game Slengo.

 
I created a Vorbis player UserControl, optimized for sounds effects in games. When initialized, the MediaElement inside will be streaming silence. When the function Play is called with a stream, the silence will be replaced by this stream, until the end of the sound, where the stream will go back into silence mode.


This scheme solves the short-sound problem, ie MediaElement is incapable of handling sounds shorter than 1 second. The silence-stream actually makes the sound effect longer than a second. Secondly, this scheme solves a major part of the sound-latency or audio-gap. With a buffer of 45ms, this latency is drastically lower than what you get out of the box. I develop in a Virtual Machine and I’ve been really pushing to get this latency as low as possible. Then I tested on iron, which demonstrated a great latency improvement.


The only drawback of this scheme is that you cannot make major sound changes while continues playing a stream. It is not possible to alter the audio buffer length, it is not possible to switch from mono sounds to stereo sounds. Those are acceptable limits.


Past week I have added another NPC to the game. And ofcourse tested her (yes it’s a she). That currently makes a total of four NPC’s (enemies).


This weekend I took my Vorbis player to the next step: seamless audio. So you buy a couple of loop-sets, encode them to Ogg Vorbis and just mix the tracks. A MediaEnd event is triggered when a sound has finished playing, and a tracker function just injects the next track. As there is no audio-gap, the tracks play seamlessly after eachother. And at the end of the playlist, you just repeat the whole thing.


The next step was to add the tracker to the game, so that you hear the music and the sound effects at the same time.


A weird thing happened. While in my test-tracker, the background music played without a glitch, in the game the sound began to stutter and distort. I thought that the decoding routines were slow, so I thought I decode all sounds effects at the start of the game and keep the result in a cache. Only the music would then be decoded at playing time. Well, this caching scheme did not work, the music still sounded distorted. The solution was to use less VorbisPlayers for the sound effects. Apparently, there were too many MediaElements active at the same time. That’s one of those cases where it is a good thing getting to know your tools.


I’ve also worked on a title screen for the game. I’m keeping it simple this time. I also want to introduce a level picker, where a level is unlocked when you reach a certain level. That sounds easy. The hard part will be next, creating challenging levels, which keep game-players attracted.

Tags: , , , ,

Research | WIP

Silverlight games and data

by SeuJogo 13. April 2010 16:27

Avios is a great game if you liked Wings of Fury during the nineties. It took 5 months to develop, but it isn’t very well appreciated. There are different aspects for improvement. One aspect is to get a better loading time experience.

Players of online games don’t like to wait very long for a game to load. I have seen different approaches for better a better game-loading experience.

1. Load everything all in one
The game exists of only one xap, which is loaded at once. At Mashooo and Silverarcade they’ve found a way to improve experience. Each game is loaded by a generic preloader, displaying the current percentage. This is very well done. The drawback is however that the game will be loaded completely, you cannot split it into parts. This approach cannot distract the player’s attention if the game is very large.

2. Partial preload
A preloader loads the basic data. The rest of the data is loaded while the game is playing. This is the scheme I’ve been using for most of my games. In my case, the preloader has a list of images and sound effects to be loaded. Any music which is played during the game, is played from the server during the game. Music files can be quite large and they’re not always played completely. So this approach has an advantage over loading it all at once.
You also have more control of what will be loaded in the preloaded, and what will be loaded during the game. Nokola’s Shock for example loads the most basic things to play the first level in the preloader and everything else during the game. Avios however loads all images and sound effects for all levels in the preloader.
An improvement for Avios could be to load everything to play the first level, while loading everything else when the first level is played. No problem for Avios. But in a different game, in such a scheme, the loading and playing of music could compete with loading other data. It could interfere with the music being played. So this needs to be tested.

3. Lower quality
It isn’t surprising that visuals in many games are very small. Smaller graphics reduce the data volume and give better loading experience. For the same reason, players experience lower sound quality for the same reason. Lower quality improves game load experience but may reduce playing experience. This balance is the choice.

4. Change the Encoding
Unfortunately, using vector graphics doesn’t increase quality, while data volume is reduced. I have been playing around with Inkscape 1), to convert bitmap images into vector graphics, exporting it in XAML. In many cases, where I replaced a bitmap image for a vectorized version, the data volume increased. If you want to preload such resources, you need to dynamically load a dll, instead of loading a list of resources on the server.

For my games, I usually use PNG’s. PNG supports alpha channel –  transparency. JPG’s do not support this. In Photoshop you can export JPG’s at low quality. One could use these low-quality JPG’s, assign a transparency color to it and process the images using WriteableBitmap, to support alpha channel. I have done a little study to this option, but I found the image-quality so very low that I decided it was not worth it.

There is also a gain for sound encoding. MP3’s are usually larger than WMA’s. So it does pay to encode for WMA. It is worth it to play around with the encoding settings. I was able to encode an original MP3 file of 1.8 MB, to a 491 KB WMA file, without significant loss of quality.

Tags: , , , , ,

Research

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

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

Powered by BlogEngine.NET 1.5.0.7