I think - how should I make a game 3D scene for my game using JME3. I created a 2D videogame before and I used Tiled for my previous project. In according to my experience, I created my game worlds using different layers - it is very comfortable to make layers for:
graphic (background, furniture, foreground and so on),
game objects (simple points for spawn places for NPC and collectables, rectangle areas for some triggers, door and chest opening zones and so on),
Lights (simple semitransparent circles on a separate layer)
Physic (colliders)
Steps-sounds layer. Here I make rectangle zones. Every zone has a specific sound for steps (stone floor, wet soil, sand)
Camera walls layer. When the player comes to some places â camera cannot follow him â it stays in the last place and can only change the target angle (when we are discussing a 3D game â in 2D game the camera stays only).
Navigation mesh layer.
Comments layer â here I was written comments for me.
It is very comfortable, because I can hide/switch off some of the layers by the map designing.
When I have started to think about porting of my 2D game in 3D using JME3 â I cannot understand, how should I design my game worlds using SceneComposer window. I thought I can make nodes, like âlayersâ in 2D directly in the main scene node and switch on/off some of them by the development phase. One node for physic, one for static meshes and lights, one for game objects, one for comments, one for step sound zones. But I cannot find a check-box to disable some of the nodes in the SceneExplorer tab of the SceneComposer-window. I donât need to see the physic colliders every time I want to shift an enemy spawn place. And I have started to think â maybe I should use the SceneComposer in an another way. How another game developers design 3D worlds in SceneComposer? How they devide the complex world in single layers/nodes?
Give me please an advice â I never created 3D games before.
I would recommend using blender for creating 3D levels. You can tag objects with userdata to indicate they do something special, and then read the userdata with code when loading the scene.
Iâd have to know what sort of game youâre aiming for. I recommend using skyboxes for the background if possible, and regular meshes for decorational/foreground.
You can use empties for spawn locations. For area-bound effects, add a cube mesh, tag it, and extract the world bounding-box with code.
I believe blenderâs GLTF exporter will export lights.
Just tag certain meshes in the scene as physical with a certain mass.
Again, use a cube mesh or something similar to define the area for this effect.
This is a bit trickier, but it sounds like you could again use a cube mesh to define where the camera is allowed to be.
I believe this can be generated with code⌠youâd have to look at navmesh usage in the wiki. There are a handful of forum posts on navmeshes, too.
Blender has the annotations tool for commenting, but I wouldnât recommend it unless youâre using a stylus.
Blender has collections for this. For example, you can add all your physics objects to a âphysicsâ collection, and toggle the visibility of all objects in that collection at once. I believe the GLTF exporter also has an option to only export visible objects.
Hmm, I didnât think about using of Blender for the whole map creation.I thought I would make only world pieces and assembly then in the JME3 in the SceneComposer. But maybe it is really better to make all the game worlds in Blender. I think I need to test, how a Blender-project can be exported in JME3.
The idea to tag some meshes like physic is not very comfortable - I need mark manually every mesh I want to use as a collision body. It will be better, if by export meshes from a same collection can receive automatically a String-user-data with the collection name. It would be the best way.
I really donât know all the Blender-features and maybe I need to investigate the export-import pipeline between Blender and JME3 manually.
Export from blender as gltf. Thatâs the best way.
If you use JMEC for your reading of gltf then there are even ways to setup âlive loadingâ so that when you export from blender it will reload the gltf file so you can see what it looks like. (Including running any jmec post-processing scripts you may have configured.)
Blender also supports linking objects. So you can create objects in like a library and then just link them into your scene⌠this means you can just update the original to change something instead of editing all of the copies.
I cannot 100% promise that jmec works correctly with this since the last time I tested it (5 years ago?) their were bugs in Blenderâs gltf exporter with respect to linked objects. Hopefully those have been fixed now.
With a JMEC post-proc script, you can also tag objects to be saved as separate child j3os. For example, if you link the same tree over and over 500 times in your scene, you can tag it as a JME linked asset and it will get saved as a separate j3o and merely linked into the main scene. (This can make source control of assets easier to manage.)
You can do certain things with the SceneComposer but differently. You can definitely have your layers but you call them Nodes here. A node is an empty thing, like an anchor, and you attach stuff to it like a Geometry (your model), AudioNode (to play audio), ParticleEmitters, and RigidBodys (but itâs a control, not a Node). So something like:
You can use AssetLinkNodes to link other files. So for example you have a level1.j3o (j3o is the scene file format) and player1.j3o, and town.j3o you can link them into one chapter1.j3o file and you can still edit them manually and when you change one j3o, because of the AssetLinkNode they will bring the change with them next time you load them.
As other have said you can also use Blender to put together your levels in Blender and export it.
If you use SceneComposer, during editing you can hide a âlayerâ (a.k.a) Node by selecting it and setting its cullhint to Always on the properties panel on the right.
For my self, Iâm more of a pipeline guy, so I wrote simple Java files for me that âpreparesâ j3o files by loading the gltf/glb file, adding controls, other nodes, etc to it from code and saving them as a j3o file. This way if I edit the model then running one simple task reconstructs all my j3o files from scratch within a second.
Letâs say you prepare a player.j3o with rigidbody, particleEmitter, audioNodes, etc⌠then you can either add it to your scene or link it. Adding means it copies it but if you modify player.j3o the changes wonât be reflected. Linking means that it will load the player.j3o so if you made changes they will appear. This uses AssetLinkNode under the hood so you can do it programmatically too.
You have solved my problem in this sentence. I have tried to find something like âhide nodeâ by a right click on the node under the Scene Root in the SceneExplorer tab. But I should simply select another local cull hint in the Node-properties. Thanks!
Do you know â I also planned to use nodes in JME3 like layers in Tiled (2D). Chests, doors, spike traps, mountains of gold and enemies â they all are only empty nodes with user data â like I was mading maps in 2D. The meshes for the entities will be created from the code in the node positions. Maybe the nodes will have meshes in SceneExplorer â but only to be sure, that the model after the creation from the code received the right orientation and will have enough free place around.
Of course, I know about the difference between adding and linking a model in JME3. I donât know how it will be work by Blender-exporting, but I think I will not use Blender for creation of game world â only single meshes. I think it is better to assembly the world in JME3 SceneComposer window â So I can see the whole world in the editor like it will be shown in the game. I also think â even if I will make the game world in Blender â I will also need to add or adjust something in the SceneComposer of JME3. I think I cannot absolutelly avoid SceneComposer. Sometimes I can forget to triangulate a mesh in Blender before exporting â If I create a whole map in Blender â I will need to reexport the whole world and adjust some elements again in the SceneComposer. But If I forget to triangulate a single mesh â I can simply reimport the single mesh and nothing to do in the SceneComposer.
There is no traditional enable/disable or show/hide node in JME. In the game if you want to disable something then you need to detach it. CullHint is just a quick tricky way to hide something quickly in the editor. Donât forget to reset it back to the original value which is usually Inherit. CullHint just tells the engine to not tot render stuff but itâs still there and itâs still updating in the background.
I think I will not have problems with that. Only meshes nodes and lights (they will be also included in the meshes node) must be left as âvisibleâ. Other nodes are used only for game map creation by the map loading. They will be removed anyway after the map uploaded and all the entities are created.
I been a long timeâŚrough few years but when I started back my project had built a level in blender using arrays, it was so damn long that I forgot what I was doing and applied the arrays before texturing the sectors, thought of quitting because life and illness but then I discovered DOOM builders, UDB specificallyâŚthey are not going to be good for detailed outdoors but indoors u can work some magic with a little thought and you get the benefit of testing in a game environment before export to objectâŚthen you can bring it into blender or your scene editorâŚbut the turnaround is rapid when you get used to it and u get the benefit of a one click ready to go test environment with a source portâŚbeen playing QCDE built on Q-Zandronum to forget my pain so I use that
Not fully tested it out re: physics and such but the level .obj displays in JME yes I think TestQ3 loads a similar type of model in the tests, thats old so I am not certain the source of that map sample but should give you sufficient direction
If you are referring to the final screenshot that is Q-zandronum running free doom as a quick and dirty âsee it in a gameâ