Monday, May 31, 2010

[android-developers] Re: Developing Online Android Game

Frank,

I plan to use the SDK. I'd like to put whatever I make on the app
store so browser based wouldn't work. And I'd like to use the SDK so
it will give me access to the android classes and such. I'm just
beginning to start with Android so my knowledge of it is limited. I'm
just trying to focus on the server at the moment but also keep in mind
android's networking capabilities. Also, my goal with persistent
connections is that will improve latency since the client doesn't have
to reconnect every time. Throughput is something I'll just have to
hope for the best.

Miguel,

Thanks for responding to both posts. I didn't even realized my older
post went through. It actually showed up in my profile as being
posted to the board, "sex+gay" :) , so I removed it from there. I've
found the old post and I've read over what you said. However, I've
somewhat moved onto trying erlang as I've been reading how much better
it scales.

I've actually started reading the Armstrong's Programming Erlang book
a few days ago. I got to the middle of chapter 3 but I got impatient
and wanted to try this nitrogen stuff. Are there any specific
chapters in that book that you think may help with my project? I
started reading about OTP and behaviors. It seems promising but its
hard to wrap my head around all of it. Oh, and I think I'll just
stick with JSON as I don't expect the encoding/decoding to be the
bottleneck plus JSON would give cleaner code.

My main problem with Nitrogen is trying to figure out how to interact
on the client side. I've installed the firebug extension into firefox
so I can view all the requests needed to the server. There are
several Javascript requests and some requests are 100KB plus. It
seems like nitrogen adds a lot of overhead which is not something a
data plan could endure. I've found another Erlang chat example which
has far fewer requests than before. I've installed it on my server.
You can access it at http://stormyd.dyndns.biz:8000 . The code is
from http://chrismoos.com/2009/09/28/building-an-erlang-chat-server-with-comet-part-1/
. When using firebug, it shows two javascript pages and multiple GET
requests (the browser appears to cache the javascripts so it will only
be the first time). I understand how the client will long poll the
server for 1 minute 30 seconds until it responds, but I do not
understand all the setting up requests. Is it possible to emulate all
of the GET requests on android. Could I bypass the javascripts? If
you or someone could help me interact with the server through telnet
(logging in, posting messages, and receiving them), I think I'd better
understand how it works.

Thanks to both of you,
Ravi

On May 30, 7:04 pm, Miguel Morales <therevolti...@gmail.com> wrote:
> Out of curiosity, why is developing the client side for a nitrogen app so
> difficult?  I'm a big erlang advocate, and I am happy that you've looked
> into it.  If you really want to make a kick ass server erlang is a good
> choice.  I would recommend you pick up Joes erlang book as it provies
> examples on how to make fault tolerant, scalable servers.
>
> It's really not that hard, and a really good excercise.
> On the java side, you would just connect and communicate either via JSON or
> via bytes dirrectly.  Working with bytes in java is easy using bytebuffer,
> and in erlang using the super awesome using the bit syntax.  Plus you avoid
> the encoding/decoding overhead, and you can create a custom byte protocol
> that'll be as fast as it gets.
>
> Erlang provides ways to make generic servers easy using behaviours.
> You'll probably want to use tcp to guarantee packet delivery.  If the
> connection is flaky.
>
> Either that or some sort of transaction system.
> Btw, I replied to your last post.  I'm not sure if u got it.
>
> Hope this helps in some way.
>
> Miguel
>
> On May 30, 2010 11:50 AM, "ravishi" <ravish...@gmail.com> wrote:
>
> Hello everyone,
>
> I am getting started in android development and I really want to
> create some form of online game.  My goal is to start out with a turn-
> based game and move onto advanced multiplayer games.  I want to have
> users associated with their google account, provide some sort of
> matchmaking to pair people together, have their stats stored in a
> database, and use the stats for various leaderboards and such.  I have
> read over an older discussion on this list athttp://www.mail-archive.com/android-developers@googlegroups.com/msg75...
> .  There was a lot of good information that I gathered but I still
> have some questions.
>
> What I originally started with is an apache web server on a laptop
> that I don't need right now (2.0Ghz Core 2, 3GB Ram).  I wrote a perl
> module that can take in a user's name with a JSON GET request.
> However, I stopped this approach after learning that apache HTTPD is
> not very scalable for a large number of persistent connections.
> Therefore, I switched over to Erlang + Mochiweb with the intention of
> using Nitrogen.  I used Nitrogen because I am looking for a comet
> based solution so I can avoid polling the server.  There is a demo app
> that uses these three technologies that seemed perfect for what I
> wanted to do.  http://nitrogenproject.com/demos/comet2.  In that demo,
> it shows how users can post message and all client's connected will
> receive the message, so it is similar to how a game would work.
> After getting it set up, I realized that developing the client part on
> android would be very difficult when using Nitrogen so I'm about to
> give up on Nitrogen and possibly a bit inefficient as Nitrogen seems
> to be more about getting web browsers to do persistent connections.
> Erlang without Nitrogen might still be a path I could take.
>
> All I want is a server-client model that has persistent connections,
> comet based, and is scalable.  But I need help in learning what
> technologies to use to get to this goal.  Any starter code or links
> would be helpful too.
>
> Thanks,
> Ravi
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscribe@googlegroups.com<android-developers%2Bunsubscribe@googlegroups.com>
> For more options, visit this group athttp://groups.google.com/group/android-developers?hl=en

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment