Posts

Showing posts with the label java

Java 4k 2013 - Meltdown

Image
In the wake of ‘Peak Oil’ in 2143, factions struggle to claim their share of the world's trickling reserve. But deep beneath the melting ice of Antarctica a new oil deposit has been discovered; the likes of which have never been seen. As private prospectors flock to the site like vultures to a corpse, you are the only thing standing between them and the fate of an entire world. Should you claim the oil and receive riches beyond your wildest dreams, or make sure it remains buried and maybe save a dying planet? Meltdown is my entry in this years Java 4k game competition. This year I teamed up with the game designer Daniel Frostberg who created the actual concept while I focused on the code. The game is a 3d dogfight game with a little twist, you have to fight below the surface as well as above it. Or as the strategy guide put it: The Antarctic is an inhospitable place – especially with prospectors around, determined to eliminate all opposing competition. Luckily, your Black Gann...

Java4k 2012 - PORT4K

Image
A couple of weeks ago the submission deadline for this year's java4k game compo was due. This year i was a close call, squeezed it down below 4k only a couple of days before deadline. My mission was to make a game with music in it and it took a lot more time that anticipated. The game became a 2.5D demake of Portal which actually became quite fun to play but the simulation is bit buggy on some systems. The synth in the game is a 4-channel beauty with sine, square and noise oscillators. The only effect other than track volume is a delay loop for each channel. I recommend using headphones to hear the base frequencies. All in all I'm very satisfied with the end result. Both the music and the game is great. You can play the game over at Java4k.com  and the tracker can be found at  https://bitbucket.org/bysse/tinysynth . Don't forget to register a user and vote for your favorites!

Multi Threaded Fractal Renderer in Swing

Image
After seeing Jeff Pershing's post on a obfuscated madelbrot renderer in python  I naturally had to try the python snippet provided. Sitting on a quad-core 3GHz machine I felt a bit disappointed when it took a long time to render the fractal and only one core was used. Performance was not a part of their initial goals so I will forgive them but I felt obliged to make a multi threaded version. For science! Said and done, it was surprisingly smooth coding and the end result is pretty decent. The palette was by far the most time consuming thing to implement, it's hard to find good colors. Only basic controls for navigating the fractal are implemented, mouse wheel to zoom and click to center. Screenshot from the application The code can be found at my repository on  bitbucket . 

BIRT Documentation

Recently I've had the pleasure opportunity to work with BIRT for a reporting project. My conclusion is that it is by far, the most inaccessible open source project I've ever seen. This post is dedicated to my future self.  Hey! Here are the links you've been looking for! BIRT Javadoc  (hidden inside  http://help.eclipse.org ) BIRT Source can be found at git://git.eclipse.org/gitroot/birt Good luck, you'll need it...

Simple Tracker

Image
Yesterday I released my third app which is called Simple Tracker. It's basically a calendar were you can enter data on different variables and then be able to plot the values over time. Obviously there are far more advanced fitness / health applications out there, but in my opinion they are too advanced. I don't know how many grams of cereals I eat for breakfast or how much cheese are on my pizza. What I do know are which days I workout and the measurements I make. And that is what I use the application for. ie. recording my weight a couple of times each week and annotate the days I workout with a color depending of the activity. Below are some of the screenshots from market, please note that this is sample data :) Calendar overview  Viewing data The app can be found on  Android Market  and is currently in beta and free but ad-supported. It will of course be a part of my  Cubing For Charity campain . 

Floating table headers for GWT

Today I've created a Google code project for the GWT port of my  jQuery floating header plugin . It's a very lightweight library that already supports both column and row headers. Since the code base is very young i haven't had the chance to try the compatibility with a lot of browsers but in time i might do this. The project is available at:     http://code.google.com/p/gwt-floating-header/ .

I won the Java 4k Game Competition 2011

I'm very proud to say that my game ' 4Kube 3d ' won the java 4k game competition this year. And what is more surprising, for me at least, is that it came first in both the judge and community voting. The timing of the results was very good also for me. I've just come back after seven months of backpacking in Asia and this will certainly relieve some of the inevitable post travel depression. Needless to say i got a lot of help from other people, so a big thanks to: * Rasmus (RL. GREEN LABEL) for helping me with level design and testing. * The guys at java-gaming.org forums for a lot of tips on how to improve the game. * Riven for his most excellent Compile 'n Shrink service. Other posts about the competition: * http://www.indiegames.com/blog/2011/03/java4k_2011_competition_result.html * http://www.rockpapershotgun.com/2011/03/29/impossigames-the-java4k-challenge/

Java 4k competition 2011

Finally the time a year when you are encouraged to write really dirty code, Java 4k competition ! Well, maybe not dirty but certainly ugly. The Java 4K competition is a game programmer competition. The goal of the competition is to create the best game possible in Java. But what's the catch? Well, it wouldn't be fun if there wasn't any catch! There are limitations, and these limitations are: The maximum allowed size of a game is only 4K This year i forgot to exclude the manifest before i started with the size optimizations. I felt like a child on christmas when i discovered it! Good times :) Anyway, my game is a classic puzzle game where you control a rolling cube. The objective is to clear all colored bricks on the playfield by rolling over the bricks with the a side of the cube which have the same color as the brick. The game can be found on the Java 4k site and I encourage you to try all submitted games, some of them are really good. Because Riven's excellen...

10k downloads for Cube Algorithms

A milestone has been reached for my first android app Rubik's Cube Algorithms . It now has 10000 downloads and almost 2500 active installs. Considering the very small audience of this app there is a huge potential to reach users through the Android market. I've learned tons of stuff releasing this app, not so much about programming but of how to handle user comments, feature requests, bug corrections and just make to TEST before you release. Obviously you want a good rating of the app on Android market but it's surprisingly hard to not care when someone give it a bad rating. Even if the comment suggests that the user doesn't know what he's talking about: I thought this was going to be like a vertual rubics cube little did i know its faaarr from it[,] this stuff is like triginomatry This user gave the app a rating of one, even though he clearly didn't read the description of the app. Not everyone will like what you're doing, no matter how much effort you...

Hibernate error message haiku

A couple of weeks ago i got this error message from Hibernate. The only change i've done is to remove the word "an" from it. CriterionImpl dimension references (an) unknown entity

Java4k: Geometry wars clone

This year i didn't miss the deadline for the java4k competition! I made a geometry wars clone and it can be found and played on their site and also on my new game project site . All my projects that are classified as 'games' have been put on porkangel.com , though it desperately needs the attention of a real designer :)

"Statistics" for QuakeLive

Image
At work we're using GWT for a couple of projects now but we have never used the  MVP pattern  recommended by Google. So to learn it i wrote a small application called Quake Statistics that uses the recomendations. The app pulls data from  quakelive.com  each night and can plot the it along with some very basic analysis. It's actually motivation to see if you're getting better at the game. Of course this was also an excuse to get to play quakelive more, to test the stats :) The application can be accessed at  http://quakestatistics.appspot.com  and if you want to play around with some example data you can try my profile . Since i don't have that many users the page can be a bit slow because AppEngine have to restart after 1 min idle time. Yes, i know. The design desperately need some (a lot of) improvements but unfortunately i'm a programmer not a designer. Right now I am in the process of rewriting the app for GWT 2.0 so if you want to help ...

Getting a FacesContext from a GWT service

I'm working on a project where we needed to integrate JSF and GWT. To be more specific, we needed to have access to JSF beans in the GWT services. Because I missed the methods getThreadLocalRequest() and getThreadLocalResponse() in RemoteServiceServlet, I had to search quite a bit before i found an answer to this problem. So to save others some time i post the class i came up with. Most of the code is taken from an article at ocpsoft.com which also points out how important it is to release the context when you're done with it. The big difference are the lines, UIViewRoot view = facesContext.getApplication().getViewHandler().createView(facesContext, "gwtViewID"); facesContext.setViewRoot(view); , which sets the view root. If no view root is set you can't use, for instance MessageBundles. The getBean methods are only convenience methods for retrieving beans by name. /** * A substitute for RemoteServiceServlet that has access to the FacesContext. */ @Sup...

Mask - the liero clone

Finally I've rewritten my little engine so that it is in a presentable state. The list of things I've tried and changed is huge but in the end it turned out pretty stable. It's gonna take a while to transform this preview into a real game though and i'm not sure i'm up for it actually. This feels like a release to me because it's playable :) Anyway what i need to do is roughly: Add a menu for game setup and changing controls Adding more weapons Adding powerups Implement some kind of sound support Get new graphics Controls Here are the controls for both players. I just realized that the keys might be placed very tight. I'm using a split natural keyboard so it works for me. Action Player 1 Player 2 Walk D,G,R,F Left, Right, U, Down Change Weapon Q Y Jump W U Shoot S J Ninja Rope Q+W Y+U Digg Hold one direction and tap the other You can also try experimenting with the mouse to add/remove ground and add particles. Applet If you're lik...

JFreeChart Legend Arrangement

When i was working with JFreeChart i found no way to layout the items of the legend box the way i wanted. I had no choice but to write a custom Arrangement . If anyone knows of a better way please enlighten me. ColumnFlowArrangement can layout on both the vertical and the horizontal axis. It works by specifying the width, in items, of the initial column. The column is filled with as many labels as there is room for, then a new column will be created with the same width. The arrangement works the same way for rows. The names of the arguments in the class can be a bit confusing but I will fix this and add factory methods to increase readability when I find the time/energy. The class can be found at: https://gist.github.com/bysse/6627232

Eclipse 3.4 - Essential hotkeys

This is the third part of my Eclipse configuration series. At work we have a new guy who never has used Eclipse before, so he's a little lost when it comes to navigating the code base. I tried to write down a list of hotkeys that would make his life easier, but there are so many of them! Here is a list of my favorite hotkeys grouped by the area of use. I really tried to keep the list short but some shortcuts you just can't live without. General ctrl+space - The most important hotkey of them all, auto complete. ctrl+m - Maximize the current view. ctrl+3 - Open preferences or any other view. Navigation f3 - Open declaration. ctrl+o - Quick outline of the class files, great for navigating within a class quickly. ctrl+t - Open the type hierarchy. ctrl+shift+g - Get a list of all methods that calls the current method. ctrl+k - Next occurrence of the currently selected text. ctrl+. - Goto the next error or warning, use ',' for the previous. ctrl+shift+r ...

Eclipse 3.4 - Even more efficient use of auto complete

The auto complete feature in Eclipse is a real time saver. Not many people know that the feature can be used event more efficiently. I've worked with Eclipse every day the last couple of years and i didn't know about this until a few days ago when i "discovered" it by accident. A single capital letter matches itself and then everything until the next word. Actually it's more similar to [a-z0-9]* than "everything". In other words, you can search for, or auto complete, entire words with just one character. For example the string "RR" matches the classes:    ReportRepositoryBean    ReportResult    ReportResultImpl The feature can also be used with the shortcuts: ctrl+shift+r - Open Resource ctrl+shift+t - Open Type

The liero project

The last couple of weeks I've been busy with a top secret web page project so i haven't had much time left for this project. But now it's time to work to get my hands dirty. The first thing I've done is that I decided to name the liero clone project. I can't go around calling it 'the liero clone project'. So in good liero spirit I'm naming it 'Mask', which means worm in Swedish. The second decision is that I have to rewrite just about everything. This is because: The graphics library need to be decoupled from the game The game is using 'fake' physics, which won't work in the long run The collision detection is not robust Everything became messy and blaaahh Yes it's gonna be a pain but 'a young idler, an old beggar'. A very suiting proverb for this page :)

No problems switching host

I was a bit surprised at how easy is was to move the WP installation to another host. I still have to move the domain names but this will work in the mean time. The new host is a VPS over at GleSYS and it's about 5-10 times faster than my previous hosting, so I'm happy. I also got access to the apache logs which always is a bonus. Any way, i thought about architecture of the liero project last night and it's gonna be a major refactorization session this weekend. Hopefully i'll get the same functionality after the rewrite as before.

Update on the Liero Project

Haven't done much in the last two weeks. Since some people at HDBits started to use my plugin (and pimping it) i got distracted and switched to that project. Anyway the last couple of days i've done a lot of refactoring to the liero clone. I've separated the physics from the Player object (phew), added health, HUD and a weapon framework. The most important thing now is to add a ninja rope, without it no liero clone is complete. Applet and keys are on the next page. Player 1: Arrow keys J,K Player 2: W,S,A,D Z,X Generic: R - Particle rain Backspace - Regenerate the level Mouse button 1 - Add dirt Mouse button 2 - Erase from the level Mouse button 3 - Shoot blood