Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (715)
Games in Android Showcase (214)
games submitted by our members
Games in WIP (788)
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 ... 12
1  Game Development / Newbie & Debugging Questions / Re: External class error on: 2017-02-13 03:18:02
You have

 cardImage = new Image("img/card.png"); 

within the file inside a main method, it should be inside the constructor.
is currently not being created anywhere within

A program has only 1 entry point, which is your

Only should have the
 public static void main(String[] args) 

Delete lines 33 to 40 within and put
 cardImage = new Image("img/card.png"); 
at line 16 (within the constructor) of
2  Game Development / Newbie & Debugging Questions / Re: Java2D radialgradient lighting on: 2016-11-05 13:39:25
Without checking the javadocs as I don't know Java2D fully.

every time you draw a light, are you rendering everywhere else with a fully solid black colour?

if you are, that would mean you are restricted to one light as you would draw the light at one location, draw another light at another location which also sets everywhere else to black meaning your first light is now unlit.
3  Game Development / Newbie & Debugging Questions / Re: Point changing for some reason on: 2016-09-27 12:36:14
I did it as an object as in Java people are more likely to say primitives are passed by value and objects are passed by reference.

So some code failing a pass by reference for an object makes them realise their mistake.
4  Game Development / Newbie & Debugging Questions / Re: Point changing for some reason on: 2016-09-27 12:23:37
oops, yep, I wrote it while talking to 2 people and trying to play a game at the same time.

I don't know how I missed calling test(ref); I swear I typed it, maybe I deleted it when I tried to rewrite it to make it more clear.
5  Game Development / Newbie & Debugging Questions / Re: Point changing for some reason on: 2016-09-27 10:34:06
If it is pass by reference, everything you do to the reference should be reflected everywhere, if you decide to set the reference to a new object, the original object will be changed to.

public static void main(String[] args) {
   MyObject ref = new MyObject();
   ref.a = "nope, not pass by reference";
   System.out.println(ref.a); //if pass by reference, this should print out "yep, pass by reference"

public void test(MyObject ref) {
   ref = new MyObject();
   ref.a = "yep, pass by reference";

True pass by reference should set the object to be be the new object created, but because its pass by value the original object is still what it was when it was created in the main.

You would pass by reference in C++ by using &.
6  Game Development / Newbie & Debugging Questions / Re: Point changing for some reason on: 2016-09-27 04:22:37
public Cell(Point location)

Java passes references, and Point is a mutable type.
Any changes (outside this class) made to the Point instance that you pass into the constructor will alter the value returned by Entity#getLocation().

Java actually passes by value, it never passes by reference.

It may look like it passes by reference but it is actually by value.

This doesn't change the answer though.
7  Java Game APIs & Engines / OpenGL Development / Re: *testing needed!* Vertex cache shenanigans on: 2016-09-12 14:39:58
Exact same results as cas.

Renderer: GeForce GTX 1080/PCIe/SSE2

8  Discussions / Miscellaneous Topics / Re: What I did today on: 2016-07-23 02:23:51
The typical not a "What I did today"...

Lets travel back in time a bit...

May: I received my HTC Vive.

June/July: Went on my first plane trip, luckily I don't hate planes, as it was from Australia to Germany.

After arriving in Berlin Germany, we then had to travel to Leipzig via train.

All up it was about 26-ish hours of traveling.

Upon arriving in Leipzig, we immediately got asked to attend a open uni demonstration day for their compsci department. After visiting and looking at the projects some of their students are working on, we then began to realise the weird sun setting time, here in Australia in winter it begins to get dark at 5pm, and in summer it begins to get dark around 7pm-8pm. It was still light in Leipzig at 10:30pm, which threw us off a bit.

Instead of sightseeing, we mostly just sat in a hotel and played with robots for the first few days.

After a few days at Leipzig, RoboCup 2016 finally opened up to participants, and we moved from our small hotel rooms to the conference center.

We competed in the Humanoid Kid Size League (football / fußball / soccer), with us and one other team having the smallest robots in the league. As you can guess, we didn't do too well with our small robots, we made it past the first knockout round, and got knocked out in the second round, just before the quarter finals. We ended up playing 5 or 6 games.

After we got kicked out, we played a "drop in game" where each team could place 1-2 robots on the side of the field they want to play for and work together to win a game against the other team, of course after being kicked out, our robots decided it was time they would perform better, and we played really well.

I also managed to meetup with Ra4king's team one day, they don't compete in the same league as us though. Unfortunately Ra4king did not attend the competition Sad maybe next year if we both end up going?

Here is a picture of the entire Humanoid League (Kid Size, Teen Size and Adult League robots)

9  Discussions / General Discussions / Re: Interesting proposals: Java 9 and beyond on: 2016-05-26 10:43:54
Value types will be a bit of a failure without the ability to define operators for them.

Cas Smiley

well if I am understanding this right, value types are going to be or allow stack allocation, so it will not be a failure in places where people are squeezing the performance out of anywhere they can; most likely none of us will need it.

10  Game Development / Game Mechanics / Re: OBJ conventions on: 2016-05-09 08:49:18
For that face you have shown; the face is a quad, as their is 4 vertices per face.

if it was a triangle, their would be 3.

You will need to write some code to triangulate the faces or load it into blender and export it with the triangulate checkbox on.
11  Discussions / General Discussions / Re: Virtual Reality on: 2016-04-01 23:16:22
Personally i won't touch VR until I don't have to target a particular VR set. The API should be generic already and cross vendor. Didn't we learn this lesson like 1000x time already!

Currently the issue is that while Steam's OpenVR allows for any HMD, Oculus hasn't allowed support for their HMDs in OpenVR, and Oculus aren't letting other HMDs into their SDK.

I suspect that as OpenVR supports several HMDs (currently Vive and OSVR) while Oculus' SDK only supports the Rift, devs are going to move towards Steam's option and Oculus will be forced to add support for OpenVR, or add support for 3rd party HMDs into their SDK.


Oculus wants to support the HTC Vive in the Oculus SDK, they also want to add Asynchronous Timewarp to the Vive.

I think it is more of a "Our SDK is the superior one, lets make it the standard"

12  Discussions / General Discussions / Re: Virtual Reality on: 2016-04-01 03:57:32
Google just posted a video about their break through in VR technology, I think we have almost got full VR immersion.

Here is their page about it

<a href=";hl=en_US&amp;start=" target="_blank">;hl=en_US&amp;start=</a>
13  Game Development / Newbie & Debugging Questions / Re: Pathfinding through a node graph on: 2016-03-30 08:00:39

Those are some algorithms for finding the shortest path in a graph.
14  Discussions / General Discussions / Re: Razer OSVR HDK on: 2016-03-29 10:37:52
The OSVR screen is 120Hz, as far as I know.

You get 60 frames per second. It can be run with 120 or 240hz but those would mean black screens in between the actual frames to reduce motion blur.
It's not as good as 120 FPS, but much better than a pure 60Hz display.

Saw that on a reddit post, from what it looks like it was from a razer employee, talking about upgrade kits for the OSVR.
15  Discussions / General Discussions / Re: Virtual Reality on: 2016-03-23 10:09:35
All major engines (Unreal Engine, Cryengine V (just released today I believe), Unity) already have support for both Rift and the Vive.

With those support, I guess at minimum, basic sit down VR will be more likely to be supported.
16  Discussions / General Discussions / Re: Virtual Reality on: 2016-03-23 06:33:45
I also saw Spasi on github saying he would support SteamVR in LWJGL if there is enough demand for it.

I know I hope for SteamVR support. I hope to do my graphics course next semester with the vive, would be nice to be able to use LWJGL for the assignment, otherwise I will probably go to C++.
17  Discussions / General Discussions / Re: Virtual Reality on: 2016-03-23 06:28:45
May does not come fast enough for my HTC Vive shipment Sad

With Ray's post, one reason why I got it now, hopefully I may be able to jump into being a game developer with it being new.
18  Java Game APIs & Engines / OpenGL Development / Re: Rendering style for maps in a procedural way on: 2016-02-22 01:42:20
There is a lot of content for OpenGL, you just have to spend a few minutes looking.
19  Discussions / General Discussions / Re: Vulkan 1.0 Release on: 2016-02-19 08:08:55
Has anyone gotten the vulcan drivers to load on Linux? I have the 361 graphics drivers installed and the 352 OpenCL drivers. Do the opencl drivers need to be more current too?
By 361 I am assuming thats NVIDIA, I believe the only version that has Vulkan support current is 356 (windows) and 355 (linux).

20  Game Development / Newbie & Debugging Questions / Re: Crash but no crash log! on: 2016-01-25 07:13:00
Use break points and step through the code, you will then find what line causes the crash, and you can work it out from there.
21  Game Development / Game Play & Game Design / Re: Top-down vehicle movement? on: 2016-01-22 09:26:26
by "w is up, s is down" do you mean, w will always make the car go up the screen, s will always go down even if the car is turned around?

If the above, it may work in certain genres, e.g. the games where you typically play as a plane / space ship, dodging or killing things coming from the right, as you don't really want an over complicated movement system for a fast paced game like that.

If your game is more like a 2D racing game, or a game where vehicles can help you move around the world, having a more accurate controlling for a car will feel better. (w is forward, s is reverse, a and d steer).

If you still want help deciding, tell us what the game is, and we can say what we feel would be the best.
22  Game Development / Newbie & Debugging Questions / Re: Should I use LWJGL 2 or 3? on: 2016-01-16 03:07:27
You should probably just switch to LWJGL3, I am pretty sure there not maintaining LWJGL2 anymore, so any bugs in LWJGL2 are more like features now.

The biggest change in LWJGL3 is GLFW, which has sample code on their website to create a display.

The OpenGL is still OpenGL, your best bet for OpenGL tutorials is going to be C++ code tutorials, if a method does not exist from the C++ article, a quick check of the javadocs and the method name will show you the method and its paramaters.
23  Game Development / Newbie & Debugging Questions / Re: Is it worth to use nashorn ? on: 2015-12-30 12:27:35
Can you really handle the possibility when you don't know if it will occur? Maybe it only needs 1 cycle more to finish.
24  Game Development / Performance Tuning / Re: Using the sun.misc.Unsafe class to do crazy stuff with the JVM on: 2015-12-19 13:27:11

My reply was more directly towards ShadedVertex, I know in certain scenarios you will probably want to use Unsafe.

My assumption was he wanted to code his entire game using Unsafe for memory management, where in the entire game, he will probably being deallocating a fair bit, which would pretty much mean he needs a deconstructor in every class.

My "If you are starting to require memory management in Java, you should change languages" was more towards him making a game in Java, I feel like his going to be limited by other stuff before he gets limited by the memory management. He also has a lot more other things he needs to learn in OpenGL before he adds the use of Unsafe to manage his memory.

At no point do I see ShadedVertex in the near future require the use of Unsafe, and most likely majority of the users on this forum.

@theagentd if you see this, do you actually use Unsafe to manage any memory at all in We Shall Wake?
25  Game Development / Performance Tuning / Re: Using the sun.misc.Unsafe class to do crazy stuff with the JVM on: 2015-12-19 06:39:23
You shouldnt need to call System.gc(); ever.

It will run its self when needed.

To what I know (also from the above post), you have to manually delete the memory you allocate using Unsafe, this means, you need to add deconstructors like methods to every Java class you use, if you simply let a reference to an object go, the GC will never clean it up, meaning you got a memory leak.

I will stand by my "If you are starting to require memory management in Java, you should change languages". You are probably going to be limited by something else before memory management in java is your concern.

You are adding an extra level of complexion to your code, where you do not require it.

26  Game Development / Performance Tuning / Re: Using the sun.misc.Unsafe class to do crazy stuff with the JVM on: 2015-12-19 06:05:50
The reason why I don't like C++ is that its syntax is quirky and inconvenient (in my opinion). I want Java's developer-friendly syntax and I'd like to manage memory manually within Java.

I find C++ pretty much similar to Java when you scrap off pointers in C++.

By adding the use of Unsafe to your code, you are probably not even going to notice a performance increase, if that is what you are hoping for.

You are pretty much saying no to one of Java's best features and rolling with your own.

If you are thinking it will increase the performance of your terrain generation, its probably going to either give worse performance or the same performance.

You should continue to improve, you will find that your performance issues are more yourself then the limitations of Java.
27  Game Development / Performance Tuning / Re: Using the sun.misc.Unsafe class to do crazy stuff with the JVM on: 2015-12-19 05:38:50
If you are starting to think about memory management using Unsafe, you may as well go to C++.
28  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Good tutorials teaching how to use Nifty in LWJGL? on: 2015-12-13 11:21:22
It is a bit complicated,

NegativeZero just posted the link in IRC for the demo of it.

29  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Good tutorials teaching how to use Nifty in LWJGL? on: 2015-12-13 10:30:07
LWJGL 2 or 3?


If you are using LWJGL3, LWJGL3 has got built in GUI Library: NanoVG

Hmm there was example code for NanoVG I saw somewhere, not sure where it is now.
30  Game Development / Newbie & Debugging Questions / Re: A couple of questions about Slick2D on: 2015-12-13 00:33:59
1) I only know one game that uses Slick2D and requires to be purchased, and that is Retro-Pixel Castles.

2) Slick2D has not been out of development for a long time.

3) It would be ok to learn on, it gives a api similar to java's Graphics2D, and if you are going to purchase a book for game development in Java, it will most likely use J2D, so it would be a lot easier to learn from the book then using OpenGL or another library.

4) OpenGL uses the GPU to draw, so it is hardware accelerated. You are going to get a lot better performance when using OpenGL. Even though Slick2D uses OpenGL, it uses immediate mode to render, which is slower then using the programmable pipeline.

With OpenGL, if you use only LWJGL, you will be writing a lot of code just to set up the rendering, and with the little experience you have, it will probably go right over your head.

5) LibGDX is Java's pretty much best game development library. It is still maintained, and uses more advanced OpenGL techniques, and there for gives a lot better performance then Slick2D.

LibGDX also supports 3D development if you decide to use that in the future.

With LibGDX, you code your game in Java, and when you go to export it, you can export it to Desktop, HTML, Android or even IOS.

LibGDX will also give you a lot more functionality that Slick2D does not provide, and should have a lot of tutorials on how to do things.

6) I have never used a book to learn programming. I learnt everything I know from articles and videos. I started off learning form Videos, but I mostly only use articles now.

If you want to learn OpenGL directly, you will need to get comfortable with reading C++, most OpenGL articles your going to find will be using C++, Though the API for C++ is very very similar to LWJGL's implementation, just a few little differences (parameters are slightly different).
Pages: [1] 2 3 ... 12
CopyableCougar4 (202 views)
2017-03-24 15:39:42

theagentd (184 views)
2017-03-24 15:32:08

Rule (243 views)
2017-03-19 12:43:22

Rule (226 views)
2017-03-19 12:42:17

Rule (231 views)
2017-03-19 12:36:21

theagentd (250 views)
2017-03-16 05:07:07

theagentd (246 views)
2017-03-15 22:37:06

theagentd (180 views)
2017-03-15 22:32:18

theagentd (174 views)
2017-03-15 22:31:11

ral0r2 (165 views)
2017-03-03 11:52:41
List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05

SF/X Libraries
by SkyAphid
2017-03-02 06:38:56

SF/X Libraries
by SkyAphid
2017-03-02 06:38:32

SF/X Libraries
by SkyAphid
2017-03-02 06:38:05

SF/X Libraries
by SkyAphid
2017-03-02 06:37:51 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!