Stig Runar Vangen homepage
Blog

Blog

JavaScript water

After implementing the tunnel effect I wanted to try an another oldschool demo effect as well. This time I tried to implement a water effect which I found at Water effect.

Go to Water Effect.
Monday February 18. 2013

Tunnel update

After publishing the tunnel effect, I got some feedback from Jonas Lund on Google+. He suggested using fixed point math for all calculations, which resulted in a speed increase at around ten times what I initially had. This increase in speed almost makes it unneeded to have several levels of quality for present computers. His suggestions also included a few other tricks I was not aware of, which definitely will improve the next project I work on. You gotta love the internet.
Sunday February 17. 2013

JavaScript tunnel

I found an article describing how an old demo effect was implemented at Tunnel effect, and I wanted to try to implement this effect using HTML5 JavaScript.

JavaScript is not well suited for these type of effects, so I implemented several quality levels. The render quality can be changed in the top right corner. It is also possible to improve performance by resizing the browser window to a smaller size.

Go to Tunnel.
Thursday February 14. 2013

Added Commodore 64 Games

I've added some games that I made on my Commodore 64. I found these games on some old cassette tapes I found in a box. I decided to try to import them to my computer and digitally preserve them that way. In order to transfer the games I bought a USB cassette player. Each side of these cassette tapes hold 30 minutes of noise, and I had to run through these tapes in 1:1 speed using different methods for recording the sound. After trying several tools for converting autdio files into Commodore 64 application files, I got best results using WAV-PRG. This application takes the recorded audiofile, and outputs several PRG files, which can then be opened in an emulator. I've added the games I was able to extract as a downloadable archive. For playing these games, I recommend using The VICE Emulator.

To compare a cassette tape with the storage technologies of today, the transfer rate of the Commodore 64 cassette was roughly 300 bits/s. This gives an overwhelming 100kB per 30 minute cassette. The storage capacity could be improved to 1000kB using turbo tape software or other fast loaders.
(source)

In addition to this, I added counts behind category and tech names, so that one can easily see how many titles are contained behind each link.
Saturday February 2. 2013

Online midlets

Lately I've been working on viewing the mobile games I've made on these pages. Games created for mobile Java, or MIDlets, are not easily runnable nowadays.

J2ME was originally formed through JSR 68 in 2002. The standard has later been abandoned, and nowadays one have to create applications for each target platform.

In order to run MIDlets one has to use an emulator. The most popular one is MicroEmulator. The emulation in this emulator is however not perfect. You do for example need to change your application somewhat for it to be runnable by the emulator.

After modifying the games so that they were runnable by the emulator I ran into problems regarding the audio. For some reason their implementation of the audio libraries only allow you to playback a unique sound once. There were also some problems regarding MIDI playback that stops after a few seconds. In addition there were some problems related to how loading of sounds are implemented, which results in crashes on load. Looking through their code I was not able to figure our how their implementation should be fixed.

What I ended up doing, was to use the reference implementation provided by Sun/Oracle. This implementation shows how to implement their interfaces. These implementations have some methods that reference native calls to the OS. I implemented all these native methods using the J2SE sound API. The end result was a fully working MIDP 2.0 sound API implementation.

Armed with this fully working implementation I patched the emulator. This resulted in an emulator that perfectly emulates the audio calls from the original games. This was the last piece of the puzzle, and I can therefore present these games on these pages.

My games originally needed only sampled and MIDI playback. The original API also defines functionality for playing tones. For the sake of completion, and for the fun of it, I also implemented this API. The biggest challenge here was to convert notes into their respective frequencies. By using a list of frequencies for each note, I managed to get a working formula. Using the reference implementation I didn't have to implement all the special operations, as this was already converted into a simple note for number of milliseconds datastructure. The use of blocks were for example converted into one long sequential sequence. The end result has some noticeable defects when the song turns into low frequent period, which almost sounds like an UFO buzzing away. There are also some clicks between notes sometimes. These errors are mostly related to rounding errors, and might be something I fix at a later date.
Sunday January 27. 2013

Pages updated

These pages has received a facelift. The design of these pages has remained the same since late 2009, and I din't like how the look anymore. I therefore decided to take some time and update the design of these pages. I've also taken the time to update the design using modern techniques. The page design is for example completely responsive, which means that the same page will be able to serve content to all devices from the high-end desktop user to a mobile phone. This was realized using the Amazium framework.

During this process I've also updated the pages to use the latest version of the CakePHP framework. This framework has changed a lot since I've used it last, and I therefore had to change a lot of the backend code.

Take a look at the screenshots below to see how the page design has changed since the last design. The last image shows how the new pages look on a mobile device.
Monday January 7. 2013

Motigon has been released

The Motigon library has finally been released. We are pleased to finally be able to show the result of our hard work with all of you. In the last few weeks we've been busy writing documentation as well as updating the web pages with as much information we can provide.

The examples browser is available at http://www.motigon.com/examples/, with lots of examples on how to use the library. This browser will be extended with new examples as we add new features to the library, as well as based on feedback from our users.

All documentation is available at http://www.motigon.com/lib/documents.html. Here you will find both the JavaDoc for the full Java/GWT library as well as JsDoc for the JavaScript implementation. There is also a simple manual that walks you through the most used functionality of the default application setup.

If there is something missing in either the library or in the documentation, please don't hesitate to drop us a mail message at motigon@wis.no or thought the forum. We will be more than happy to help you with the problems you are facing using our library, if any.
Friday December 14. 2012

Motify is dead, long live Motigon

In the final stages of the development of our diagramming solution we have decided to change the name of the product. This decision was made because of a name conflict with an another commercial product, which our lawyers tells us is a bad thing. The new name of the product will be "Motigon", as you can see from the new blog title. The logo will still remain the same.

If you have been visiting our web pages lately, you might have seen that we've added a lot of new content. In addition to the general presentation we had earlier, we've also added a lot of documentation aimed at developers. We have also updated the previously mentioned API documentation for both the Java and JavaScript interfaces. Please have a look at our new pages at:
http://www.motigon.com/

When the final details are ironed out, we are finally ready for a release of this product. If everything works out as planned, we are only a few days away from a public release of the library.
Wednesday November 21. 2012

Using system clipboard from GWT

As part of the Motigon project I've been working of integration the application with the system clipboard. I've written an article on how I did this here:

http://infposs.blogspot.no/2012/10/using-system-clipboard-from-gwt.html
Tuesday October 30. 2012

Motify examples

As we approach the release of the Motify library we want to show you some of what we have been working on. These examples give a small look into how the final product will be like. These examples are not yet in its final form, and might therefore contain bugs and lack some features. When we release the final version of the library, these examples will be fully polished and contain all the functionality they should have.

Complete example
This example show what a developer can do using the GWT version of the library. This example uses the default GWT interface. While this interface might be good enough for most uses, the interface is completely customizable from code.
http://www.motigon.com/demo/

Example browser
The example browser contains several demos that shows how to use various elements of the library. All these examples contain full source code so that it's easy to find an example for most scenarios. The browser will be extended as more features are added to the library.
http://www.motigon.no/examples/

JavaDoc
Complete documentation for the Java / GWT library. Here you will find how the library is organized as well as how each method is intended to be called. Details on how parts of the library works with each other can be found in the example browser.
http://www.motigon.no/javadoc/

JsDoc
Complete documentation for the JavaScript library. This documentation tries to follow the format of the documentation generated by the JsDoc project. Because this documentation is generated from Java sources that has been exposed as JavaScript, parts of this documentation will not appear quite like its pure JavaScript counterpart.
http://www.motigon.no/jsdoc/
Wednesday October 3. 2012