Simple Multiplayer Online Game?

Ideas, Opinions, Suggestion, Comments, Anything..

Page 1 of 1

14 Replies - 9235 Views - Last Post: 12 June 2008 - 08:23 PM Rate Topic: -----

#1 mensahero   User is offline

  • I Desire...
  • member icon

Reputation: 17
  • View blog
  • Posts: 680
  • Joined: 26-May 08

Simple Multiplayer Online Game?

Posted 11 June 2008 - 12:03 PM

Hello.. Good day to all.. After I've finished my project in JAVA I got bored and try vb.net with SQL but luckily.. microsoft hates me.. :angry: so I hate them to and decided to better learn JAVA..

my problems:

1. I can't learn by just reading books or anything.. I want a Goal.. something to accomplish.. That's how I learn..

2. I'm planning on making a simple ONLINE GAME played by 3 persons..

3. What do I need to learn? Don't hesitate I'm good at learning by myself.. but I need a specific lesson to learn.. I can't learn them all..

4. Is it possible to be done with pure JAVA? if so what part of JAVA do I need to learn.. specific API? or anything..

5. If I need to learn something that is not related to JAVA.. what is it? and what part of it do I need to learn..

6. I only have a single PC. Its a browser based game.. Do I need another pc to act as a server? or I can get webhost to act as a server? What do I need to learn about online server?

7. Any suggestion, Opinions.. but please don't laugh and tell me I'm a dreamer.. I'm new to JAVA.. but give me the Topics and I can learn them..

8. Any possible diagram would be great.. diagram on how the data flow..

9. I'm getting pretty bored.. and classes will start next week.. I need something to keep me pretty busy so that I can avoid going out and wasting my time just hanging around doing nothing.. :blink:

This post has been edited by mensahero: 11 June 2008 - 12:05 PM


Is This A Good Question/Topic? 0
  • +

Replies To: Simple Multiplayer Online Game?

#2 1lacca   User is offline

  • code.rascal
  • member icon

Reputation: 44
  • View blog
  • Posts: 3,822
  • Joined: 11-August 05

Re: Simple Multiplayer Online Game?

Posted 11 June 2008 - 12:18 PM

You should specify a bit better what kind of an online game you are thinking of. You wrote that it is browser based. Does it mean, that you would like something that works like a homepage, and it is refreshed by clicking links?
Or something that is more dynamic, and refresh it's state asynchronously via AJAX? Maybe something that is not based on HTML at all (an applet)?
The first two options only require a servlet, and you are fine, but you'll have to know HTML, and in the second version some Javascript as well.
Sticking with the third option, you can create just about anything. If it is turn-based, then you can get away with HTTP refreshes. If you want something where the clients get real-time messages from the server, then you'll need to look up socket programming. For this some knowledge of TCP/IP might be useful, but not necessary.
So what will it be?
As for testing with one machine: it is possible in all cases, but in the last option simulating user inputs might be tricky.
Was This Post Helpful? 0
  • +
  • -

#3 mensahero   User is offline

  • I Desire...
  • member icon

Reputation: 17
  • View blog
  • Posts: 680
  • Joined: 26-May 08

Re: Simple Multiplayer Online Game?

Posted 11 June 2008 - 12:31 PM

Now.. thats a good.. start.. well sorry to be less informative.. I'm in the middle of giving up hope on .net while posting that.. I prefer the third one.. It offers a lot to learn..

more information..

1. It would run on a browser. An Applet is a great IDEA since i'm into those..

2. It will only consist of 3 players. That will give me enough IDEA on how to develop it..

3. I don't want people downloading anything. I just want to simulate 3 persons playing together online. something like a multiplayer side scrolling game..

4. What technology would hold the data? and were can I upload the database or something.. ? does webhost a possible server? or Do I need my pc to be the server.. what technology should I learn?

5. To be honest.. I'm not really into games.. I just thought that this project could give me the whole IDEA on how JAVA ONLINE could work.. how data are transfered from what to where..

6. and if its possible on JAVA ALONE.. I prefer doing it PURE JAVA.. ? but still if its no possible.. then what do I need to learn? and any specific topics about them.. i.e.. learn HTML .. but what part of HTML?

:D :D

This post has been edited by mensahero: 11 June 2008 - 12:34 PM

Was This Post Helpful? 0
  • +
  • -

#4 pbl   User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8381
  • View blog
  • Posts: 31,956
  • Joined: 06-March 08

Re: Simple Multiplayer Online Game?

Posted 11 June 2008 - 05:29 PM

You you know the Game "RushHour" ?

I guess you can Goggle for it if you don't know it.

You have a parking lot with vehicles that can be moved in only one direction (up and down or left to right)
There is only one exit from where a designated vehicle should exit. You should move vehicles to clear the way to let the designated one to exit.

That was the first Java program (after HelloWorld) I wrote.

Lots of challenges...

You need a Grid object composed of Corridor objects into which Vehicles objects can be dragged.
Vehicule object have a size (2 or 3 squares) and a direction (up/down or left/right).
That will teach you a lot of Swing and mouseListener.

Your first version can use simple Rectangle as vehicle then you can load Image from cars downloaded from the Internet that will teach you Image manipulation in Java.

Then you can put predefined problems (with their level of difficulty) into an SQL database and retreive them at random. Sure, you will need a GUI to populated that database. This database will be filled with Problem objects that will be the initial state of the parking when the game start.s That will teach you SQL programming from Java. (Use HSQLdb easy to use and to put Java object into it).

Then you can share between 3 users athe same problem and see who does the problem faster that will teach you Socket programming.

RushHour comes with predefined problem (and their solutions). If you want you can try to figure out an algorithm to find the better solution. That will teach you Operational Research.

Do that and you will know a lot about java and you can publish that problem into the net. (For free I hope so I can play).

You can start with an hardcoded problem single user... then add the database thing then add the multi user interface.
That will teach you how to re-use objects already created.

I was a C/Cobol programmer, learned Java and OO in 3 months doing that project at home.

If you can't find predefined problems on the net I'll be glad to email you my Problem class and an file containing Problems object into it.

Have fun

This post has been edited by pbl: 11 June 2008 - 05:47 PM

Was This Post Helpful? 0
  • +
  • -

#5 pbl   User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8381
  • View blog
  • Posts: 31,956
  • Joined: 06-March 08

Re: Simple Multiplayer Online Game?

Posted 11 June 2008 - 10:49 PM

Mensahero

can't wait to play RushHour with Cindy :D
when will you post it on your web site ?
Was This Post Helpful? 0
  • +
  • -

#6 mensahero   User is offline

  • I Desire...
  • member icon

Reputation: 17
  • View blog
  • Posts: 680
  • Joined: 26-May 08

Re: Simple Multiplayer Online Game?

Posted 11 June 2008 - 11:24 PM

View Postpbl, on 11 Jun, 2008 - 10:49 PM, said:

Mensahero

can't wait to play RushHour with Cindy :D
when will you post it on your web site ?


Cindy will be out.. around 3 AM in the morning.. I guess you could play with her during that time.. :D :D

Well.. I did a search for rushHour.. I did find it.. to bad it was made in flash..

Now.. SQL Server << that thing again.. that's the reason I run away from .NET.. it took me almost two days.. to make that work.. lmao.. pretty n00b.. :crazy:

now This one is more interesting... I guess I'll read more about.. HSQLdb ..

well I need to face my enemy.. *SQL* .. :blink:

Lastly classes will start next week.. So I don't have enough time to work with it.. too bad.. but it will make sure that I won't waste my free time hanging out doing nothing.. which is a good thing.. :D Vacation is over.. :sigh:

And I'm not planning on doing something like rush Hour.. I have this idea.. a real pokemon game applet.. the one played in gameboy advance.. I starting to gather sprites, images.. used in that game.. and i'll try creating the game engine first.. that will keep me pretty busy for the next few days..
I want it to be PURE GAME APPLET.. not like browser games were you read paragraph's and given choices.. :blink:

it's perfectly hard.. but it's the best way to learn.. rather than just reading..

Thanks for the suggestions bro's.. i'll keep you updated with my progress.. :D

This post has been edited by mensahero: 11 June 2008 - 11:24 PM

Was This Post Helpful? 0
  • +
  • -

#7 pbl   User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8381
  • View blog
  • Posts: 31,956
  • Joined: 06-March 08

Re: Simple Multiplayer Online Game?

Posted 12 June 2008 - 05:49 PM

No need to implement SQL right away
You can put your problem in a flat file as objects.
Was This Post Helpful? 0
  • +
  • -

#8 mensahero   User is offline

  • I Desire...
  • member icon

Reputation: 17
  • View blog
  • Posts: 680
  • Joined: 26-May 08

Re: Simple Multiplayer Online Game?

Posted 12 June 2008 - 07:16 PM

View Postpbl, on 12 Jun, 2008 - 05:49 PM, said:

No need to implement SQL right away
You can put your problem in a flat file as objects.


Yeah.. that's a good Idea.. but somehow.. I cannot run from SQL all my life.. since this is not really a paid project or anything.. I better face that SQL.. :blink:


Implementing the SQL language is not my problem.. it's running the SQL server that causing me lots of headache.. lmao.. :blink:

.. I'm still doing some research about java basic networking.. and hopefully I could learn how to use your suggestion.. HSQLdb.. :blink: ..

..and SQL SERVER 2005 is now running fine in my pc.. lmao.. maybe I could use it with JAVA.. not sure though.. how to do it since I never tried to read something about it.. :D
Was This Post Helpful? 0
  • +
  • -

#9 pbl   User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8381
  • View blog
  • Posts: 31,956
  • Joined: 06-March 08

Re: Simple Multiplayer Online Game?

Posted 12 June 2008 - 07:34 PM

View Postmensahero, on 12 Jun, 2008 - 07:16 PM, said:

Implementing the SQL language is not my problem.. it's running the SQL server that causing me lots of headache.. lmao.. :blink:


Don't need a server with HSQLdb... and the Database engine is embedded with your Java Application

So in your Java code you "connect" to the databse "files" not a server
Was This Post Helpful? 1
  • +
  • -

#10 mensahero   User is offline

  • I Desire...
  • member icon

Reputation: 17
  • View blog
  • Posts: 680
  • Joined: 26-May 08

Re: Simple Multiplayer Online Game?

Posted 12 June 2008 - 07:41 PM

Quote

Don't need a server with HSQLdb... and the Database engine is embedded with your Java Application

So in your Java code you "connect" to the databse "files" not a server


is That possible? WOOW.. :blink: :blink: nice information.. THANKS for telling me that.. if it's all inside JAVA.. the better.. :blink: :blink:

well Since it's a database inside java.. here's my assumptions:

1. I can dynamically change data through code? send/retrieve data dynamically?

2. Well since it's embedded inside JAVA.. is it like file level connection? like access and vb6?

3. If Everything (Java files, along with the database) I uploaded in a webhost.. will the database works the same?

I'm very new to servers, htmls.. but I've learned how to setup a webhost since I need it to test my former project online..

:blink: :blink:

This post has been edited by mensahero: 12 June 2008 - 07:43 PM

Was This Post Helpful? 0
  • +
  • -

#11 pbl   User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8381
  • View blog
  • Posts: 31,956
  • Joined: 06-March 08

Re: Simple Multiplayer Online Game?

Posted 12 June 2008 - 07:55 PM

Yes
Yes
and Yes

the only draw back.... the database cannot be shared by multiple application

Your application locks it.... so only one application can access the DB at one time.

Then you have 2 choices:

HSQLdb has also a server mode... and can be run has a server...
or (the solution that I prefer) you write your own server

So your server opens the database in embedded mode and you have clients that connect to you and transmit to you (through) Java object their SQL request...

Happy to have make your day
Was This Post Helpful? 0
  • +
  • -

#12 mensahero   User is offline

  • I Desire...
  • member icon

Reputation: 17
  • View blog
  • Posts: 680
  • Joined: 26-May 08

Re: Simple Multiplayer Online Game?

Posted 12 June 2008 - 08:02 PM

well.. access too has file level restrictions.. but since I'm only doing it with probably 3 - 4 players.. this will be good..

I think I could code something like what you've suggest..

4 of them uses a single embedded database.. that only allow a single connection/transaction everytime.. well I think I can sort it out with codes.. probably.. something like.

.. open db.. send/retrieve data.. close db.. then let other user use it.. that logic seems easy.. some background threads will handle the checking if db is open or something..

.. lmao.. :blink: I can't wait to get started.. well I'm still reading some information of basic java networking.. and I've read a tutorial here that its better to plan first than jump with the code right away.. which is what I often prefer.. lmao.. :blink:

This post has been edited by mensahero: 12 June 2008 - 08:03 PM

Was This Post Helpful? 0
  • +
  • -

#13 pbl   User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8381
  • View blog
  • Posts: 31,956
  • Joined: 06-March 08

Re: Simple Multiplayer Online Game?

Posted 12 June 2008 - 08:07 PM

View Postmensahero, on 12 Jun, 2008 - 08:02 PM, said:

well.. access too has file level restrictions.. but since I'm only doing it with probably 3 - 4 players.. this will be good..

I think I could code something like what you've suggest..

4 of them uses a single embedded database.. that only allow a single connection/transaction everytime.. well I think I can sort it out with codes.. probably.. something like.

.. open db.. send/retrieve data.. close db.. then let other user use it.. that logic seems easy.. some background threads will handle the checking if db is open or something..

.. lmao.. :blink: I can't wait to get started.. well I'm still reading some information of basic java networking.. and I've read a tutorial here that its better to plan first than jump with the code right away.. which is what I often prefer.. lmao.. :blink:


Have fun son
you are the fastest learner I've ever met

but you don't need to open/close the databse...
just have a server that receive the SQL String to execute and returns a Vector of the selected rows
Was This Post Helpful? 0
  • +
  • -

#14 mensahero   User is offline

  • I Desire...
  • member icon

Reputation: 17
  • View blog
  • Posts: 680
  • Joined: 26-May 08

Re: Simple Multiplayer Online Game?

Posted 12 June 2008 - 08:11 PM

Quote

Have fun son
you are the fastest learner I've ever met


.. Funny.. my real DAD used to say that.. before my parent's got annulled.. lmao.. :blink: well the last news I've heard about him.. is 2 days ago.. they said he was dead.. then luckily.. it was just a joke.. :blink:

.. Lastly.. everytime he say that.. I end up absent in my class.. lmao..

This post has been edited by mensahero: 12 June 2008 - 08:12 PM

Was This Post Helpful? 0
  • +
  • -

#15 pbl   User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8381
  • View blog
  • Posts: 31,956
  • Joined: 06-March 08

Re: Simple Multiplayer Online Game?

Posted 12 June 2008 - 08:23 PM

View Postmensahero, on 12 Jun, 2008 - 08:11 PM, said:

.. Funny.. my real DAD used to say that.. before my parent's got annulled.. lmao.. :blink: well the last news I've heard about him.. is 2 days ago.. they said he was dead.. then luckily.. it was just a joke.. :blink:

.. Lastly.. everytime he say that.. I end up absent in my class.. lmao..

You have a strange sense of humour in the Phillies
Weird Dad you have...
anyhow my salutations to Cindy
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1