Page 1 of 2

Browser Game

Posted: Tue Feb 09, 2010 4:25 pm
by ibly31
Hai I wanna maek a mmoe on teh broswer!1

Actually, I've been wondering how they are made. I would like to attempt some sort of game played in the browser that is multiplayer, but I know that won't happen, so I'd like to start at the basics. I know how to use MySQL databases and PHP and junk, but the thing that confuses me is the graphics. (NO FLASH PLEASE)I know your not gonna find something that is a full 3D FPS in a browser game, but what about the simple 2D drawings? Do they use something like the canvas tag? One idea that I thought of, but I don't know how practical it is, is to set the source of an image to a php page that outputs an image that you create. PHP can create images and put its on text and stuff on it, so can it create entire images with more than just text?

I also know that since PHP is server side, how do you tell it to update the person's stats on screen and stuff when HTML and JavaScript is all client side?

Re: Browser Game

Posted: Tue Feb 09, 2010 4:31 pm
by Live-Dimension
Flash, Flash c++ wrapper runtime, Java, or Unity3D.

Or the best javascripting on the planet

Re: Browser Game

Posted: Tue Feb 09, 2010 4:36 pm
by davidthefat
I forgot what it was called but there was/is a full on FPS in 3d played on the browser, it was programming in flash, I forgot the name of it, it was full speed too

edit: http://www.rasterwerks.com/

Re: Browser Game

Posted: Tue Feb 09, 2010 4:44 pm
by Live-Dimension
davidthefat wrote:I forgot what it was called but there was/is a full on FPS in 3d played on the browser, it was programming in flash, I forgot the name of it, it was full speed too

edit: http://www.rasterwerks.com/
That's actually Adobe Director. It'd probably do the job better then flash, but the shockwave plugin is no where near as used and installed as much as flash is.

Re: Browser Game

Posted: Tue Feb 09, 2010 4:52 pm
by Winawer
ibly31 wrote:Hai I wanna maek a mmoe on teh broswer!1

Actually, I've been wondering how they are made. I would like to attempt some sort of game played in the browser that is multiplayer, but I know that won't happen, so I'd like to start at the basics. I know how to use MySQL databases and PHP and junk, but the thing that confuses me is the graphics. (NO FLASH PLEASE)I know your not gonna find something that is a full 3D FPS in a browser game, but what about the simple 2D drawings? Do they use something like the canvas tag? One idea that I thought of, but I don't know how practical it is, is to set the source of an image to a php page that outputs an image that you create. PHP can create images and put its on text and stuff on it, so can it create entire images with more than just text?
That's kind of vague, but you could probably use Canvas and/or JavaScript depending on what you're trying to do.
ibly31 wrote:I also know that since PHP is server side, how do you tell it to update the person's stats on screen and stuff when HTML and JavaScript is all client side?
AJAX.

Re: Browser Game

Posted: Tue Feb 09, 2010 5:46 pm
by ibly31
Hmm I'll have to think of how AJAX can be used for this, because every time I've tried to use the XMLHttpRequest it has been really gay. I know the whole point of Ajax is to be asynchronous, but I think it would have been easier to be synchronous. Also, I know you are all trying to help but I am not doing anything involving flash.

Re: Browser Game

Posted: Tue Feb 09, 2010 5:53 pm
by davidthefat
http://lwjgl.org/ try this java API

Re: Browser Game

Posted: Tue Feb 09, 2010 5:56 pm
by ibly31
That does look like a pretty cool API for desktop games, but the thing I'm aimed at is a browser game. My main goal is to make it compatible with the iPod touch and mobile devices like that, along with an actual computer. I researched the XMLHttpRequest function and I think I understand how to use it, correct me if I am wrong:

I have my game which calls a function, lets call it "reloadStats()". It calls an XMLHttpRequest function that grabs a PHP page that goes into my database, outputs the values in a format I can understand, sends the page back to my javascript, parses it, and pastes it onto the users screen? (Try to say that all in one breath. :D )

Re: Browser Game

Posted: Tue Feb 09, 2010 6:00 pm
by davidthefat
I know this can be a pain in the butt, but have you thought about using animated GIFs? if you dont want to use flash, the other thing I can think of is GIFs

Re: Browser Game

Posted: Tue Feb 09, 2010 6:03 pm
by Winawer
ibly31 wrote:I have my game which calls a function, lets call it "reloadStats()". It calls an XMLHttpRequest function that grabs a PHP page that goes into my database, outputs the values in a format I can understand, sends the page back to my javascript, parses it, and pastes it onto the users screen? (Try to say that all in one breath. :D )
Sounds about right.

Re: Browser Game

Posted: Tue Feb 09, 2010 6:04 pm
by ibly31
Yeah, I just feel like that would be more pain than it is worth. I'm gonna look around at some browser games to see how they do graphics. Can Flash interact with MySQL databases?

Re: Browser Game

Posted: Tue Feb 09, 2010 6:06 pm
by davidthefat
ibly31 wrote:Yeah, I just feel like that would be more pain than it is worth. I'm gonna look around at some browser games to see how they do graphics. Can Flash interact with MySQL databases?
http://www.youtube.com/watch?v=pxHX6DmhWdA
yea it can

Re: Browser Game

Posted: Wed Feb 10, 2010 3:08 am
by RyanPridgeon
Most browser games are done on Flash, so you really will need to use this if you want to have a standard web game. Flash does have a nice language (Actionscript 3) which is similar to Java and its animation/art tools are the bomb so I'd recommend just use Flash!

Re: Browser Game

Posted: Wed Feb 10, 2010 11:25 am
by ibly31
I'm on a mac and the version of Flash for mac is horrible in my opinion. I'd like something compatible with mobile devices so that throws flash out the window unless Apple decides to make flash run on the iPhone platform.(not gonna happen).

Re: Browser Game

Posted: Wed Feb 10, 2010 12:18 pm
by Arce
Hai I wanna maek a mmoe on teh broswer!1

Actually, I've been wondering how they are made. I would like to attempt some sort of game played in the browser that is multiplayer, but I know that won't happen, so I'd like to start at the basics. I know how to use MySQL databases and PHP and junk, but the thing that confuses me is the graphics. (NO FLASH PLEASE)I know your not gonna find something that is a full 3D FPS in a browser game, but what about the simple 2D drawings? Do they use something like the canvas tag? One idea that I thought of, but I don't know how practical it is, is to set the source of an image to a php page that outputs an image that you create. PHP can create images and put its on text and stuff on it, so can it create entire images with more than just text?

I also know that since PHP is server side, how do you tell it to update the person's stats on screen and stuff when HTML and JavaScript is all client side?
Dude, google "Unity3d" and try the free download. I think it's a pretty sound engine, and it runs flawlessly in the browser. Not to mention you really can be up and running a full 3d FPS with muliplayer in under a day.