Java-Gaming.org Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (601)
Games in Android Showcase (171)
games submitted by our members
Games in WIP (649)
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 ... 11
1  Discussions / General Discussions / Re: Something wrong with LWJGL3? on: 2015-07-09 13:41:23
just you, works perfect for me.

edit: both worked
2  Discussions / General Discussions / Re: FFXIV refunds on Mac OS through poor performance - interesting nuggets... on: 2015-07-06 13:13:13
yeah, a quick search of that looks like Metal is coming to OS X 10.11.

I remember hearing about Metal, but I completely forgot about it until I just googled it.

EDIT:

I think its not very smart for them to move to Metal, I think if they want to replace OpenGL they should of moved to something more standard by adding Vulkan support (one site seems to say Vulkan may not be added to OS X, If they had an API that will be mainstream on mac (instead of there own API), they may get a lot more users, as games would more likely have a mac version available.
3  Discussions / General Discussions / Re: FFXIV refunds on Mac OS through poor performance - interesting nuggets... on: 2015-07-06 13:07:23
From what I believe Mantle is dead, so if they replace it with mantle, their replacing a active developed API with a dead API.

Maybe there going to replace it with Vulkan?
4  Game Development / Game Mechanics / Re: Rendering on: 2015-07-03 13:31:49
you cant do "to much in the constructor", you can run your entire game through the constructor if you really want to.

your stack trace failed because of "No OpenGL context found in the current thread.", which gives the impression that OpenGL has not yet been initialized.

Try and move where you load your textures, as this would be your issue, put it directly before you start your game loop, and it should work.
5  Game Development / Game Mechanics / Re: Rendering on: 2015-07-03 13:00:04
you got to start the OpenGL first before you can declare a texture, so creating a texture can not be your first thing, you must initialize OpenGL, then create your texture.

You are also correct, you want to reuse the same texture.
6  Game Development / Game Mechanics / Re: Rendering on: 2015-07-01 15:07:25
you can improve the performance by reducing the number of
1  
2  
3  
GL11.glBegin(GL11.GL_QUADS);

GL11.glEnd();


calls you produce.

e.g.

1  
2  
3  
4  
5  
6  
   public void render() { 
      GL11.glBegin(GL11.GL_QUADS);
      level.render();
      player.render();
      GL11.glEnd();
   }



inside your Player class
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
   public void render() {
   GL11.glTexCoord2f(0,1);
          GL11.glVertex2f(x, y);
          GL11.glTexCoord2f(1,1);
          GL11.glVertex2f(x + width, y);
          GL11.glTexCoord2f(1,0);
          GL11.glVertex2f(x + width, y + height);
          GL11.glTexCoord2f(0,0);
          GL11.glVertex2f(x, y + height);
   }


which would then put it all into one call, but you would not be able to change textures, so you would need to use a SpriteSheet, and produce the correct TexCoords for each sprite.

EDIT:

And yes, using VBO's would be better performance, but for your first OpenGL game, it should be enough. After you produce a game or two, and are a bit more familiar with OpenGL, learn how to use VBO's, unless if you wish to start now.
7  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-07-01 14:51:50
Ages ago, I made a bot, that did some basic commands.

After starting to use IRC a bit more, and having no projects to work on, I decided to add an IRC connection to the bot I made.

I quickly found out how ugly my old bot code was at extending it to add extra functionality, so I rewrote the Server class to make it much easier to add new commands too.

The new design makes each new command its own class, which you then register it to the server (which controls the bots, and does the message processing).

was much easier, instead of adding a block of code inside of a new else if(...) statement, I could simply do this
1  
server.register(new TestCommand());


if anyone wants to look at the source code, or use it, here is a link to the repository. There is a bit of untested code in there, but I think it should work. The untested code is around allow commands for only certain people, I changed it after uploaded it to github, realising it was not the best way that I had done it before.

current features are, WolframAlpha search (you got to supply that API key), create a google search, calculate an equation, set and get messages from a database, reply back when spoken too using the ChatterBot API that is connected to CleverBot by default.

some owner only features are, adding new bots, to a specified channel, specified name and a specified identifier (how most bots are !help, the identifier is '!'),  changing nicks, kicking bots, and setting a bot to reply to all messages that a certain user says (mostly used to set 2 bots to start a conversation between them).
8  Game Development / Game Mechanics / Re: Collision between different maps (2d lwjgl) on: 2015-06-14 15:11:58
If you had an exam question, java is pass by value.

Although it seems to be pass by reference, its not pass by reference, as long as you remember.

You can send your ArrayList to any class and modify it, and every other class will update it too. But if you set an ArrayList in one of your entities to null, it WILL NOT set every other reference to it to null.

EDIT: can replace ArrayList with any Object and the same thing applies.
9  Game Development / Game Mechanics / Re: Collision between different maps (2d lwjgl) on: 2015-06-14 14:23:41
From what I read your still a bit confused by javas approach to pass by value.

try this code out for example

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  
public class Main {
   public static void main(String [] args) {
      Test a = new Test();
      a.a = 50;
      a.b = 60;
      exampleA(a);
      System.out.println("passing a object to a method " + a.a + "  "+a.b);
     
      int d = 50;
      exampleB(d);
      System.out.println("passing a primitive to a method "+d);
   }

   public static void exampleA(Test b) {
      b.a *= 10;
      b.b *= 5;
      b = null;
   }
   
   public static void exampleB(int c) {
      c = 500;
   }

}

public class Test {
   public int a;
   public int b;
}


you can update variables inside of a object that you pass around, but you cant physical change where that object points to on the heap.

The object does get updated everywhere, but the primitive doesn't. Except for setting a object to null, that wont update it everywhere.
10  Game Development / Game Mechanics / Re: Collision between different maps (2d lwjgl) on: 2015-06-14 14:01:29
When can everyone just call it 'pass by pointer?' That's what it is; potential confusion completely circumvented.

I agree 'pass by pointer' would make it so much less confusing, but we can't having it be to easy for people, we have to make it as hard as possible.

Just like one of my lecturers, answers must be word by word correct to the textbook, wrote one word wrong and lost 3 marks, even though the word still made it work.

EDIT: and after rereading your post, I got to what you were saying, reading through it quickly then reading the last paragraph made it seem wrong, but probably better having the value part there for people to know.
11  Game Development / Game Mechanics / Re: Collision between different maps (2d lwjgl) on: 2015-06-14 13:50:57
So whenever you are passing any values/expressions of a reference type (everything except primitive types) around, you would pass a "reference" to that same object around. So everywhere you assign that same reference, it would mean the "exact same object".

To be correct, java is all pass by value.

Although you pass a reference into a method, it actually gets converted to a value, so primitives and objects are both passed by value.
12  Game Development / Newbie & Debugging Questions / Re: Scripting With Jython on: 2015-06-04 02:24:59
I have limited knowledge of Jython, but this is how I remember it.

You import the packages.
you dont need to use new infront of instantiating objects.

then it acts kinda like normal java using the method.

1  
2  
3  
4  
5  
6  
from javax.swing import *

def create:
   frame = JFrame("Window Name")
   frame.setSize(600, 600)
   frame.setVisibile(True)


I am not too sure, exactly how you would fit it in, maybe the use of Singletons so you can always get the current instance of the class. And make a single class that would hold all your methods that you want to allow for your scripts to access.
13  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-05-28 06:08:59
You haven't scratched the surface once it works. Especially the MySQL JDBC library is critically bugged and so far off the spec it's funny.

I managed to find no bugs in JDBC connecting to MySQL.

Though, my program was not complex, but I had all of JDBC up and running in about 30 mins, though I did have one problem, but I think that was my own mistake in writing the SQL code for creating a user, a created user wasn't able to see the database I created (I thought i granted all permissions for the database to the user). But it worked fine when I used root instead.

EDIT:

I did notice a flaw with MySQL Command Line, and MySQL Workbench though, as we had to swap implementations with another group.

I used the Command Line, and wrote my SQL scripts in Notepad++, where the other group used MySQL Workbench.

MySQL Command Line will let you go with some errors, where Workbench is really strict.

E.g.

If you use Timestamp as a data type in MySQL, Workbench requires a default date, where the Command line does not require you to specify the default date.

So we had an issue where they didn't want to use the Command Line to avoid the error, so they edited the SQL script. well, 1 out of the 3 people in there group didn't want to use the Command Line.

It was really only query the database, as full implementation of our designed system would of taken longer then we had, as well as all the test cases and other various testing we need to do.

It was only a uni assignment, so I left it as root access, because we had to supply the .java files to allow others to modify the username, password and IP of the database if required.

14  Discussions / General Discussions / Re: Rayvolution's JGO Appreciation Thread (AKA: Free copies of Retro-Pixel Castles!) on: 2015-05-27 09:36:33
I would be interested in playing it.

I didn't want to buy it for myself yet, because I thought I would wait for it to be nearing completion before I did.
15  Discussions / Miscellaneous Topics / Re: What do you define as a programming language? on: 2015-05-01 10:50:09
This is another askyahoo situation isn't it? where no one have an opinion or thought on their own, instead they just go to sources to give the absolute definition.

Or your responses are well educated.

I am currently studying defining languages and such in Formal Languages and Automata class, which is done in Software Engineering and Computer Science at my uni.

EDIT: Touring machines are apart of Formal Languages and Automata.
16  Game Development / Game Mechanics / Re: [LibGDX] Cinematic text rendering on: 2015-03-21 03:25:17
I have never thought about how to implement it until now, so here is a way you could implement it.

First of all you do not want a loop. If you use a loop, its always going to render the entire string each frame.

Use an if statement, that checks to see if a certain amount of time has passed since the last character appended to the output.

Have a variable that stores the entire string, and append one character to the end of the output, and remove that character from the variable that stores the entire string.

Which should produce one character appearing at a time at a fixed time.
17  Game Development / Newbie & Debugging Questions / Re: Velocity Slide Effect on: 2015-03-18 05:13:46
make DAMP = a higher value?

using 10 as a example, before you apply the DAMP, it would be 10, then as soon as you apply DAMP, it would become 2.

maybe you should use a value that will not reduce it so dramatically. Which is the first thing you should of tried, trying different values, to make it be more to your liking.

at the moment, your reducing it to be 80% of the current value, which seems a little to high for a sliding.
18  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-02-22 01:27:02
I finished all game play elements in my first android game! Woo! (Although they are very simple). Now just some simple sound and some ads and boom! google play store here I come! Pointing I'll post it here when it gets published.

Also, in LibGDX is there any way to call a method in my AndroidLauncher class from my core class?

Yes, add an interface to the AndroidLauncher (and other Launcher files to, just leave the method code blank).

Then pass the class to your core MyGdxGame class, and you can call the methods, if its android the code will execute, if its desktop or any other, it wont.

EDIT: this link here shows you how to implement what I was talking about, but when I added ad's the wiki page was outdated.
19  Game Development / Newbie & Debugging Questions / Re: Attempting to make my game prototype take screen shots via LIBGDX. on: 2015-02-12 00:54:52
you have to make a new instance of the class.

1  
2  
3  
ScreenRecorder screenRecorder = new ScreenRecorder();

screenRecorder.takeScreenshot();
20  Game Development / Shared Code / Re: LibGDX Lightning Effect Code on: 2015-02-11 12:15:56
Also to make it simpler @Phased took out a performance enhancement where I use the Sqrt class with precalculated values to speed up the get distance calculation

Furthermore note that this code was not intended for third party use and was just part of my code base and I posted it, meaning it might still be clunky and there are some hardcoded values to some extend.

Actually, I just changed from my getDistance() to your original implementation.

Looking through the code again, in your original implementation, you decided to use the getDistanceAccurate() method, which is the code implemented in the one on this thread.

Your Trigonemtrics class had getDistanceAccurate() and getDistanceFast(), and your GFX class used getDistanceAccurate().


About the hard coded variables, there is a few, but I did mess around with them, and then numbers you chose in my opinion are the actual "magic number" they made it look the best in my opinion.

I was going to add a method to set them, so the user could customize it, but I didn't worry as it didn't really improve it.
21  Game Development / Shared Code / LibGDX Lightning Effect Code on: 2015-02-11 04:16:00
To an Android Game I am currently developing slowly, I thought a Lightning effect would look good to link and show something is in effect.

I first tried to create my own Lightning, but my first go didn't look exactly as I wanted it.

I remembered seeing a post about someone sharing some source code on a game, and decided to look for it.

After talking to Cero about his lightning code here, I went through with it and implemented it into my game.

Since implementing the code into my game, I decided to modify Cero's original code, to make it more friendly to use, by setting some methods to private and also adding a few duplicate methods to allow more control or less code required to use.

Source Code
Source Code can be found here

Implementation
The GFX class is completely static, you do not need to create a new instance of it, just supply the texture once, and use it when you need to.

During your creation of the game, in the create() method add the line
1  
GFX.setTexture(new Texture("image.png")); //set a texture for it to use, 1x1 white image is all that is required



Preview of the effect:

Default Chain Lightning
Click to Play


Red and Yellow Chain Lightning
Click to Play


Multi Coloured Chain Lightning
Click to Play


Chain Lightning in a random position
Click to Play


Default Sphere Lightning
Click to Play


Red and Yellow Sphere Lightning
Click to Play


Multi Coloured Sphere Lightning
Click to Play



Using a 1x1 white image will produce the lightning a little differently to what is seen in the previews, if you would like the image I used you can get it here

If you have any suggestions for improvements, let me know, and I will see what I can do.

Thanks to Cero for letting me use his code, the original can be found here.
22  Game Development / Newbie & Debugging Questions / Re: Android error: package android.os does not exist on: 2015-02-04 12:45:39
Do you have the Android SDK setup in eclipse?

Have you downloaded the Android API from the Android SDK Manager?
23  Game Development / Newbie & Debugging Questions / Re: True sprite centering libgdx on: 2015-01-27 05:16:46
Not knowing how much of your code works, if you want to just center it on your screen.

1  
player.setPlayerPosition((Gdx.graphics.getWidth() / 2 ) - (texture.getWidth() / 2), (Gdx.graphics.getHeight() / 2 ) - (texture.getHeight() / 2));


Well, ray, just as i went to hit post, you replied.
24  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-01-24 07:32:32
Got into the windows insider program and a free copy of Windows 10, installed it on my Surface Pro 3 after having to hack an intel driver installer that specifically says not to install it on Windows 10 in the '.inf' file. Works fine though... For now...

That is a preview build, not the final build, so I hope you kept your windows key (or you could be dual booting I guess). Once Windows 10 is released, you will need to change back to your old Windows, and upgrade to windows 10.

All windows 7 and 8 users will be able to upgrade to Windows 10 for free for the first year of its release.
25  Discussions / General Discussions / Re: RESOLVED: am thinking of getting this PC, for both gaming and developing on: 2015-01-22 22:46:03
New computer built from parts is up and running!

I'm using an AMD FX 6300 CPU (6 cores). There is an 8-core available for a future upgrade.

I'm using a Saphire Radeon R7 260X GPU. It was listed as a good low-cost option for gaming PCs in a Toms article. (Ah, Phased recommended this GPU in an earlier post.) Upgrading to a 750 Ti can wait for a bit.

Thanks, everyone!

I wouldn't think going from a Radeon 260X to a GeForce 750Ti would be much of an upgrade if any.

http://gpuboss.com/gpus/Radeon-R7-260X-vs-GeForce-GTX-750-Ti

It is not a upgrade, but he was on a really low budget, my suggestion was a 750 TI, and a Radeon 260x if he had to really save money (almost half the price in some cases). Especially when he noted his not a huge gamer, especially not with newer games that get released.

he also said the GTX 750 TI would be a future upgrade, though by the time you decide to upgrade @philfrei , it would probably be better to try going for something more powerful then the 750 TI.

From looking at graphics cards when I was looking one for a friend, a lot of people were suggesting the Radeon 260x over the GTX 750 TI, as it was cheaper and supposedly better in some cases.

Also from my looking around, most people on tomshardware tell people to not use gpuboss as its not a reliable way to compare them.
26  Game Development / Newbie & Debugging Questions / Re: Is LWJGL 3 stable enough for use? on: 2015-01-06 04:37:15
Better in the long run?

Yes, LWJGL 3 has a bigger plan then just target desktop. And is going to be adding other stuff such Occulus rift support. Also, LWJGL 2 is no longer being maintained, so any bugs will most likely stay in it for ever, while bugs will be fixed in LWJGL 3.

Stable enough, I think it should be, if it was not stable enough, I do not think they would of started to release builds for use.
27  Game Development / Newbie & Debugging Questions / Re: Is LWJGL 3 stable enough for use? on: 2015-01-06 04:31:55
I did a direct copy and paste of a game pretty much from LWJGL 2 to LWJGL 3.

the only error I had (that I remember) from the copy and paste was my Shader loading class, which was horrible in a way, so I changed it.

for changing the display to GLFW, well I pretty much just followed the LWJGL 3 GUIDE, when I did it there was one mistake in it, but I managed to work that out by just checking out the LWJGL3 wiki.

I think if you have a little bit of experience in LWJGL or just OpenGL in general, it should not be really much of a difference.

SHC has also been writing LWJGL3 tutorials on his website, so you could follow his tutorials to learn how set up GLFW.
28  Discussions / General Discussions / Re: System requirements for Oculus Rift? on: 2015-01-04 23:14:13
I believe you really want to go for about 75+ FPS for it to be good.

from their website:

Minimum requirements: A computer running a Windows 7 or higher, Mac OS 10.8 or higher, or Ubuntu 12.04 LTS operating system, 2 USB ports (at least one powered), and a DVI-D or HDMI graphics output.
Recommended specifications: A desktop computer running a dedicated graphics card with DVI-D or HDMI graphics output, with capability of running current generation 3D games at 1080p resolution at 75fps or higher.


I believe at lower then 75 FPS its easier for people to get nausea from the use of it.

from a Reddit Thread, they recommend a minimum of a GTX 770.

The integrated graphics, may be ok for short testing.

I believe Mike has a Occulus rift, I think he integrated it with his game if I remember correctly, may be thinking of someone else, but I think it was him.
29  Discussions / Miscellaneous Topics / Re: The Escapist! on: 2015-01-04 09:08:10
That 2.55 million is not pure profit. Only a fraction of that 2.55 million was actually profit.

So now.

firstSubtraction = 2.55 million - cost of development.

now we are getting closer to the profit.

secondSubtraction = firstSubtraction - money to be put into the next game to be developed.

now we have how much profit they actually made. I can't give you values, as I do not know them, and I do not know how much they got paid per developer.

you could even subtract the cost of what it takes to keep their office rent / power bills / internet bills / what ever else is needed to keep their business and office up.

thirdSubtraction = secondSubtraction - business or office costs.

that 2.55 million could actually mean their behind in profit, and lost money because of this game they made.
30  Discussions / Miscellaneous Topics / Re: What I did today on: 2014-12-27 06:48:35
You can still start your computer.

Find out what pins are the power button on your motherboard, and you should be able to just bridge it with something like a screw driver (something metal) to short it.
Pages: [1] 2 3 ... 11
 
Jesse (11 views)
2015-07-29 04:35:27

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

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

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

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

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

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

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

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

NoxInc (18 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
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!