Featured games (81)
games approved by the League of Dukes
Games in Showcase (482)
Games in Android Showcase (110)
games submitted by our members
Games in WIP (547)
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 ... 9
1  Game Development / Newbie & Debugging Questions / Re: Voxel game bad-ish fps on gaming computer and high fps on laptop!?! on: 2014-08-18 10:54:03
bind your block textures before you start your chunk rendering.

once its bound, the texture coordinates you pass in have to be a value between 0 and 1.

coordinate (0, 0), being the top left, and (1, 1) being the bottom right. so you need to find out the coordinates of where each block is on your texture.

chances are you could probably even combine your enemy textures into the same file, even if they are different sizes to your blocks, some extra code for the texture coordinates for mobs (if required), and you could do it all in one texture bind.
2  Game Development / Newbie & Debugging Questions / Re: Voxel game bad-ish fps on gaming computer and high fps on laptop!?! on: 2014-08-18 10:39:04
if you are using immediate mode rendering, then that is your problem, and if you want to make a 3D sandbox game, you should probably look into VBO's.

Though, there's still a small chance you could improve performance.

make sure you only start one draw call ( GL11.glBegin() and GL11.glEnd() ). you want as little as those calls as possible, and have all your textures in a one texture, so you don't have to keep rebinding different textures.

if you have already done that, then either make your world render less blocks, or exactly what you should do, learn a more modern OpenGL approach.
3  Game Development / Newbie & Debugging Questions / Re: Bullet shooting in mouse direction on: 2014-08-10 05:36:58
or if you don't want to use ClickListener, you could do something like

   boolean hasReleasedMouse = true;

   public void shoot(){
            hasReleasedMouse = false;
         hasReleasedMouse = true;
4  Games Center / WIP games, tools & toy projects / Re: Jumproom on: 2014-07-30 13:41:18
It also does the same thing for the Galaxy S5, screen rotates, and it hangs for like 5 seconds when i open the recent apps to exit out of it, pressing the home button while in the recent apps has another like 5 second hang.
5  Discussions / General Discussions / Re: BrickBroken2 ? SLDT's GameEngine ? on: 2014-07-25 10:44:21
First of all, you shouldn't ask this community if we want you to make BrickBroken2, we are a forum filled with Developers, if you really want to know if there is a community for BrickBroken2, another website would be the best, as the chances are this site wont have a heavy community for your game, especially when to create a account you need to know a little about Java, or you will probably get scared of the activation quiz.

But in my opinion, if you like BrickBroken, and you really want to make the game, create it, post it on here, and improve from the feedback, but ONLY IF YOU WANT TO DEVELOP IT. if you do not want to, move on to your next game idea, if it is something you really want to make, the chances are its going to be a much better game then the game you don't want to develop.

The only time you should develop a game you do not want to make is if you are contracted with someone to develop a game for them (and I would find out about the game they plan before even accepting the contract, as you may not be able to deliver the project they require), and this is definitely not that scenario.

You mentioned you made a Scrabble game with your new engine, why don't you post it to show off what your game engine you made is capable of? Maybe you could extend on your Scrabble Game, and turn it into something more advanced and polished.

If you want someone to use your game engine you create, put it up on github or provide a link for someone to play around with, we do not know if we want to use a game engine that we only know has rendering (what type of rendering? is it OpenGL? Immediate Mode? VBO's? ), input and new features (what are these features?), until we know what exactly it is and how it helps to develop a game and examples of what it can achieve, the answer is probably no.
6  Discussions / Miscellaneous Topics / Re: What I did today on: 2014-07-24 11:56:51
Tune Locks 2

A sequel to my Ludum Dare game "Tune Locks" for LD26.

EDIT: Link to my Tune Locks LD26 Entry
What the player can see without placing down lights:

When the player places lights down:

It it not all done today, I have been working on it for ages, now and again on and off. For a long time, it turned into my "tech demo" where I was just updating the rendering to VBO's, and trying to get more performance, as well as playing with shaders.

The game started out with just Immediate Mode rendering, then I learnt how to do VBO's more, so I changed the rendering. Then it became my text rendering test. I then decided to learn more about shaders, so I had to learn how to send the VBO data to the shader, and started to learn how to create lights.

By about the time that I learnt all of those, I set the project as "tech demo", planning to never finish the game, but use the current state to just learn new stuff. University started shortly after, and I didn't do much for a while, other then redo my text rendering, it is definitely not great, but idea was, lets just get text working, how ever ugly it looks, then polish it later, not just the code, but the image for the text is definitely not great and some letters are to far over, or to far up.

I then improved on the rendering again, fairly recently (within the last 2 or 3 weeks), I use to cap my lights at 10 or 20, because I would started to get like 300 FPS, down from like 2500 FPS with like 2 lights, and any more it would just go down a lot more. By the time i fixed the rendering, I was getting about 5000 FPS with 2 lights, and 300 FPS with about 126 lights. I can probably increase it a bit better, at the current state, the light is not limited to a certain distance. As well as making the puzzles a lot more easier and cleaner to implement into the game.

What I have done today, and yesterday was removed the limitation of having the level restricted to 32x20 pixels, as well as made the camera follow the player, but not go past the edge of the level, the player will stay in the middle until the camera locks to the side, then the player can gets unlocked until moved in the opposite direction to unlock the camera. I have also decided that I am going to remove it from my "tech demo" and try and finish the game, I have always wanted to, but never got around to it.
7  Game Development / Newbie & Debugging Questions / Re: How to reset the game ? on: 2014-07-19 13:50:12
If you want to reset a game, you don't want to "close the game" and restart it within the application.

To achieve the reset, just reset any variables back to the default.

I am going to assume you have an array of aliens, where you first put the aliens in the array, you could put it into a new method

   public void createLevel(){
      aliens = new Alien[levelSize];
      for(int i = 0; i < levelSize; i++){
         alien[i] = new Alien();
      //recreate or have a method inside player to change it back to the default values
     //and anything else you need to create for your game level

something like that, and you can create new levels of any size pretty fast.

Edit: Ninjad, I hate formatting inside the post, so I always open up eclipse to format Sad just as i finished the code you posted it, but it was to much effort to delete!
8  Game Development / Performance Tuning / Re: Efficient Fog of War on: 2014-07-02 13:26:42
I am assuming it is 2D.

First of all, you shouldn't need to search through every tile, you should just check the tiles being rendered on the screen.

you can just recheck the fog of war when an actor moves.

you could only update the fog of war in locations where an actor moves, instead of checking every actor within view every time it updates, you could have only the tiles around the actor to update.

if your using shaders, you could just send an array of vectors, and create lights around the points, with the rest of the tiles being black / darkened.
9  Games Center / Featured Games / Re: [Slick2d] Retro-Pixel Castles >>MAP EDITOR TECH DEMO RELEASED!!<< on: 2014-06-22 06:44:19
Don't think anyone mentioned it:

When hovering over the buttons in the tools on the map editor, you need to position the mouse more towards the center or even pretty much the last pixel of the last button, as the text starts off the edge of the screen.

not sure how you code your text rendering, but you should just check to see if the beginning x is less then 0, if it is put it to like x = 5 or something, so their is a little gap from the edge.
10  Game Development / Game Mechanics / Re: How would I do fading images? on: 2014-06-22 01:37:52
GL11.glColor4f(red, green, blue, alpha);

4f meaning 4 float values.
11  Game Development / Game Mechanics / Re: How would I do fading images? on: 2014-06-22 01:34:19
A super easy way is to just change the alpha value.

To fade the image out, reduce the alpha. To fade it in, increase the alpha.
12  Game Development / Newbie & Debugging Questions / Re: Questions about port speed and game bandwidth required on: 2014-06-19 23:44:01
I am pretty sure most VPS (atleast the ones I have looked at) atleast provide 100/100 Mbit internet.

that "4000" players is theoretical in a perfect scenario, I am sure your ISP tells you you will get a certain amount, but really only get half of it. e.g. in my case I am suppose to get around 20Mbit down, but I only get between 5-7 MBit down. Also, 250Mbit may see like there super advanced, but more and more people are starting to get 1000Mbit internet (I believe the University I go to, their provider also supplies 10gbit internet, rumors that mine have it, but I have only heard people getting around 800 Mbit).

Also for that 4000, you are just taking in account of the network speed required to maintain 4000 players, are you sure your server can handle 4000 players and send 120000 (30 * 4000) packets and update the game at the same time?

TL;DR: You also need to take in account of the hardware required to have 4000 players at one time, which will most likely be the issue.
13  Game Development / Networking & Multiplayer / Re: How safe am I? on: 2014-05-03 08:58:45
go buy the cheapest server you can ( they have been pretty reliable for me, most likely you only need 1gb or 2b max) that has enough performance for what you need.

IF your game suddenly happens to become huge and your cheap server cant handle it, you can just change to a new company where your getting a better server.

IF your game turns out that you don't get the thousands of players you intended, you lost $50 (most likely $30 max) max for a years worth of server hosting to what you can recover from and try a new game and use the same server to host your game.

This $20-$50 you spent for 1 years worth of hosting saved you in electricity bill, which probably would of cost more if you used a home server based on the fact you had a spare computer. if you had to build a new computer to host the server, well you just saved a few hundred initial cost.
14  Game Development / Newbie & Debugging Questions / Re: glOrthod problem LWJGL on: 2014-04-26 05:22:26
What ever tutorial you are using is horrible.

IF you learn to debug, and start reading java docs, you will relise where you failed.

LWJGL javadoc for glOrtho
15  Game Development / Newbie & Debugging Questions / Re: How to control the game time-line. on: 2014-04-25 08:16:23
true, trollwarriors method would be better if your having a pausing within the game.
16  Game Development / Newbie & Debugging Questions / Re: How to control the game time-line. on: 2014-04-25 07:45:59
I highly doubt you will be having a problem with the CPU not being able to keep up, especially if it is 2D which I am thinking it is.

If you are having a CPU problem,  I think you may be doing something horribly wrong.

To pause the game, in your game loop, have a if statement around your update, and only let the game update if the game is not paused.
17  Game Development / Newbie & Debugging Questions / Re: How to control the game time-line. on: 2014-04-25 07:21:28
somewhere inside your wizards update, work out how to fit it into your code but something like this can detect if 2 seconds has past.

   long oldTime = 0; //set oldTime to when your wizard started the cast
  long timeDelay = 2000; //2000 milliseconds is 2 seconds

   if(System.currentTimeMillis() > oldTime + timeDelay){
      //your wizard has completed your 2 second cast

EDIT: If you want to be more precise, you could use nano time instead of milliseconds, but I don't think you after precise timing, you just want it to work.
18  Discussions / General Discussions / Re: Need C programs to practice for debugging competition on: 2014-04-05 14:27:28

Actually I spotted that bug as soon as I saw the if statements and the first if statement didnt have brackets, when I did a course in University, our tutor kept pretty much nailing it into us to try and not use single line if statements, he said if your working on the project by your self go ahead, but in a group project, someone may have the standard of always using brackets, and could just shove some new code for the if statement in the single line if statement.

so soon as I saw the if statements, I checked and saw the second
goto fail;

but knowing I was looking for a bug may of helped me spotting it as soon as I saw it.
19  Game Development / Newbie & Debugging Questions / Re: Web Hosting My Java Server Code - How? on: 2014-04-01 12:02:22
I had a 123system VPS for a year, I found they were pretty good. I had some small issues, but I think most of them was my fault.

The node my VPS was on did go down, and I waited a few days for it to go back up but it didn't, so I contacted them and they said the node my VPS was down and they were trying to fix it and should be a day or 2. after a few days, they offered to transfer people to a new node, but they would lose some stuff from the old VPS, or they could wait it out to how ever long it took to get repaired. I opted for a transfer, as I had nothing important on mine that I couldn't redo in like 20 mins.

123Systems VPS's are cheap, so I would suggest trying one of them, and seeing if you can manage to just use that without many problems.

I would suggest there OpenVZ VPS due to their cheap prices (e.g. 1gb ram is $19, 2gb ram is $30 USD for one year, 4gb ram is $59).

also here is my referral:

not sure to much about their referral benefits.
20  Game Development / Newbie & Debugging Questions / Re: Libgdx how to send arrays to Shader on: 2014-01-22 11:54:21
I am no expert on shaders its just how I learnt to send an array to a shader, and how many lights will you be sending, i think you will need to be sending literally thousands to notice a difference. (notice a difference at sending data to the shader)

remember if your using a fragment shader, its effect every single pixel that you are rendering, chances are you are rendering to many lights at once without restricting the area that the light modifies.
21  Game Development / Newbie & Debugging Questions / Re: Libgdx how to send arrays to Shader on: 2014-01-22 11:49:04
You need to specify the array index in the location, this is pretty much what i use in my shaders

for(int i = 0; i < totalLights; i++){
int loc = shader.getUniformLocation("shaderColor[" + i + "]");
//setuniform here
22  Game Development / Newbie & Debugging Questions / Re: GLSL - setting uniform problem on: 2014-01-21 13:48:56
if it is "weird" it is your shader. not my fixed code, i just re arranged your draw call.

how shaders should be used:

shader.begin(); //Begin the shader we want to use

spriteBatcher.draw(...); //put EVERYTHING we want to draw between "begin()" and "end()"

shader.end(); //Our draw call is over, lets stop the shader
23  Game Development / Newbie & Debugging Questions / Re: GLSL - setting uniform problem on: 2014-01-21 13:42:21
You are not using your shader to draw the square.

Fixed code:
map[mapPos].light = Lighting.checkSunLight(mapPosY, mapPosX, this); // It works good.. returns float
Shaders.blockS.setUniformf("lightBlock", map[mapPos].light); // Problem is here!!!
batch.draw(map[mapPos].getBlockTexture(), (mapPosX * Block.WIDTH), (mapPosY * Block.HEIGHT), Block.WIDTH, Block.HEIGHT); // Doesn't draw the block.
Shaders.blockS.end(); //end the shader as the draw call is over

You should end the shader once you have finished drawing everything with the shader. Basically the shader was useless as you ended your shader before you actually begin drawing with your sprite batcher.
24  Game Development / Newbie & Debugging Questions / Re: NullPointer - TextureRegions on: 2013-12-13 13:33:13
if you re read it, you will know I never said TextureRegion constructor, but the TextureRegion region[][] is null, I showed him how to initialize the array, because either region[][] or playerSheet is null as they are the only variables that can produce a null pointer, like I said in my post that you only read the code snippets of.

To remove your confusion, I will edit the code and use his class name that he had the exception in.
25  Game Development / Newbie & Debugging Questions / Re: NullPointer - TextureRegions on: 2013-12-13 13:15:56
You have 2 possible variables that could be causing the problem

first, either



may be null.

Check to see if your playerSheet is null, as I don't see that anywhere in your snippets you posted

you could use this

if(playerSheet == null){
System.out.println("playerSheet is null");

for the array of TextureRegions

make sure you initialize the array

private TextureRegion[][] regions;

public Player(){
regions = new TextureRegion[size][size];

edit: renamed the constructor so people don't have to read the non code snippets.
26  Java Game APIs & Engines / OpenGL Development / Re: Positions of VBO's with Shaders on: 2013-12-07 11:18:07
Shaders are in the Textured Quad:
27  Java Game APIs & Engines / OpenGL Development / Re: Positions of VBO's with Shaders on: 2013-12-07 11:14:25
Yes, I have

glOrtho(0, WIDTH, HEIGHT, 0, 1, -1);

using SHC's VBO tutorial, it works fine with supply values of e.g. 800 and 600, but once I implemented shaders into it, i need to use -1 to 1, while I play around while I cant find out how to fix this, I have the position changed in the vertex shader and it works like SHC's tutorial.
28  Java Game APIs & Engines / OpenGL Development / Positions of VBO's with Shaders on: 2013-12-07 09:11:46
For a while now, I have been learning VBO's more and trying to move away from deprecated code.

My main struggle was sending the texture coordinates to the shader, I knew what I had to do, but I could never get the them to work.

I finally got the texture coordinates to the shader, but the problem now is the positioning in the VBO.

I have used SHC's VBO Tutorial and LWJGL Wiki on Textured Quads to produce my VBO Class.

It's probably not the best VBO class, but its good enough for my testing of drawing 2 squares on the screen currently as I am only testing before I implement it into my game.

The question is what have I done or what do I need to add to allow for sending the x, y, width and height parameters in addRectangle() for values such as 800, 600, 100, 200 etc. Currently I need to supply values in floats between -1f and 1f. Is their a way I can just send 800, 600 etc or will I need to create a method to convert 800 down to a float between -1f and 1f?

also any recommendations on improving my VBO class will be good, but this is not its final state, just its current working state.
29  Games Center / 4K Game Competition - 2014 / Re: Java4k Launcher on: 2013-12-06 09:34:09
someone already did:
30  Game Development / Newbie & Debugging Questions / Re: Theory of 2d per pixel lighting. on: 2013-11-29 14:03:45
For a game I made for a assignment (in my projects, a horde style game, i am pretty sure i have day/night cycle turned on), I didn't spend much time and just stayed with immediate mode because the school computers suck, some of them didn't even support OpenGL.

vec4 old is a rgba value for the pixel, gl_TexCoord[0].st is a vector 2 of the texture coordinate (if you use the GL11.glTexCoord2f() method to set your texture coordinates you can use the gl_TexCoord[0], if not use the vec2 of your texture coordinates you passed in). the value of texture is the texture ID you set up when you bound it.

each update I change the value of timer, according to how dark it should get, the timer way is probably not the best, but it did good for my first time using shaders and rushing it.

fragment shader
uniform sampler2D texture;
uniform float timer;
uniform float alpha;
float timeEffect;
void main() {
   vec4 old = texture2D(texture, gl_TexCoord[0].st);
   timeEffect = 1.0 / timer;
   gl_FragColor = vec4(old.s * timer, old.t * timer, old.p * timer, old.q * alpha);
Pages: [1] 2 3 ... 9

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

The first screenshot will be displayed as a thumbnail.

atombrot (26 views)
2014-08-19 09:29:53

Tekkerue (24 views)
2014-08-16 06:45:27

Tekkerue (23 views)
2014-08-16 06:22:17

Tekkerue (13 views)
2014-08-16 06:20:21

Tekkerue (20 views)
2014-08-16 06:12:11

Rayexar (59 views)
2014-08-11 02:49:23

BurntPizza (38 views)
2014-08-09 21:09:32

BurntPizza (30 views)
2014-08-08 02:01:56

Norakomi (37 views)
2014-08-06 19:49:38

BurntPizza (67 views)
2014-08-03 02:57:17
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

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08 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‑
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!