Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 ISU Help
Index -> Programming, Java -> Java Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
djplatinumalex




PostPosted: Wed Feb 06, 2008 8:14 pm   Post subject: ISU Help

I'm currently taking grade 12 computer science and I got the idea of creating a game which can interact with the internet (to store data and such). Does anyone know where I can find the syntax to use in order to create this interaction?
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Wed Feb 06, 2008 8:21 pm   Post subject: Re: ISU Help

djplatinumalex @ Wed Feb 06, 2008 8:14 pm wrote:
interact with the internet

Laughing what part of it?
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
djplatinumalex




PostPosted: Wed Feb 06, 2008 9:53 pm   Post subject: Re: ISU Help

Well for what part I was assuming a lan but possibly a webpage (one of those free ones). My goal is to be able to send player info to the other player. I was thinking of creating a method where it collects the required data (locations of things in the game) and then sends the data to the other player.
Nick




PostPosted: Thu Feb 07, 2008 1:48 am   Post subject: RE:ISU Help

a webserver?
/me thinks of the one Dan tried to make me make that I failed at due to Turing's faults
ericfourfour




PostPosted: Thu Feb 07, 2008 12:40 pm   Post subject: RE:ISU Help

My suggestion is to look into what servers and clients are. Start with programs that network on the same machine (localhost, 127.0.0.1) before you worry about LANs or the internet.
djplatinumalex




PostPosted: Thu Feb 07, 2008 6:32 pm   Post subject: Re: ISU Help

I have, in fact, looked at some open source for a simple chat program. I saw it involved a BufferedReader to receive, a BufferedWriter to send and a Socket/Server Socket as means of doing the chatting. How do you go about using that to make as I said, a method to transfer variable values?
Euphoracle




PostPosted: Thu Feb 07, 2008 7:05 pm   Post subject: RE:ISU Help

Memorization strikes again!

Basically, you first have to design how you want your system to work. Forget Java for the time being, and think in a neutral language--or pseudo code for those who wish to call it such. Ask yourself question: How am I going to keep track of connected users? How am I going to relay words? How will users be alerted when other uses leave? How will I identify users?

After you've created a general idea for your design, you can begin to work on the protocol: Am I going to use codes to denote message types? How will I parse the messages? How will I make sure that the client stays in-sync with the server?

After you have a basic idea how your protocol is going to work, you should begin planning your implementation. Now you can concentrate on Java as a language, although I still prefer to be neutral here. Always plan before you even create a .java file. A structured, planned and thought-through program will always be more successful than coding-on-the-fly. Writing your code should be quick and painless, however, designing it will be the challenging step. Don't make the mistake of many Highschoolers before you! It may seem simple from the outside (ie: "send message"), but in reality, there's a lot more that goes into how those messages are sent and how the client stays in-sync with the server, and most important, error handling! When something goes wrong, your application will have to deal with it. "Sorry something happened, restart me" is not a valid solution to errors. A project like this isn't one of your average highschool assignments, and if you want to be successful, you have to take the extra steps to ensure that your program has been designed, your idea has been tested logically (not practically) and that your solution to the problem ("How do I make a networked chat client/server?") is both doable and viable.

It won't be easy if it's your first time designing something like this, but it will be worth it, and you'll feel much better coding it when you realize you don't have to go back and redesign parts, because you did that before hand! Wink
djplatinumalex




PostPosted: Thu Feb 07, 2008 8:06 pm   Post subject: Re: ISU Help

The idea of keeping track of client/server connection and interaction makes sense but i have a possible way in mind. It would work through the sending of information from the client to the server where the server receives the variables and stores them as a text file. Then, the other client receives the data through a method which is run before that client can do what they must in the game. At the moment, the goal is to find such an interaction where the values are sent. Another idea I had is to make two seperate client files which were player-specific in order to make tracking values easier based on the player number. I think it will help if I can figure out exactly what game I am going to make, so I will try and figure that out a.s.a.p..
Sponsor
Sponsor
Sponsor
sponsor
Display posts from previous:   
   Index -> Programming, Java -> Java Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 8 Posts ]
Jump to:   


Style:  
Search: