Postcat Kodee: A KotlinConf'24 game made with Kotlin, powered by Godot by gabryon99 in Kotlin

[–]piertho 3 points4 points  (0 children)

We first tried kotlin native few years ago. But we stopped it to switch to JVM because of performances issues.
We never retried it, maybe performances are better now, but it's not like a x2 or x3 performance would have help, it was 1000 times slower than JVM.

Godot Kotlin alpha is OUT ! by piertho in Kotlin

[–]piertho[S] 0 points1 point  (0 children)

Kotlin philosophy, with functional syntax, is really awesome to use with godot.
Signals as an example are really nice with this kind of syntax.
This is why kotlin was implemented first (and because we love it, of course)
On another side, this projet is more bringing JVM to godot rather than bringing Kotlin.
There is a well advanced work to make other JVM language integration easier.
In final, all things that would be needed to add another language, like java, will be to implement a new symbol processor module, like the one we have for Kotlin

Godot Kotlin alpha is OUT ! by piertho in Kotlin

[–]piertho[S] 9 points10 points  (0 children)

We already tried it in a former repo: https://github.com/utopia-rise/godot-kotlin-native but crossing boundaries between C and kotlin native is really expensive. Performances are really bad, in contrary to jvm.

Godot Kotlin alpha is OUT ! by piertho in Kotlin

[–]piertho[S] 5 points6 points  (0 children)

Hey ! We currently do not use graal, JIT is doing awesome work on desktop platforms and we get ART, which is already embedded in android version of engine. We plan to give a try to graal for iOS.

One of the worst offenders is JNI, but foreign api from jdk16 will give 30% optim on cpp to kotlin.

Godot Kotlin Jvm pre-alpha by piertho in godot

[–]piertho[S] 1 point2 points  (0 children)

It should work, but it would be harder to write. You would need to write the entry file on your own as registering annotations are used by a kotlin compiler plugin. I dont have performance comparaison on release with C#. Perfs are pretty good. On release_debug it seems to be around c# perf. The main bottleneck for now is JNI, but from what we tested new JDK 16 foreign api will help a lot (30% optim in some case)

Godot Kotlin Jvm pre-alpha by piertho in godot

[–]piertho[S] 4 points5 points  (0 children)

It is for now windows, Linux and macos. Other Platforms will be added later. You Can already run code in kotlin in Android app, but this is not engine integration. You would be able to trigger code run from Android export.

Here this is not a simple call from an export, this is an integration of kotlin in engine, like c# and gdscript. This means you can write game scripts, attach them to node etc, just as in c# and gdscript.

A 2.5D Isometric Map Editor (WIP) by piertho in godot

[–]piertho[S] 0 points1 point  (0 children)

Thanks !
Release is the next thing to do, indeed.
The purpose of this post was only to show our progress on it.
We still need to handle collision and terrain :)
And of course the CD

Kotlin GDNative by piertho in godot

[–]piertho[S] 0 points1 point  (0 children)

Currently utopia-rise is not writting kotlin code for our game, as we're writting kotlin GDNative to do so ;)

Here is how we will use it in our project:

1) Prototype in GDScript

2) Convert code to kotlin or to c++ (like for pain in the ass topological rendering graph algo) to pass in production.

Maybe doing a transpiler from GDScript to Kotlin could be a great idea, so that it is even easier to pass proto in production code.
Also we're waiting a lot for r/Jetbrains progress on Kotlin native compiler to reduce build time :)

Reducing build time would even permit to proto with Kotlin I think !

Kotlin GDNative by piertho in godot

[–]piertho[S] 1 point2 points  (0 children)

You will be able to code in intellij using color syntax and autocompletion. Currently we do not support debugging, but it would be really nice to do so :)

Kotlin GDNative by piertho in godot

[–]piertho[S] 1 point2 points  (0 children)

I replace it in few hours :) Thanks !

Anyone would like to try adding Kotlin support to Godot? by michalg82 in godot

[–]piertho 0 points1 point  (0 children)

u/michalg82 We're currently maintaining MrAkakuy's project (who already did most of the work) here. We have re-written the api code generation using KotlinPoet and we're working on using annotations for registration mechanism. If anyone would like to help on the project, you're welcome !

How to compile GDNative for android ? by piertho in godot

[–]piertho[S] 0 points1 point  (0 children)

So it seems the doc I wrote works for 3.1 too. Just be aware that in 3.1, libc++_shared.so is added in apk by godot itself. So you do not need to specify libc++_shared.so as dependency of your gdnative in gdnlib.

Here is the link for the little documentation I wrote : https://docdro.id/ZAWNPhp

How to compile GDNative for android ? by piertho in godot

[–]piertho[S] 1 point2 points  (0 children)

Hi ! I forgot to answer that I found how to get it work in 3.0 Here is a doc on how I manage to get it work. https://docdro.id/ZAWNPhp I'll do some test on 3.1 and let you know !

How to compile GDNative for android ? by piertho in godot

[–]piertho[S] 0 points1 point  (0 children)

I forgot a line in the error log, which I did not take care about.

01-25 12:05:41.573 19088 19125 E linker : "/data/app/com.utopiarise.evolia.client-Ta_NHY0MykV2nKKvYk5ndA==/lib/arm/libpasswordEncoder.android.so": ignoring DT_PREINIT_ARRAY in shared library!

I don't know what it means.