Java-Gaming.org Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (603)
Games in Android Showcase (171)
games submitted by our members
Games in WIP (651)
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 ... 6
1  Game Development / Newbie & Debugging Questions / Re: Animation on: 2015-07-07 14:29:17
Yup... Grin Something like that
2  Game Development / Newbie & Debugging Questions / Re: Animation on: 2015-07-07 14:16:52
Why would you need atlas file? Just load the sprite sheet, cut it into sprites and store it in a list. Then when you want to draw the sprites chose an index (change it every (let's say) 150 ms) and there you go....
3  Discussions / Business and Project Management Discussions / Re: Am curious how to budget a team project on: 2015-07-07 06:56:49
Have you played Wow? Skyrim? The levels are very huge and there is a lot of areas in the world... So you need a level designer... But if you don't want to have huge levels a you can do it your self.And it is possible that you do it your self. <a href="http://www.youtube.com/v/Ec9DqrtWcPc?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/Ec9DqrtWcPc?version=3&amp;hl=en_US&amp;start=</a> I think he did it all by him self... I don't know how to answer you question but all is possible. Maybe you will need an artist tome make art while you code, to speed up the process but you don't really anyone.  Wink
4  Game Development / Artificial Intelligence / Re: Decision Making in Strategy Game on: 2015-07-05 22:15:33
This,this
I hope i helped! Cheesy
5  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-07-05 19:49:16
I uploaded another timelapse video on youtube. I think i am addicted  persecutioncomplex

<a href="http://www.youtube.com/v/0UqVM_5t9xc?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/0UqVM_5t9xc?version=3&amp;hl=en_US&amp;start=</a>
6  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-07-04 10:57:26
Just uploaded my second timelapse. I have a little problem with aabb colision any tutorials on colision?
<a href="http://www.youtube.com/v/TW8ZY4CjSnQ?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/TW8ZY4CjSnQ?version=3&amp;hl=en_US&amp;start=</a>
7  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-07-01 22:02:54
Now I know I can die peacefully...
8  Discussions / General Discussions / Re: Steam Machine vs homebuilt PC on: 2015-07-01 21:54:20
Build your own, if you know what are you doing go for it. You get to chose your own spec and you can upgrade if need be. (I don't really know if you can tweak steam machine). If you never built your own pc ask for help, online, someone you know... I think you will get a much cheaper pc but stronger than steam machine. Cheesy

Edit : You can upgrade a steam machine but it is hard... And they say it is "console like" sooo.....Source
9  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-07-01 21:45:49
I was brain f**ked by brainf**k, it is simply amazing!

-[------->+<]>.-[->++++<]>.[->+++<]>+.++++++++++++.[->+++++<]>-.[->+++<]>++.[--->+<]>----.+++[->+++<]>++.++++++++.+++++.-[->+++++<]>-.++[->+++<]>.-[--->+<]>--.+[->+++<]>+.++++++++.------.-.-[--->+<]>.
10  Game Development / Networking & Multiplayer / Lag when sending position data on: 2015-06-26 09:22:46
So what am I doing is sending the position of the player every time he moves

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
public void update() {
      int h = player.health;
      int mh = player.maxHealth;
      float xx = player.x;
      float yy = player.y;
      player.tick();
      if ((xx != player.x || yy != player.y) && ticks) {
         client.getServerConnection().sendUdp(new PacketPos(PlayerID, player.x, player.y));
      }
      if (h != player.health || mh != player.maxHealth) {
         client.getServerConnection().sendUdp(new PacketHealth(player.health, player.maxHealth));
      }
      ticks++;
   }


and my server sends the data to other clients

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
   public void received(Connection con, Object obj) {
   if (obj instanceof PacketPos) {
         for (Player p : ps) {
            Connection c = p.CON;
            if (c.getId() != con.getId()) {
               c.sendUdp(obj);
            }
         }
      }
   }


and then my clients receives that packet and moves the player with that id

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
   public void received(Connection con, Object obj) {
      if (obj instanceof PacketPos) {
         PacketPos pos = (PacketPos) obj;
         if(!hasID(pos)){
            con.sendTcp(new PacketReqReg(pos.id)); // if it cant recognize the id, it requests registration packet
         }
      }
   }
   
   public boolean hasID(PacketPos pos){
      for (PlayerOnline po : gclient.po) {
         if (po.id == pos.id) {
            po.posMove(pos.x, pos.y); // moves the player
            return true;
         }
      }
      return false;
   }


It is kinda working fine when there are 2 clients, when there are 3 it starts to drop the fps.

How do I optimize that and make the movement smooth?

I have tried to make it send the pos packet every few milisec but it looks chunky...

BTW: I use NitroNet
11  Games Center / Cube World Projects / Re: Technetium - A realistic voxel game on: 2015-06-21 12:19:25
Copying code is not making a game  Cranky ... Don't do that, be original Tongue
12  Game Development / Networking & Multiplayer / Re: NitroNet - New, High-Level Networking Library on: 2015-05-17 10:35:59
I quite like it. It is similar to kryonet but simpler, good for beginners!
13  Game Development / Newbie & Debugging Questions / [LWJGL] Shaders, implementing? on: 2015-04-15 09:32:44
So i am trying to implement shaders on my own with lwjgl.
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  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
71  
72  
73  
74  
75  
76  
77  
78  
79  
80  
81  
82  
83  
84  
85  
86  
87  
88  
89  
90  
91  
92  
93  
94  
95  
96  
97  
98  
99  
100  
101  
102  
103  
104  
105  
106  
107  
108  
109  
110  
111  
112  
113  
114  
115  
116  
117  
118  
119  
120  
121  
122  
123  
124  
125  
126  
127  
128  
129  
130  
131  
132  
133  
134  
135  
136  
137  
138  
139  
140  
141  
142  
package necro.graphical;

import static org.lwjgl.opengl.GL11.GL_FALSE;
import static org.lwjgl.opengl.GL20.GL_COMPILE_STATUS;
import static org.lwjgl.opengl.GL20.GL_FRAGMENT_SHADER;
import static org.lwjgl.opengl.GL20.GL_VERTEX_SHADER;
import static org.lwjgl.opengl.GL20.glAttachShader;
import static org.lwjgl.opengl.GL20.glCompileShader;
import static org.lwjgl.opengl.GL20.glCreateProgram;
import static org.lwjgl.opengl.GL20.glCreateShader;
import static org.lwjgl.opengl.GL20.glGetShader;
import static org.lwjgl.opengl.GL20.glLinkProgram;
import static org.lwjgl.opengl.GL20.glShaderSource;
import static org.lwjgl.opengl.GL20.glUseProgram;
import static org.lwjgl.opengl.GL20.glValidateProgram;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

import org.lwjgl.opengl.Display;

public class ShaderProgram {

   private int shaderProgram, verShader, fragShader;

   private String vertexShader, fragmentShader;

   private StringBuilder vertexShaderSource;
   private StringBuilder fragmentShaderSource;

   /**
    * !!! THIS MUST BE IN THE INIT METHOD!!! initializes shader program. Use
    * load to load and then create() to create!
    *
    * @param verShader
    * @param fragShader
    */

   public ShaderProgram(String verShader, String fragShader) {
      vertexShader = verShader;
      fragmentShader = fragShader;
   }
   /**
    * Load the shaders!
    */

   public void load() {
      shaderProgram = glCreateProgram();
      verShader = glCreateShader(GL_VERTEX_SHADER);
      fragShader = glCreateShader(GL_FRAGMENT_SHADER);

      vertexShaderSource = new StringBuilder();
      fragmentShaderSource = new StringBuilder();

      BufferedReader reader = null;
      try {
         reader = new BufferedReader(new FileReader(vertexShader));
         String line;

         while ((line = reader.readLine()) != null) {
            vertexShaderSource.append(line).append('\n');
         }

      } catch (IOException e) {
         System.err.println("Can not load vertex shader! There is no :" + vertexShader);
         e.printStackTrace();
         Display.destroy();
         System.exit(1);
      } finally {
         if (reader != null) {
            try {
               reader.close();
            } catch (IOException e) {
               e.printStackTrace();
            }
         }
      }
      BufferedReader reader1 = null;
      try {
         reader1 = new BufferedReader(new FileReader(fragmentShader));
         String line;

         while ((line = reader1.readLine()) != null) {
            fragmentShaderSource.append(line).append('\n');
         }

      } catch (IOException e) {
         System.err.println("Can not load fragment shader! There is no :" + fragmentShader);
         e.printStackTrace();
         Display.destroy();
         System.exit(1);
      } finally {
         if (reader1 != null) {
            try {
               reader1.close();
            } catch (IOException e) {
               e.printStackTrace();
            }
         }
      }

   }

   @SuppressWarnings("deprecation")
   /**
    * Create and compile shaders!
    */

   public void create() {
      glShaderSource(verShader, vertexShaderSource);
      glCompileShader(verShader);
      if (glGetShader(verShader, GL_COMPILE_STATUS) == GL_FALSE) {
         System.err.println("Vertex shader could not comple!");
         Display.destroy();
         System.exit(1);
      }

      glShaderSource(fragShader, fragmentShaderSource);
      glCompileShader(fragShader);
      if (glGetShader(fragShader, GL_COMPILE_STATUS) == GL_FALSE) {
         System.err.println("Fragment shader could not comple!");
         Display.destroy();
         System.exit(1);
      }
      glAttachShader(shaderProgram, verShader);
      glAttachShader(shaderProgram, fragShader);
      glLinkProgram(shaderProgram);
      glValidateProgram(shaderProgram);

   }
   /**
    * Start using shader program!
    */

   public void startShader() {
      glUseProgram(shaderProgram);
   }
   /**
    * Stop using shader program!
    */

   public void stopShader() {
      glUseProgram(0);
   }

}

and using them
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  
public class Game extends State {

   ShaderProgram sp;
   Texture grass;
   MyGame mg;

   public Game(MyGame myGame) {
      mg = myGame;
   }

   @Override
   public void init() {
      grass = Loader.getTexture("img/grass.png");
      sp = new ShaderProgram("shader.ver", "shader.frag");
      sp.load();
      sp.create();
   }

   @Override
   public void render() {
      sp.startShader();
         Render.drawTexture(grass, 100, 100, 64, 64);
      sp.stopShader();
   }

   @Override
   public void update() {

   }

}

And there is nothing i can do with them now...... xD
how do i pass the values (exp. color) to the shader and use it?
14  Games Center / WIP games, tools & toy projects / Re: 2D Terrarian engine on: 2015-04-13 20:25:09
It looks so niceeee! Cheesy
15  Game Development / Networking & Multiplayer / Re: Kryonet How to update sprite animation in client/server on: 2015-03-28 11:38:17
just save previous x and y and compare it to the new x and y if it changes just update the animation or something....
16  Games Center / WIP games, tools & toy projects / Re: Bit Siege - 2D Competitive Multiplayer PvP Game. (Patch v1.4.2 out now!) on: 2015-02-21 12:27:52
The game looks nice, but why don't you make the "bullets"/"Abilities" go 360 degrees instead locking them to 0,90,180 and 270. I think it would be better and more fun. Maybe?
17  Games Center / Showcase / Re: Spaceport Hope on: 2015-02-21 12:20:55
It is AWESOME!!! Love the pixel art! Gameplay looks nice. I think it could be big! When did you start developing it and when will it be finished?
18  Game Development / Newbie & Debugging Questions / Re: Adding chunks to world for large maps? on: 2015-02-21 12:03:40
Well i made something that is working BUT i load all of the chunks and if i have a lot my ram usage goes over 1 Gb.... and i dont want that

my world class

https://github.com/GNecro1/RPG/blob/master/src/net/world/World.java

and my Chunk class

https://github.com/GNecro1/RPG/blob/master/src/net/world/Chunk.java

I was thinking to just have an a 2D array of 3x3 chunks and as the player moves i make the previus chunk = new chunk.... and i don't really know how.....
19  Game Development / Newbie & Debugging Questions / Re: Adding chunks to world for large maps? on: 2015-02-17 21:39:37
I dont realy know what that means.... a tree structure?
20  Game Development / Newbie & Debugging Questions / Re: Adding chunks to world for large maps? on: 2015-02-17 20:52:06
How would i do this for infinite terrain?
21  Game Development / Newbie & Debugging Questions / Adding chunks to world for large maps? on: 2015-02-17 13:07:19
I really don't know how do i implement large maps(over worlds), but i split it into smaller maps, like chunks, and update them only... If you know any tutorial or something, please don't hesitate to share! Thanks in advance!
22  Java Game APIs & Engines / Engines, Libraries and Tools / Re: [Slick2D] Why the F is it so slow? [SOLVED] on: 2015-01-12 08:39:04
Well it is better than what i did. I just did all of that in my game.
23  Java Game APIs & Engines / Engines, Libraries and Tools / Re: [Slick2D] Why the F is it so slow? on: 2015-01-10 12:22:51
I solved it, i just get the image from the animation. YAy
24  Java Game APIs & Engines / Engines, Libraries and Tools / Re: [Slick2D] Why the F is it so slow? on: 2015-01-10 10:02:49
Yea i am doing that, one more problem i am using only one spritesheet for everything and how do i draw animation it only has draw? And when i draw it it goes to the 0,0 no matter what!
25  Java Game APIs & Engines / Engines, Libraries and Tools / Re: [Slick2D] Why the F is it so slow? on: 2015-01-09 21:50:52
Thx it runs very fast! <3
26  Java Game APIs & Engines / Engines, Libraries and Tools / Re: [Slick2D] Why the F is it so slow? on: 2015-01-09 12:13:09
I dont think so......
27  Java Game APIs & Engines / Engines, Libraries and Tools / Re: [Slick2D] Why the F is it so slow? on: 2015-01-09 12:01:29
When i use start() and end() my game brakes.... ? It does not show the player (Animation) and it only shows some of the sprites.....
28  Java Game APIs & Engines / Engines, Libraries and Tools / Re: [Slick2D] Why the F is it so slow? on: 2015-01-09 11:41:22
Here you go the whole project https://www.mediafire.com/?9h7o6mmy97919di
29  Java Game APIs & Engines / Engines, Libraries and Tools / Re: [Slick2D] Why the F is it so slow? on: 2015-01-09 11:10:11
Nope that is not the problem i checked that first when i saw the FPS.
30  Java Game APIs & Engines / Engines, Libraries and Tools / Re: [Slick2D] Why the F is it so slow? on: 2015-01-09 11:03:57
I did i draw one tile and it still slows down... when i dont draw tiles the FPS goes to 60 (target FPS 60) and when i draw one it goes to 57 FPS
Pages: [1] 2 3 ... 6
 
SHC (11 views)
2015-08-01 03:58:20

Jesse (16 views)
2015-07-29 04:35:27

Riven (38 views)
2015-07-27 16:38:00

Riven (19 views)
2015-07-27 15:35:20

Riven (22 views)
2015-07-27 12:26:13

Riven (12 views)
2015-07-27 12:23:39

BurntPizza (32 views)
2015-07-25 00:14:37

BurntPizza (43 views)
2015-07-24 22:06:39

BurntPizza (25 views)
2015-07-24 06:06:53

NoxInc (31 views)
2015-07-22 22:16:53
List of Learning Resources
by gouessej
2015-07-09 11:29:36

How Do I Expand My Game?
by bashfrog
2015-06-14 11:34:43

List of Learning Resources
by PocketCrafter7
2015-05-31 05:37:30

Intersection Methods
by Roquen
2015-05-29 08:19:33

List of Learning Resources
by SilverTiger
2015-05-05 10:20:32

How to: JGO Wiki
by Mac70
2015-02-17 20:56:16

2D Dynamic Lighting
by ThePixelPony
2015-01-01 20:25:42

How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21
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!