Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (580)
games submitted by our members
Games in WIP (499)
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 ... 37
1  Game Development / Newbie & Debugging Questions / Re: How do you guys name builds, betas, etc. on: 2014-03-01 11:44:19
If you simply count, it's really easy to auto-update the version number from inside your build-script. Tongue
2  Discussions / General Discussions / Re: GPU acceleration on: 2014-03-01 11:16:17
I don't get it. How is this different from what our bindings to OpenCL/OpenAL/OpenGL offers?
3  Discussions / General Discussions / Re: Considering Java for game development, looking for brains to pick on: 2014-01-21 10:21:16
Why do you want to use Java instead of PHP? If it's for server communications, I find that PHP and Java can easily talk to eachother.

I find that it's just easier and cheaper to find shared hosting with PHP, than Java.
4  Game Development / Game Mechanics / Re: Loading and storing card images on: 2014-01-21 09:16:24
Starting with the assumption that "the game will contain too many cards to load into ram at once" might be a bad idea.
How big is a single card texture, in terms of memory usage?

Are you storing entire cards, or just the artwork? For less ram usage, you can load in just the artwork and the text by itself, and render the assembled cards.
5  Games Center / Showcase / Re: Desktop Bob on: 2014-01-20 12:27:05
How does this.... work? I mean... java?
6  Game Development / Game Mechanics / Re: Rotate camera around origin problem on: 2014-01-20 08:16:06
Thanks for the help guys!

The next section is about upward/downward rotation only. The vector to rotate about changes, because I'm also rotating around the y-axis (poiting upwards).

Currently, I'm finding the vector to rotate about, by taking the taking the x/z coords of the camera position, switching them around and negating the new x-coord.
This is to find the perpendicular vector to the camera position, in 2D space (the y-axis points upwards).

I imagine the problem arises when trying to define this perpendicular vector, when both the x-coord and z-coord are both zero (the case where the camera is directly above or below the origin). I think thats the reason it doesn't help to use the vector "as" a quaternion, because the vector will still never be assembled correctly.

Now, I think my problem comes down to this: How can I find this vector in a reliable way? A way that doesn't break in specific cases. Tongue
7  Game Development / Game Mechanics / Re: Rotate camera around origin problem on: 2014-01-19 16:12:09
I don't know how to implement this, then. I'd still do it the way I showed you, and that doesn't really work when I run it. Googling did nothing, as it seems I'm currently doing it correctly. Or maybe I can't clearly see what they are doing differently.
 
I don't know how I would implement your modification either.

Can you post some pseudocode, or be more specific about how an arcball is different from what I'm currently doing, or what I am doing wrong? Smiley
8  Game Development / Game Mechanics / Re: Rotate camera around origin problem on: 2014-01-19 15:25:05
I'd say: arcball.  It's a nice start.  I like to modify it so that when you click-and-drag outside of the invisible sphere that camera rotates about the vector into the screen.  The combo makes it really easy to look at something in an arbitrary orientation.

I'm quite sure arcball is not what I am looking for. I find it very hard to control what I'm looking at, with that solution.

Is there anything wrong with the code I posted? Am I doing something wrong with the quaternions? It was a shot in the dark for me, using them, so I can't tell if I'm doing something horribly wrong.

EDIT: I just found out my implementation has the same annoying thing as arcball, where the whole scene is tilted and it's impossible to adjust this with the mouse. The gimbal lock also persists. I'm all ears about how to implement the camera without the silly gimbal lock.

9  Game Development / Game Mechanics / Re: Rotate camera around origin problem on: 2014-01-19 10:57:32
You can't get gimbal lock with quaternions...describe what camera control you're trying to implement.

There's an invisible sphere around the origin, on which the camera can move. The camera will always point to the center of the sphere (the origin). This creates the effect of rotating the actual world.

The reason I need this behavior, is that I need to be able to look at a model in the origin, from any angle.
10  Game Development / Game Mechanics / Re: Rotate camera around origin problem on: 2014-01-19 10:29:21
Thanks for the reply!

I tried using Quaternions instead, and it works.. kind of. When rotating the camera around itself, there are no problems. However, when I try to rotate it around the origin, the gimbal lock problem persists.

This is what I do.
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
Quaternion quat = new Quaternion( // Assemble the quaternion from perpendicular vector
               new Vector3(
                      -camera.position.z,
                      0f,
                      camera.position.x),
                Gdx.input.getDeltaY() // This is supposedly the angle of rotation. I'm using the mouse to move the camera.
         );
camera.position.set(0f, 0f, 0f);
camera.rotate(quat);
camera.position.add(
                new Vector3(  // Moving the camera 10 units away, along the opposite vector of the cameras facing direction
                     -camera.direction.x,
                      -camera.direction.y,
                      -camera.direction.z).nor().mul(10f)
                );


The problem is probably how I make that quaternion, but I don't know how else I'd do it. I'm using LibGDX, by the way.  Smiley
11  Game Development / Game Mechanics / Rotate camera around origin problem on: 2014-01-18 16:08:33
Hey guys!

I'm trying to rotate a camera around the global origin, as if it was moving on a sphere, maintaining the same length to the origin at all times. Like the movement that is typical for any 3D model-viewer.

It works great when just rotating around the y-axis, pointing upwards.
1  
2  
3  
4  
camera.rotateAround(
                new Vector3(0f, 0f, 0f),
                new Vector3(0f,1f,0f),
                1f);


The API is like this, for reference:
1  
2  
3  
4  
camera.rotateAround(
                point,
                axis,
                degrees);


However, when I want the camera to rotate upwards or downwards, I need to take care that the camera might already be rotated. Therefore, I can't just rotate around the x- og z-axis. I tried finding the perpendicular vector in 2D and rotating it around that, and that worked!
1  
2  
3  
4  
5  
6  
7  
camera.rotateAround(
                new Vector3(0f, 0f, 0f),
                new Vector3(
                      -camera.position.z,
                      0f,
                      camera.position.x),
                1f);


Here's the problem though: Whenever my camera is directly above or directly below the origin, this math breaks and I can no longer rotate. I'd like to, though. How can I solve this problem, so it doesn't break in these two cases?
12  Game Development / Newbie & Debugging Questions / Re: [LibGDX] Changing Scene2D from a different Thread on: 2014-01-02 00:33:00
Use Gdx.app.postRunnable so you only manipulate scene2d from the game thread.

That's awesome! Thanks!
13  Java Game APIs & Engines / Engines, Libraries and Tools / Re: [LibGDX] Root table's background is not rendered in Scene2D on: 2014-01-02 00:24:48
Or setFillParent(true).

I specifically only needed a window, and not the whole screen. Thanks though, I appriciate it. Smiley
14  Game Development / Newbie & Debugging Questions / Re: [LibGDX] Changing Scene2D from a different Thread on: 2014-01-02 00:13:48
I have now made a thread-safe "HighscoreReading"-class that is accessed from the thread doing the networking. It also has a dirty-flag, for when it's updated.

The HighscoreReading is also accessed by the Screen (main thread) every single frame to check if it is done (the dirty flag). If it is done, the data is added to the highscore-table (Actor). This works, because communication between the threads is going on through HighscoreReading which is thread safe. Right?

I feel like this is such a hack, though. There must be a better way to handle this. I really don't want to poll HighscoreReading every frame via a synchronized method "isDirty()".

Is there a way I can push to the model (Actor) when the HighscoreReading is done being changed by the networking thread (when the thread ends)?
15  Game Development / Newbie & Debugging Questions / [LibGDX] Changing Scene2D from a different Thread on: 2014-01-01 23:03:05
Hey guys!

This is a threading issue more than a LibGDX issue, hence the subforum.

Quote from: docs of Scene2D
The Stage and its constituents (like Actors and Listeners) are not thread-safe and should only be updated and queried from a single thread (presumably the main render thread). Methods should be reentrant, so you can update Actors and Stages from within callbacks and handlers.

I don't understand how this is implemented. I've found out that changing the Actors from different threads are not a solution, and doing that has caused me grief for the last couple of hours.

Now, the question is as follows: How can I generate data on thread A, and then change an Actor on thread B to display that data.

Specifically, this is what I am looking to do: I have a GUI (Stage) that includes a highscore table (an Actor in this case). Whenever the highscore table is shown, I want to query my server for the latest global highscores. Upon completion, I want the highscore table (Actor) to be updated to show the highscores from the server.
Since the server communication is blocking, this needs to happen on a different thread. However, when it's complete it's important that the highscore table (Actor) is updated from the main thread.

How can I achieve this?
16  Java Game APIs & Engines / Engines, Libraries and Tools / Re: [LibGDX] Root table's background is not rendered in Scene2D on: 2014-01-01 21:54:56
Not sure whether it'll help or not, but call 'table.pack()' after you're done putting everything in. >.>

That did the trick. Thanks.
17  Java Game APIs & Engines / Engines, Libraries and Tools / [LibGDX] Root table's background is not rendered in Scene2D on: 2013-12-26 01:08:59
Hey guys!

I'm having this weird problem where a Table's background can not be rendered, when it's the root table. The table's children's backgrounds are rendered just fine, and when it's not the root it also works. However, I'd very much like for this table to be the root - it should work, right?
 
I can't anything in the docs about the root table's background not rendering.

Here's my code. It's the gameOverTable's background that doesn't render:
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  
gameOverTable = new Table(app.getUISkin()); 
guiStage.addActor(gameOverTable);
       
gameOverTable.setBackground(app.getUISkin().getDrawable("ui-bg"));
gameOverTable.pad(15f);
     
gameOverLabel = new Label("GAME OVER", app.getUISkin(), "gameOver");
gameOverTable.add(gameOverLabel).colspan(2).row();
     
score = new Label("SCORE: 0", app.getUISkin());
gameOverTable.add(score).colspan(2).space(10f).row();
     
TextButton mainButton = new TextButton("main menu", app.getUISkin());
mainButton.addListener(new ClickListener() {
           public void clicked(InputEvent event, float x, float y) {
              mainMenu();
           }
        });
mainButton.pad(10f);
gameOverTable.add(mainButton).fill().uniform().space(10f);
     
TextButton retryButton = new TextButton("retry", app.getUISkin());
retryButton.addListener(new ClickListener() {
           public void clicked(InputEvent event, float x, float y) {
              restart();
           }
        });
retryButton.pad(10f);
gameOverTable.add(retryButton).fill().uniform().space(10f);
     
gameOverTable.setX(app.getWidth()/2 - gameOverTable.getWidth()/2);
gameOverTable.setY(app.getHeight()/2 - gameOverTable.getHeight()/2);


..and here's what that code looks like (the pink grid is the game behind. Also, the buttons use the same "ui-bg" Drawable for background).:
18  Games Center / Showcase / Re: EtSplodera on: 2013-12-01 02:34:02
I got the ANCII art generator ~ Took about 2 secs.
1  
2  
3  
4  
5  
6  
7  
8  
 _____              _     _ _                            _   _ 
|_   _|            | |   (_) |                          | | | |
  | |     __ _  ___| |_   _| |_         _ __   ___  __ _| |_| |
  | |    / _` |/ _ \ __| | | __|       | '_ \ / _ \/ _` | __| |
 _| |_  | (_| |  __/ |_  | | |_ _ _ _  | | | |  __/ (_| | |_|_|
|_____|  \__, |\___|\__| |_|\__(_|_|_) |_| |_|\___|\__,_|\__(_)
          __/ |                                                
         |___/                                                
19  Game Development / Shared Code / Re: Picnic highscore system for HTTP written in PHP on: 2013-12-01 02:30:06
Well, my suggestion is to look around, how others have done.
For example, the big game portals, like kongregate. It has it's own api, it has lots and lots of games so it would be logical to assume they also have had lots and lots of problems Smiley
Also, I think that google had a gameportal thingy (cant' remember the name) and a scores api.

Okay, I took a look around. Smiley  It seems that most of these places (Kongregate included) has problems with keeping their highscore table safe. Not because people figure out an exploit in the submitting process, but because they edit the score in the actual game. No kind of security on the highscore end can prevent this, sadly.

I guess it just goes to show that it is an almost impossible task, with Cheat Engine out there.
However, I think I'm going to encrypt all the fields in the JSON, just to add another layer for the actual network hackers.

I'm also thinking about adding a data-array to the JSON, containing data about the game.
That way, developers can plug-in their game-specific values and do validatory calculations on them, on the server. I'm confident that would stop Cheat Engine-powered cheats.

What do you think of this? Are these good ideas, or am I unnecessarily obscuring this for developers?
20  Discussions / General Discussions / Re: A Reminder To Everyone Here on: 2013-12-01 02:23:12
I'm a ninja and I did nothing noteworthy. It's really a matter of long-term activity, more than expertise. Smiley
21  Games Center / Showcase / Re: The Basics - Pong on: 2013-11-30 22:08:50
Even though this is a simple game, you should still polish it. Smiley Congratulations, nonetheless.
22  Game Development / Shared Code / Re: Picnic highscore system for HTTP written in PHP on: 2013-11-28 22:26:14
Cool, I like it, but it seems like it would be extremely easy to modify the scores externally, no?

You are right! As with any REST API, it can be accessed from everwhere equally.
Currently, there is next to no validation going on in the highscore. This is because scores are calculated differently in every game, so I could not implement any universal score-validator.

This is what I suggest doing, to prevent cheating:
  • Add a UNID field to all POST-requests. That way hackers can't spam by resending packets.
  • Add a few statistics of the game to all POST-requests. Then check on the server, if the game was viable. For a fly-the-copter type game, send the flight time, the powerups collected, the seed for level-generation and place of death. That way you can check if the score is equal to what the flight-time/powerups suggest, and you can check if there is an obstacle in the place the player died, resulting in death.
  • If you're into it, you can encrypt the "score" field using a predetermined seed.

All of the above are security through obscurity though, and can be broken. Then again, it's next to impossible to completely prevent cheating unless the game logic is executed remotely.

If you can think of any more ways to prevent cheating, please do tell. Smiley
23  Game Development / Shared Code / Picnic highscore system for HTTP written in PHP on: 2013-11-28 21:28:50
Hey guys!  Smiley

I wrote a super-simple highscoring system for HTTP in PHP and MySQL. I figured it would be appropiate to post it here, since.. online highscores for games.

It works using only GET- and POST-requests, and JSON-formatted text. It is currently very basic feature-wise, and not cryptic at all to developers. It's supposed to be easy to change for your needs.

The script can be found here, along with a few words about how to to integrate it:
https://github.com/JavaDaemon/picnic-highscore

It is published as public-domain, so knock yourselves out!

If you have an opinion about this, I'm very interested in hearing it.

I'm planning to add a few example client implementations, to show how easy it is to integrate.
I'm also planning to add further functionality to the, currently, fairly limited GET-requests.

Take care Smiley
24  Games Center / Showcase / Re: EtSplodera on: 2013-11-26 09:09:21
Looks like you put a lot of work into the error-messages.  Smiley
25  Discussions / General Discussions / Re: Excelsior JET AOT Java Compiling (sale) on: 2013-11-25 17:17:20
They did this some time ago, as well. I just went and checked what version it was, and it was 7.6.
Unfortunately, the download links they provided me with are now dead. Bummer.
26  Game Development / Networking & Multiplayer / Re: HTTP POST highscore JSON object with LibGDX on: 2013-11-25 09:58:00
That seems very much like what I'd need. Thanks so much. Smiley
27  Game Development / Networking & Multiplayer / HTTP POST highscore JSON object with LibGDX on: 2013-11-24 15:03:51
Hey guys!

I'd like to post highscores from my game through HTTP. I understand this can be done easily with LibGDX's Net-module, if I provide an InputStream with the data I want transferred.

I'm not very good working with streams over the network, so I don't know the pitfalls and what I need to be wary about.
 
How would I go about sending a JSON object (from memory), to my webserver, using POST, and LibGDX?

Thanks guys. Smiley


EDIT:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
HttpRequest httpPost = new HttpRequest(HttpMethods.Post);
httpPost.setUrl("http://highscore-server.net/highscore-accepting-script.php");
httpPost.setContent(stream, length);

Gdx.net.sendHttpRequest (httpPost, new HttpResponseListener() {
   public void handleHttpResponse(HttpResponse httpResponse) {
      status = httpResponse.getResultAsString();
   }

   public void failed(Throwable t) {
      status = "failed";
   }
 });


This as far as I can get, code-wise. I don't know what to do for the InputStream.
28  Games Center / WIP games, tools & toy projects / Re: Galactic Progress on: 2013-11-21 20:21:50
Honestly, you'll just have to create it. You could actually do it the cool way, and create a program in OpenGL to randomly place stars with different light intensities and colors, and then export it as an image so you can use it as a skybox, or you could look one up on Google and make sure it's free, or you can just do it by hand, which would be a pain.

Or you can plot a bunch of random dots on the sky, on the fly.
29  Game Development / Shared Code / Re: OpenGL font without textures on: 2013-11-21 15:42:55
Whoa. Just like 8-segment displays. Smiley Thanks for contributing.
30  Games Center / WIP games, tools & toy projects / Re: Wind Powered Games - Project 1 on: 2013-11-20 19:19:30
If you programmed the physics yourself, it looks like you got impulse wrong.
If not, you probably just assigned too small mass-values to those rocks, or insanely large ones for the ship and it's shots.
Either way, it kind of ruins it for me. Sad
Pages: [1] 2 3 ... 37
 

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

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (43 views)
2014-04-15 18:08:23

BurntPizza (39 views)
2014-04-15 03:46:01

UprightPath (55 views)
2014-04-14 17:39:50

UprightPath (37 views)
2014-04-14 17:35:47

Porlus (53 views)
2014-04-14 15:48:38

tom_mai78101 (76 views)
2014-04-10 04:04:31

BurntPizza (135 views)
2014-04-08 23:06:04

tom_mai78101 (235 views)
2014-04-05 13:34:39

trollwarrior1 (196 views)
2014-04-04 12:06:45

CJLetsGame (204 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
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!