-
New Multiplayer Game: Connect 4 Online
Posted on July 3rd, 2009 13 commentsConnect 4 Online is a multiplayer-enabled version of the classic “four in a row” game. The aim is to connect four pieces either horizontal, vertical or diagonal — before your opponent does! Enjoy worldwide multiplayer games with random opponents or in private rooms. A computer opponent with three difficulties is available for offline games, as well as a variable grid size! The game can be found in the market under “Games -> Brain & Puzzle -> By Date“.
The game connects to a simple threading TCP-Server written in python, which pairs new players, sends the game-signal and passes the game-stats around. A typical delay on a GSM network is just around 50 to 100 milliseconds; easily sufficient for a round-based multiplayer game.
We have bundled the game with an android emulator (for linux and windows), so it’s not even restricted to playing on the actual android devices. Anyone can download the bundle, unzip it and jump right into the game! :-D (The downside of this approach is that the bundle has to include qemu and the full android stack, counting up to ~ 40 MB)

Download for LinuxDownload for Windows
Enjoy the game, and let us know what you think of it! :-)
[UPDATE] We published an update
What Next
Related Posts
13 Responses to “New Multiplayer Game: Connect 4 Online”
-
It’s cool and addictive but it has some bugs…
1) Force close on bad network (I assume it lays in the async thread that connects to your server)
Tested on emulator without inet and there it force closes as soon as you hit the online button.
Maybe you can (if you don’t already have) add some code to check for net connection first.2) Points added to the person with more stones on the board, if one player leaves the game but has more stones on the board he wins.
Some people just enter the game and if they can play the first stone they play it an leave to get the points or some people leave if they see that they can not win the match and this can lead that they get the points even they left the game.
I suggest that the one that is leaving always looses the points but maybe add a timeout if one player is not playing for 2 or 3 minutes that leaving the session wont take points awayThe chat function is not very comfortable with the Toast messages… maybe add the last message (after the toast disappeared) at the bottom of the screen in one line, just if someone missed the toast.
-
Hey rac! Thanks for the feedback!
re 1 - force close on bad network: i will have a look into that and fix it (should be easy).
re 2 - points added: at the moment it should work like this: if your opponent leaves an active game you will always get the points, regardless of who has more stones on the board. but i’ll check again and make sure it works this way and that the opponent looses the points on quitting…
re 3 - timeout: yeah man, really necessary… i think 30 seconds should be enough to place a new stone, and maybe get 10 seconds more once a round if you send a chat.
We are working on an update with all these points — it will be released this thursday! thanks for your feedback - that helps a lot improving the game! :D
Best from Vienna, Austria
- Chris -
rere1: had this force closes on bus travels… but with emulator that has IP but no dns you should be able to replicate
rere2: from my expierience in last days:
Sometimes the points stay the same, sometimes the opponent gets the points and sometimes I get the points.
Whats odd is that if I loose I loose 15 Points but if I win I sometimes have 3 Points and sometime 4 points more.rere3 don’t make it force the limits just allow exit without point loose after the limit.
Wenn ihr noch Unterstützung im coding braucht einfach melden ;-)
-
Discovered another bug:
While playing this morning i came in to the situation that I saw the stone from my opponent but couldn’t play my stone.
I had 4 stones, my opponent 5 stones on the board so it should have been my turn but the top stone was blue and I couldn’t play my stone.
Can’t tell you how to reproduce, just had it once. -
I just recorded 10 gamestats…
Pasted the stats at http://imagebin.org/549772 times out of 10 the stats from opponent are wrong…
Can this be a force close leading to forget the actual points and restore old value?How does the counting work?
3 times out of 10, the opponent left the game
4 Times I win and 3 Times I loose but total point difference is -6
Maximum points I got for winning is 8 but minimum point I lost for loosing is 12 -
Thank you very much for your feedback and log!
I will look into it and let you know what I found out this evening.
The point system is related to the Elo-Rating of chess — if you have more points than your opponent you are expected to win - thus if you win you earn few points and if you loose you loose more points. the same is vice versa if you have fewer points than your opponent (you win more and loose less)
-
If I understand your right, the Point diff is the factor for the winning/loosing points.
How is the formula with that you calculate it?
-
Better said, how did you project the elo rating system onto connect4 parties?
Would be funny to see the opponents elo rating when starting a game.
-
Bugreport:
I just had the bug from above with a locked game (no player can play a stone) again this morning.
It happened as I opened the keyboard and the screen rotated…
As the game is not usuable in landscape mode…
You could add this to the manifest:
android:screenOrientation=”portrait”
android:configChanges=”orientation|keyboardHidden”
This should block android from auto rotating on activity basis… -
hey again!
thanks for your continuous contribution to the debugging and enhancing progress!
i think i already have an idea where the locked game bug might come from. i’m currently rewriting the multiplayer engine to include md5 checksums, to make sure no packets are lost somewhere. the release will probably be rescheduled from today to tomorrow (friday).
as for the screen orientation bug: i will look into it and consider the fix you suggested. actually rotating the screen, typing on the keyboard and rotating back should work, but it seems to still have some bugs. and fixing the screen like you suggested might be a sufficient solution!
thanks again :-D
-
at least I would add the portrait force to the game activity because with autorotate on it’s unhandy to play while walking…
You could start the chat mode in an own activity that while in entering a message the keyboard slide changes orientation of message entering but not the game itself. -
[...] is a brief summary about today’s update of Connect 4 Online, a multiplayer-enabled four-in-a-row game for Android phones. One major improvement is in the [...]
-
I was looking at the way you guys created Iconic Memory and I must admit that you did and an amazing job in such a short period of time. My friends and I are working on our first Android game and we currentlty have a nice working version. Now we are trying to figure out how to create a high score table that would display the top 5 or 10 scores. We went through tons of tutorials that were all but helpful. Can you please guide us through this?
Thank again :-)
- cell phone unlock code
- Skin pics: Tattoo download - tribals ...
- Data Recovery Services
- Mouli Cohen
- cheap web hosting
- ReputationDefender.com
- Canon Ink Cartridges
- Server Partition Software
Save this page
Follow us on Twitter