Sign in to follow this  
helldoggie

[java] some java game questions

Recommended Posts

helldoggie    122
Hi, I already made some simple games in java and now I want to make a 2D rpg-game. You can walk around and do some things like battle enemys, opening chests and stuff like that. Now I want something in it like a textbox where the user can typ in commands. But I don't know how to do this. Would you use the existing textbox from java or write one on you own? And is it the same for 3D games? I'm also busy with networking trying to do something with sockets. When you make a MMORPG how do you send data to the clients? Do you use broadcasting? I have read some articles and it seems that it is best be done with UDP? If someone know a good article about it, please tell me. Thanks

Share this post


Link to post
Share on other sites
Son of Cain    480
Hi,

For the network part, broadcast is evil - do multiplexing with Java NIO: asynchronous, non-blocking IO. I use, for my current game, Apache's MINA for the networking, because it provides a high level abstraction of Java NIO's functionalities, and also supports custom protocols, object encoding, and so on. Take a look at their project's page for more information.

As for the text box, it really depends on your requirements. If it's in-game user interface, you'll probably want to write your custom "component" for it, depending on the rendering layer you're using (OpenGL? Setup a semi-transparent quad!). 3D games are no exceptions, you wouldn't use the default swing components in them, not because you can't (JOGL supports awt, JME is an engine who has swing support even using LWJGL), but because it's... ugly for a game. =D

Son Of Cain

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this