PDA

View Full Version : Online Game ?



programmer
23-09-2009, 06:12 AM
Hi ...

I wanna make an online game , but the main problem is how to make connection between the players like if I moved player1 the other computer has to see this movement ,I tried to make it as the network game(LAN) but the computers can't connect with each other by internet sepically if the internet access by router , so I found another idea like to make all players send there information movements to the website and then every player will bring all the information from the same website in that case all players will know if there any changes in movement
I don't know if my idea is good or not, please tell me if it's wrong what the best way.

- is there any example about that ?
- is there any example about send and bring information from website?

Thanks

chronozphere
23-09-2009, 07:07 AM
A bunch of articles on multiplayer gamedev:

http://www.gamedev.net/reference/list.asp?categoryid=30

You should take a look at the Indy components. There are also other networking libraries like Raknet etc...

NecroDOME
23-09-2009, 07:28 AM
What I would do:
Create a server-client environment.
- Server -> Start server
- Client -> Start client
- Client -> Join server
- Server -> Jibber jabber game state/level
- Server -> Send send message CreatePlayer(ID)
- Server -> (optinally) Sends all other player ID's
- Client -> Creates player with ID
- Client -> Send player update info to server
- Server -> Send client player update to the other clients

This way both server and client know the status and ID of the player. And as you can see the server is the master that know everything. He knows when a player connects or disconnects, so he can also notify the other clients.

paul_nicholls
23-09-2009, 11:40 AM
Hi ...

I wanna make an online game , but the main problem is how to make connection between the players like if I moved player1 the other computer has to see this movement ,I tried to make it as the network game(LAN) but the computers can't connect with each other by internet sepically if the internet access by router , so I found another idea like to make all players send there information movements to the website and then every player will bring all the information from the same website in that case all players will know if there any changes in movement
I don't know if my idea is good or not, please tell me if it's wrong what the best way.

- is there any example about that ?
- is there any example about send and bring information from website?

Thanks


Perhaps this site will help:

http://indie-resource.com/forums/viewforum.php?f=27

It has videos on how to create a complete browser-based (Firefox or IE) MMO using PHP, MySQL, and Apache!

I am trying it out right now so I can learn some PHP, etc.

In just the first 4 videos, you learn where to get the software you need (WAMP), and how to write your first PHP programs...a hello world, and then a database accessing simple registration page for creating a character in a database :)

cheers,
Paul

User137
23-09-2009, 12:59 PM
If you already have game working on LAN, the TCP/IP version of it is no different at all. There may be some issues that need to be taken care of for packetloss, latency and disconnections but the network components and usage are the same.

In regard to routers, that is something you can't do much about. Loads of people posess internet connections that are not capable of acting as server, therefore you can either put up a real game server that all games send packets through (as any mmorpg does), or be happy that some people can create server to host games to their friends :)

programmer
23-09-2009, 02:16 PM
Thank you so much

The next question
- is there any example about send and bring information from website? by delphi

or some codes for doing that

programmer
25-09-2009, 10:15 AM
Question ????
Just about the server , what is it , I mean is it a program put on the website and all the clients connect with it or I can make it like for example a MYSQL Database in that way all clients can send and save there positions to the Database and the other take that positions from the same Database and update the players positions

AthenaOfDelphi
25-09-2009, 11:17 AM
Question ????
Just about the server , what is it , I mean is it a program put on the website and all the clients connect with it or I can make it like for example a MYSQL Database in that way all clients can send and save there positions to the Database and the other take that positions from the same Database and update the players positions


If you want to host the server properly, then in most cases it will be either a service application (for Windows) or a daemon (for Linux). It will run on a server and your clients would connect to it using a specific TCP/IP port. It would be good to wrap the entire server in a self contained class, so during development, you can run it in a normal application (debugging services isn't nice) and then when it's ready for use, wrap it in a service.

Depending on your game and the volatility of the game universe (ie. the frequency with which things change during normal game play), you'll probably find that using anything other than a dedicated server application isn't fast enough. My on-line game uses MySQL as it's storage medium, but it is entirely web based with updates only occuring when players change things via the web interface and the hourly updates which make time pass in the game.