Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (522)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (589)
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 ... 39
1  Discussions / Miscellaneous Topics / Re: What I did today on: 2014-11-22 16:04:58
@kpars

Wow, thought you won't do that?!

@others

Implemented Display and Input, and Batcher in my SilenceEngine.



@kpars

Wow, I replied to you!! Tongue
2  Game Development / Newbie & Debugging Questions / Re: [GLFW][LWJGL3] Toggle between fullscreen and windowed mode on: 2014-11-22 13:55:48
Thanks for your reply Spasi. This is resolved for now. For anybody who is having this issue, here is my
setFullScreen()
method.

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  
public static void setFullScreen(boolean fullScreen)
{
    if (Display.fullScreen == fullScreen)
        return;

    Display.fullScreen = fullScreen;

    if (fullScreen)
    {
        ByteBuffer vidMode = glfwGetVideoMode(glfwGetPrimaryMonitor());

        oldWidth = width;
        oldHeight = height;

        width = GLFWvidmode.width(vidMode);
        height = GLFWvidmode.height(vidMode);
    }
    else
    {
        width = oldWidth;
        height = oldHeight;
    }

    // Create new window
    long fsDisplayHandle = glfwCreateWindow(width, height, "SilenceEngine", fullScreen ? glfwGetPrimaryMonitor() : NULL, displayHandle);
    glfwDestroyWindow(displayHandle);
    displayHandle = fsDisplayHandle;

    glfwMakeContextCurrent(displayHandle);
    glfwSwapInterval(1);

    GLContext.createFromCurrent();
    glClear(GL_COLOR_BUFFER_BIT);
    resized = true;

    WindowCallback.set(displayHandle, new WindowCallbackAdapter()
    {
        @Override
        public void windowSize(long window, int width, int height)
        {
            Display.width  = width;
            Display.height = height;

            resized = true;
        }

        @Override
        public void key(long window, int key, int scanCode, int action, int mods)
        {
        }
    });

    show();
    centerOnScreen();
}

Yes, I'm trying to make a Display class, so that most of the old code can be ported without many problems. Thanks again Spasi.
3  Discussions / Chitchat Monster / Re: Just got Far Cry 4!!!!! on: 2014-11-22 09:51:22
Please don't post Cracked-Games on the Forum. This forum is for game developers, not for crackers.
4  Game Development / Newbie & Debugging Questions / [Solved][GLFW][LWJGL3] Toggle between fullscreen and windowed mode on: 2014-11-22 09:15:14
Hello,

I've tried to toggle between fullscreen and windowed mode, but calling
glfwDestroyWindow()
also destroys it's context. Is there any way to toggle between fullscreen and windowed mode without losing the context?

Thanks.
5  Java Game APIs & Engines / OpenGL Development / Re: LWJGL 3; how's it getting along? on: 2014-11-21 17:26:56
Nevermind, it is resolved now. I forgot to rebuild after changing the library and natives.
6  Java Game APIs & Engines / OpenGL Development / Re: LWJGL 3; how's it getting along? on: 2014-11-21 17:18:23
Hey Spasi,

It's now working, but there is another bug. When I've clicked the close button on the window, the window became unresponsive, and I've to force quit it. No exceptions, but the return code is 137.
7  Java Game APIs & Engines / OpenGL Development / Re: LWJGL 3; how's it getting along? on: 2014-11-21 17:05:33
Think I've found a bug on OS X. The library is spitting an
UnsatisfiedLinkError
until I explicitly call
Sys.getNativeLibrary()
method. The natives aren't loaded until I call that method.
8  Discussions / General Discussions / Re: Jar Decompiler? on: 2014-11-21 08:43:42
I prefer this, JD-GUI. Also has plugins for Eclipse and IntelliJ.

9  Game Development / Game Play & Game Design / Re: Represent entity with multiple points on: 2014-11-20 10:40:02
I think that what you are asking, is about animation and collision detection. If you want to display an animation, you would have two images (or more) and draw them each for a frame, and you will see it animate. To know which part was collided, use hitboxes.

For, example, see these two images. The first one shows the sprite, and the second one shows the sprite with hitboxes drawn on it.



These hitboxes are just rectangles, which you can use to test on which part the collision took place. What you'd be doing is testing each of the sprite's rectangles with each of the other sprite's hitboxes to determine the collision. If any one intersect, you know which part, i.e., which hitbox intersects, and react to the collision.
10  Discussions / General Discussions / Re: java jar file rejected by folks at "Demo Derby", need .mov ASAP on: 2014-11-18 16:41:54
Your game doesn't work on my mac. It stays forever at the intro screen. From the second launch, I see no window. Here is the console output.

1  
2  
3  
4  
5  
6  
Harshas-Mac-Pro:Downloads sriharshachilakapati$ java -jar hexarademoderby.jar
making GameFrame:1416328832187
making smokegs:1416328833098
PZConstructor, starfld1:com.adonax.hexara.stars.StarField@7daf6ecc
com.adonax.hexara.PuzzlePanel[,0,0,0x0,invalid,alignmentX=0.0,alignmentY=0.0,border=,flags=0,maximumSize=,minimumSize=,preferredSize=]
Harshas-Mac-Pro:Downloads sriharshachilakapati$

Sorry, couldn't accomplish the task.
11  Discussions / General Discussions / Re: java jar file rejected by folks at "Demo Derby", need .mov ASAP on: 2014-11-18 14:54:04
Can I record it for you? MOV is the default format for QuickTime on mac.
12  Games Center / WIP games, tools & toy projects / Re: Mercury: The Simple 2D Game Library | >> BETA coming soon << on: 2014-11-17 16:11:49


Ported Framebuffer API to Modern OpenGL. Here's a small snippet showing how to use the framebuffer.

1  
2  
3  
4  
5  
6  
7  
8  
frameBuffer.use();
{
    g.setColor(Color.CRIMSON);
    g.drawRectangle(100, 100, 100, 100);
    g.setColor(Color.CLOUDS);
    g.drawString("This is rendered to framebuffer!!", 0, 0);
}
frameBuffer.release();

That renders to the framebuffer. Then you can simply get the rendered texture by calling
frameBuffer.getTextureObject()
and use it while rendering. The test renders the texture to a rotating rectangle.

And here is the FrameBufferTest running under Mac with OpenGL 3.3 (A crappy gif I could record)

Click to Play


And also fixed a small bug that caused rendering of
SubTexture
s to cause an NullPointerException. Anyways, this is so small right now.

We plan to release this somewhere between 20th and 30th of December, and there is a lot more to do. Jev is currently working on a TMX map loader, and it's going on pretty well, that should be available in his next commit. Till then, I'll be working on the documentation, and will be testing to find any bugs that might crept in.

Happy Time Folks!!
13  Game Development / Newbie & Debugging Questions / Re: ArrayList error on: 2014-11-17 12:38:50
Grids are better when used against static objects (Even in other case, they are better than brute-force). For moving objects, generally QuadTrees are preferred. If you need to use them for moving objects, you have to re-construct the grid every frame. Or better, only update the entity which moves.

So you have to store the grid cells in the entity too, then remove the entity from those cells. Calculate the new cells and insert the entity there. This will be a lot more better.
14  Game Development / Newbie & Debugging Questions / Re: ArrayList error on: 2014-11-16 04:20:54
Hello @hugotheman

I'm the author of that article you're referring to. The above code was valid in Java 1.5, but not under newer Java versions. You have to follow what CopyableCougar4 has suggested.
15  Discussions / General Discussions / Re: Parsing SVG files on: 2014-11-16 03:43:15
I've found the specification of SVG 1.1 (The Latest Release). Here's the link http://www.w3.org/TR/SVG/
16  Games Center / WIP games, tools & toy projects / Re: Mercury: The Simple 2D Game Library | >> BETA coming soon << on: 2014-11-15 16:25:09
This is to notify you guys that I've successfully converted the code to use OpenGL core profile. Here's a screenshot showing you the tests that are along with the library being run on core profile.




To do this, I've made two new classes,
Matrix4f
and
GraphicsUtils
. I've removed the
VAOUtils
class completely, as it has no use, since the new code is relatively small. This
GraphicsUtils
class, is used to emulate the Matrix stack, to provide the an easy way to keep the matrices for every frame.

I've also modified a lot of shader code, and the default shader uses 330 version of the OpenGL Shading Language. Everything is working, and we are currently assuming that most people will use the standard shader, have made the process of using the shader difficult with
VAOBatcher
since we hard-code the names of the uniforms we use, and also the locations of the attributes is fixed.

I also made modifications to the
Graphics
and
Batcher
interfaces to include another void method called
cleanup
to clean the handles for OpenGL objects generated in the constructor and I've called those methods in the
end
method of the
Runner
class to ensure that they get cleaned every time.

Anyways, I'm proud to say that these changes doesn't effect the library, any existing code using this library runs fine just without porting.

Happy Time Users!!
17  Discussions / Miscellaneous Topics / Re: The C family, should I dig deeper? on: 2014-11-14 13:02:47
Learn any language, but don't deviate from the logical thinking of OOP style. C Programs are written Top-Down, they focus more on the procedural paradigms. While high level programs are written with a focus on the data. The thinking is different for C style, C++ style and Java/C# style.
18  Game Development / Newbie & Debugging Questions / Re: lwjgl Exiting my launcher and starting my game on: 2014-11-11 06:26:26
Oops an accidental medal..
19  Game Development / Newbie & Debugging Questions / Re: Bitshift Operators in RGB values? on: 2014-11-10 17:27:57
(Also, SHC, you have a typo: "java int's are 4kb each"  Tongue)

Yep! Fixed that. Thanks for pointing it out.
20  Game Development / Newbie & Debugging Questions / Re: Bitshift Operators in RGB values? on: 2014-11-10 16:28:56
The definition of OR is simply Either this or this. If any of the two inputs to an OR gate is 1, then the output is 1. So, this truth table should help you understand.

 P | Q | Y
---|---|---
 0 | 0 | 0
---|---|---
 0 | 1 | 1
---|---|---
 1 | 0 | 1
---|---|---
 1 | 1 | 1

Logical OR


 P | Q | Y
---|---|---
 0 | 0 | 0
---|---|---
 0 | 1 | 0
---|---|---
 1 | 0 | 0
---|---|---
 1 | 1 | 1

Logical AND



The difference between those two is really simple, OR requires at least one to be 1 while AND requires both to be 1 for the output to be 1.
21  Game Development / Newbie & Debugging Questions / Re: Bitshift Operators in RGB values? on: 2014-11-10 15:07:18
To store a value of 255, you need 8 bits size. The purpose of this, is to simply package them into a single 32 bit package. (java int is 4bytes, giving you 4*8=32 bits). The idea is to represent every 8-bit value in 32-bits and simply, or them.

Let's take an example. We have a color in ARGB format as (100, 255, 50, 158) and you need to package them into a single ARGB integer. First, we see the bit versions of those integers.

1  
2  
3  
4  
   A: 0000 0000 0000 0000 0000 0000 0110 0100
   R: 0000 0000 0000 0000 0000 0000 1111 1111
   G: 0000 0000 0000 0000 0000 0000 0011 0010
   B: 0000 0000 0000 0000 0000 0000 1001 1110

So, now if you OR them, the contents will be damaged and cannot be retrieved. So we shift the bits, in-order to place all them in the same single 32-bit package. First, we shift A by 24 bits to make it the first in the package. We shift R by 16 bits to make it second, G by 8 bits to make it third. We don't shift B since it is already in place. After doing that, the values look like this.

1  
2  
3  
4  
   A: 0110 0100 0000 0000 0000 0000 0000 0000
   R: 0000 0000 1111 1111 0000 0000 0000 0000
   G: 0000 0000 0000 0000 0011 0010 0000 0000
   B: 0000 0000 0000 0000 0000 0000 1001 1110

Finally, you OR them together to package them into a 32-bit ARGB integer. So the ARGB looks like this.

1  
ARGB: 0110 0100 1111 1111 0011 0010 1001 1110

That's the ARGB integer. This is the way you follow to pack the integers. Instead of just applying this, pay an attention to the pixel format, in this case, it is ARGB. There are also other formats like ABGR, RGBA, BGRA, etc., The shift to be done depends on the pixel format you are packing into. By the way, the value of that integer in decimal system is (1694446238)10 very large, isn't it?

Hope this helps.
22  Games Center / WIP games, tools & toy projects / Re: Army Men - a 3do fangame! on: 2014-11-09 05:28:43
It ran at 17 fps from the console. First time, it showed this exception:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
 World setup in (17.319s)
java.lang.NullPointerException
   at net.mantagames.armymen.Game$1.compare(Game.java:88)
   at net.mantagames.armymen.Game$1.compare(Game.java:1)
   at java.util.TimSort.countRunAndMakeAscending(TimSort.java:351)
   at java.util.TimSort.sort(TimSort.java:216)
   at java.util.Arrays.sort(Arrays.java:1512)
   at java.util.ArrayList.sort(ArrayList.java:1454)
   at java.util.Collections.sort(Collections.java:175)
   at net.mantagames.armymen.Game.reorderObjects(Game.java:85)
   at net.mantagames.armymen.Game.update(Game.java:60)
   at net.mantagames.armymen.Client.update(Client.java:284)
   at net.mantagames.anarchyengine.Core$GameTickRate.run(Core.java:300)
   at java.lang.Thread.run(Thread.java:745)
AL lib: (EE) alc_cleanup: 1 device not closed
Harshas-Mac-Pro:ARMY MEN sriharshachilakapati$

Second time, I ran it, but configured every option to LOW, and it ran at 17fps.
23  Discussions / Miscellaneous Topics / Re: Mechanical Engineering on: 2014-11-08 16:02:47
We have those chips in DLD (Digital Logic Design) lab.
24  Games Center / WIP games, tools & toy projects / Re: Army Men - a 3do fangame! on: 2014-11-08 12:59:09
Well, unfortunately, it's not playable for me. First I found a bug when I input my name. Every character is inputted twice. Then the game is utter slow, only giving 1fps for me, but on windows it plays at constant 60fps.

Any Ideas?
25  Games Center / WIP games, tools & toy projects / Re: Army Men - a 3do fangame! on: 2014-11-08 12:48:05
Downloading it right now. Will let you know of the results.
26  Games Center / WIP games, tools & toy projects / Re: Army Men - a 3do fangame! on: 2014-11-06 13:58:34
It looks great, but before downloading, I'd like to know whether you've fixed the OS X bug, just because the download is large for me.
27  Games Center / WIP games, tools & toy projects / Re: The Final Jump (Windows, Linux, Mac) on: 2014-11-06 12:19:46
Is there any download to play? The idea sounds nice.
28  Games Center / WIP games, tools & toy projects / Re: SJGL (Now on GitHub!) on: 2014-11-04 17:24:00
Could you try running the program again? Sometimes that helps. Otherwise, I don't know.

Is it a joke? I ran this more than 5 times and the same output.
29  Games Center / WIP games, tools & toy projects / Re: SJGL (Now on GitHub!) on: 2014-11-04 17:10:22
Well, your example doesn't work on OS X.



Console output here.

1  
2  
3  
4  
5  
6  
$ java -jar FindTheCake.jar
Creating Window Find The Cake
Size = 640x480
Resizable = false
Component null added to window.
$
30  Games Center / WIP games, tools & toy projects / Re: SJGL (Simple Java Game Library) on: 2014-11-04 08:27:16
There are a lot of criticisms here, so I would like to clear them up and make a summary of the thread. (I don't want to offend anyone) So here are the very important things you need to take care of, DarkCart.

  • Project Hosting

    DarkCart, you are offering everything in the form of downloads, but the main thing is nobody is going to download things without knowing what it can do. The best thing you can do is to host your project online (GitHub is better in that case) and also show some screenshots what your library is capable of.

    Hosting on the internet has it's benefits, users need not download to look at the stuff, they can browse the code online and save a lot of time themselves. It also allows people to contribute in return, or notify you of any issues or bugs, and you can fix them asap. I recommend you to host your library on GitHub to prevent these criticisms.

  • Naming Conventions

    You named your methods in a weird manner which no one really expects. Your methods start with
    gl
    in their names, which confuses many users that your library uses OpenGL, which is not the case. It's not going to benefit you, as this may cause a reduction in the number of users that are willing to try your library.

    Another example is you named your color class as
    ColorValue
    while many people prefer
    Color
    as the name. Using non-standard conventions will do nothing but scare people away. I recommend you to change these names to the correct ones to avoid the confusion of your users.

  • The Tools you Use

    Even the tools you use does matter for your users. You are using Java2D, which is not the right tool for this job. Java2D is not designed for performance efficient graphics programming, and especially not with games in mind. Since yours is a game library, you should really start using the recommended libraries, such as OpenGL. I recommend learning OpenGL and LWJGL (again I don't want to start wars, but I do prefer LWJGL) and make your library use it.

    Not only that OpenGL allows you to gain good performance and frames per second, it will also give you the ability to apply much transformations to your entities using shaders and GLSL. By the way, I'm not against Java2D, nor we hate it, we just say that it is not the right tool for games programming.

  • Proper Game Loop

    As seen in your
    ImageTest
    example, your game loop is the not the right one, and is an example of a bad game loop. You might want to look at the game loops article written by EliDelventhal in the articles section of this forum. Or you can also read the article by Koen Witters, namely deWitter's Game Loops on the KoonsoloGames website. That is more necessary for a perfect game loop.

    And again, the game loop should be built-into the
    BasicGame
    class, and you should also allow the user to switch between variable frame times or fixed frame times. A perfect library should give those.

  • Proper Demos

    You need to provide proper demos to show off what your library is capable of. ImageTest isn't one, since users need to know how to make a game with your library, just showing them on how to draw an image wouldn't suffice. The recommendation is to make as many games with this as you can (not only limited to tile based ones) and post the screenshots here. It is also important to post the code in a folder alongside with your library on github or whatever hosting you use.

Aside from these things, this entire thread is filled with arguments, they do good in the end, but I think there should not be these many criticisms arguments on a project page. Anyways, DarkCart, these are the things that you need to take care of. I wish you good luck with your game library.
Pages: [1] 2 3 ... 39
 

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

The first screenshot will be displayed as a thumbnail.

trollwarrior1 (26 views)
2014-11-22 12:13:56

xFryIx (69 views)
2014-11-13 12:34:49

digdugdiggy (48 views)
2014-11-12 21:11:50

digdugdiggy (42 views)
2014-11-12 21:10:15

digdugdiggy (36 views)
2014-11-12 21:09:33

kovacsa (60 views)
2014-11-07 19:57:14

TehJavaDev (64 views)
2014-11-03 22:04:50

BurntPizza (62 views)
2014-11-03 18:54:52

moogie (77 views)
2014-11-03 06:22:04

CopyableCougar4 (77 views)
2014-11-01 23:36:41
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!