Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (603)
Games in Android Showcase (171)
games submitted by our members
Games in WIP (650)
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] 2 3 ... 72
1  Game Development / Newbie & Debugging Questions / Re: ANDROID Perlin Noise clouds & CPU-Usage & Bitmaps on: 2014-11-15 08:37:04
you may try this way :

Implement the following in a C Library using Android NDK

then in your Java you will use it like this :
private static native void render(Bitmap  bitmap,byte[] imageBuffer,int width,int height);
private Bitmap bitmap=Bitmap.createBitmap(width,height,Bitmap.Config.ARGB_8888);
public void renderImage()

EDIT: I managed to perform real time camera image manipulation using ndk on galaxy S so it should be fast enought, also multithreading idea mentionned above is good

Below the C source code for generating a gray image with 50% alpha.

It must be adapted for your project package and class name, here the package is "" and the class name "OverlayView" =>  Java_net_dzzd_camera_OverlayView_render

#include <jni.h>
#include <time.h>
#include <android/log.h>
#include <android/bitmap.h>

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

#define  LOG_TAG    "native"
#define  LOGI(...)  __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__)
#define  LOGW(...)  __android_log_print(ANDROID_LOG_WARN,LOG_TAG,__VA_ARGS__)
#define  LOGE(...)  __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__)

/* Set to 1 to enable debug log traces. */
#define DEBUG 0  

JNIEXPORT void JNICALL Java_net_dzzd_camera_OverlayView_render(JNIEnv * env, jobject  obj, jobject bitmap, jbyteArray data,jint width,jint height)

    AndroidBitmapInfo  info;
    void*              pixels;
   jboolean          isVideoDataCopy;
    AndroidBitmap_getInfo(env, bitmap, &info);
    AndroidBitmap_lockPixels(env, bitmap, &pixels);
   int outputOfxXY;

   for(int y=1;y<info.height-1;y++)
      for(int x=1;x<info.width-1;x++)
         int A=128;
         int R=128;
         int G=128;
         int B=128;
         int ARGB=R | (G<<8) | (B<<16) | (A<<24);
         ((uint32_t*)pixels)[outputOfxXY] = ARGB;

    AndroidBitmap_unlockPixels(env, bitmap);
2  Discussions / General Discussions / Re: what's up ? on: 2014-11-13 20:36:18
and a frame of reference is needed too
3  Discussions / General Discussions / what's up ? on: 2014-11-13 20:16:21
back after a while, so, what's up on JGO ? Smiley
4  Game Development / Shared Code / Re: Noise in 2D on: 2012-05-07 17:21:04
depending on your need, alternativly you may use this one ^^  :
5  Game Development / Game Mechanics / Re: Triangulating contour data on: 2012-04-27 14:56:37
If you're going to interpolate normals, those long, narrow triangles will become a PITA. To completely work around this problem, use normalmaps.

IMHO, I am not sure it is necessary to use normalmaps, you can get smooth result with normal interpolation by using the angle of the two edges of the triangle that touch the vertex as a weights on computation of the resulting normal. It usually give good results.

(also maybe I would rather consider a lighting/shadow map (and disable light on rendering if not requiered), as it is easy/fast to compute/update in 2d for land/terrain and can also be used to cast other object shadow)
6  Game Development / Game Mechanics / Re: Triangulating contour data on: 2012-04-15 10:08:36
One thought would be to use something like ROAM but not sure that it is the best for contour

here an old applet with source code

EDIT : you can imediatly test the result by converting your contour image in blue gradiant and test it with the above applet
7  Game Development / Newbie & Debugging Questions / Re: FPS difference on: 2012-04-13 21:53:53
maybe this kind of loop will help (inded feel free to replace currentTimeMillis by nonoTime...)

EDIT: after reading it dos not seems to be as good :/

this one seems better, it will do a fixed step logic/physic and will render only if at least one logic update has been performed (and then max FPS will be also limited to update logic rate but will run logic the same even on computer with very low FPS and will only consume requiered CPU on fastest computer):
time=getTime(); //System.currentTimeMillis or other method
int elapsedTime=(time-lastTime);
int nbLogic=elapsedTime/20;
int interpolateMs=elapsedTime%20;

  for(int n=0;n<nbLogic;n++)
  //interpolateMs can be used to extrapolate rendering...


8  Game Development / Performance Tuning / Re: Fastest way to determine if two rotated rectangles intersect? on: 2012-04-13 09:21:16
If you are looking for fastness rather than precision I would advice to make a first pass using bounding radius of both view and objects (basically distance between center of view and center of object) and remove all object that are too far and than use another method smarter for all remaining viewable objects

basically :

for each objects
double dx=objectX-viewX;
double dx=objectY-viewY;
double distMinSqrt = (viewRadius+objectRadius)²; //<== for even faster test, this value could be precomputed and stored for each object if there size doesnt change

if(dx*dx+dy*dy>distMinSqrt ) //Object wont be viewable

 //Here use a smarter test if requiered

9  Discussions / General Discussions / Re: Raspberry Pi ultra-low-cost ARM based computer (about the size of an USB key) on: 2012-02-29 20:57:24
nb: can also be usefull for prototyping something for a client that would cost a lot of money
10  Discussions / General Discussions / Re: Raspberry Pi ultra-low-cost ARM based computer (about the size of an USB key) on: 2012-02-29 18:52:25
But you can't code on your phone
yes you can ! Wink

but anyway this "toy" is really fun, I found it even more interresting for doing some kind of robotics
11  Game Development / Networking & Multiplayer / Re: Starting point for multiplayer development needed! on: 2012-02-29 17:34:24
I would advice to start by trying & playing with standard network object (Sockets) than once you understand how it work you may want to switch to a library (as it is IMO always important to understand how things works).

Also start with TCP it is a lot easier, you should be able to build you first client/server pretty quickly with a good tutorial
12  Discussions / General Discussions / Re: SCRATCH : An excellent tool for learning the basics of programming on: 2012-02-29 10:35:50
I adopted the Scratch interface for Stencyl a while back. It took a lot of iteration to adapt it for games, and we're still learning and refining the approach a few years later...
wow stencyl looks very nice
13  Discussions / General Discussions / Re: How Long Have You Been Coding? on: 2012-02-28 20:18:59
arround 25 years, starting by doing my first game on a CPC 464 in basic, than going on 8086 assembly for my first 3d engine, and after turbo pascal, and after ..., and after..., and... finally java!

I am still nostalgic for that time, that was really really cool with a lot of things to discover, different computers, different languages, concurrency, games was a little crappy but imagination and coverage of games was doing all the stuffs, this was really cool
14  Discussions / General Discussions / Re: SCRATCH : An excellent tool for learning the basics of programming on: 2012-02-28 09:33:18
I found it pretty useful for learning the basics but don't expect to do anything too exciting with it
yes sure, It is not really what it is intended to do, I am more looking at this soft like a game rather than a program IDE, I found it fun to manage to get something interresting from it that's why I was saying it may be fun for a contest (with this soft as the constraint of the contest)
15  Game Development / Shared Code / Re: Fastest PerlinNoise : Improved version bicubic&bilinear grad&value noise on: 2012-02-25 22:40:21
Hi DzzD,

Your noise func is super-fast, thx for that ! (could be also easily simdized, yum!).

I needed a seamless xy result so I used your multiplication trick to get the pseudo 4D noise and feed it with two circle coordinates. This is also working a treat !

Probably silly question :
Do you think that fake 4D is overkilling / do you have a simpler solution to get your 2D perlin signal tileable ?

The tiling is working cool with your fake 4D trick for now, but I get far more pronounced bi-cubic artefacts with this multiplication trick...

Do you think quintic interpolation could solve this ?

Much thanks again !
sry I was not on JGO for a while...

but I get far more pronounced bi-cubic artefacts with this multiplication trick
yes I pointed this artefact above, this is due to a lack of precision in the bicubic computation (it can be corrected)

Do you think quintic interpolation could solve this ?
probleme come from the discretisation of computation not the computation itself , so I believe that it wont help more than correcting the integer cubic interpolation implementation
16  Discussions / General Discussions / Re: SCRATCH : An excellent tool for learning the basics of programming on: 2012-02-25 22:28:16
If you like visual design like Scratch, you should check out Unreal's Kismet.  Scratch is kind of basic, and the puzzle shapes are hardwired for simple control flow constructs you get in any other language.

Scratch is for  learning basics and IMO  really well done for kids and to help people understand, a fast look let me think that Unreal's Kismet look a bit complex ans less user friendly

(nb: we used sracth for a young trainee  (13/14) in our company and in less than one day without having any knowlege in programming he was able to nearly produce a litte game and start to understand basics of programming)
17  Game Development / Newbie & Debugging Questions / Re: Collision Detection for Circle and Rectangle (including rotated) on: 2012-02-24 14:48:13
you can simplify a lot the problem by changing frame of reference for computation (in other terms compute collision from the rectangle point of view) this way the given problem "Collision Detection for Circle and Rectangle (including rotated)"
become "Computing collision for a moving circle with a static rectangle"

to do it easily if you rectangle is done with four points ABCD like this
|     |

for each physics cycle compute circle position in the rectangle frame of reference :
x distance using the normalized vector CD and point C
y distance using the normalized vector CA and point C

this will give you the position of the circle in the rectangle frame of reference (from the rectangle point of view) where you can compute collision easily (as the rectangle is static : none rotated or translated)

something like (CD & CA normalized):
distCircleX=CDx*CircleX+CDy*CircleY - (Cx*CDx+Cy*CDy);
distCircleY=CAx*CircleX+CAy*CircleY - (Cx*CAx+Cy*CAy);

then compute collsion circle pos if any
if (distCircleX<-radius) => no collision
if (distCircleY<-radius) => no collision
if (distCircleY>CDlenght+radius) => no collision
if (distCircleY>CAlenght+radius) => no collision
if(no corner collision ?) => definitly no collision

 and convert this collison pos from rectangle to original frame of reference
18  Discussions / General Discussions / SCRATCH : An excellent tool for learning the basics of programming on: 2012-02-24 13:05:54
I encourage every one to look & try for fun this project :

I found it fun and very interresting to help people understand basics of programming

You program just using the mouse and can publish your project via Java Applet

(a JGO contest for fun on this tool may be very fun ^^)
19  Discussions / Miscellaneous Topics / Re: Java to Flash (or ActionScript ?) on: 2011-11-22 01:34:16
Why would you want to design in Flash over Java?
hum... du to the crappy java plugin implementation, most customer ask for flash instead of java

AS3 is very much like Java
only for the syntax (and that's not that true, local variable scope are just really stupid in flash)

java & flash have a completly different approach, you wont be able to convert a full project flash to java easily (you can for simple class) but: flash is higher (or at least more far .... ) level language, flash have a lot of predefined features as filters / sprite / etc... that you cant convert from java as it, you also dont manage the rendering loop and flash is damnly slow (maybe slower than javascript if you dont use the right tools : PixelBender/ColorFilter etc ... to deal with pixels) so... as Java & Flash use a completly different approach it is IMO not a good idea to build a project in flash and try to convert it later in flash (it may be right fo simple class test but you may need to earn some experience on flash before)
20  Discussions / General Discussions / Re: Nothing related to Java ! on: 2011-11-22 00:13:46
Off-topic: We haven't seen you for a long time DzzD! Where have you been?
doing some work (for Superdev.... : a startup that Hire me, pleasant but... ) not "that interresting" but enought to "stuck me out" for out-job stuff :/ I really miss that but I plan/hope that i will soon post some interresting code in shared section

you're right about long time, I got 7 pages on "unread topic" :/
21  Discussions / General Discussions / Re: Nothing related to Java ! on: 2011-11-22 00:08:48
LOL at the enthusiastic fat guy at the end Smiley
yes, very enthusiast !

I really like the song! It's quite awesome to see people fight for equality and their rights!

On Lache Rien!! On Lache Rien!! On Lache Rien....ON...LACHEEEEEE RIENN!!!
walou !
22  Discussions / General Discussions / Nothing related to Java ! on: 2011-11-21 23:30:54
Would like to come back with something a bit more technical but I reallly love this one

<a href=";amp;hl=fr_FR" target="_blank">;amp;hl=fr_FR</a>
23  Game Development / Networking & Multiplayer / Re: Java Game Server (RedDwarf) job in North Boston on: 2011-05-25 12:53:40
Are you sure you can't cope with remote working? ;p

+/- 1 : would be really nice.... we also had to deal with remote working but unfortunatly it has never been really satisfying, remote work really require to be well organized
24  Games Center / Showcase / Re: JTetris on: 2011-05-22 18:13:11
Why did you make a Windows and Mac version? It would be better to leave it as a Jar file so anyone can run it.
even better if it was an applet  Wink
25  Games Center / Archived Projects / Re: Joebung tanks on: 2011-05-17 22:29:52
there is something wrong in the loading process (related to sound maybe) it took more than 30s to start (20Mb bandwith), also the gamesize is to small (maybe it was a bug but I only add very few pixels in height).

it may be a fun game to play with other people
26  Discussions / Jobs and Resumes / Re: ATTENTION GAME DEVELOPING GRADUATE IOS PROGRAMMERS! on: 2011-05-17 22:04:53
porting those game may requiere gameplay review / deep modification no ? I mean some of them will no be adapted to some IOS device capabilities : screensize / touchscreen
27  Game Development / Game Mechanics / Re: Customizable avatars in your RPG on: 2011-05-17 21:58:50
depending on the requested goal : use different layers, and a sprite hierarchie : like weapon is child of body

example :
have n weapons animations and only one body animation, if you want to just change clothes/skin/hair colors you may use same spritesheeet but with a tint filter, when user change weapon tou will just change its children weapon spritesheet/animation
28  Game Development / Newbie & Debugging Questions / Re: Random image placement? [Array] on: 2011-05-17 21:51:18
you may use a grid placement to avoid two object to overlap and a stack of pos and maybe a PRNG to avoid different generation, not very optimised but should work well until you use very small object on very big area.

something like :

Vector freePos=new Vector();
int nbPosX = screenWidth / objectWidth;
int nbPosY = screenHeight / objectHeight;
//fill free pos
for(int cx=0;cx<nbPosX :cx++)
 for(int cy=0;cy<nbPosY :cy++)
  freePos.addElement(new Point(cx,cy));

for(int n=0;n<nbObject;n++)
 int pos=(int)(pseudoRandom()*freePos.size());
 Point gridPos=(Point)freePos.elementAt(n);
29  Discussions / General Discussions / Re: Advice for Game Designers on: 2011-05-17 21:22:24
Some people like writing libraries and other people like using those. Both sides can be equally interesting.
yes you're absolutely right, this is two separate way and both have their motivations (this was just a personal opinion)
30  Discussions / General Discussions / Re: Advice for Game Designers on: 2011-05-17 20:31:15
hoho! this topis is becoming hot, where is the JGO fairplay/coolness  Roll Eyes

[size=9pt]2 cents :

related to a previous post about libraries :
being employed dont mind you cannot have fun anymore  Undecided that's why my side I usually prefer rebuilt everything from scratch, including GUI/network/physics/etc... because often, when thinked enought it does not take so much time to rebuild something (anything), it ends more adapted to the project you're working on and a lot more fun to do. IMHO there is nothing more boring to be employed in a big (blockbuster) company that only use/reuse "pre-made" engine. I mean you can use software/libraries or write software/libraries for other and the second one is a lot more interresting.

about studying to get a job (in all area of work), nothing is more efficient then real work, someone who can show real project  and/or have referent people in different companies will always get more attention to anyone having any study/certification, study is only interresting for the first job.[/size]
Pages: [1] 2 3 ... 72
Jesse (16 views)
2015-07-29 04:35:27

Riven (37 views)
2015-07-27 16:38:00

Riven (19 views)
2015-07-27 15:35:20

Riven (22 views)
2015-07-27 12:26:13

Riven (12 views)
2015-07-27 12:23:39

BurntPizza (32 views)
2015-07-25 00:14:37

BurntPizza (42 views)
2015-07-24 22:06:39

BurntPizza (24 views)
2015-07-24 06:06:53

NoxInc (31 views)
2015-07-22 22:16:53

NoxInc (21 views)
2015-07-22 22:13:39
List of Learning Resources
by gouessej
2015-07-09 11:29:36

How Do I Expand My Game?
by bashfrog
2015-06-14 11:34:43

List of Learning Resources
by PocketCrafter7
2015-05-31 05:37:30

Intersection Methods
by Roquen
2015-05-29 08:19:33

List of Learning Resources
by SilverTiger
2015-05-05 10:20:32

How to: JGO Wiki
by Mac70
2015-02-17 20:56:16

2D Dynamic Lighting
by ThePixelPony
2015-01-01 20:25:42

How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21 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!