+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Best programming language to choose

  1. #1
    froger is offline x10Hosting Member froger is an unknown quantity at this point
    Join Date
    Sep 2009
    Posts
    49

    Best programming language to choose

    I have a question, where would be the best place to start to create a game for mobile users. This will be a multiplayer mobile game.
    How you would move on the map, would be from a link going north east south or west. The game will be browser based and require
    a reload to move the character over one space. The setup for this game would be something like this...

    72x72Image

    HP:XX
    Mana: XX

    North
    East
    South
    West


    This is where things start to puzzle me though, How would I create a map that they could move up and down on. Mobile phones are very very
    limited so the image would be 72x72. I have an idea of one thing. I create a whole bunch of small 8x8 images.
    Such as player(your character moving in game.) the ground, mountains etc. In the end it really wouldnt be that many pictures.
    Now how would I be able to combine them/duplicate them as needed to create a small map.
    When I say 72x72 pixel image, thats just the piece of the map at the time that I want to display. In reality the map would be bigger. Here is an example
    of what I mean.

    ground

    cavewall

    player


    turn them 3 small 8x8 images into something like this.

    MMMMMMMMM
    MMMMMMMMM
    M--------
    M--------
    M---P----
    M--------
    M--------
    M--------
    M--------
    HP: xx
    Mana: xx

    north
    east
    south
    west

    aka


    HP: xx
    Mana: xx

    north
    east
    south
    west

    Things you need to consider are that this game should be playable from ANY phone. That includes old ones. This is the reason why I think I should go along the lines of something
    text based, then have something convert the text into image. So that way an option to have image or text would easily be able to be implemented. Any ideas? Thanks in advance.

  2. #2
    bhupendra2895's Avatar
    bhupendra2895 is offline x10 Elder bhupendra2895 is an unknown quantity at this point
    Join Date
    Jun 2010
    Location
    India
    Posts
    554

    Re: Best programming language to choose

    Old phones, I don't think will be able to support browser based game, because each time the images needs to be refreshed and downloaded by mobile browser.This will take so much RAM of client phone and finally browser would crash.Even in nokia s40 platform this won't perform better if the game goes so long and so the consumption of memory.Developing games for such handsets in J2ME is best option.
    Handset with good Java Script and Ajax support can do that easily and such handsets are gaining market, even in third world countries like India.So my suggestion is you should develop your browser based application for them.Presently cellufun @ http://www.cellufun.com is creating browser based games, so you can get more help by reviewing what they do.

    Good Luck :-)
    Last edited by bhupendra2895; 07-13-2010 at 02:55 AM. Reason: typo
    Liked this? Click on the icon on the bottom of post to make me .

  3. #3
    froger is offline x10Hosting Member froger is an unknown quantity at this point
    Join Date
    Sep 2009
    Posts
    49

    Re: Best programming language to choose

    Quote Originally Posted by bhupendra2895 View Post
    Old phones, I don't think will be able to support browser based game, because each time the images needs to be refreshed and downloaded by mobile browser.This will take so much RAM of client phone and finally browser would crash.Even in nokia s40 platform this won't perform better if the game goes so long and so the consumption of memory.Developing games for such handsets in J2ME is best option.
    Handset with good Java Script and Ajax support can do that easily and such handsets are gaining market, even in third world countries like India.So my suggestion is you should develop your browser based application for them.Presently cellufun @ http://www.cellufun.com is creating browser based games, so you can get more help by reviewing what they do.

    Good Luck :-)
    I have seen many mobile phones that dont even support images, that could carry something like this out. It could even be done in PHP if necessary. There would be a table named world or something. Have 5 columns X, Y, Z, Image, Type. Ex. X: 5, Y: 5, Z: 0, -,Ground.

    Then have a table named location with 4 columns (more if necessary) X, Y, Z, PlayerName. So it stores Locations of players. Then you could do something like this...



    $sql = mysql_fetch_array(mysql_query("SELECT * FROM Location WHERE Player='Example'"));

    for ($y = ($sql['Y']-4);$y<=($sql['Y'] + 4);$y++)
    {
    for($x = ($sql['X'] - 4);$x<=($sql['X'] + 4);$x++)
    {
    $img = mysql_fetch_array(mysql_query("SELECT * FROM world WHERE X='" . $x . "' AND Y='" . $y . "'"));

    if (($img['X'] == $sql['X']) && ($img['Y'] == $sql['Y']))
    {
    echo str_replace($img['Image'], "P", $img['Image']);
    } else {
    echo $img['Image'];
    }
    }
    echo "<br/>";
    }

    Then to move all I would have to do is have get variables in my north east south west links. This game has to be browser based. Older phones do have wap browsers that ARE capable of supporting text if they cant support image. Thus the ability to switch from text to image would be required. Also could J2ME be multiplayer AND browser based? I don't know much of J2ME either.

    Also thanks for the response. Much appreciated.
    Last edited by froger; 07-13-2010 at 10:44 AM.

  4. #4
    bhupendra2895's Avatar
    bhupendra2895 is offline x10 Elder bhupendra2895 is an unknown quantity at this point
    Join Date
    Jun 2010
    Location
    India
    Posts
    554

    Re: Best programming language to choose

    J2ME is not browser based it runs in java virtual machine(jvm) on mobile devices.I don't have through knowledge of J2ME, but mobile devices which supports internet in j2me applications can take advantage of this using platform request() method, but game will be slow because old mobile phones don't support 3G, so either your application have to perform better in 48kbps GPRS connection and if you are lucky and operator and handset both support EDGE then there will be 239.5 kbps maximum speed.You can make it multiplayer and as you said it will be text based then no need to use j2me, because php will do it.I think ajax on client side will be more better because page need not to be refreshed.You can create two versions one for low fi handsets (with html and text only) and other for handsets like Iphone(with images, javascript etc.) and for detection of mobile devices, you can use wurfl. http://wurfl.sourceforge.net and
    http://tera-wurfl.com
    If you use firefox then you can install an addon called user agent switcher and switch to user agent of Iphone and open m.youtube.com you will be able to see what Iphone, android and handset like nokia 9500 can do.
    Liked this? Click on the icon on the bottom of post to make me .

  5. #5
    froger is offline x10Hosting Member froger is an unknown quantity at this point
    Join Date
    Sep 2009
    Posts
    49

    Re: Best programming language to choose

    Quote Originally Posted by bhupendra2895 View Post
    J2ME is not browser based it runs in java virtual machine(jvm) on mobile devices.I don't have through knowledge of J2ME, but mobile devices which supports internet in j2me applications can take advantage of this using platform request() method, but game will be slow because old mobile phones don't support 3G, so either your application have to perform better in 48kbps GPRS connection and if you are lucky and operator and handset both support EDGE then there will be 239.5 kbps maximum speed.You can make it multiplayer and as you said it will be text based then no need to use j2me, because php will do it.I think ajax on client side will be more better because page need not to be refreshed.You can create two versions one for low fi handsets (with html and text only) and other for handsets like Iphone(with images, javascript etc.) and for detection of mobile devices, you can use wurfl. http://wurfl.sourceforge.net and
    http://tera-wurfl.com
    If you use firefox then you can install an addon called user agent switcher and switch to user agent of Iphone and open m.youtube.com you will be able to see what Iphone, android and handset like nokia 9500 can do.
    I expected the phones to be slow. Lets say mabe one space per 2-5seconds. There will be a run option but thats something totally different. 3G networks will go 2-3x faster.

    Isn't there a better way than making an entirely seperate type of game? Lets say have a table of player information. One of the columns will be display.

    $stats = mysql_fetch_array(mysql_query("SELECT player, display FROM playerstats WHERE player='example'"));

    if ($stat['display'] == 'text')
    {
    display text version.
    } elseif ($stat['display'] == 'gif') {
    display gif version.
    }

    that way converting between text, wbmp, gif, and png will be easy. The main question I guess is
    from the script that I posted originally, how would I use that same method to convert the $img['Image'] to the small 8x8 image.
    Last edited by froger; 07-13-2010 at 11:14 AM.

  6. #6
    bhupendra2895's Avatar
    bhupendra2895 is offline x10 Elder bhupendra2895 is an unknown quantity at this point
    Join Date
    Jun 2010
    Location
    India
    Posts
    554

    Re: Best programming language to choose

    Quote Originally Posted by froger View Post
    .The main question I guess is
    from the script that I posted originally, how would I use that same method to convert the $img['Image'] to the small 8x8 image.
    I think that can be done using GD function, if you are going to implement it in x10hosting, because imagemagick is not available here.I don't know about GD too much, you can search the PHP manual, web and this forum's programming section with GD in search string.
    Liked this? Click on the icon on the bottom of post to make me .

  7. #7
    froger is offline x10Hosting Member froger is an unknown quantity at this point
    Join Date
    Sep 2009
    Posts
    49

    Re: Best programming language to choose

    Quote Originally Posted by bhupendra2895 View Post
    I think that can be done using GD function, if you are going to implement it in x10hosting, because imagemagick is not available here.I don't know about GD too much, you can search the PHP manual, web and this forum's programming section with GD in search string.
    Before I started looking for help on my quest to create this game, I was actually looking into GD functions. I really couldn't find any that would help my situation. What would really help is, if anyone knew how to store an image to a variable so it can be echo'd multiple times. ex.

    <?php
    $url = example.com/images/example.png";
    $img = imagecreatefrompng($url);

    header("Content-Type: image/png");
    imagepng($img); // here is where I would need the help.
    ?>

    How would I be able to echo that same image numerous times. Turning them three small 8x8 images on my original post to that 72x72 image.
    Last edited by froger; 07-13-2010 at 11:57 AM.

  8. #8
    lemon-tree's Avatar
    lemon-tree is offline x10 Minion lemon-tree has a spectacular aura about
    Join Date
    Nov 2007
    Posts
    1,420

    Re: Best programming language to choose

    The images would have to be arranged either using GD functions prior to outputting with imagepng($img) or could be arranged through the use of multiple structured img items in HTML.

  9. #9
    froger is offline x10Hosting Member froger is an unknown quantity at this point
    Join Date
    Sep 2009
    Posts
    49

    Re: Best programming language to choose

    Quote Originally Posted by lemon-tree View Post
    The images would have to be arranged either using GD functions prior to outputting with imagepng($img) or could be arranged through the use of multiple structured img items in HTML.
    I agree with you here. I just dont know how I would do this. I don't see any GD functions that can be of use to do this? Can you point me in the right direction?

  10. #10
    Salvatos's Avatar
    Salvatos is offline x10 Lieutenant Salvatos is an unknown quantity at this point
    Join Date
    Jun 2006
    Location
    Québec, Canada
    Posts
    271

    Re: Best programming language to choose

    Quote Originally Posted by froger View Post
    What would really help is, if anyone knew how to store an image to a variable so it can be echo'd multiple times.
    Well, if you're using a database, what I usually do is just store the image's location (filepath) in the table. You can already put the image tag around it if desired.

    For instance:
    echo "<img src=\"$sql['result']\" />";

    In your case, I would probably add the whole tag in the db so you can do something like this:
    if ($mode == 'graphic') {
    echo $sql['img'];
    }
    else {
    echo $sql['text'];
    }

    Or, more conservative, you could just have one "type" column to identify what is on the square (person, landscape, item, etc.) and have your code fetch an image or display a character in accordance. That is assuming that every "desert" square, for instance, will always have the same image/symbol. It might not work, or not as simply, if you want to superimpose images, for instance a character on a desert square.

+ Reply to Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 42
    Last Post: 07-26-2011, 12:59 AM
  2. What is your prefered programming language?
    By dito7967 in forum Off Topic
    Replies: 58
    Last Post: 05-10-2010, 07:18 PM
  3. Choice of Programming Language
    By shanrei in forum Computers & Technology
    Replies: 10
    Last Post: 12-02-2008, 10:27 PM
  4. Your Favorite Programming Language
    By sumitmehta in forum Off Topic
    Replies: 14
    Last Post: 03-08-2008, 11:26 PM
  5. Replies: 18
    Last Post: 02-01-2008, 12:24 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers