Showing posts with label competition. Show all posts
Showing posts with label competition. Show all posts

Friday, January 14, 2011

Mozilla Game On 2010

During last Thursday it was possible to send your entry to the Mozilla GameOn 2010 Competition. There were more than 160 games submitted, but some of them was disqualified because of using 'non open' technologies like flash or Unity. Finally, there are 124 chosen titles in the gallery. Checking almost every game I found couple of technologies, libraries, plugins, frameworks or engines I've never heard of before, or just forgot about. Some of them are worth describing in here. First of all I totally forgot about HTML5 Boilerplate, an "HTML/CSS/JS template for a fast, robust and future-proof site", used in Snake game [MGO2010]. Another technically interesting entry was Black Obelisk [MGO2010], written completely in haXe, opensource programming language with ability to compile to Javascript, Flash, NekoVM bytecode, PHP, C++ and C# or Java in the near future. Couple of games was written in Java with cross-compiled JavaScript presentation layer using GWT, eg SVG-EDU [MGO2010] or Zulu [MGO2010]. Main reason people used Flash in their games was enabling sound effects (like Sinuous [MGO2010], the winner of 10kApart). But Wizard Wars [MGO2010] used SoundManager2 to achieve same effect. Mad Tanks TD [MGO2010], one of my personal favorites in the competition, uses LESS, which "extends CSS with variables, mixins, operations and nested rules". Looks cool! (both, the game and the compiler:) ). I was impressed with amount of WebGL based games. In Red shooting Hood [MGO2010], made by Tymon ZgaiƄski from Poland, member of polish gameDev community Warsztat, I found Sylvester, "Vector and Matrix math for JavaScript". Open web implementation of simple and well known Frogger [MGO2010] was compiled to Javascript & canvas using Ristretto Mobile, "a Web-based Compiler for Running Interactive Games and Simulations". My own entry, OpenOdyssey [MGO2010]was made simultaneous with Mibbu framework and is based on it. I'm not satisfied with the final result, but I will develop both after the competition. If I will find some free time during the weekend I will write few words about OO & Mibbu.

Friday, January 7, 2011

JavaScript from command line - standard input & output

As you could already know from Mr. C's lectures from YUI Theater or FrontTrends - standard I/O is the worst thing programming languages could ever implement. Fortunately - Javascript has no input at all. And in most cases it doesn't need any - it was designed as script language for web pages. But nowadays we use Javascript in any other aspects of our programming life - we can build for desktops using XUL, server-side tools like node.js (for example with announced last week JSPP) or any other Server-side Javascript implemenation provide JS backend for the web, native mobile apps could be created using frameworks like Phonegap. So what about executing JS scripts from command line? And why do we need it?
The reason I've refreshed my experiences with JS scripts executing was Hacker Cup organized by Facebook - there are no language restrictions in there, your scripts just has to know how to analyze given input and write the answers on the standard output. It is quite unpopular way of using & writing Javascript, so I will show few tips of command line in here.

Engines
There is such a JavaScript engine called Rhino. It is completely written in Java, open source, and very easy to use. It is managed by Mozilla, so you can find a lot of docs and tutorials on Mozilla's page.
Rhino has few additional functions eg for working with files (readFile()) or serializing objects (serialize()), which makes it useful in solving algorithmic problems in competitions like FBHC. Full list of all shell function can be found on Mozilla's page.
Each time you run Javascript scripts from command line, all the arguments you provide will be stored in global variable called 'arguments'. Enriched with this knowledge we can begin with some examples. This is my implementation of binarySearch algorithm:
Array.prototype.binSearch = function(element) {
    var element = parseInt(element, 10), 
        left = 0,  
        right = this.length-1,
        middle = ~~((left+right)/2),
        lastMiddle;

    while (parseInt(this[middle], 10) !== element) {
    
        if (lastMiddle === middle) {
            return null; //nothing found, break
        }
        
        if (parseInt(this[middle], 10) < element)
            left = middle++;
        else 
            right = middle--;
        
        lastMiddle = middle;
        middle = Math.round((left+right)/2); 
    }        
    return middle; //index of found element 
}


var MainFunction = function(args) {

    var a = readFile(args).split("\n"),
        arrayElement = a[0].split(" "),
        result;
    
   
    print("Array: "+arrayElement);
    
    for (var i=1, j=a.length;i < j;i++) {
        result = arrayElement.binSearch(a[i]);
        if (result) 
            print("Element "+parseInt(a[i], 10)+" in on position nr "+result);
        else 
            print("Element "+parseInt(a[i], 10)+" cannot be found in the array");
    }

}(arguments)
As an input it takes filename with the elements of an array in first row and elements to find in that array in next rows, like this:
4 10 12 19 25 34 41 50 52 61 66 68 76 81 82 85 94 97 105 112 115 124 128 138 139 230 321 432 456 540 
61
82
94
2
10
4
24
432
Assuming that script file is called binSearch.js, data.txt is the file with input data, and both are in the same directory as Rhino, to run the script simply type
java -jar js.jar binSearch.js data.txt
Ideone You can simply achieve the same effect using online tools\, without installing anything on your computer. Ideone, online IDE & debugging tool allows you to run your scripts using Rhino or SpiderMonkey, another Mozilla's JS engine, this one written in C. You can edit your scripts in realtime and provide different inputs on every run. Good luck in FBHC!

Friday, August 27, 2010

NodeKnockout

It is about 7 hours to the Node Knockout, last time for final preparations. Because I don't plan to sleep during that 48h, I prepare a lot of coffee and energy drinks as well as easy-to-eat stuff like frozen pizzas or fries. If it will be possible I will describe everything I will be working on here in near real time. Wish me luck!

Tuesday, August 3, 2010

"Stairs to heaven in 6,22KB" competition!

Inspired by few videos posted in comments I would like to announce a little competition. Rules are as simple as possible: play my "StHi6,22KB" game, make a video from it (using your mobile, camera or just record part of your desktop using programs like CamStudio) with your result visible, upload it on any video-hosting site like Youtube or Vimeo and put the link in the comments on 10k Apart site (here) before 25 of August. I will prepare two truly unique "Stairs to heaven in 6,22KB" T-shirts - one for the owner of the best result and one for the randomly chosen participant (e.g. by 'true random numbers generator - random.org). So, good luck and I'm waiting for your videos!

My best try (of course it doesn't count):

Wednesday, July 7, 2010

The "A Game By Its Cover" Competition

On the end of June the new "A Game By Its Cover" Competition started on the TIGSource.
"A Game By Its Cover" is a game development competition based on how people's work inspires others to think in new and wonderful ways. In it we'll make real games out of fake game carts whose creators probably never imagined would become something real!

Because I like the idea, and I was looking for some simple project to test first options of my Javascript canvas-based game engine, you can watch progress of my "Real-time tree growing simulation" in this threat on TIGForums.

Tuesday, June 1, 2010

"Impossible is nothing" play-off

Few hours before I want to send our game to Ovi challenge I read on the site that organizers gave us additional week for app polishing. I don't think it was necessary - my game was complete on Monday, about 7-8am. I will use my extra time to change it from WRT widget to Symbian app.
About an hour after the announcement I found something called Rhodes, but using of Ruby and that all 'Network synchronization' stuff effectively deterred me.
What I found next was PhoneGap. Quoting creators:

PhoneGap is an open source development framework for building cross-platform mobile apps. Build apps in HTML and JavaScript and still take advantage of core features in iPhone/iTouch, iPad, Google Android, Palm, Symbian and Blackberry SDKs


It was everything I need. It seems that it also supports Symbian. My first try was 'Get Started with Symbian (Qt)' part from the tutorial. I installed another tons of useless stuff (really - it was another 20GB to make it 'works').
I did my best but nothing seems to work properly or even close to. I googled thousands of different forums, blogs, tutorials and manuals with no result. I even try to search for my answers on Stack, where i found nothing. So I asked new question in there and few hours later I got the answer (from one of the phoneGap developers), from which i concluded that it simply doesn't work. Fine. So I had to write something on my own.

One of the methods that come to my mind was to render HTML/JS in simple browser-like application. It is possible for example using WebKit.
Tired of installing millions of plug-ins, libs, etc. I download Nokia SDK All in one Beta and start new 'Mobile QT Application' project in Qt Creator.
I will explain later what to do if we want render our applications with WebKit, now I'm happy that it works fine. I made minor changes in the game, like control system (now there are no buttons, you simply tap the screen - character goes in direction of your tap. I will also try with accelerometer). Tomorrow I will test it on device and if everything will go well I will submit it to the challenge.

Saturday, May 29, 2010

"Impossible is nothing" 9 : 2

I decide not to show everything in here - it has to be a little mysterious and something must motivate you to play when the game will be finished:). What I want to say & show today, two days before the deadline, is very simple table based map editor I write in about 200LOC with simple DOM manipulation using 24 sewers tiles placed in one png file. It is easy and not so annoying to use, just watch the video below. Second part shows early location exiting/entering (it is already changed), Zombies AI, and better than yesterday connected map tiles.
I don't know if tomorrow I will have time to write something because of last corrections. Results will be announced on 3rd June, I have good feelings because it is my birthday, so keep your fingers crossed.

Friday, May 28, 2010

"Impossible is nothing" 8 : 3

IAs I promised before, here is the simple few seconds long video with basic gameplay on uncut scenery tiles. I want to focus now on mechanics, not visual details (I will improve it tomorrow or during the day after).


There is no interaction with Zombies and no Survivors for now, that is my job for the next days.

Thursday, May 27, 2010

"Impossible is nothing", first week off, 4 more days.

Today I improved frame rate detection using Scott Porter's Gamelib javascript library, modified by Brent Silby. Now it keeps constant number of frames on each device, I don't have to calibrate engine when I want test it on Nokia's, and i gained beautiful loading screen for introductory splash graphics. I will write something more about the library later.
I also fix few bugs, change sprites for that prepared by Kuba and start to think about particular missions. Unfortunately because of deadline getting closer every second, we decide to make only 2-3 different 'levels' with 5-6 missions each. It seems to be enough for 10-days-created game:). Last but not least for today - meet our survivors:

Wednesday, May 26, 2010

"Impossible is nothing" 6th day - after the half-way point

Okay, we have now only 5 more days to deadline so without unnecessary words let me introduce Mr. & Mrs. Zombie as a first gamesprites created by Kuba:
No more pandas:). Tomorrow I will try to record screencast from my emulator to show some gameplay details.

And continuing saint war between Flash-lovers and JavaScript developers - Thoughts on Flash directly from the Apple.

Tuesday, May 25, 2010

"Impossible is nothing" 5th day - six to go.

Today I expand features of my Map editor. It's now ready for multiple type tiles and 'special' cells (like that which are teleporting you to given place when you stand on it).
As I planned I also add first enemies - for now colorful pandas instead of zombies. I gave them simple AI using which they will moving in the player's direction.
I also change my plans about placing enemies and items on the map. I have no time for that. Maps will be designed using map editor, but all element like zombies, pellets and other items will be placed using random techniques (and it will change every time you get out and get back to the screen - I think that makes game more interesting and 'a little bit frightening' - you never know what is around the corner). Check first 15 screens of game world in the editor's mode preview with one screen pasted directly from the game:
And yes, I have changed tiles from simple red/yellow because they 'irritated' my eyes:), but this is still not target graphics.

Monday, May 24, 2010

"Impossible is nothing" 4th day, Only a week more.

After first tests on mobile device my game seems to work. I've done basic logic such as displaying player, simple map (with locations and moving between them) and player control - with collisions with the environment. Tomorrow i will work on enemies (finally, ZOMBIES!) and survivors. I want to finish engine in next two days and use rest of the time to build world, expanded with many locations and put final graphics on. I already found graphic designer with enough free time in that week to make some sprites and tiles - meet Kuba from HighColors. And meet first Zombie I've ever seen - 1st location guy from Resident Evil (it was 1996 on PSX)

And one technical aspect of designing tileset-based map movement. Let us consider map created from simple array with '0' as road and '1' in the role of wall, e.g.

map[0] = [];
map[0].push([0, 0, 1, 0, 0, 0, 0]); //0
map[0].push([0, 0, 1, 0, 0, 0, 0]);
map[0].push([0, 0, 1, 0, 1, 1, 0]); //2
map[0].push([0, 0, 0, 0, 0, 0, 0]);
map[0].push([0, 0, 1, 0, 1, 0, 0]); //4
map[0].push([0, 0, 1, 0, 1, 0, 0]);
map[0].push([1, 1, 1, 0, 1, 0, 0]); //6
map[0].push([0, 0, 0, 0, 1, 0, 0]);
map[0].push([1, 1, 1, 1, 1, 1, 1]); //8
map[0].push([0, 0, 0, 0, 0, 0, 0]);
Movement and collision detection are easy if we want our character just 'jump' from one cell to another. We need then simply calculate if destination tile is not '1'type (wall).

var x = (player.xPosition/tileSize) + deltaX,
//if we move along X axis deltaX is 1 or -1 and deltaY is 0
y = (player.yPosition/tileSize) + deltaY;
//and vice versa in here

if (map[actualMapIndex][y][x] !== 1) {

//move player

} else {
displayFunnyWallHitAnimation();
}
It gets complicated when we want it to take smaller steps, what is necessary if we want animation. For example our player moves 9px each step in 50px big tile. Because DOM coords are calculated from top-left corner, we can observe case in which our character is moving 'on the wall', like that:

With yellow fields as roads, red walls & dark blue dot as sprite's 0,0. We can see that 0 point of the sprite is on the road but the sprite itself is traveling on the wall. So I got the idea of adding one more point to that, i call it x2, like that:

var x = ((player.xPosition+tileSize*0.2)/tileSize) + deltaX,
x2 = ((player.xPosition+tileSize*0.8)/tileSize) + deltaX
y = (player.yPosition / tileSize) + deltaY;

if (map[actualMapIndex][y][x] !== 1 && map[actualMapIndex][y][x2] !== 1) {

//move player

} else {

displayFunnyWallHitAnimation();

}
I add 1/5 size of the tile to the 0.0 point, and 4/5 for another one. It's because my sprite has a little free, transparent space from each size. In practice it looks like that:

And because of kind of isometric (or oblique) view I use ('will use', because it's hard to say about perspective if i have only semi-colored squares as background), i don't have to introduce additional point in Y-s. It looks good when character is standing in front of the wall like on screen below (like in the old Pokemon games for gameboy).
Ok, I will return to developing now, because, paraphrasing George Bernard Shaw (I don't really remember how it was originally), "Able is creating, unable is teaching" , and I always find writing blogs as a kind of teaching:).

Sunday, May 23, 2010

"Impossible is nothing" 3rd day, only 8 more

Ok, finally I have an idea. Thanks to Squidi's so-called GameDocs, PacMan's birthday the day before yesterday and my true zombie-love I have a plan. I decide to design everything for Nokia 5800 XpressMusic (with 360x640 resolution) with very simple reason - that is one my neighbor have so I can test my game on it.
I use simple map editor I write before, initially for my first FaceBook Snake (where I finally never use it), used later in Eastern Compo Game. I made 7x10 map of 50px height tiles, what gives me up to 90px on the bottom of the screen for navigation panel (coz that device had no keys). Now I have to find someone who can make me some graphic.

Saturday, May 22, 2010

"Impossible is nothing" 2nd day - 9 days left

To create any game, you need:
  1. idea

  2. skills

  3. time

  4. tools

  5. and resources

As I wrote in previous post, I have no skills in mobile dev, no idea for any interesting app, and I'm run out of time. What I have today are tools.

All night long i read mostly everything in the web about creating mobile widgets in web technologies. It wasn't so easy because Nokia's site is one big mess with everything upside-down. I download tons of stuff from there (really, it is almost 10GB, with most annoying thing ever - Symbian Emulator which is 4GB big and you have to reinstall it every time you want to clear all preferences. Fortunately Aptana has additional plugin with browser-based Nokia device emulator too), install everything they asked me to, read and tried to understand every "Getting started" and "Hello World!" tutorials, and not sleep at all.
Finally, I can proudly say that it is working. First photo of some pre-prototype game-like application running on Nokia's device (I don't even have one, thank one more time to Owca for help).

Friday, May 21, 2010

"Impossible is nothing" 1st day - 10 days left

Ok, I give up with J2ME. My mate Jakub a.k.a Owca had an idea of cool J2me application inspired by alcoholic blackouts, with very strong chance to win ODC, but unfortunately Blue-tooth implementation for our needs was to difficult to overcome. Now we have 10 more days (challenge ends 31 May, at 15:00 Central European Time), no experience or even skills in mobile development for Nokias, no idea of any awesome app that could win, and no money to drink from grief.


But there is a little light at the end of the tunnel. According to Nokia Forum there is some way to write mobile applications using Web Technologies, such as HTML/CSS and our favorite JavaScript. I have to get familiar with that. We'll see what will happen.

Thursday, May 13, 2010

Mobile applications

Best proof that it's time for develop something for mobile devices is that in new Photoshop option 'Save for Web...' changed into 'Save for Web & Devices...'. That's why in my free time I'm working on social-like fun and nice application for Ovi Dev Challenge. I have almost two weeks, I have to speed up a little. Wish me luck & keep your fingers crossed:).

Monday, April 5, 2010

Eastern Compo 2010

It's almost tradition that during Eastern Holidays Warsztat members organize special edition of Compo (game developing competition, check). Randomly chosen topic of competition was "A game with particles-effect, Zombies, arrows and deadly spikes". Quite creative.

I tried to create Tower Defense Game with Zombies as creatures, particle-flame throwers and spike-guns as towers and arrows as obstacles. I use some old javascript particle effects and try even to build few fire-towers. Unfortunately JS and web browsers are not adapted to generate thousand of tiny objects. It worked fine with one tower, very bad with two of them, and with three haven't work at all. Because of that I decided that required 'particle effect' will be "Hell fire", shown on spawn place of Zombie creatures. The same situation was with spike/nail guns. So i change my mind and simply put spikes like arrows - on the ground as obstacles. It took me about 8 hours to design, code, prepare the graphics and test the game, so it is not finished at all.

Finally, except me, there was only one participant took part in Compo, so there was no results. If you are interested in my game, download it here: EasternCompo [290KB]
(Readme and gui are in polish, sorry).