Need docs for game

the only distinction between locally and over the internet is the IP address.  However, it can become more complicated these days with routers, firewalls, etc that can cause headaches
yeah I had some troubles setting up my apache server back when I had 52kbit/s dailup and windows xp I had to open the ports on my connection settings in my network places (and I had no one except some helpful people on irc to help me) I knew nother about internet IP/tcp;utp;dns I knew nothing, It took me like 2 weeks but I got it working ;) now I've got 64kbit/s and its more of a downgrade and only works propperly half of the day no p2p downloads (and 0.01bytes/s upload speed to stop me from using bittorrent with encryption and a custom port) Its just South Africa  :'( Anyways my new ips also doesn't allow me to open any ports on my router and people from outside can't even ping my router :(

Is there a test that I can run for example I want to run ChatServer app on my pc (my internal ip = 192.168.8.130) and I want to connect to it with a ChatClient app on my pc. On my brother's pc (his internal ip is 192.168.8.35) I want him to be able to connect to me too and chat with me?

You can likely leave it binding localhost, but when you say connect you need to pass the remote machine's IP address you want to connect to.

Good job. :slight_smile:

I’m still some what confused :stuck_out_tongue: erm… how would I do that and why does JGNServer need to use two ports (I ran my server on my pc and I ran my client on my pc I entered 192.168.8.130 to connect to myself but it couldn’t connect if i told it to connect to 127.0.1.1 then it connected :? ) yeah lol about 127.0.1.1 just now it was 127.0.0.1 like its suppost to be…



edit:

I keep on spelling ‘just now its was…’ wronge whats up with me :stuck_out_tongue:

JGNServer and JGNClient are convenience classes for client/server style communication.  They take two MessageServers (or you can use the convenience constructor and pass two SocketAddresses and it will create the MessageServers for you), a reliable message server (typically TCPMessageServer), and a fast message server (typically UDPMessageServer), but either one of these can be null and it will just use one or the other.  In most games you'll likely need to use both for efficiency, but like I previously stated, those classes are just convenience classes wrapping the core of JGN and aren't required.

wo0O0ot I got it working. I don't know what it was… could have been a firewall though but its working now :smiley:

If I try to run a MenuState with this:


MenuState menustate = new MenuState("ms");
GameStateManager.getInstance().attachChild(menustate);
menustate.setActive(true);


I get this: (the openal i don't have a issue with unless its causing this problem...)


Failed to open device (/dev/input/event5): Failed to open device /dev/input/event5 (13)

Failed to open device (/dev/input/event4): Failed to open device /dev/input/event4 (13)

Failed to open device (/dev/input/event3): Failed to open device /dev/input/event3 (13)

Failed to open device (/dev/input/event2): Failed to open device /dev/input/event2 (13)

Failed to open device (/dev/input/event1): Failed to open device /dev/input/event1 (13)

Failed to open device (/dev/input/event0): Failed to open device /dev/input/event0 (13)

Linux plugin claims to have found 0 controllers
2007/03/16 08:44:20 com.jme.system.lwjgl.LWJGLDisplaySystem <init>
INFO: LWJGL Display System created.
2007/03/16 08:44:20 com.jme.renderer.lwjgl.LWJGLRenderer <init>
INFO: LWJGLRenderer created. W:  640H: 480
2007/03/16 08:44:20 com.jme.renderer.AbstractCamera <init>
INFO: Camera created.
2007/03/16 08:44:20 com.jmex.sound.openAL.SoundSystem <clinit>
INFO: DETECT OPERATING SYSTEM
2007/03/16 08:44:20 com.jmex.sound.openAL.SoundSystem <clinit>
INFO: CREATE OPENAL
open /dev/[sound/]dsp: Device or resource busy
open /dev/[sound/]dsp: Device or resource busy
open /dev/[sound/]dsp: Device or resource busy
2007/03/16 08:44:20 com.jmex.sound.openAL.SoundSystem initializeOpenAL
SEVERE: Failed to Initialize OpenAL...
org.lwjgl.LWJGLException: Could not locate OpenAL library.
   at org.lwjgl.openal.AL.create(AL.java:153)
   at org.lwjgl.openal.AL.create(AL.java:104)
   at org.lwjgl.openal.AL.create(AL.java:189)
   at com.jmex.sound.openAL.SoundSystem.initializeOpenAL(SoundSystem.java:96)
   at com.jmex.sound.openAL.SoundSystem.<clinit>(SoundSystem.java:86)
   at com.jmex.game.StandardGame.initSystem(StandardGame.java:222)
   at com.jmex.game.StandardGame.run(StandardGame.java:131)
   at java.lang.Thread.run(Thread.java:619)
2007/03/16 08:44:20 com.jmex.sound.openAL.SoundSystem <clinit>
INFO: CREATE LISTENER
2007/03/16 08:44:20 com.jmex.game.state.GameStateManager create
INFO: Created GameStateManager
2007/03/16 08:44:20 com.jme.util.lwjgl.LWJGLTimer <init>
INFO: Timer resolution: 1000 ticks per second
2007/03/16 08:44:20 com.jme.scene.Node <init>
INFO: Node created.
2007/03/16 08:44:20 com.jme.renderer.AbstractCamera <init>
INFO: Camera created.
Exception in thread "main" java.lang.NullPointerException
   at org.lwjgl.opengl.GL11.glMatrixMode(GL11.java:1897)
   at com.jme.renderer.lwjgl.LWJGLCamera.doFrustumChange(LWJGLCamera.java:175)
   at com.jme.renderer.lwjgl.LWJGLCamera.apply(LWJGLCamera.java:133)
   at com.jme.renderer.lwjgl.LWJGLCamera.<init>(LWJGLCamera.java:73)
   at com.jme.renderer.lwjgl.LWJGLRenderer.createCamera(LWJGLRenderer.java:182)
   at com.jmex.game.state.CameraGameState.initCamera(CameraGameState.java:111)
   at com.jmex.game.state.CameraGameState.<init>(CameraGameState.java:76)
   at jmetest.game.state.MenuState.<init>(MenuState.java:67)
   at org.zapto.scar.slayer.Slayer.main(Slayer.java:19)



edit:
I also found out now that StandardGameState is called CameraGameState. Is there any good samples any ware of good menu-states? or simple ones...

So I’m actually finally ready to start the programing of the base of my game. XD I’m wondering what type (simplegame/basegame/multithreading/standardgame) does it matter that much? rollarama was written with multithreading right? I though about trying to use standard game but I hope it doesn’t get to complex if it does I’ll just run back to simple-/base game. :wink: Is there maybe a hello world app that I can run that runs off/implements jme+jgn2+jmephysics2 ?



Edit:

I read a little more… StandardGame is a form of multithreading so my question up there is actually ‘rollarama was written with StandardGame right?’

…I don't remember. :o



StandardGame is what I would suggest using and the level of "multithreading" you actually do is really up to you in the way you implement StandardGame.  Realistically, there's nothing forcing you to do any true multithreading even when you use StandardGame.



There used to be a few examples of jME-Physics-Networking in the source but I think when I re-wrote the system they never got back in.  As far as examples that use StandardGame and jME-Physics there are a couple tests that have recently made their way into jME-Physics that do so.

Ok so I wrote my own gamestate for the mainmenu. but I don't have any idea how to show the mouse pointer (I think there is a mouse test some where in the jmetests so I can maybe try to implement that test…) but I have really got no idea how to make it select some thing like a box for new game. I would like to make a mainmenu like war3/rollarama. (you know, it uses the mouse and not keyboard hotkeys like I currently do :stuck_out_tongue: and its got 3d rendering in the background not like me All I have as 2d text) I don't know if I'm spending to much time on this (gamestates) and not on the thing I want to do jme-physics2 combined with jgn2… I guess I don't know how to do both :expressionless:

Here is the code for my gamestate…

import com.jme.scene.Node;
import com.jme.scene.Text;
import com.jme.system.DisplaySystem;
import com.jmex.game.state.GameState;

/**
 * @author Willem Dreyer
 *
 * This class loads the content in the main menu
 */
public class SlayerMainMenuGameState extends GameState {

   protected Node rootNode;
   private SlayerMainMenuHandler input;

   public SlayerMainMenuGameState(String name) {
      this.name = name;
      System.out.println("Started to load main menu");
      rootNode = new Node("SlayerMainMenuGameState: RootNode");

      initInput();
      initText();

      System.out.println("Done with loading main menu");
   }

   private void initInput() {
      input = new SlayerMainMenuHandler( this );
   }

   private void initText() {
      Text text = Text.createDefaultTextLabel( "Main Menu: info" );
      text.print( "Main Menu :)" );
      float regtehoogte = DisplaySystem.getDisplaySystem().getHeight()-text.getHeight();
      text.getLocalTranslation().set( 0, regtehoogte, 0 );
      text.updateRenderState();
      rootNode.attachChild( text );
   }

   public void cleanup() {
   }

   public void render(float tpf) {
      DisplaySystem.getDisplaySystem().getRenderer().draw(rootNode);
   }

   public void update(float tpf) {
      rootNode.updateGeometricState(tpf, true);
      input.update(tpf);
   }
   
   public Node getRootNode() {
      return rootNode;
   }
}

All of your questions will be answered by going through the tests in jME.  I've created multiple tests using StandardGame with GameStates and even a special test for MenuState.



The problem you're getting with the NullPointerException has to do with code being executed outside of the OpenGL thread that is required to be in it.  Take a look at GameTaskQueueManager as a means to interject things from an outside thread into the OpenGL thread (many if not all of the StandardGame examples use this).

Well, I'm in the process of finally creating an official web site for Captive Imagination (the parent of all my projects) so when that is finished I'll be more diligent about getting tutorials, faqs, etc. out to help people better understand the APIs.

Well Good luck XD I've seen you have a lot of projects … I'm looking forward to see how it will look and the content on it  :D.

I've got a good base for my game now. I've got a question and a problem.



I don't know if I'm giving enough information but here it is anyhow… I'm in my 'singleplayer' state and if I leave the state in this way


if (KeyBindingManager.getKeyBindingManager().isValidCommand("exit", false)) {
         // Here we switch to the menu state which is already loaded
         GameStateManager.getInstance().activateChildNamed("mainmenu");
         // And remove this state, because we don't want to keep it in memory.
         GameStateManager.getInstance().detachChild("singleplayer");
}

then my "mainmenu" does not render that good, only the text it rendered not what every is in there example the skybox...

On to my question ... Is it possible to set your game settings example fullscreen or not from loading a file with bufferedreader or just static commands at the start of the app?

Edit:
I've noticed that my cursor renders fine I think it can be one of two things either that the state is not being properly loaded or I need to add some node.updateRenderstate or some thing like that

If I understand correctly what you're asking, yes, you can change anything in GameSettings programmatically before starting the game:


StandardGame game = new StandardGame("Test");
game.getSettings().setXxx();
game.start();



It's important to note though that changes to the settings are persistent, so if you change it to fullscreen, the next time you load even if you don't explicitly set the option it will default to what you last had set.  You would have to explicitly set fullscreen to false or clear the settings in order to revert back.

Cool, this is how I currently clear the settings that is being loaded

try {game.getSettings().clear();} catch (Exception e) {e.printStackTrace();}

well I've not tested it but yeah…

that should be fine.

This is how I launch jme:

java -cp ./jme-awt.jar:jme-collada.jar:./jme-editors.jar:./jme-effects.jar:./jme-font.jar:./jme-gamestates.jar:./jme.jar:./jme-model.jar:./jme-scene.jar:./jme-sound.jar:./jme-terrain.jar:./jmetest-data.jar:./jmetest.jar:./jme-ui.jar:./lib/jinput.jar:./lib/jogg-0.0.5.jar:./lib/jorbis-0.0.12.jar:./lib/junit-4.1.jar:./lib/lwjgl_applet.jar:./lib/lwjgl_fmod3.jar:./lib/lwjgl.jar:./lib/lwjgl_test.jar:./lib/lwjgl_util_applet.jar:./lib/lwjgl_util.jar:./lib/native-mac.jar: -Djava.library.path=./lib classtoberan


What must I add to for both jme-physics2 and jgn2? (I can throw the physics engine's natives with jme's natives all in one folder if that would be easier...)

jME-Physics is a little more complicated, but JGN is simply the jgn.jar. :slight_smile:

my computer doesn't like me anymore but why?

StandardGame game = StandardGame("GAMESERVER", StandardGame.GameType.HEADLESS);
game.start();

gives me

2007/03/19 07:33:21 com.jme.app.AbstractGame assertDisplayCreated
SEVERE: Display system not initialized.
2007/03/19 07:33:21 com.jmex.game.DefaultUncaughtExceptionHandler uncaughtException
SEVERE: Main game loop broken by uncaught exception
com.jme.system.JmeException: Window must be created during initialization.
   at com.jme.app.AbstractGame.assertDisplayCreated(AbstractGame.java:112)
   at com.jmex.game.StandardGame.run(StandardGame.java:132)
   at java.lang.Thread.run(Thread.java:619)

it used to work fine I think :P
Edit: I'll update via cvs tonight... that might help...