Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (538)
Games in Android Showcase (132)
games submitted by our members
Games in WIP (600)
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
1  Game Development / Newbie & Debugging Questions / Re: Should I make different classes for different levels of my game ? on: 2014-12-18 02:57:10
Hmm. I can't see any benefits in it. That would complicate things in the future.
If you do plan on making different classes for levels try to have them implement an interface or extend an abstract class.
2  Game Development / Newbie & Debugging Questions / Re: Reading nextInt() from a text file on a new line? on: 2014-12-18 02:52:55
I typed it out on here.

replace:
1  
for (int i = 0; i < line.length; i++) {


with:
1  
for (int i = 0; i < line.length(); i++) {
3  Game Development / Newbie & Debugging Questions / Re: Should I make different classes for different levels of my game ? on: 2014-12-18 02:50:11
No you make a "Level" class which contains all the level data.

So say you have a class called Level:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
public class Level {
   
    private Tiles[][] tiles;
    private String name;

    public Level(String name, Tile[][] tiles) {
         this.name = name;
         this.tiles = tiles;
    }

}


Now you can do:
1  
2  
Level level1 = new Level("level1", tileArray1);
Level level2 = new Level("level2", tileArray2);


Extremely basic it's up to you to extend the design.
4  Game Development / Newbie & Debugging Questions / Re: Reading nextInt() from a text file on a new line? on: 2014-12-18 02:43:50
1  
2  
3  
4  
5  
6  
7  
8  
while (input.hasNext()) {
    String line = Integer.parseInt(input.nextLine());
    for (int i = 0; i < line.length; i++) {
        int n = Character.getNumericValue(line.charAt(i));
        System.out.println(n);
    }
    System.out.println("------");
}
5  Game Development / Newbie & Debugging Questions / Re: Reading nextInt() from a text file on a new line? on: 2014-12-18 02:41:38
Yes thats what that loop I pasted will do.

@BurntPizza wow Scanner looks really useful for parsing my model files. Can't believe I've never ran across it. Might switch over to that instead of BufferedReader and splitting/substring manipulations.
6  Game Development / Newbie & Debugging Questions / Re: Reading nextInt() from a text file on a new line? on: 2014-12-18 02:34:28
1  
2  
3  
for (int i = 0; i < line.length; i++) {
    int n = Character.getNumericValue(line.charAt(i));
}


This?
7  Game Development / Newbie & Debugging Questions / Re: Reading nextInt() from a text file on a new line? on: 2014-12-18 02:25:07
Oh so it coudl be like so:

1  
2  
3  
1234
2341
1235


and you want to read each digit??
8  Game Development / Newbie & Debugging Questions / Re: Reading nextInt() from a text file on a new line? on: 2014-12-18 02:23:21
1  
2  
3  
4  
5  
6  
7  
8  
try (BufferedReader reader = new BufferedReader(new FileReader(fileName))) {
    String line;
    while ((line = reader.readLine()) != null) {
          System.out.print(Integer.parseInt(line));
    }
} catch (IOException | NumberFormatException e) {
    e.printStackTrace();
}
9  Game Development / Newbie & Debugging Questions / Re: [LWJGL] Sending multiple textures to sampler uniforms in openGL on: 2014-12-18 01:15:24
Latest GLSL versions allows this

frag:
1  
layout(binding=0) uniform sampler2D diffuseTex

the 0 is the slot.

java where you bind:
1  
2  
GL13.glActiveTexture(GL13.GL_TEXTURE0 + slot);
GL11.glBindTexture(GL11.GL_TEXTURE_2D, getId());
10  Game Development / Newbie & Debugging Questions / Re: LWJGL - Immediate rendering alternative on: 2014-12-18 00:26:17
I figured it was something like that. Thanks for the glVertexAttribPointer() tip I'll look into that.
11  Game Development / Newbie & Debugging Questions / Re: LWJGL - Immediate rendering alternative on: 2014-12-17 22:19:42
Okay. I had to clear depth buffer before using the immediate calls.

But now it renders the immediate stuff with the center at the middle of the screen. How do I update those transforms?

Remember I'm not 100% familiar with the deprecated code.

Here for reference:
Click to Play
12  Game Development / Newbie & Debugging Questions / Re: LWJGL - Immediate rendering alternative on: 2014-12-17 21:21:25
nothing ? O_o

Yes, nothing renders at all. I have no experience with the deprecated immediate mode. So I might not be setting up properly?

And thanks Mac70. I just need them to debug frustum and ray casting. It is not going to be a part of my game. I just need a visual for that sort of thing.

I'm testing by using this:
1  
2  
3  
4  
5  
GL11.glColor3f(1f, 1f, 1f);
GL11.glBegin(GL11.GL_LINES);
GL11.glVertex3d(10, 5, 10);
GL11.glVertex3d(10, 15, 10);
GL11.glEnd();
13  Game Development / Newbie & Debugging Questions / Re: LWJGL - Immediate rendering alternative on: 2014-12-17 20:45:29
Yeah that's what I figured. However,
1  
2  
3  
4  
GL11.glBegin(GL11.GL_LINE);
...
...
GL11.glEnd();


Does nothing.
14  Game Development / Newbie & Debugging Questions / LWJGL - Immediate rendering alternative on: 2014-12-17 20:04:35
I want to render points and lines on screen for debugging purposes.

What methods are there?
15  Games Center / WIP games, tools & toy projects / Re: SilenceEngine - A 2D/3D Game Engine on: 2014-12-14 15:32:37
Keep up the good work! Make sure as you progress to keep things just as simple as it is now. If this starts getting overly complicated and over engineered it will have no use.

Great work nonetheless!
16  Game Development / Newbie & Debugging Questions / Re: 3D GPU animation skinning issue on: 2014-12-11 21:39:22
I'm modeling a new test model now. I decided to repurpose the old MD5 script and make my own format out of it. It now converts exported models to OpenGL coordinates (flips y-z)
17  Discussions / General Discussions / Re: Sprite DLight - Instant normal maps for 2D graphics on: 2014-12-11 19:17:55
-Clap clap-

This is extremely impressive. Makes me want to work on a modern "retro" 2D game!
18  Game Development / Newbie & Debugging Questions / Re: 3D GPU animation skinning issue on: 2014-12-11 04:57:51
Tried flipping them around couldn't seem to find the right combo. It morphed the mesh in weird ways
19  Game Development / Newbie & Debugging Questions / Re: 3D GPU animation skinning issue on: 2014-12-11 02:35:35
Ill try that out and I'll get back with the results
20  Game Development / Newbie & Debugging Questions / Re: 3D lighting with lwjgl on: 2014-12-11 00:34:48
Here's the best resource for lighting:

https://www.youtube.com/watch?v=mo94KvzjHB0&list=PLEETnX-uPtBXP_B2yupUKlflXBznWIlL5&index=24
21  Game Development / Newbie & Debugging Questions / 3D GPU animation skinning issue on: 2014-12-11 00:33:33
I have GPU animation skinning working however the resulting effects are so strange. I've figured that i need to flip some axis's or something but I'm not sure which. I've tried just about every combo!

Please help me out? Any clues?

I ported this code: http://3dgep.com/gpu-skinning-of-md5-models-in-opengl-and-cg/

Heres what it looks like:
Click to Play







This is what the animation should be like:
<a href="http://www.youtube.com/v/3lxq95MnRW0?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/3lxq95MnRW0?version=3&amp;hl=en_US&amp;start=</a>
22  Game Development / Newbie & Debugging Questions / Re: LWJGL - 3D Frustum Issue on: 2014-10-16 15:01:05
My frustum isn't culling properly when I move the camera around. Its hiding chunks and showing chunks completely incorrectly.
23  Game Development / Newbie & Debugging Questions / Re: LWJGL - 3D Frustum Issue on: 2014-10-13 21:57:56
Can anyone point me in the right direction?
24  Game Development / Newbie & Debugging Questions / Re: LWJGL - 3D Frustum Issue on: 2014-10-10 13:00:45
Thats what I figured. But the camera is rotating fine. So doesn't that mean my viewMatrix is rotating? And the projectionMatrix shouldn't change, right?
25  Game Development / Newbie & Debugging Questions / Re: LWJGL - 3D Frustum Issue on: 2014-10-10 03:14:12
UPDATE:

Analysis: When I point the camera at the origin (0,0,0) all chunks render (I have it counting chunks rendered). And as I rotate over to 180degrees away from the origin the chunks stop rendering at a consistent rate as I approach 180degrees. Then if I continue towards 360 back to origin they start rendering as same rate they were disappearing.

I'm stumped... 
26  Game Development / Newbie & Debugging Questions / LWJGL - 3D Frustum Issue on: 2014-10-10 02:11:08
What is a typical set up for frustum culling?

I've looked at example codes but the culling is coming out wrong.

Chunks that shouldn't be rendering are rendering and some aren't rendering.

This is how I'm setting it up:
1  
2  
3  
4  
Matrix4f.mul(projMatrix, viewMatrix, combinedMatrix);
invProjViewMatrix.load(combinedMatrix);
invProjViewMatrix.invert();
frustum.update(invProjViewMatrix);


And I'm extracting the planes the typical way.

this is how I update my viewMatrix:
1  
2  
3  
4  
5  
setIdentity();
rotate((float) Math.toRadians(camera.getPitch()), new Vector3f(1, 0, 0));
rotate((float) Math.toRadians(camera.getYaw()), new Vector3f(0, 1, 0));
Vector3f cameraPos = camera.getPosition();
translate(new Vector3f(-cameraPos.x, -cameraPos.y, -cameraPos.z));



What's wrong?


EDIT: Heres what it looks like with me rotating the camera around: (It only renders wire mesh when its "outside" frustum. For debugging purposes.)

http://i.imgur.com/uvrYtGc.gifv


Big gif. Takes awhile to load.
27  Game Development / Newbie & Debugging Questions / Re: LWJGL - 3D Tiled Terrain on: 2014-10-06 21:50:43
Any good resources on shadow mapping?

I can't find any that look promising.
28  Game Development / Newbie & Debugging Questions / Re: LWJGL - 3D Tiled Terrain on: 2014-10-06 21:47:07
Updated. However there is a slight performance hit.

Ultimately I'm divide into chunks.

Good idea?
29  Game Development / Newbie & Debugging Questions / Re: Would it be better to make a thread for terrain generation> on: 2014-10-06 04:01:32
There would be no benefit (that I can think of) to do it in another thread.

Usually only thing that would be in another thread for a game would be the network thread.
30  Game Development / Newbie & Debugging Questions / Re: Would it be better to make a thread for terrain generation> on: 2014-10-06 02:58:51
Is your terrain going to be dynamic?

If not there is not need to create another thread to generate. Just generate it once.
Pages: [1] 2 3
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

rwatson462 (28 views)
2014-12-15 09:26:44

Mr.CodeIt (19 views)
2014-12-14 19:50:38

BurntPizza (37 views)
2014-12-09 22:41:13

BurntPizza (73 views)
2014-12-08 04:46:31

JscottyBieshaar (34 views)
2014-12-05 12:39:02

SHC (47 views)
2014-12-03 16:27:13

CopyableCougar4 (42 views)
2014-11-29 21:32:03

toopeicgaming1999 (110 views)
2014-11-26 15:22:04

toopeicgaming1999 (96 views)
2014-11-26 15:20:36

toopeicgaming1999 (29 views)
2014-11-26 15:20:08
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

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
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!