Porting to Java

Note: I still love Panda3D.
Because some reason I try to migrate to Java lately. I like Java language… because I live in Java and even I am a Javanese. And here Java is not a word for coffee. I speak Javanese but that doesn’t make me good in Java language actually. And this post have been three years old:
I wonder is that possible to port to Java? Seriously!
It is not April 1st anymore here. But I think at the Panda3d it is still April 1st. Is it breaking the rule if I say: April fool!!
(…Seriously, is that possible to port to Java?)

Well, porting all the C++ code to Java is enough work for a decade. But most people here use Panda3D via the Python interface, which is automatically generated by the Panda3D component interrogate. Interrogate is a wrapper generator, which is designed in such a way that it is extendable, i. e. it is possible to add new wrappers by deriving from existing interrogate base classes.

For Java you could use JNI (Java Native Interface) and add an interface maker to interrogate which creates JNI binding for the Panda3D C++ classes.

The interrgoate code lives in panda3d.cvs.sourceforge.net/view … terrogate/ .

I found somewhere in the forum ( at showcase section I think), that somebody use Java for the server and the client is Panda3d. I never check about that again. Is that possible? This is what I want to try actually. Is the answer the same? I need JNI?
I really appreciate for your answer.

As long as your client and server speak the same protocol when communicating with each other, it does not matter if your server and client use different programming languages.

I think this very much depends on the question what your server should do. Do you need Panda3D functionality on the server side?

If the server should do collision detection using the Panda3D built-in collision system then you will need to run Panda3D components on the server-side. Or if you want to dynamically create geometry on the server using Panda3D’s built-in geom classes, and then stream it to the clients (most people want to load model from file on the client side, for obvious performance reasons. But there might be special use cases…).

If the server purely handles game logic related stuff then chances are good that you can live without Panda3D components on the server side.

It is not possible to give any advice without knowing what your server’s functionality is.

I like this idea, but in the other hand I want a online game which is the player no need to install anything. Does it mean the server need to handle more than that?

To run panda3d on the web brower the end user still needs to install the panda3d runtime. The runtime will then automaticly download anything needed to play your game. Unity web browser plugin works the same way.

To make your game fully install free you will have to make your game using java, flash, or html5. Its now considered bad practice to run java applets in the web browser (this is where java gets its reputation of security holes, its not the language itself). Flash is no longer supported for phones or tables. I saw a couple engines in this reddit thread which support html 5.

That being said I really like python and panda3d because I’m the most comfortable with python (although I have yet to make anything close that resembles a game :wink: ). Go with what you are the most comfertable with so your project can be a reality sooner.

The only way to write a browser-based 3D game where the user does not need to install anything is using a JavaScript-based WebGL engine.

recently i am learning Java. and found that, comparing to Python, Java is more difficult in writing the structure/framework of an application (object type casting, no array of functions, …), but when the structure is done, filling in the details is not very different from Python.
i also wish Panda3D can be used with Java:

  1. Java lauguage can be used alone to make a complex application with high performance, no need for dlls, cython etc. meaning: the work environment is more simple - one text editor, one compiling command. and the written codes can be more “cross-platform”.
  2. there are many more Java programmers than Python programmers in the world, Java can attract more programmers to use Panda3D as the 3D engine, for games or visualization of industry application.
  3. the more choices, the better. (although it can also mean more work for the developer :smiling_imp: )

if Panda3D is advertised as an engine which can be programmed in C++, Pyhon, Java, then nearly all programmers in the world can choose Panda3D - who would only learn C# without learning other mainstream languages?