Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (754)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (842)
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: Could someone explain to me the update method? on: 2018-04-08 06:43:03
Having the update tied to fps would also make the game less smooth when a player has lower fps.

Yes that's what I mean, when you're calling the delta time from one frame to another and using that to only update the game (not render) 60 times / second, wouldn't that hinder performance? Or am I missing something.

I am confused on what you are trying to say.

Are you saying updating the game every frame is a performance hit? Of course it is, but it also can't be helped, unless you your game never changes, at that point, it is just a single image.

If you are trying to say you want to reduce the update rate from 60 updates per second to 10 updates per second because you are using delta time, that is possible, but your game will feel not feel very responsive unless you make another update like function that processes user input / menu control / what ever else, and only let the game logic be updated at 10 updates per second (may be acceptable for a turn based game).

My quote was more towards not using delta time. Also remember, you need smarter collision detection when you are using  delta time, if my character moves at 10 meters a second, and for some reason my game freezes for 10 seconds, the delta time would then mean my character moved 100 meters in the update, if you are doing collision by checking to see if your hitbox is inside of another hitbox, I would teleport over all objects that are less then 100 meters away.

So having a lower delta time for the above situation would increase the accuracy of the collision detection. So forcing 60 updates per second would ensure that the collision detection is always accurate to that precision.
2  Game Development / Newbie & Debugging Questions / Re: Could someone explain to me the update method? on: 2018-04-08 05:36:42
separation of concerns.

You want to make your code as easily understandable as possible, trying to bake a cake by mixing the ingredients while its cooking is not ideal. We should mix the ingredients, then cook (bake) it.

In game development we should update the game then render it, not try and update it as we render it.

Another good reasoning is, we can control the updating separately to the game FPS, some games will cap the amount of updates per second, or run at a higher update rate (e.g. with physics). Having the update tied to fps would also make the game less smooth when a player has lower fps.
3  Discussions / General Discussions / Re: VR motion sickness on: 2018-03-17 12:07:09
The thing about VR is that it is immersive, you feel like you are really there, a good way to break the immersion would be to constantly switch between first person and a cinema view.

Moving in VR only causes motion sickness when you are using a traditional game movement ( wasd or joystick ). A fair few games offer various ways for the player to move, one is teleporting, which gives no motion sickness, there have been variations to the teleporting, where you see a ghost image of your character moving when you attempt to move (From Other Suns does this).

You would have to be really sensitive to motion sickness to get motion sick from VR from just moving your head / walking around in real life without using controller input to move the character (and without teleportation).

It also varies from games, I played Pavlov for 1-2 hours and I felt fairly sick after it. I played another game Echo Arena, which is based in zero gravity, where I barely got any motion sickness.

@CommanderKeither Level of Detail is important for VR because you can get so close. At the same time, things in the distance can be of less quality, so the things that you are currently close to for sure need to be high quality (if you are aiming for realistic graphics).
4  Game Development / Newbie & Debugging Questions / Re: Java regex pattern for finding text between [[ ]] on: 2018-03-04 08:03:20
The second "]]" causes the entire script to be highlighted, as it regards the second "[[" as part of the inner text from the first "[[".

Here is a fix.

Without testing it, this may be the fix for you:

? will make it non greedy.

it seems \r is your line break in your editor instead of \n, so I guess that is why mine does not work for you.

The other problem will be that it will detect comments within ", so you will also need to work out how to get around that.
5  Game Development / Newbie & Debugging Questions / Re: Java regex pattern for finding text between [[ ]] on: 2018-03-04 05:05:25
Did you add the multiline option to the Pattern?

Pattern regex = Pattern.compile("--\\[\\[.+?\\]\\]", Pattern.MULTILINE);

Otherwise, regex will stop at a single line.

that won't work.

import java.util.regex.Pattern;

public class MyClass {
    public static void main(String args[]) {
        String str = "hello[[ abc \n def \n ghi ]] world";
        Pattern regex = Pattern.compile("--\\[\\[.+?\\]\\]", Pattern.MULTILINE);
        String shc = regex.matcher( str ).replaceAll( "" );
        String phased = str.replaceAll("\\[\\[(.|\\n)*\\]\\]", "");
        System.out.println("SHC:" + shc);
        System.out.println("Phased:" + phased);

gives the output:
SHC:hello[[ abc 
 ghi ]] world
Phased:hello world
6  Game Development / Newbie & Debugging Questions / Re: Java regex pattern for finding text between [[ ]] on: 2018-03-04 04:16:21

with \ escaped:

that should work.

you can try it out here
7  Discussions / General Discussions / Re: Anyone tried using/developing for an Android VR headset? on: 2017-09-28 12:53:41
If you wish to write your own graphics code, LWJGL3 has OVR bindings, Oculus' SDK, which is what the GearVR uses.

LWJGL3 also has bindings for OpenVR, but that is not for mobile.
8  Game Development / Newbie & Debugging Questions / Re: print game screen like vr games on: 2017-08-04 05:08:44
Download LWJGL3, make sure you get the OpenVR or OVR bindings.

1) Get the left eye view matrix from the headset
2) Render the scene using the left eye view matrix
3) Pass the texture buffer to the headsets left eye
4) Get the right eye view matrix from the headset
5) Render the scene using the right eye view matrix
6) Pass the texture buffer to the headsets right eye
7) If its OpenVR, update the HMD matrix pose, if OVR, find the equivalent function.
9  Discussions / Miscellaneous Topics / Re: What I did today on: 2017-04-27 08:15:50
I'm starting to consider getting myself a second monitor. Anyone here coding with two monitors? Does it increase productivity? Smiley

Yes, 2 reasons.

I can have resources I need on my second monitor and my IDE on my left monitor.

I can also Netflix and Code.
10  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
11  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.
12  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.
13  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.
14  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 &.
15  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.
16  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

17  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)

18  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.

19  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.
20  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"

21  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>
22  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.
23  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.
24  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.
25  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++.
26  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.
27  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.
28  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).

29  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.
30  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.
Pages: [1] 2 3 ... 12
DesertCoockie (33 views)
2018-05-13 18:23:11

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

nelsongames (70 views)
2018-04-24 18:14:32

ivj94 (752 views)
2018-03-24 14:47:39

ivj94 (82 views)
2018-03-24 14:46:31

ivj94 (623 views)
2018-03-24 14:43:53

Solater (98 views)
2018-03-17 05:04:08

nelsongames (179 views)
2018-03-05 17:56:34

Gornova (405 views)
2018-03-02 22:15:33

buddyBro (1065 views)
2018-02-28 16:59:18
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

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 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!