game newbie question-shorter version

Started by
6 comments, last by hplus0603 17 years, 8 months ago
hi, i want to make an online multiuser role playing game using Java, and not sure if it will be a java applet. Some people have said i need to learn php and sql, but im not sure how that fits in. can anyone please tell me what things i need to learn to make an online role playing game? mainly 2d simple one. my goal is for players to log in to the website and play the game right in their browser, maybe something like Runescape, but not 3d. I want to be able to save the game saved character info on a web hosting service server. [Edited by - derekpainter1 on August 17, 2006 7:44:58 PM]
Advertisement
Well, if you make an applet, your applet get loaded on the client computer. If you want to interact with your server you should get data from your applet to your server. The easiest way to do this is to create a php script that connects to mysql, and let the applet send a post or get request to the php script.

PHP itself cannot be used for graphic realtime games, it only generates output from an input. You should realize that when you want realtime multiuser interaction, posting to php via your applet won't cut it probably. You should look at sockets and create a serverside application that is able to interconnect clients with eachother and a database.

Greetings.
thank you. also, could i do all that with just Java? what do i need to learn? also, should i make my game an applet? or should i make it a regular program.
Quote:Original post by derekpainter1
could i do all that with just Java? what do i need to learn? also, should i make my game an applet? or should i make it a regular program.


Well you could make a regular Java application, however that won't run within your browser, only an applet will.

Here are some pro and conns of using applet with raw socket and using http post:
http://www.unix.org.ua/orelly/java-ent/servlet/ch10_01.htm

To create a game like an MMORPG you need to know a lot on a lot of different subjects. I would start with a simple text based multi-user chat + inventory or something using a server and a database. make a normal chat and have 2 extra commands: create an item in your inventory and give an item that is in the inventory to another online user. Als make a command to print your inventory.

If you got this to work you are on your way. Add more commands as you go, like moving to another coordinate.

If you got all your commands, make a graphical user interface for it.

That's how i would start.

Offcourse there is a lot of other things to know, but first things first right :)

Greetings.
would that chat be a regular java program? or should i make it an applet.
im not really sure when to use an applet and when not. isnt the mmorpg Runescape a java applet? http://en.wikipedia.org/wiki/Runescape

[Edited by - derekpainter1 on August 17, 2006 8:11:07 PM]
Quote:Original post by derekpainter1
would that chat be a regular java program? or should i make it an applet.
im not really sure when to use an applet and when not.


Well, there are a lot of advantages if you use regular java. You can compile it into an exe and it will probably run faster, you can add more functionality to it because it will have more rights on the computer it runs on. Also, if you have a lot of images and textures you can store these clientside since a java application can read from client computer whereas a applet cannot. However, a regular java application won't run in your browser. Applet are suitable for small simple programs, i don't know if your MMORPG will be small and simple enough to be efficient as an applet.

I would personally go for a regular application. But that's just me.

Greetings.
awesome, thanks very much for your help.
You can write the client as an applet if you want (just make sure that you comply with the security settings for applets -- you can only connect back to the server that the applet came from).

However, the server that receives the chat and commands of all players, updates their position and stats, and sends out new information about players periodically to all connected, needs to be a real server executable; it cannot be an applet. Thus, you cannot host this on a free or low-cost web host, because they will not let you host a custom server.

For more pointers, you might want to look at the FAQ for the Multiplayer and Networking forum.
enum Bool { True, False, FileNotFound };

This topic is closed to new replies.

Advertisement