Plugin SDK and JNI

Forum for plugin, effect and behavior programmers. Please use the Help & Support forum for help using Construct.

Post » Mon Sep 06, 2010 2:17 pm

Would it possible to use JNI with the plugin SDK to allow writing plugins with Java?
B
17
S
6
G
6
Posts: 113
Reputation: 4,161

Post » Mon Sep 06, 2010 3:32 pm

I don't know much about JNI. Does it require end-users to have the Java framework installed? If so, I'd decline because it'd cause really complicated dependencies for end-users. If we enable plugins to be written in Java, the .NET framework, Python etc, then end users could end up having to install all three of those separately to run a game - which they most likely won't bother with.

C++ compiles to native code with essentially no dependencies, so it just works for everybody, generally.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,508

Post » Mon Sep 06, 2010 3:58 pm

Truth is, I don't know too much about JNI either, but school is approaching (we use Java there) and I need a project; I was thinking of doing this. I was posting to see if anyone had an opinion about the feasibility. However, if you think this would be bad for Construct I can see why. End users will probably need a JVM, but I imagine the vast majority of people have one even if they don't know they do.
B
17
S
6
G
6
Posts: 113
Reputation: 4,161

Post » Mon Sep 06, 2010 5:28 pm

I think most end users will have the JVM (if you use older Java features), so I wouldn't let that hold you back trying to do this. Also, C++ meshes with JNI much better than C.

But I agree with Ashley that this probably would not be good to support officially, but as a school project it sounds interesting to attempt. Doesn't sound easy at all though. :-)
B
8
S
3
G
7
Posts: 835
Reputation: 5,313

Post » Mon Sep 06, 2010 8:58 pm

Yeah, your school project could be along the lines of "Is it feasible to extend a C++ application using JNI?" Even if you conclude "no", you might get an interesting report and a good mark.

The problem with JVMs (and .NET frameworks) I think is that you're caught between two difficult choices: either use an old framework everybody has, but then that doesn't have all the latest, greatest features. Or, use the latest framework - but then it's less likely everyone has it. I know this is true of the .NET framework, but I don't know about JVM. Plus, I wouldn't assume everybody has it installed in the first place - it's a lot of work to go to, to then find (say) 20% of people can't run it. Someone should look in to the actual stats first!
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,508

Post » Mon Sep 06, 2010 11:31 pm

[quote="Ashley":3upmjkal]Someone should look in to the actual stats first![/quote:3upmjkal]
I think the number of users will be more like %90+, but I still don't think officially supporting JNI is a good idea. I believe most manufacturers HP, Dell, etc ship JVMs with their custom loads which most users will have. If you do a fresh install the JVM will not be installed.

http://news.cnet.com/HP,-Dell-to-ship-J ... 15723.html

http://www.highbeam.com/doc/1G1-108111914.html
B
8
S
3
G
7
Posts: 835
Reputation: 5,313

Post » Tue Sep 07, 2010 10:36 am

I've been thinking about this, when Construct is installed it has a web installer for DirectX. A similar web installer exists for Java which means I should be able to write an installer (with NSIS or something) that will also download the JRE. Also, Java 1.6 (the latest version) was released almost 4 years ago, so adoption should be very high.
B
17
S
6
G
6
Posts: 113
Reputation: 4,161

Post » Wed Sep 08, 2010 12:24 am

[quote="Trevor10":d6m518lr]Also, Java 1.6 (the latest version) was released almost 4 years ago, so adoption should be very high.[/quote:d6m518lr]
I agree. I really think nearly everyone will have Java installed. It is a much different case than say Python where you absolutely must package with your game. Also, the web installer is a great idea for those who don't have Java and you can determine automatically during install time whether or not to prompt to install Java. Now, just have to figure out how feasible JNI is with Construct.
B
8
S
3
G
7
Posts: 835
Reputation: 5,313

Post » Wed Sep 08, 2010 11:17 pm

The project idea was turned down, it was considered inappropriate for second year, but I'm welcome to do it in third. I'm considering going ahead with it anyway, but if it looks like it'll be very difficult I'll probably wait for third year as I'll have to find something else to do this year.
B
17
S
6
G
6
Posts: 113
Reputation: 4,161


Return to Construct engineering

Who is online

Users browsing this forum: No registered users and 0 guests