I have been doing software architectural work for a long time now, and as it turns out, the ‘right way’ of solving things may not always be the best way. Below are two anecdotes from life in the trenches.
I have been doing software architectural work for a long time now, and as it turns out, the ‘right way’ of solving things may not always be the best way. Below are two anecdotes from life in the trenches.
Recently I ranted about non-productive tasks that can divert focus away from the developer and seriously hamper the effectiveness in your project. As an extension of that discussion I would like to propose a new rule – the 30 second rule:
Any process that takes longer than 30 seconds to run, must be fixed.
Implementing a poker network is a very expensive project to undertake. There are many barriers to overcome; development, license(s) and player liquidity just to mention a few. The cost and effort involved has proved to be prohibitive to new actors on the market, leading to a fairly stale and static playing field. But does it have to be this way? In this article I will discuss an idea on how to start and scale up a poker network without the enterprise big bucks.
Building a low cost poker network from scratch:
But how would I implement the actual points? Read on…
Just the other day a colleague of mine started a small rant of how little time in a development project that was actually writing & fixing code. I think the final crescendo was a Tweet that read:
“My dream is simple. One day, developers can spend their time on actual development..”
It seems that developers don’t riot in the street, they post a message on Twitter or Facebook. Anyway, the nerd-rage was released and so we went back to our tasks as usual.
Read the rest of this entry »
Adobe has made their Flash Player version 10.1 available for some time now. Among some more or less nifty features, they also have a new way of preserving CPU and resources when an application is out of view (different tab or minimized), the application is throttled to a meager 2 frames per second instead of about 60 frames per second.
The throttling effects everything in the application, Timers, Events, LocalConnections etc. The behavior is explained very well in Tinic Uro’s blog post.
I think I understand the rationale here. Currently, an application is running full speed even when it is out of sight from the user. This means that flash applications running on background tabs might eat up CPU without any real reason for it. Since Flash has been taking a lot of flak for this lately I can see how they are eager on improving this. The general idea behind this is sound.
However, my problem with this (and other companies as well) is that you are breaking backwards compatibility. The throttling affects all timers and event handling. Any type of Flash application that uses multiple windows might use LocalConnection to communicate between the windows/applications. After all, that’s what it’s there for. If any of the participating applications are minimized or hidden, they will almost stop producing/consuming since they are throttled down to 2 FPS.
What is even worse is that you get no notification when this occurs. There are no callbacks or events triggered. Suddenly your application might be running at a 30th of the default speed and you will not be told about this. There is currently no option to avoid being throttled either. To me this is not acceptable if I am developing RIA:s. Imagine writing a desktop application in C++ where your timers suddenly could jump down from 60 FPS to 2 FPS. Without a callback. How would that go with the developer community?
Can this be fixed?
I think so. If Adobe only adds an opt out option for an application I think it would be fine. The default behavior could still be the throttled solution, which would probably work in 90+% of the Flash applications out there. For the freaks like us that are relying on a stable timer and LocalConnection we could explicitly say that we want full FPS even when hidden.
The argument that this could be abused is moot in my opinion. This is the current behavior so you are not making something worse even if everyone decides to opt out from throttling. Besides, what would be the motives for people to ‘abuse’ this behavior? Some evil scheme to waste CPU cycles on people’s computers?
But until then?
If you application is running into problems because of the throttling, there are some things you can try to make things better.
1. Loop a silent MP3 in your applications. Yes, I am serious. This will ramp up the FPS from 2 to 8. Still not much, but four times faster.
2. For LocalConnections you can run a separate LocalConnections per client (if applicable). This will allow you to send more data per tick. *
3. Batch data over LocalConnections. Aggregate as much as you can between ticks and then send it as an Array. Pack it up on the other side.
4. Set the parameter ‘wmode’ to ‘opaque’. This will in theory stop the timer from getting clocked down. Seems to be working for some, but it may depend on your use-case.
Remember that when your ticks go down you need to try and perform as much work as possible for each tick. Of course, this is a bit against the design principles for an asynchronous framework, but hey, that’s what happens when you start to nerf the framerate.
* Edit: This does not seem to be possible. The routing seems to be executed outside the LocalConnection, meaning that all events sent will be dispatched sequentially in a throttled manner to all recipients. Ergo, if you have one broker and four clients (think online poker game with one lobby and four tables) then for the 2 FPS case each client will receive a maximum of 1 event every two seconds. Yikes.
You can contact him at: fredrik.johansson(at)cubeia.com
Upon popular demand I have made an analysis of the bandwidth requirements for running the Cubeia Poker on Firebase with the lobby. The scope was to test 8 000 simulated poker users on a 4-way cluster where every user is also subscribing to the entire lobby tree (i.e. all tables). The values of interest are external and internal bandwidth usages.
This somewhat technical document can be found here.
For some reason I can’t seem to comment at the moment. So if you’re experiencing problems, please bear with us.
In the last post, netsql asked about action script support (as upposed to Flex) for Firebase, and I’ll post my answer here for the time being: Good point, it should be documented. As far as I know, but I’m no Flash coder, the API is the same. So you should be able to download it and then use the Flex examples to find your way.
Drop me a line (lars.j.nilsson at cubeia dot com) and I’l let you know when we have something up on the wiki. Otherwise just hang around, we’ll get it updated in the next few days.
Update: Oh, apparently commenting is on again.
After a few years of ‘who care about the looks’ mentality, we now have redesigned the entire website. The system is still Joomla, but now the template is ‘HiveMind’ from the excellent RocketTheme.com. Really good stuff!
So… What do you think?
| After six months of development, we're proud to announce a new major release of Firebase: Cubeia Firebase 1.8.0-CE. This release brings HTML5 support directly into the game server. More information here. |
| Cubeia just released a Random Number Generator service for Firebase. More information can be found here. |
RSS 2.0 Cubeia Ltd is a software and services company, registered in with UK company no. 6056566 and operating through our office in Stockholm, Sweden. Cubeia Ltd. UK Fillial is a registered branch office in Sweden, organisation no. 516404-2268. Please contact Lars J. Nilsson, Executive Vice President, on telephone: +46 (0)704 - 10 69 53.