Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (109)
games submitted by our members
Games in WIP (536)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  New to the "java-gaming" scene and would look a few insights.  (Read 2451 times)
0 Members and 1 Guest are viewing this topic.
Offline loliown

Senior Newbie





« Posted 2011-04-21 06:22:16 »

Anyways a few years ago when I was 14 I had dabbled a little bit into "java" programming mostly around the game based "runescape" and had found it quite interesting making things do what I wanted and being able to use my imagination to do things that appealed to me.

I haven't done it in a few years but have recently started watching,reading, and gathering information on certain points of java that stump me (and ALOT does) but I have been thinking about going to a media arts school/graphics and design and start learning the ways of technology.

Currently after just watching a 4 hour video I had downloaded for "Beginner" programmers I had learned quite alot and i'd still like to expand on that knowledge and be able to get a headstart to the game designing career as early as possible (I am currently 17)

I have tried/looked into using other "languages" of building a game off of such as python,c++,flashscript, and java of which was my favorite. C++ was a more "advance" coding/programming language which by the means required a group of developers to get a really great game going where as I noticed an independent person can base a very good game from java and make it a success and if they felt like it they can expand and work with other developers.

Anyways currently what i'm looking to do is to be able to create a "client" for web-based applications on sites such as facebook. A popular game such as "farmville" is what i'd like to create a reflection client (of which i believe it is) and have the game be played through an application that can be downloaded onto your desktop and ran for quicker access. An example of such thing is "swiftkit" which is a client/browser that had directed linked/went to runescape and there you can play their game which is a web-client. I know that this will require VB.net and java to do such a thing and i may be over my head but i'd like to learn and or be pointed in the right direction from the pros to where i should start, wether it be basic game programming for practice/knowledge/understanding of java moreor whatever you believe i should be starting. The client idea is a main goal of mine and i'd also like to be able to get to such a point to where i can have a spot for an application i built/programmer to be placed on popular sites.
Offline Mads

JGO Ninja


Medals: 26
Projects: 3
Exp: 6 years


One for all!


« Reply #1 - Posted 2011-04-21 18:13:10 »

I wrote the runescape wrapper called Tinderbox, and stuff like that is not really that easy because of cheat-client detection and whatnot.
You'd have to run flash in swing also, which is not really that easy Tongue

Offline philfrei
« Reply #2 - Posted 2011-04-21 20:57:28 »

To use Java as a server, you'd be looking at working with Java EE, and running it with something like Apache Tomcat (easiest) or JBoss or Glassfish and probably a database for persistence (MySQL, or maybe Derby which is java-based would work though it might be considered to have poorer peformance than MySQL). It is a handful getting all that to work together, to say the least, and may not be the best choice anyway.

I've not heard of VB.Net being used with Java. I think the microsoft web server would be more likely used with C#, the microsoft version of Java.

Most folks recommend doing a simple java game (2D) before getting into client-server. There's a LOT to learn with Java & the OOP style, and it helps to have experience with that before jumping into additional layers of complications.

Depending upon your emphasis and interest, there's things like learning about graphics & working up to the math & the implementation of physics & movement & collision detection & 3D issues & perlin/simplex noise & AI & list goes on -- lots of stuff to learn about. The underlying data structures and math for most of this is transferable, whereas who knows what will be the best client-server configuration in five years.

"Greetings my friends! We are all interested in the future, for that is where you and I are going to spend the rest of our lives!" -- The Amazing Criswell
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Online loom_weaver

JGO Coder


Medals: 17



« Reply #3 - Posted 2011-04-21 22:00:20 »

To use Java as a server, you'd be looking at working with Java EE, and running it with something like Apache Tomcat (easiest) or JBoss or Glassfish and probably a database for persistence (MySQL, or maybe Derby which is java-based would work though it might be considered to have poorer peformance than MySQL). It is a handful getting all that to work together, to say the least, and may not be the best choice anyway.

Sounds like overkill to me.  If you just want a simple game server you can use Java Sockets in particular server sockets.
Offline loliown

Senior Newbie





« Reply #4 - Posted 2011-04-22 07:53:12 »

Thanks for the posts guys, just purchased "java for dummies" hoping to get a way better understanding of it all. and MYSQL will most likely be used for the data saving and such.
Offline ra4king

JGO Kernel


Medals: 342
Projects: 2
Exp: 5 years


I'm the King!


« Reply #5 - Posted 2011-04-22 08:31:34 »

I don't really like to use databases and the like. I have created my own "database" class that stores everything in simple text files (with the option to encrypt it Grin ) Anyway, just my 0.02c Wink

But yeah, welcome to the Java gaming community, loliown! I recommend to start small, try at first replicating a game to strengthen and broaden your skills, then you can move to on to more advanced and complex games. Good luck!!

Offline philfrei
« Reply #6 - Posted 2011-04-22 20:27:34 »

Sounds like overkill to me.  If you just want a simple game server you can use Java Sockets in particular server sockets.

I remember looking briefly into this approach earlier before plunging into learning about JSP & Servlets. I hadn't realized that it was powerful enough for gaming! loom_weaver, do you know of active examples of games where sockets are used? I'd love to see this in action.

Even so, it is going to require multithreading & file handling and other aspects that usually come later in the Java learning process, so it would be good to get one's head around OOP and concepts like weak-coupling first. "Java for Dummies" is a reasonable way to go for this. But when some of their sketchy code examples don't work, be sure and give grief to the folks at their "JavaRanch" http://www.coderanch.com/forums

"Greetings my friends! We are all interested in the future, for that is where you and I are going to spend the rest of our lives!" -- The Amazing Criswell
Online Riven
« League of Dukes »

JGO Overlord


Medals: 754
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #7 - Posted 2011-04-22 20:40:47 »

I remember looking briefly into this approach earlier before plunging into learning about JSP & Servlets. I hadn't realized that it was powerful enough for gaming! loom_weaver, do you know of active examples of games where sockets are used? I'd love to see this in action.
This really got me scratching my head.

If anything, sockets should be used for gaming. In fact, everything is built on sockets, including JSP & Servlets.

Sockets basically mean TCP/IP is used, and TCP/IP is used almost everywhere these days, even in quite a few FPSs.

FLV

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline philfrei
« Reply #8 - Posted 2011-04-23 02:19:08 »

Well, I see you point, Riven. I guess my conceptions on this are shakier than I realized. Sad And I am grateful for being corrected.

Can I rephrase? When I play a Jagex game, for example, from a desktop icon, does it link up to the server via Java SE libraries (e.g., java.io.*, java.nio.*)? Does the server side manage clients via these Java SE libraries? Did they build their own server? Do game hosts tend to use prebuilt frameworks?

My conception was that to handle the server side, one would at the minimum write a Servlet reading XMLHttpRequest or HttpServletRequest objects passed in via Tomcat. But even that is "overkill"?

Thanks! (I hope I'm not so far off that I'm in "eye-rolling" territory.)

"Greetings my friends! We are all interested in the future, for that is where you and I are going to spend the rest of our lives!" -- The Amazing Criswell
Offline loliown

Senior Newbie





« Reply #9 - Posted 2011-04-24 15:25:12 »

Thanks for all the positive feedback and such Smiley

Anyways looking to purchase quite a few books while i attend class from 8:30 to 11:30 i'll be sure to be reading up on java Smiley
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline securobo

Junior Newbie





« Reply #10 - Posted 2011-04-24 19:41:38 »

Java a Beginner's Guide is an excellent book. The authors site is http://herbschildt.com/. amazon.com always has a great price. 4th Edition is the current and the next version updated for Java 7 will be released I think in July this year.
The book is not just an excellent read, but the author has substantial experience in C based languages. He has several books on other languages and every book follows the exact same guidelines including most of the same exercises. So if you later switch from Java to C# to C or to C++, if you get the other books, it will be easy to remember the structure, which will allow you to transition between the languages. In my opinion, some of the best books ever written. Also, the books are always available as a Beginner's Guide, or a Complete Reference. Personally, I suggest the Beginner's Guide, but if you follow up with one of the Complete References, you will notice it is almost the same with a great deal of more detail. Again, the entire idea I believe in his series of books, is to keep everything consistent and transferable between languages. If you choose to switch to C++ when you discover it might be necessary for a specific game, the transition will be smooth. You will be able to reuse just about everything you learned in Java and vice versa. I highly recommend you give Java A Beginner's Guide 4th Edition a try, even if you are a veteran programmer. Clear and concise book. Good luck.
Offline avm1979
« Reply #11 - Posted 2011-04-24 20:02:23 »

Well, I see you point, Riven. I guess my conceptions on this are shakier than I realized. Sad And I am grateful for being corrected.

Can I rephrase? When I play a Jagex game, for example, from a desktop icon, does it link up to the server via Java SE libraries (e.g., java.io.*, java.nio.*)? Does the server side manage clients via these Java SE libraries? Did they build their own server? Do game hosts tend to use prebuilt frameworks?

My conception was that to handle the server side, one would at the minimum write a Servlet reading XMLHttpRequest or HttpServletRequest objects passed in via Tomcat. But even that is "overkill"?

Thanks! (I hope I'm not so far off that I'm in "eye-rolling" territory.)

You generally wouldn't use HTTP for games, unless its for something that doesn't care much about response time/lag, like posting a high score.

I wouldn't even consider using Tomcat for a real-time multiplayer game, it's going to be way too slow. You *could* try do some things like keeping HTTP connections open and reading/writing to them continually but it's more trouble than it's worth.

For games you're looking at either TCP or UDP. This means custom server/client code, or some gaming-oriented framework built using either one. HTTP is built on top of TCP btw, but is just unsuited for gaming.

Offline ra4king

JGO Kernel


Medals: 342
Projects: 2
Exp: 5 years


I'm the King!


« Reply #12 - Posted 2011-04-24 20:24:31 »

@securobo
That's the book that I first bought! That book taught me Java Grin Grin Grin

Offline Mads

JGO Ninja


Medals: 26
Projects: 3
Exp: 6 years


One for all!


« Reply #13 - Posted 2011-04-25 12:10:32 »

Just contributing to the discussion about using java for game-servers:

Before getting here I used to hang out over at some forums where everyone made servers in java to emulate Runescape, with the
original runescape client. We chose a client-revision, and started examining it.
The first working servers were made with regular IO in java, and saved all data in .txt files, and it worked! 30 - 50 people on a strong machine.. That server was in around 10 classes, and 10K lines of code, filled with content. In this design, each client got it's own thread.
Later we had some educated people looking into it, and they wrote some servers that were WAY different! They used Netty, Mina and MySQL and these servers could handle over 2000 people at once. These used NIO libraries, so you don't have to have 2k threads running at once.
At last (just before I left) a guy wrote a server that used the old design with the only difference that he used NIO to go around all those threads (and various other different approaches at small things to speed up updating), and that also held 2000 people..

If you're doing it efficiently, you don't need other libraries to get nice server performance in java. If you dont need such a vast amount of players on the same server you could even do it with IO, and thread-per-client.

Offline ra4king

JGO Kernel


Medals: 342
Projects: 2
Exp: 5 years


I'm the King!


« Reply #14 - Posted 2011-04-26 00:52:47 »

I don't understand how you can design a server without doing it thread-per-client. How is that possible? My understanding of NIO is that they are just a bunch of classes that you can use to buffer data. Sounds like a faster InputStream to me, unless I'm getting things mixed up Huh

Offline Mads

JGO Ninja


Medals: 26
Projects: 3
Exp: 6 years


One for all!


« Reply #15 - Posted 2011-04-26 15:35:58 »

I don't understand how you can design a server without doing it thread-per-client. How is that possible? My understanding of NIO is that they are just a bunch of classes that you can use to buffer data. Sounds like a faster InputStream to me, unless I'm getting things mixed up Huh

Basicly, when someone connects you put them on a list. Then each time you cycle you run through the list, and check who needs to be updated.
https://svn.assembla.com/svn/runesource/trunk/RuneSource/src/
This is a simple set-up of a runescape emulator that uses NIO. Server.java is the main class.
As it is here it was benchmarked to 2000 players spamming random packets. Ofcourse you get way more lag when each packet is processed Smiley

Offline ra4king

JGO Kernel


Medals: 342
Projects: 2
Exp: 5 years


I'm the King!


« Reply #16 - Posted 2011-04-26 23:47:22 »

Whoa that looks....complicated. I shall look into this gem. Thanks! Smiley

Offline counterp

Senior Member


Medals: 11



« Reply #17 - Posted 2011-05-11 07:08:05 »

I don't understand how you can design a server without doing it thread-per-client. How is that possible? My understanding of NIO is that they are just a bunch of classes that you can use to buffer data. Sounds like a faster InputStream to me, unless I'm getting things mixed up Huh

Basicly, when someone connects you put them on a list. Then each time you cycle you run through the list, and check who needs to be updated.
https://svn.assembla.com/svn/runesource/trunk/RuneSource/src/
This is a simple set-up of a runescape emulator that uses NIO. Server.java is the main class.
As it is here it was benchmarked to 2000 players spamming random packets. Ofcourse you get way more lag when each packet is processed Smiley

perhaps it would be more beneficial to use attachments then to have a map of SelectionKeys to Clients.

and as for the actual processing of players and npcs wouldn't it be more realistic to at least multithread the processing if you want reasonable speeds with 2000 people? (i see it prints out a warning message when the server cannot perform all of its operations in the designated cycle time)

also I don't like the StreamBuffer class.. in this case i feel speed is most important, you want to keep method calls within methods to a minimum (perhaps just ensuring capacity is required, you shouldn't have to readByte(), readByte(), readByte()) and what's with all that 'ValueType' stuff. it should just be split into different methods.

that was just a quick glance
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

CogWheelz (18 views)
2014-07-30 21:08:39

Riven (25 views)
2014-07-29 18:09:19

Riven (15 views)
2014-07-29 18:08:52

Dwinin (12 views)
2014-07-29 10:59:34

E.R. Fleming (33 views)
2014-07-29 03:07:13

E.R. Fleming (12 views)
2014-07-29 03:06:25

pw (43 views)
2014-07-24 01:59:36

Riven (43 views)
2014-07-23 21:16:32

Riven (30 views)
2014-07-23 21:07:15

Riven (31 views)
2014-07-23 20:56:16
List of Learning Resources
by SilverTiger
2014-07-31 18:29:50

List of Learning Resources
by SilverTiger
2014-07-31 18:26:06

List of Learning Resources
by SilverTiger
2014-07-31 13:54:12

HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!