Java-Gaming.org Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (575)
Games in Android Showcase (154)
games submitted by our members
Games in WIP (623)
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
1  Game Development / Newbie & Debugging Questions / Re: Property based pattern for a game. on: 2015-04-02 23:00:48
Not really sure what you are trying to achieve here? Do you want low memory usage?

Also can you post the code for all your tests? I'm surprised the best and worst times have a 4x difference so would be interested in what you actually compared against.
2  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-04-01 20:16:27
I was playing around in OpenGL and accidentally made a flame thing:
http://gfycat.com/FlawlessSphericalFairybluebird

EDIT: I made it fancier Smiley
https://gfycat.com/GregariousPlumpJerboa

Very nice! what strategy do you use for the flame generation? My current method is quite basic (texture billboarded and then put through a particle system animator)
3  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Lost System.out.println, Being bombarded with text. on: 2015-03-28 09:39:04
Just use this instead of System.out

https://docs.oracle.com/javase/7/docs/api/java/util/logging/Logger.html

It provides lots of useful information as to where the logging was generated from

An example of using it can be found here

http://examples.javacodegeeks.com/core-java/util/logging/java-util-logging-example/
4  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Coroutines - A new coroutine library on: 2015-03-26 03:42:42
I understand the concept and why this is different to threads. But can you expand more on

Quote
The next time you're coding up something that could benefit from being written as a coroutine (e.g. AI logic),

And provide some real world use cases? I don't really get why this would useful for AI. I don't want to diminish what you have done as it sounds pretty impressive but I suspect the reason Javaflow isn't actively developed is because there isn't a huge need for it and that might be the case with what you have too. But I encourage you to prove me wrong Smiley
5  Discussions / Miscellaneous Topics / Re: Crash - Corrupt File, Months of Work Lost on: 2015-03-20 05:47:41
I've never used Visual Studio, but does it have a directory specifically for compiled files. I know you decompiled a 4 month old version but you must have compiled it in VS since then. The "output path" location must have some files.
6  Games Center / WIP games, tools & toy projects / Re: Our new game Glow, first public alpha available to download now on: 2015-03-17 22:11:27
Looks like I didn't acutally have JAVA_HOME set for openjdk so it was actually using the oracle jdk

Version is below

1  
2  
3  
java version "1.8.0_11"
Java(TM) SE Runtime Environment (build 1.8.0_11-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.11-b03, mixed mode)


On the positive side, when forcing the JRE to be

1  
2  
3  
openjdk version "1.8.0-jdk8u60-b06"
OpenJDK Runtime Environment (build 1.8.0-jdk8u60-b06-20150314)
OpenJDK 64-Bit Server VM (build 25.60-b06, mixed mode)


The code did work! I guess there is a bug in the version of oracle java I am using, although I use this version for LWJGL with no issue.
7  Discussions / Community & Volunteer Projects / Re: Starting a team (Music Composer, Developer, 3d designer, and writer needed) on: 2015-03-17 06:52:00
This seems to be a another "bash anyone who asks for people to join their project" thread! What a fun and encouraging community there is here. 
8  Games Center / WIP games, tools & toy projects / Re: Our new game Glow, first public alpha available to download now on: 2015-03-15 17:50:34
I'm running on Linux but the screen just dissapears after I press escape to start the game, is there a log file anywhere?

Edit : Ran it from the command line, error attached. It just so happen that I am running the open jdk 8 (as I experimented building it from source earlier on today) so this might be the error. Stack trace below

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
java.lang.VerifyError: Bad <init> method call from inside of a branch
Exception Details:
  Location:
    ai/behaviours/steering/MoveAroundPositionBehaviour.<init>()V @91: invokespecial
  Reason:
    Error exists in the bytecode
  Bytecode:
    0000000: 04bd 002e 5903 b200 30b8 0036 b200 3ab8
    0000010: 0040 5359 10ff 1202 b800 442a 5fab 0000
    0000020: 0000 00b6 0000 0006 0000 9b75 0000 003b
    0000030: 0013 3aeb 0000 0044 1259 9e57 0000 0054
    0000040: 34ec a228 0000 0069 38da 9449 0000 007e
    0000050: 68a8 0a98 0000 009a 5f5a 57b7 0045 a700
    0000060: 7f5f 5a59 0332 b800 4b5f 57b7 004d a700
    0000070: 6f5f 5a59 0332 124f b800 53c0 004f 5f57
    0000080: b700 54a7 005a 5f5a 5903 3212 56b8 0053
    0000090: c000 565f 57b7 0057 a700 455f 5a59 0332
    00000a0: 124f b800 53c0 004f 5f59 0432 b800 4b5f
    00000b0: 57b7 0059 a700 295f 5a59 0332 1256 b800
    00000c0: 53c0 0056 5f59 0432 b800 4b5f 57b7 005b
    00000d0: a700 0dbb 005d 5912 5fb7 0062 bf57 b1  
  Stackmap Table:
    full_frame(@88,{UninitializedThis},{Object[#100],UninitializedThis})
    full_frame(@97,{UninitializedThis},{Object[#100],UninitializedThis})
    full_frame(@113,{UninitializedThis},{Object[#100],UninitializedThis})
    full_frame(@134,{UninitializedThis},{Object[#100],UninitializedThis})
    full_frame(@155,{UninitializedThis},{Object[#100],UninitializedThis})
    full_frame(@183,{UninitializedThis},{Object[#100],UninitializedThis})
    full_frame(@211,{UninitializedThis},{Object[#100],UninitializedThis})
    full_frame(@221,{Object[#2]},{Object[#100]})

   at java.lang.Class.getDeclaredConstructors0(Native Method)
   at java.lang.Class.privateGetDeclaredConstructors(Class.java:2658)
   at java.lang.Class.getDeclaredConstructors(Class.java:2007)
   at org.codehaus.groovy.reflection.CachedClass$2$1.run(CachedClass.java:71)
   at java.security.AccessController.doPrivileged(Native Method)
   at org.codehaus.groovy.reflection.CachedClass$2.initValue(CachedClass.java:68)
   at org.codehaus.groovy.reflection.CachedClass$2.initValue(CachedClass.java:66)
   at org.codehaus.groovy.util.LazyReference.getLocked(LazyReference.java:46)
   at org.codehaus.groovy.util.LazyReference.get(LazyReference.java:33)
   at org.codehaus.groovy.reflection.CachedClass.getConstructors(CachedClass.java:265)
   at groovy.lang.MetaClassImpl.<init>(MetaClassImpl.java:215)
   at groovy.lang.MetaClassImpl.<init>(MetaClassImpl.java:225)
   at groovy.lang.MetaClassRegistry$MetaClassCreationHandle.createNormalMetaClass(MetaClassRegistry.java:168)
   at groovy.lang.MetaClassRegistry$MetaClassCreationHandle.createWithCustomLookup(MetaClassRegistry.java:158)
   at groovy.lang.MetaClassRegistry$MetaClassCreationHandle.create(MetaClassRegistry.java:141)
   at org.codehaus.groovy.reflection.ClassInfo.getMetaClassUnderLock(ClassInfo.java:250)
   at org.codehaus.groovy.reflection.ClassInfo.getMetaClass(ClassInfo.java:282)
   at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.getMetaClass(MetaClassRegistryImpl.java:255)
   at org.codehaus.groovy.runtime.InvokerHelper.invokeConstructorOf(InvokerHelper.java:944)
   at org.codehaus.groovy.runtime.DefaultGroovyMethods.newInstance(DefaultGroovyMethods.java:15420)
   at ai.behaviours.trees.tasks.AddSteeringBhvTask.update(AddSteeringBhvTask.groovy:41)
   at ai.behaviours.trees.tasks.SequenceTask.update(SequenceTask.groovy:33)
   at ai.behaviours.trees.tasks.SelectorTask.update(SelectorTask.groovy:33)
   at ai.behaviours.trees.tasks.ForeverTask.update(ForeverTask.groovy:29)
   at ai.behaviours.trees.tasks.SequenceTask.update(SequenceTask.groovy:33)
   at ai.behaviours.trees.tasks.RootNodeTask.update(RootNodeTask.groovy:38)
   at ai.behaviours.trees.BtTreeInstance.update(BtTreeInstance.groovy:47)
   at ecs.lib.sys.BehaviourTreeSystem.tickPreRender(BehaviourTreeSystem.groovy:21)
   at ecs.SystemController.tickPreRenderSystems(SystemController.groovy:49)
   at ecs.SystemController.tickPreRenderSystems(SystemController.groovy)
   at lib.game.GameScreen.render(GameScreen.groovy:220)
   at com.badlogic.gdx.Game.render(Game.java:46)
   at lib.game.MyGame.render(MyGame.groovy:127)
   at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:214)
   at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:120)
AL lib: (EE) alc_cleanup: 1 device not closed
9  Discussions / Business and Project Management Discussions / Re: Newbie Dev Looking for a Team. on: 2015-03-12 07:07:10
To be fair they may have started but not with people from here, a lot of people here are anti team work unless its for a more advanced project (so they know they aren't wasting their time), but the truth is you are probably right, most would have fizzled in to nothing

@Hakired You might struggle a little bit to find your team but don't let that stop you trying, there are a lot of good people on this forum who have some exceptionally good knowledge but most people are either studying or have full time jobs so time is quite precious and is normally dedicated ot personal projects and for helping out on questions. If you don't find a team you will still have some good resources to extract information from when you have specific questions.
10  Game Development / Newbie & Debugging Questions / Re: Check for lan servers on: 2015-03-10 17:50:48
try and telnet there, if it connects and had rubbish coming back then its active, if you get a connection refused then the port is not open
11  Discussions / Miscellaneous Topics / Re: Android Studio comedy of errors on: 2015-03-10 08:06:01
Here's another fun one for naive Ubuntu users, a major "Doh!" moment for me. Le't say you have an executable, and using the Terminal shell, you navigate to the file folder where the executable resides and type in it's name. What happens: crickets, and a command not found message. But when you type 'ls' the command is clearly there in the file folder. SOLUTION: to execute the command, you have to prefix the file name with "./" .

This is because by default the shell looks for the command in the PATH environment variable, you can add the current working directory to the PATH and it should work. For you the current working directory is not in the PATH variable so you need to use "./" to predicate the full location.
12  Game Development / Newbie & Debugging Questions / Re: Check if it's a combo/streak on: 2015-03-08 22:18:18
could you store the rows and columns as strings and then use regex or string find functions?

The regex "/(.+)\1/" finds patterns 2 or more, you could amend it for any length you want as a minimum
13  Game Development / Newbie & Debugging Questions / Re: Stop geometry shader from auto-billboarding shapes on: 2015-03-08 08:55:28
Move the

1  
gl_ProjectionMatrix * gl_ModelViewMatrix *


code to your geometry shader and rotate each generated vertex, example

1  
gl_Position = gl_ProjectionMatrix * gl_ModelViewMatrix *corner0;
14  Game Development / Newbie & Debugging Questions / Re: Stop geometry shader from auto-billboarding shapes on: 2015-03-06 21:29:54
you will need to create 2 4x4 matrix

1) a perspective matrix (one off as you create a new window)
2) a view matrix which is the result of your camera moving
3) optional model matrix

You pass these to your shader via uniforms

In your vertex shader do gl_Position = perspectiveMatrix * viewMatrix * modelMatrix * pointPosition, this will rotate everything to the correct positions. The geometry shader should then work

There are other threads on how to generate the perspective matrix which can explain things more on this topic
15  Game Development / Newbie & Debugging Questions / Re: Stop geometry shader from auto-billboarding shapes on: 2015-03-05 19:48:41
I could be wrong on this approach but where do you pass in the camera rotation to the geometry shader? I'm not an expert on mixing functionality introduced from 3.2 with the fixed pipeline so I don't know the impact of a glRotate on verticies generated in the geometry shader, my initial assumption is that the geometry shader ignores everything from the fixed pipeline.
16  Discussions / General Discussions / Re: The Khronos Group announces "Vulkan": the successor to OpenGL on: 2015-03-04 21:48:48
They are still going to develop opengl independently of this, this will be similar to directx 12 / AMD Mantel / Apples Metal and opengl will be like directx 11 (both still being actively developed).

Bye Bye AMD Mantel, you inspired a new generation of API but the big boys are now going to swallow you up Smiley
17  Games Center / Cube World Projects / Re: Technetium - A realistic voxel game on: 2015-03-02 09:19:51
tech demo / non voxel lookey likey or not I think the second video still visually looks good, so congratulations on that. I look forward to seeing how this pans out in the future.

@Gibbo3771 - I think the point of the WIP is forum is to post "work in progress" games and this is the very start of a work in progress game. All games start of as tech demo like programs because that is how you progressively develop things, they become more game like during the development process as you add features. I think your comment was a little rude, it may not be anything new at the moment but at least give them a chance, they stated a June / July time for an Alpha of the game which gives them plenty of time to add things. It may eventually be just another pile of crap but you are judging it at an early stage.
18  Game Development / Newbie & Debugging Questions / Re: (LibGdx) Controlling an animation on: 2015-03-01 08:38:48
Thanks, it worked perfectly. I can't medal you for some reason sadly.

I appreciated on your behalf Smiley
19  Game Development / Newbie & Debugging Questions / Re: What should i use to develop multiplayer game online in browser ? on: 2015-03-01 08:36:35
have a look at webgl, a selection of engines for you to try can be found here

http://html5gameengine.com/tag/webgl
20  Game Development / Game Mechanics / Re: Making GUIs on: 2015-02-28 07:19:08
Swing as a whole is a light weight framework that is platform independent but at its core it still extends AWT (JComponent extends the AWT container), this is its hook in to the OS to get screen graphics and user interface events of the operating system which it then translates to an OS agnostic set of events for it to use (it therefore manages its own event queue on top of the OS event queue). It also does this translation on its own thread which is why you need those invokeLater commands to run anything on the underlying event queue thread. AWT was born when Java was born and is a very old horrible piece of technology.

JavaFX should fix a lot of the AWT issues, it doesn't run the event processing on its own thread, it instead does this in the same thread that the application is run on (JavaFX Application Thread). It also hooks in to the native OS event queue rather than maintaining its own version of the event queue. JavaFX also has a separate rendering thread (Prism render thread) to the main application thread (which helps you use multi threaded systems better for rendering). Lots of good things in JavaFX but its big disadvantage is it will need a different native build for every OS it runs on and it currently doesn't run on all OS's
21  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-02-24 14:10:20
No textures are created (texture coordinates change though), but you could be on to something here

I won't take up any more space here, I thought it was something worthy of posting here Smiley turns out it probably isn't and is something subtle somewhere else.
22  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-02-24 13:48:24
You are probably right (I hope you are), but just adding this line

1  
currentTime = System.currentTimeMillis();


(currentTime is a private class variable and is a double (doesn't matter if its a long))

To my FPS calculator class increments the loaded class count for DirectByteBuffer

And replacing that line with

1  
currentTime = 1.56;


(ie hard coded)

Stops the loaded class count going up. I'm sure there is something else going on here but it is looking odd at the moment
23  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-02-24 12:56:00
I learnt that calling

1  
System.currentTimeMillis();


or

1  
System.nanoTime();


or

1  
GLFW.glfwGetTime();


In an FPS calculator all lead to a steady increase in java.nio.DirectByteBuffer objects being created on the heap. Does anyone have any idea on how to stop this happening?
24  Java Game APIs & Engines / Engines, Libraries and Tools / Re: TGA Decoder on: 2015-02-24 10:47:31
What license is it under?

I'd love to include it in Spade. We've had this issue open for a while now.

@HeroesGraveDev I noticed you were using ImageIO in Spade, this library here https://github.com/haraldk/TwelveMonkeys (not me but I have used it) has some good image plugins for ImageIO and is actively developed. You might find it useful.
25  Discussions / General Discussions / Re: Do you sometimes skip braces? on: 2015-02-13 22:22:19
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
if(nested()) 
{
   if(stillNesting())
   {
      for(int count =  0; count < nestAmount; count++)
      {
         for(int dex =  0; dex < nestAmount * 2; dex++)
         {
              initMindExplosion(fetalPosition);
         }
      }
   }
   else
   {
      whenWillIdoIt();  
   }
}


Much better Smiley There is much happiness in the braces aligning up
26  Discussions / General Discussions / Re: Do you sometimes skip braces? on: 2015-02-13 19:20:57
I always put braces on everything, I'm quite compulsive with this  Grin I find it makes the code more readable because its easier to see where the scope starts and finishes among lots of things. I don't think you lose anything by having them on.

I always put the brace on a new line too, but that's a whole other discussion!
27  Discussions / Miscellaneous Topics / Re: Unit Testing: Waste Of Time? Discuss on: 2015-02-07 22:35:15
TDD = Code a test then build some code to pass that test  (I don't know anyone who does this)
Unit testing (Manual) = You test your own code after you code (Most people do this in some basic form)
Unit testing (automated) = re runnable set of tests you can run, probably done in Junit / JBehave or something similar (more people than TDD but less than unit testing manual probably do this)
28  Discussions / Miscellaneous Topics / Re: Unit Testing: Waste Of Time? Discuss on: 2015-02-07 08:30:11
In principal testing is a great idea but in practise it is quite hard to do to make it really effective

  • You could write tests for every class but you aren't then testing how the application works as a whole
  • Its very hard to create every possible type of input, for a complex system, and to then have something that can test all the possible output. Opengl is a great example of it being very hard to test the output
  • if you don't maintain tests, they can very easily get out of date
  • The effort vs reward ratio is very biased towards effort


Where I work every agrees test cases are a good thing but in practise non are actually written
29  Game Development / Newbie & Debugging Questions / Re: How would you simplify a nested for loop? on: 2015-02-03 07:01:54
But tinfoilboy did specify performance

Quote
I'm wondering how you would simplify a nested for loop for better performance

On the benchmark point you are kind of correct but the results do show that the single loop was more expensive which was the point I was trying to make.
30  Game Development / Newbie & Debugging Questions / Re: How would you simplify a nested for loop? on: 2015-02-03 06:05:18
Not sure how you define "simpler," but since x and y are integers:

1  
2  
3  
for (int i = 0; i < width * height; i++) {
    makeTile(i % width, i / width);
}


This transformation is occasionally useful.
It's simply the inverse of
index = x + y * width
which you may have seen turn up in a few places.



Is this actually going to be any quicker? You have now added a mod operation and a division operation for every i. My mind says it will be slower

I ran a quick test to prove it

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
public class Speed
{
    private static int counter = 0;
   
    public static void main(String[] args)
    {
        int width = 800;
        int height = 600;
       
        long a = System.nanoTime();
       
        for (int i = 0; i < width * height; i++)
        {
            makeTile(i % width, i / width);
        }
       
        long b = System.nanoTime();
       
        for (int y = 0; y < height; y++)
        {
            for (int x = 0; x < width; x++)
            {
                makeTile(x, y);
            }
        }                

        long c = System.nanoTime();
       
        for (int i = 0; i < width * height; i++)
        {
            makeTile(i % width, i / width);
        }
       
        long d = System.nanoTime();
       
        for (int y = 0; y < height; y++)
        {
            for (int x = 0; x < width; x++)
            {
                makeTile(x, y);
            }
        }  
       
        long e = System.nanoTime();
       
        System.out.println("Single : " + (b-a));
        System.out.println("Double : " + (c-b));
        System.out.println("Single2 : " + (d-c));
        System.out.println("Double2 : " + (e-d));
    }
   
    public static void makeTile(int x,int y)
    {
        counter++;
    }
}


Output :

Single : 6771960
Double : 1434076
Single2 : 4413039
Double2 : 1309231

Note I ran both tests twice to avoid any optimisations the compiler does on the first run, the times also vary on every run but they all show the same picture
Pages: [1] 2
 
BurntPizza (29 views)
2015-04-23 03:42:11

theagentd (35 views)
2015-04-22 16:23:07

Riven (48 views)
2015-04-16 10:48:47

Duke0200 (59 views)
2015-04-16 01:59:01

Fairy Tailz (41 views)
2015-04-14 20:13:12

Riven (44 views)
2015-04-12 21:36:37

bus hotdog (60 views)
2015-04-10 02:39:32

CopyableCougar4 (66 views)
2015-04-10 00:51:04

BurntPizza (70 views)
2015-04-06 22:06:58

ags1 (68 views)
2015-04-02 10:58:48
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

Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27
java-gaming.org 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‑gaming.org
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!