Processing 2.x in JME (again :)

So, I am returning to this topic again… Does anyone have any idea on how to go about that? Processing has its own way of working with OpenGL, I guess it claims the context for its own purpose and sole use… so how is it possible to integrate it with JME ? That’s the main thing that concerns me - “sharing” OpenGL…

I have found this thread: http://hub.jmonkeyengine.org/forum/topic/jme3-and-processing/ and sent a PM to @atom but I am not sure that he is still reachable.

So, after studying the mentioned solution and going into some experiments, I was able to get Processing to render to JME textures. It turned out to be rather easy - no manipulations with GL things at all… probably Processing goes with a non-GL renderer there, I have to study more… However, if anyone is interested, that might be a rather cool contribution to JME, since it gives you an unlimited photoshop-like potential in drawing textures programmatically.

In addition, I am implementing my original solution in Clojure, so that I plan to fork and re-engineer Quil to work for the Processing part here with JME. Currently, my Clojure-JME program loads a traditional Java PApplet. However, if JME is interested in the contribution for the community, I can make a pure Java version of the integration facility too.

Is anyone else interested in this kind of thing?

I definately am. Im working on a RTS game where Ill need to draw alot of 3d objects that are small units. sorta like command and conquer. Ive been using processing to make all the pages , buttons, etc. if you have any info that would help me figure out how to run JME stuff within a processing frame/sketch please email it to me @ smeck1999@gmail.com or just email me about it and maybe we could do a hangouts video call or something. thanks!

So, you want to get JME inside Processing? That’s the opposite of what I’ve done, and thinking of it, I can only propose one way to go: render JME into an offscreen framebuffer, then convert that framebuffer into a PImage. All has to be done in realtime. While this would be ok for several such images, idk, if it will work for many elements.

Another concern is the OpenGL context. As I have realised, Processing, while being embedded into JME, uses the default renderer, which is software (see P3D \ Processing.org). I haven’t yet tried mixing Processing OpenGL with JME OpenGL and am not sure if that is possible. I will try to modify my prototype, to see if it works and how it works.

Still, why don’t you consider moving to JME and using Processing inside of JME? That seems to be a more prolific solution…

Okay I will have to look into that. Im getting into game design for the first time and honestly its totally new territory from the UI design and web programming im used to. you seem to have some experience in game design so in your oppinion what would be a good way to have little characters rendered? the game is a RTS like I said and the perspective is far away and above so render doesnt have to be extremely clean. I thought about designing the characters as shaders in blender and using that shader in processing.

Well, if I would do the thing you’re describing, I would definitely stick to JME as the backbone. In Processing I only do quick graphical approximations, using it as a programmable paint or photoshop.

Saying “characters”, you mean, like, letters or game units? The letters are rendered with the help of shaders, yes, like you have a texture with the font and you send the uv coordinates to the shader to only show one character on a particular quad (to be exact, a quad is 2 faces each of which is a triangle). Pretty much the same goes for 2D units, as in 2D RTS games. You can look at them as just fonts too. But I am not sure that this is what you were asking…

It is not really clear, what are you going to implement as shaders, and what exactly are you asking about :slight_smile: please, describe more.

by characters i mean game units. like I said Im totally new to game design/programming. Is giving the game units a visual using shaders reasonable? or do you suggest another method? the game is sorta 3d, have you seen the game transistor? the objects of the game are only shown from one side (2D) but the styling of those objects is very 3D.
My hope is to have a dimensional look much like this but I dont know if i should go 2D or 3D.

heres an image

One thing to keep in mind is that my characters and buildings are much, much smaller than the game shown in the image. also probably gonna have alot less detail.

heres another image example

These definitely look like 3D models (haven’t played the game, can’t tell for sure). Such characters are created in a 3D editor (like Blender) and imported as assets to your game… Shaders won’t do all the work here - you need to create the mesh, textures and animation… you can use shaders to spice up the picture, but there has to be some backbone first.

This is not to say that you can’t do this entirely with shaders, and some games do have purely shader-based graphics (mostly as a concept), but usually this is not practical at all and it is hard to acheive many traditional.

Okay I understand that. so i could create a simple 3D shape and wrap it with a image (texture). I really appriciate all the pointers and help. I do have one final question tho. I’m considering programming in destructible terrain elements like trees and buildings. how would you do that. I thought about creating a 3D topography/terrain grid for most of the map with a image texture, and then having the destructible objects as something on top of it? like possibly a 3D object that has different pre-created forms. so like a building would have a normal form, slightly damaged form, rubble pile form etc. I’m getting a small team together to help me build this. but it will still be a several year project. so im fine with attempting a hard challenge, theres just alot of things im not sure how to implement

There are various ways for creating a terrain with objects. In almost any case the terrain is totally separate from the world objects like trees and buildings.

The terrain itself is usually either a mesh (as in most games and JME3), or a voxel thing (e.g. like in the old game DeltaForce). It can be made destructable with another handful of tricks… The world objects are separate and placed on the terrain. So, for example, if you change the landscape, then vehicles travelling over it will move and behave exactly the way they should - climbing up the hills and going down from them. That’s just math and it depends on the type and data representation of your landscape. However, such things are not usually granted to work as you expect, even when you get them out-of-the-box, some tuning or a specific solution might be required.

For terrain - check the JME terrain thing. I did not use it (coz I did not make games of this type yet), but people use it much. Not sure if it is based on heightmaps or or manual or procedural generation or all of this.

As for destructability of objects - that’s another huge topic. The most simple case is to prepare several meshes, as you’ve said. Other techniques may involve more math and make your single mesh destructable, but that’s another story, and it is not quite straightforward.

As for vegetation you can also use various auto-generation methods, like this and this and others.

All in all the approach that you’ve described is correct. I would suggest you start thinking of what technologies will you apply first from describing in your game design document how you want to create things and what they should be able to do. Out of that you will then be able to figure out the ways of achieving them.

You can always ask on this forum regarding your questions on game programming with JME and general game programming questions, we will be glad to help! :slight_smile: