Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (788)
Games in Android Showcase (234)
games submitted by our members
Games in WIP (860)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Java Game APIs & Engines / OpenGL Development / LWJGL native compilation with GCJ success on: 2006-02-08 20:58:26
I managed to natively compile a game that uses LWJGL via GCJ for linux.

The steps for a full native compilation are:

1) Compile lwjgl & jinput into object files using gcj

Neotokyo:/tmp/lwjgl# l
total 528
-rw-r--r-- 1 root root  26493 Feb  8 22:31
-rw-r--r-- 1 root root 104782 Dec 18 22:05 jinput.jar
-rw-r--r-- 1 root root 396822 Dec 18 22:05 lwjgl.jar

Neotokyo:/tmp/lwjgl# gcj -c -fjni jinput.jar
Neotokyo:/tmp/lwjgl# gcj -c -fjni lwjgl.jar -Ijinput.jar

Neotokyo:/tmp/lwjgl# l *.o
-rw-r--r-- 1 root root  730396 Feb  8 22:32 jinput.o
-rw-r--r-- 1 root root 3996880 Feb  8 22:34 lwjgl.o

jinput is needed because lwjgl references some jinput classes by name. If jinput is not included,
AOT compilation will break with undefined references even if jinput is unused by the project.

2) Compile and link the application

Neotokyo:/tmp/lwjgl# gcj --main=Shmup jinput.o lwjgl.o -Ijinput.jar -Ilwjgl.jar
Neotokyo:/tmp/lwjgl# l a.out ; strip a.out; l a.out
-rwxr-xr-x 1 root root 4033104 Feb  8 22:36 a.out
-rwxr-xr-x 1 root root 2336820 Feb  8 22:37 a.out <-- final executable, contains lwjgl & jinput, size can be reduced to ~500kb with upx

3) Create deployment archive
Assuming that the target users do not have libgcj (libjava) installed, we must create a fully self-contained deployment archive
that will execute with no problems. The users do not have to download and install anything.

In order to do that we have to ship the following libraries with the application. First libraries that are part of libgcj:

Then, extra native libraries used by our program, in this case the lwjgl native ones:

These files can be grouped in a separate directory lib within our package. Use of the LD_LIBRARY_PATH linux env variable
will ensure that they get loaded properly.

The final size of our self-contained 100% native lwjgl application package: 6 mb
Most of this comes from the size of libgcj which is 16mb by itself. This solution only works on linux for now because the awt implementation
of gcj (and classpath) currently only supports gtk/x11 peers. Windows, Cairo, QT peers are in their todo list.Once mingw
is updated to reflect the latest versions of classpath and gcj, cross-compilation of completely native windows lwjgl applications
will be a reality.

The promising part of this article is that libgcj follows the GPL license with an exception that allows linking
with proprietary code without tainting this code. This means that someone could hack libgcj to pieces, create a mini
library containing only needed functionality and further reduce the filesize of his deployment package. The license would only
require that these changes to (only) libgcj be made public.

Versions used:
GCJ version 4.0.3 20060121 (prerelease)
LWJGL 0.99
2  Game Development / Artificial Intelligence / Re: Back propagation algorithm on: 2005-12-20 16:58:44
When it comes to neural networks, there are no definite answers. Empirical studies
and techniques are frequently used. Replying to your question about momentum and
learning rate, the situation is as described in previous answers. I would suggest
you start with low values for both (in a typical feedforward MLP, 0.3 for learning rate
and 0.2 for momentum are 'nice' values to start with). Monitor your network and estimate
its performance over a separate testing set (kept hidden from training) in order to
see what values will work best for your case (tune accordingly).

Moreover there are a couple of other things you can do to combat the local minima problem:

Try using the stochastic approximation to gradient descent which traverses multiple
error surfaces (distinct for each training example) and uses the average in order to converge.

Train multiple neural networks using different parameters (rate, momentum, initial weights) over the same
training set. Evaluate and choose the best performing one.

Use a separate validation set in order to stop training in time and avoid overfitting.
Pages: [1]
hadezbladez (2081 views)
2018-11-16 13:46:03

hadezbladez (799 views)
2018-11-16 13:41:33

hadezbladez (2050 views)
2018-11-16 13:35:35

hadezbladez (413 views)
2018-11-16 13:32:03

EgonOlsen (3444 views)
2018-06-10 19:43:48

EgonOlsen (3665 views)
2018-06-10 19:43:44

EgonOlsen (2270 views)
2018-06-10 19:43:20

DesertCoockie (2991 views)
2018-05-13 18:23:11

nelsongames (3068 views)
2018-04-24 18:15:36

nelsongames (3753 views)
2018-04-24 18:14:32
Deployment and Packaging
by philfrei
2019-02-17 20:25:53

Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08

Deployment and Packaging
by gouessej
2018-08-22 08:03:45

Deployment and Packaging
by philfrei
2018-08-20 02:33:38

Deployment and Packaging
by philfrei
2018-08-20 02:29:55

Deployment and Packaging
by philfrei
2018-08-19 23:56:20 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!