New Guy Here. Any Suggestions?

Hello. I’m SolarLune, an independent game developer (though I haven’t released any games except for one :wink: ). I’ve been looking toward jME for awhile now, but I just recently decided to give it another try after downloading the SDK previously. It looks very interesting, and seeing what’s been done with it is quite impressive and encouraging.



I am not new to coding, so I’m prepared to get down to the grit of coding, though I’ve never really looked at Java before. I’m going to look at some tutorials to learn more about the language before really getting into jME. Does anyone have any tips or suggestions for a new user like me to help learn?



For example, where exactly does the jMonkeyPlatform scene editor fit into games? Don’t I have to instantiate everything in code? Or do the things placed in the scene editor work directly in the game, and if so, how do I script those objects? Also, I’ve heard that the jME’s got native .blend file loading support (before you distribute the game). So, how would I load up a blend file model or scene? Can I do so in the scene editor, or do I have to do so in code?

First, forget the “script” word, jME is a powerfull object oriented engine, if you are good with object oriented programming, then you won’t have problems. About the scene editor and other stuffs in jmp, you create your stuffs with that, and you just load them in source code, and then you start to program the game logic. About .blend files, you can load them directly in jmp, it has a BlenderLoader built in. You can both load your .blend files or other model formats directly in source code, or in SceneComposer in jmp. jMonkeyPlataform is a friendly plataform for the game development team, it can be used both the modeler and the programmer and etc.



Here is the SDK documentation : https://wiki.jmonkeyengine.org/legacy/doku.php/sdk



You answer your asks here http://www.hub.jmonkeyengine.org/wiki/doku.php/jme3:faq



And the engine documentation itself it here : https://wiki.jmonkeyengine.org/legacy/doku.php/jme3#tutorials_for_beginners

Most of it is explained in the manual (press F1) which contains the info in the wiki here. For getting into coding jme (yeah, you will need java knowledge or pick it up along the way using :google:) have a look at the jme3 beginner coding examples (which are also in the manual).



As you mention, most of what you do is code but theres always the question of getting models in and getting them to work properly, this is where the SDK comes in. Theres lots of things that just are specific to the engine (like particle emitters, physics collision shapes etc) so they have to be done in tools that are made for the engine. So you can add particle emitters, create collision shapes, adapt materials and textures, create compatible fonts for the engine and much more that you will want to do at some time in the development process :wink:



Recently I added direct “coding in the scene” to the SDK via custom controls support (basically some java classpath magic to get the freshly compiled code into the scene), maybe this short video I did is a good example on how the SDK can now (and even more so in the future) be used for combined coding and visual editing:

Custom Controls - YouTube

(IDE in development mode with video recording → slow)



Edit: Oh and yeah, you can load these in code, the SceneExplorer displays 1:1 what you will have in code later. So you can access a physics control for a model easily like this:
[java]
Spatial model = assetManager.loadModel("Models/MyModel.j3o");
RigidBodyControl rigidBody = model.getControl(RigidBodyControl.class);
rigidBody.setLinearVelocity(Vector3f.UNIT_Y);
[/java]

Thanks, you two. Now, I’m just starting out with Java, so I was wondering - what’s the equivalent of include / import statements? I mean, I know that you can have source code spread out over more files than just the main source file - how would you include those files? Also, what’s the main idea behind multi-object projects? I mean, I would think that you would create all objects that you would need to create in the Initialization function, and then call update all of those objects (or do it with a Task?).



EDIT: Ah, I see in the Best Practices log that implementing controls into spatials (objects) run the behaviors that you want to implement, and that you don’t have to manually call for updates on them at all. Interesting. That solves that question. :slight_smile:

Also you will need some shaders: http://code.google.com/p/jme-glsl-shaders/

The import keyword is just import. Note that you either import individual classes, or you import entire packages. For instance, you could use

import MyGame.FirstPackage.MyClass;

or

import MyGame.FirstPackage.*; //all classes belonging to FirstPackage



I suggest reading up a bit on OOP and Java practices. Notably, classes and objects. By the time you have written a game, you will have lots and lots of source files containing lots and lots of classes. You also might not instantiate instances of those classes (the objects) all at the same time, in the initialize method. In my game, I only instantiate objects when needed, for instance when a user actually clicks on new game.

Thanks for the advice, you guys. I’d also like to know if there’s a way to not launch the launcher when I’m testing a game out? I mean, I don’t really care so much about the settings when I’m just testing some stuff out. :stuck_out_tongue:

You can turn that off, I did but I cant remember how. Will have a look tonight.

@mifth said:
Also you will need some shaders: http://code.google.com/p/jme-glsl-shaders/

3 Likes

@normen - LOL - What do you mean?



Also, I was wondering how the SceneComposer fits into the game dev. workflow? I mean, how would I get the scene made with the scene composer to appear when I start the game (or otherwise set the current scene to be the one that I’ve already created)? Any ideas?

Theres absolutely no need for a newbie to mess with shaders, especially not some untested external ones that might cause issues themselves, just using the Materials with default ones will work fine.

I answered your other questions in the first post already.

@normen - That’s a cool video. After watching it all the way through, I see that it shows a lot about a normal jME3 workflow. Sorry, but I still didn’t see how you would, for example, get the windmill that’s rotating in the scene explorer window to appear in the game? I think that according to your post, you said that you would just create it in code, right?

You place it in a scene that you then load in code. You could also construct the scene in code completely but as said everything thats in the j3o file is 1:1 what will be in your scene graph later.

Okay, so you load the scene in via code? The same scene that you make with Scene Composer. I get it. Thanks!

Yes. You load your models with the assetManager in source code.

I wrote the code in my first post… :roll:

Oh, so that code is for scenes too? I thought it would be a different function to load scenes. So, loading and placing scenes is the same as loading and placing models, huh? I guess I’ll have to see for myself instead of bothering everyone. :stuck_out_tongue: Thanks!

Both models and scenes are .j3o binary formats, and they are nodes, and you load them the same way.

Okay, I see. I’m gonna have to take a closer look at this. Thanks again!

Okay, so I’m going through the Beginner’s tutorial, and I think that I might have found an issue - it’s never clearly stated what the variable ‘rootNode’ is. I know it’s the root scenegraph node in the scene, but it’s never explained where the rootNode variable comes from (a constant? It’s not defined in the tutorial example code, although it works).