Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (539)
Games in Android Showcase (132)
games submitted by our members
Games in WIP (603)
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
1  Games Center / WIP games, tools & toy projects / Re: Izzy's Revenge on: 2013-02-27 04:28:43
To me, the perspective that you have used in drawing the walls does not look right.  In the purple picture, it seems that the perspective for the hole in the centre platform and the lowered ceiling above it have been done incorrectly.  For the rest of the scene, the perspective lines are drawn back to one point, like in one point perspective, but for these two parts something has gone wrong!  You should not be able to see the sides of the walls for the lowered ceiling, and the ends of the floor in the centre platform should be reversed.
Just something to consider.
2  Games Center / WIP games, tools & toy projects / Re: Untitled - 2D side scroller on: 2012-12-15 23:54:19
It just about looks like you've got this same problem sorted out yourself, eliminate the legs alltogether!  Doing this right the first time and not having to worry about it for the rest of the project is something I really want to do.  I have started on skeletal leg animations, I'll post the new project here in a few days once they are looking good.
3  Games Center / WIP games, tools & toy projects / Re: Untitled - 2D side scroller on: 2012-12-15 00:01:44
Haha, I know.  Since the last update, I've been at a standstill.  Its either the skeletal animations, or a series of different animations for walking up different sloped hills (at the moment I'm thinking this one, but if I can implement skeletal animations that would probably look much better).  The next update might not be for a while, but will most likely include one of these two methods.
4  Games Center / WIP games, tools & toy projects / Re: Untitled - 2D side scroller on: 2012-12-12 12:44:17
Update!
A few additions, nothing major.  From the first post:
  • Chunk offset added.  This shifts the border for the loading of chunks wider (can change in config.txt, default is 100 pixels) to prevent nasty black lines and visible tears off the screen.
  • Can no longer place blocks under player (if you spawn in the dirt, exit the game and start again!)
  • Added a proper player sprite (ripped from terraria for the moment) with directional movement
  • Can walk up slopes of a maximum of 2 tiles high without jumping
Would appreciate it if people continue to test on mac and linux Smiley, thankyou PeterNicholson.

I am not sure where I will go with the players sprite.  On flat ground it works really well, but when he gets on a slope, only one point of his toe is touching the ground.  I am yet to implement saving and loading, and I think finite water is a long way off!

The new .jar's are up!
5  Games Center / WIP games, tools & toy projects / Re: Untitled - 2D side scroller on: 2012-12-09 04:14:17
Updated a few things:
Firstly the biggest.  The whole game loop was redone.  Previously I had logic updating as fast as possible, and the option to render alongside updating, or seperately at 60fps.  As you all probably know, this didn't really work too well.  Now, the logic runs at a constant frame rate (50fps for simple timing in the future), and rendering is done as fast as possible with linear interpolation.  I think this approach is much better, thanks to theagentd among others for this!

Please note, there is no saving or loading of chunks at this time!  If you place dirt somewhere and walk it off the screen, the world will regenerate that chunk as the default heightmap.

'W' 'A' 'D' to move
left click to place block
right click to remove block

open jar file with 7zip and edit config file, disable vSync for max fps!
6  Game Development / Game Mechanics / Re: VSync in multi-threaded Game on: 2012-12-09 03:56:50
Thankyou so much!!!
You have no idea how much smoother this makes the game loop, no more nasty lag spikes and much simpler physics to code.  All while maintaining, if not improving, the overall look!  I combined your game loop, the one you linked, and the one by Eli (I think) found at http://www.java-gaming.org/index.php?topic=24220.0.
This is the game loop I will be using for all from now on!  The results can be found here:
http://www.java-gaming.org/topics/untitled-2d-side-scroller/28019/view.html
7  Discussions / General Discussions / Re: Where are you from? on: 2012-12-08 23:58:06
The snow's really pummeling down in Adelaide, Australia.  Can hardly get out the front door, and when we do, we see kangaroos that can barely even jump around the snow is so deep and soft.  We're in for a white christmas this year!
8  Games Center / WIP games, tools & toy projects / Re: Untitled - 2D side scroller on: 2012-12-07 23:43:46
Thanks for all the interest everyone.  The 'hellish' terrain to the left is an error with the perlin noise (I don't know what is causing this), I can fix it by shifting the whole map to the left a few trillion pixels Cheesy, but I will find out what is wrong with the perlin noise at some stage.

Quote
Out of curiosity, how are you storing and then rendering the noise (different colors on mountain)?
As I said, there are many chunks (128 tiles square).  Dirt does have a fixed colour, but when rendering the world each element (r, g, and b) is added with +- 10 (colour range is 0-255).  I think this makes the game a little more interesting.

Quote
I'm on Linux here and it didn't work. I checked it with Ark, and the Linux natives were missing. Could you please include the Linux Natives.
The natives for each machine are around 1.5mb.  Javagaming's max file size is 2mb.  I could always upload 3 seperate files of mac, linux, and windows.  I'll get onto that for the next update (its not in the right state at the moment!)
9  Game Development / Game Mechanics / Re: VSync in multi-threaded Game on: 2012-12-07 11:15:45
That was a long, but really interesting answer,
thankyou very much!
I never thought variable timestep for a game was so frowned upon, all websites make it seem much better than fixed timestep!  So what would be the best way to sort this out then?  Should I have both logic and rendering update at 60 frames per second, same as the refresh rate, or have rendering update at 60, and logic at 120?  Are you saying I should completely eliminate the interpolation factor (I have seen some game loops where the interpolation is passed to the render function, which does it there.  What is all this about?).
This would make life easier for me, however it seems too simple! Grin
10  Games Center / WIP games, tools & toy projects / Re: Untitled - 2D side scroller on: 2012-12-07 06:11:31
Don't even need that anyway, for the moment.  Try again, the new jar is up and ready to go!
11  Game Development / Game Mechanics / Re: VSync in multi-threaded Game on: 2012-12-07 05:42:29
For real? haha.
I always thought that you should let the logic update as fast as possible (with interpolation), and only render at a specific frame rate (same as the screens refresh rate preferebly).
Currently, I have been updating and rendering once in the same thread, and the delta values dont seem to be giving me any troubles.  Seems that I probably shouldnt worry about splitting logic and rendering into seperate threads.
12  Games Center / WIP games, tools & toy projects / Untitled - 2D side scroller on: 2012-12-07 05:24:47


A game I've been woring on for the past couple weeks, looking to take terraria (minus the magic cr*p) and shrink down the tile size to make it feel more real.  Name suggestions please!

To Do:
  • Saving and loading of chunks
  • Flowing finite water

Change Log:
[9/12/12]
  • Improved game loop.  Much smoother with interpolation while rendering.  Thankyou theagentd!
  • Added placing and removing grass blocks with left and right click.
[12/12/12]
  • Chunk offset added.  This shifts the border for the loading of chunks wider (can change in config.txt, default is 100 pixels) to prevent nasty black lines and visible tears off the screen.
  • Can no longer place blocks under player (if you spawn in the dirt, exit the game and start again!)
  • Added a proper player sprite (ripped from terraria for the moment) with directional movement
  • Can walk up slopes of a maximum of 2 tiles high without jumping

Downloads:
Not sure if compatible with OSX or Linux, have uploaded any if someone wants to test
Get the jar(s) here:
windows
macosx
linux

Controls:
Cannot currently do much, just walk around jump, and place blocks, but much more is coming.
  • WSD - walk left and right and jump
  • Left Click - Place dirt blocks
  • Right Click - remove block (place void)

I hope to have some sort of story line, but instead of exploring across, explore up (campaign will be on an island), but an option for infinite width since it is supported (read on).  At this stage, chunks (128x128 tiles, 256x256 pixels) are loaded and unloaded as you walk.  The small amounts of 'blur' you get at the edges of the screen when moving around is the chunks unloading and loading again, I must change the distance out a little further so this isn't noticable Done!  I am on the brink of implementing loading and saving of chunks when exiting the app.  The world is generated using perlin noise.  Player movement and collisions are pixel perfect.  The config file changes the screen width and height, and an option for vSync and/or sleeping the game loops thread to save system resources, chunk offset can also be set.
13  Game Development / Game Mechanics / VSync in multi-threaded Game on: 2012-12-07 04:38:11
Is there any way to get vSync to work for one thread (the main thread where rendering is done, all opengl is done in this thread), and allow a seperate, logic thread to operate at maximum speed?  Currently, vSync lowers the rendering thread FPS to below 60 (60 is what it sould be), and the logic thread is also lowered partially compared to if there is no vSync.
Display.sync(60) has similar effects, though the frame rate differences are not as significant.
Is there any way to fix it, or is I dumb?
14  Discussions / General Discussions / Re: Where are you from? on: 2012-12-06 23:22:39
I'm 17 and from good old Australia.
As 5c0jt said, hopefully I'll be in the WIP section soon too!
15  Game Development / Newbie & Debugging Questions / JarSplice Troubles :( on: 2012-12-06 00:03:21
I have been having real troubles exporting to a runnable jar using JarSplice.  I have two jars attached, one of a previously exported jar which works perfectly fine, and one of an updated version which does nothing when run.  From what I can tell, everything is exactly the same, I used the same process to do it all, and the manifest.mf file looks identical.

Old Version:http://www.java-gaming.org/user-generated-content/members/130033/old-version.jar
New Version:http://www.java-gaming.org/user-generated-content/members/130033/new-version.jar

I do not know why the new version is not working, please help!

[Edit]
Fixed it guys.  Problem was when trying to read a file, you cannot use File from within a jar file!
Jar files will be taken down.
16  Game Development / Game Mechanics / Re: Projectile Calculation in Discrete Time on: 2012-12-03 07:42:09
I don't want to keep a bunch of time variables floating around.
In your very first post you asked for the time when it would occur.
Quote
My goal is to determine if/when a particle with a given position will land on a platform
The answer you get for the 't' variable in my equations simply tells you when the collision will occur, ie. after t logic updates.  My explanation was probably a bit long and tedious, pretty much all it takes is two equations to solve if it will collide, and when it will collide.  If you want, I can help you out with rearranging and such.
17  Game Development / Game Mechanics / Re: Projectile Calculation in Discrete Time on: 2012-12-02 11:12:35
Why not use some physics and quadratic equation?

Simple Physics, using this equation:
s = 1/2 * a * t2


using this, the location of the projectile at time t after the calculation will have a y-coordinate of y' :

y' = (u * t + 1/2 * gravity * t2) + yi

where u is the y-velocity (vy) of the projectile at the current time.
and yi is the y coordinate of the projectile at the current time.

when y' is equal to the y coordinate of the platform, there is a chance the projectile will collide with it, we can work out the time that this will occur by doing this (where yp is the y-coord of the platform:

y' = (u * t + 1/2 * gravity * t2) + yi
but y' = yp
therefore, yp = (u * t + 1/2 * gravity * t2) + yi
(u * t + 1/2 * gravity * t2) + yi - yp = 0

you can then use quadratic equation to find t, the times when the y-coords are equal (there will be 2!).  Just note, sometimes the y-coords will never be equal and if this is the case your calculation will involve finding the square root of -1 (not sure how java proceeds with this).

Then all you have to do is find the x-coord of hte projectile at this time and see if it matches up with the platform.

x' = xi + ( t * vx)

(assumes constant vx), where xi is current projectile x-coordinate.

then,
1  
2  
3  
if (x' < right && x' > left) {
   the projectile will collide at t!
}
18  Game Development / Newbie & Debugging Questions / Re: How to HANDLE collision? on: 2012-12-02 04:00:22
In my collision detections, I've always passed the proposed movement vector into a new function, which returns a new vector (in the same direction) of the maximum movement distance the player can make before colliding with something.
Ie (pseudo code)
1  
2  
3  
4  
5  
6  
7  
8  
9  
public void movePlayer() {
   If (left key is down) {
      playerVector += getMaxDistance(-1, 0, 0);
   }
}
public void getMaxDistance(Vector3f move) {
   //Do all calculations to find max movement, then return it.
   return maxMove;
}


This has always worked really well for me, with no troubles!
19  Games Center / WIP games, tools & toy projects / Projectile Motion Calculator on: 2012-11-26 06:55:44
Just finished year 12 in Australia here (YEW YEW YEW!), and for physics made myself a little projectile motion app in Java to help me check my answers.  Doesn't show working out, but takes in the initial conditions:
- Initial height
- Initial velocity (via components or speed with an angle)
 and spits out answers for:
- Time of flight
- Range
- Maximum Height

Just thought you all might like to see something here other than a game!  Enjoy!
http://www.java-gaming.org/user-generated-content/members/130033/projectile-motion-calculator.jar
20  Game Development / Newbie & Debugging Questions / Re: Optimal saving and loading times for bytes on: 2012-11-24 01:22:19
Attempted to implement threads for each function but cannot seem to get it to work.  Help?

Thanks, Harry.
21  Game Development / Newbie & Debugging Questions / Optimal saving and loading times for bytes on: 2012-11-24 00:39:03
I am making two methods which write and read bytes to and from files on the hard drive.  Each of these methods could be called up to 30 times every second (dont ask!) and have a size of 32KB.  At the moment my code looks like this:

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  
public void save(int i) {
      try {
         FileOutputStream fos = new FileOutputStream("saves/" + "mySave" + i);
         DataOutputStream dos = new DataOutputStream(new BufferedOutputStream(fos));

         for (int x = 0; x < 300; x ++) {
            dos.write(30);//-127 to 128
            dos.write(65);
         }
         dos.close();
         
      } catch (IOException e) {
         e.printStackTrace();
         System.err.println("Unable to save file");
      }
   }
   
   public void load(int i) {
     
      try {
         
         FileInputStream fis = new FileInputStream("saves/" + "mySave" + i);
         DataInputStream dis = new DataInputStream(new BufferedInputStream(fis));
         
         for (int x = 0; x < 300; x ++) {
            id[x] = dis.read();//id is defined elsewhere
         }
         
      } catch (Exception e) {
         e.printStackTrace();
         System.err.println("Unable to load file");
      }
     

   }


Is there a faster way to do this?  At the moment you can tell by the lag/stutter that files are being saved and loaded.  I thought of creating a new thread which does all the saving and loading, so the original thread can run unbothered, but am yet to look into this.
22  Java Game APIs & Engines / OpenGL Development / Re: Strange optical illusion when moving adjacent colours. Fixes? on: 2012-11-23 12:06:36
That is actually very cool, thanks cas!  I'll just have to avoid those colours next to each other.
23  Java Game APIs & Engines / OpenGL Development / Re: Strange optical illusion when moving adjacent colours. Fixes? on: 2012-11-22 10:23:16
Definately a good read, cheers for all the help.  So its not a problem with the colours mixing in Java/OpenGL, but our eyes playing tricks on us!
24  Java Game APIs & Engines / OpenGL Development / Re: Strange optical illusion when moving adjacent colours. Fixes? on: 2012-11-22 01:18:28
Can reproduce it in a paint program (just save the image and give it a go yourself, drag the image to the left at a constant speed), and same thing occurs on a macbook pro in its paint program, I am using windows 7.
25  Java Game APIs & Engines / OpenGL Development / Strange optical illusion when moving adjacent colours. Fixes? on: 2012-11-21 23:48:24
I have been trying to get my head around this problem for a while now, and only figured out what the problem is when editing the pictures to post here.  The first picture is of the 'tile map', it is actually one big bufferedImage with a few quads in it.  Here is what it looks like (when stationary):

However, in game, the image is constantly moving around.  And when the image moves left, this is what appears to be shown:

Please note I had to edit this, as when I screenshotted it, the illusion disappeared.  The illusion only effects the seams of some of the quads, but leaves most untouched.
This effect only happens when the whole image is moving to the left.  You can even download the original image, and move it to the left to see the effect (for best results do this with java at a constant speed).
My question is, am I right in this being just an illusion or is there something weird going on with OpenGL, and is there any steps I can take to eliminate the problem?
26  Games Center / Featured Games / Re: Daedalus on: 2012-11-09 23:20:23
Awesome game, dropbox link worked perfectly.
Thankyou!
27  Games Center / Featured Games / Re: Daedalus on: 2012-11-08 10:42:27
much appreciated, thankyou.
28  Games Center / Featured Games / Re: Daedalus on: 2012-11-08 01:31:52
I am in Australia, so I don't know if that would be a problem or not.  One more, I try to access your website, http://www.daedalus-thegame.com (I think), and it gives me the error:
1  
2  
403 Forbidden 
You don't have permission to access / on this server.
29  Games Center / Featured Games / Re: Daedalus on: 2012-11-08 00:20:52
download link doesn't seem to work for me...  Begins to download with chrome and firefox, but doesnt get any speed, and arrives corrupt.
30  Java Game APIs & Engines / OpenGL Development / Re: LWJGL Updating a screen full of pixels every frame on: 2012-11-01 07:44:25
Might I ask what glMapBuffer() does and how to use it?  Should I use glMapBuffer() before rendering and then glUnmapBuffer() after rendering, or should do this when editing the pixels, or both, or just have it mapped the whole time, throughout the whole game loop?
Pages: [1] 2
 

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 (33 views)
2014-12-15 09:26:44

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

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

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

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

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

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

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

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

toopeicgaming1999 (32 views)
2014-11-26 15:20:08
Resources for WIP games
by kpars
2014-12-18 10:26:14

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