Java-Gaming.org Hi !
Featured games (87)
games approved by the League of Dukes
Games in Showcase (649)
Games in Android Showcase (181)
games submitted by our members
Games in WIP (699)
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 ... 7
1  Game Development / Networking & Multiplayer / Lag Compensation on: 2016-01-23 20:49:15
I've been working on a little multiplayer game based on Valve's Source Multiplayer method (Described here: https://developer.valvesoftware.com/wiki/Source_Multiplayer_Networking) and I'm coming across an issue which someone asks on the page, but no answer is presented. I was wondering if anyone here could help me answer it. The question is as such:

Quote
From the page: After 100 milliseconds, the client will receive the server snapshot that contains the changes based on the user command he predicted earlier.
After 50 milliseconds, though, the client will receive a server snapshot that does not yet contain the changes based on the user command. Does the client simply ignore this snapshot? If so, what are the rules governing this?

In my case, this causes a stuttering when players let go of a movement key. Any help? I can provide some code if necessary, however, I think this is more of a conceptual issue than code issue.
2  Game Development / Game Mechanics / Re: [Libgdx]Looking to make a 3D effect with 2D sprites. (Example in thread) on: 2015-10-09 15:53:21
Actually, What I'm really looking for is how to accomplish the textured ground and scaling of objects as they come closer. I'd like to do this with sprites drawn to the screen instead of models.
3  Game Development / Game Mechanics / [Libgdx]Looking to make a 3D effect with 2D sprites. (Example in thread) on: 2015-10-09 03:14:04
I'm trying to figure out how to make a 3d effect with 2d sprites, but I have no idea where to even start. I want to make something like this:

https://www.youtube.com/watch?v=34JbhA154To

But with a higher camera angle. If anyone can point me in the direction of what I need to accomplish this, it'd be much appreciated. Thanks.
4  Game Development / Newbie & Debugging Questions / Re: GLContext class not found? [Solved] on: 2015-09-30 19:05:54
Yeah, I think I've got it all sorted out. This time I used lwjgl's actual website and all seems to be working fine without that code. Thanks.
5  Game Development / Newbie & Debugging Questions / GLContext class not found? on: 2015-09-30 17:45:50
I'm trying to follow a tutorial for LWJGL 3 and I've stumbled across a problem. The tutorial tells me to use the line:
1  
GLContext.createFromCurrent()

However, I cannot find the GLContext class anywhere in the lwjgl library.
Here's a link to the tutorial I am using: https://www.youtube.com/watch?v=yzDZIN1eSGQ
If anyone knows what could be going on, I would appreciate the help. Thanks.
6  Game Development / Networking & Multiplayer / Re: Netcode works perfectly on one network, doesn't work on another. on: 2015-06-01 01:21:20
I'm entering the IP address for the server manually.
7  Game Development / Networking & Multiplayer / Netcode works perfectly on one network, doesn't work on another. on: 2015-05-31 17:46:02
This code isn't necessarily a code oriented question, but I was hoping someone might have an idea of what to do. I've got networking working in this app I'm working on, where I have an android client connect to a desktop server running on a laptop. I have two routers in my house, where one is just an old linksys and the other is an apple airport extreme. My app works great when both server and client are connected to the linksys. However, the client cant seem to find the server when connected to the airport. I'm using libgdx's built in networking if that helps. Does anyone know what is the issue here?
8  Games Center / WIP games, tools & toy projects / Re: Army Men - a 3do fangame! on: 2015-02-01 03:15:41
Really like the look of this. Downloaded it, but I couldn't get it to run. I get an exception when at the loading map screen.

How much RAM does your machine have?
In the batch file included, try raising the max amount of RAM if possible.

batch file:
1  
java -Xmx1G -Xms1G -jar Game.jar

1G is the amount of RAM. If 1 does not work for you, raise to 2.
Oh, I forgot to put the arguments before the -jar. Got it working.
9  Games Center / WIP games, tools & toy projects / Re: Army Men - a 3do fangame! on: 2015-01-31 20:26:39
Really like the look of this. Downloaded it, but I couldn't get it to run. I get an exception when at the loading map screen.
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  
C:\Users\Eddie\Downloads\ARMY MEN (1)>java -jar Game.jar -Xms2048m -Xmx2048m
SETTING ICON
SHADER ERROR: Uniform 'normalMatrix' does not exist in shader program net.mantag
ames.armymen.Game$TransparencyShader@b62d79!

Starting up SoundSystem...
Initializing LWJGL OpenAL
    (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.or
g)
OpenAL initialized.

Loading global resources
Starting to load MD3
  Loading tags
    tag_barrel: (3.8070388, 0.011169279, 0.39257425)
  Loading surfaces
    g
MD3 File loaded!
Starting to load MD3
Starting to load MD3
  Loading tags
    tag_weapon: (0.60052204, -0.25301063, 0.583339)
    tag_camera: (0.19334438, -1.3352519, 2.8884773)
  Loading surfaces
    g
MD3 File loaded!
Starting to load MD3
  Loading tags
    tag_torso: (6.077345E-11, 1.9356355E-7, 3.88718)
  Loading surfaces
    default
MD3 File loaded!
LOADED IN 3.626 seconds
Setting up world
Detected NVIDIA card.
Vendor: nvidia corporation
Renderer: geforce 840m/pcie/sse2
Post processing pipeline: [net.mantagames.anarchyengine.post.MergeProcessor@1f62
e33, net.mantagames.anarchyengine.post.BloomRenderer@b1e9b8, net.mantagames.anar
chyengine.post.ToneMapper@1406a17, net.mantagames.anarchyengine.post.FXAAProcess
or@af004b]
ARB_base_instance supported, using for decal rendering.
C:\Users\Eddie\Downloads\ARMY MEN (1)\Resources\maps\Kitchen.wad
  Loading map...Exception in thread "main" java.lang.OutOfMemoryError: Java heap
 space
        at net.mantagames.anarchyengine.model.BinFile.<init>(BinFile.java:38)
        at net.mantagames.armymen.world.GameMap.load(GameMap.java:189)
        at net.mantagames.armymen.world.GameMap.<init>(GameMap.java:64)
        at net.mantagames.armymen.world.World.loadWorld(World.java:130)
        at net.mantagames.armymen.Client$2.execute(Client.java:119)
        at net.mantagames.anarchyengine.World.doTasks(World.java:23)
        at net.mantagames.armymen.world.World.draw(World.java:214)
        at net.mantagames.armymen.Client.draw(Client.java:290)
        at net.mantagames.anarchyengine.Core.startGameLoop(Core.java:178)
        at net.mantagames.armymen.Client.<init>(Client.java:80)
        at net.mantagames.armymen.Client.main(Client.java:374)
10  Game Development / Game Mechanics / Pathfinding without a grid on a 2d plane on: 2014-10-23 19:27:12
I've been working on a little side project where it's just two endless armies fighting each other and I've begun adding buildings to it so that they can refill their ammo and such things. The issue I'm having is in having pathfinding AROUND the buildings. Right now the buildings stop the fighters in their tracks and the fighters can't find their way around. I don't have any sort of grid in place either. This is an example of what is happening:
11  Game Development / Newbie & Debugging Questions / Re: Programming an online top-down game for newbies - Questions on: 2014-10-20 17:53:17
I'd like to hear your honest opinion!
As beginner, don't do an online multiplayer game at all.
I had the same thought. When I see "newbie" and "online-multiplayer" in the same post, I see a recipe for disaster. This is not always the case, but I still hazard opening the can of worms labeled "multiplayer" as a first serious project.
12  Game Development / Newbie & Debugging Questions / Libgdx - Tiled Map object properties on: 2014-09-15 02:02:57
I'm having a bit of trouble with trying to iterate through the list of keys provided by Libgdx's MapObject class. As I'm trying to iterate through them, I only receive the data for the first item in the list. Here's what I've got.
1  
2  
3  
4  
5  
MapProperties p = o.getProperties();
while(p.getKeys().hasNext()){
   String s = p.getKeys().next();
   System.out.println(s);
}

All I'm getting is the name of the first key, x, over and over. Any help would be great.
13  Game Development / Game Mechanics / LIBGDX - Xbox360 Controller joystick conversion on: 2014-09-14 01:32:28
I'm working with Libgdx's controller library, trying to make a platformer. I want the joystick to behave like d-pad however. Specifically, I need to only recognize one direction at a time, and I need to recognize when the player lets go of the stick and it returns to the center position. Any insight to this would be much appreciated. Pardon the messy code. This is what I've got going so far:
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  
   public boolean axisMoved(Controller controllerN, int axisCode, float value) {
     
      if(Math.abs(value) > joystickDeadzone){
         switch(axisCode){
         case 0:
            if(value < 0){
               controller.keyDown(ControlMapXbox.upAxis);
            }
            if(value > 0){
               controller.keyDown(ControlMapXbox.downAxis);
            }
            break;
         case 1:
            if(value < 0){
               controller.keyDown(ControlMapXbox.leftAxis);
               
            }
            if(value > 0){
               controller.keyDown(ControlMapXbox.rightAxis);
            }
            break;
         case 2:
           
            break;
         case 3:
           
            break;
         case 4:
            if(value < 0){
               controller.keyDown(ControlMapXbox.rightTrigger);
            }
            break;
         }
      }
      return false;
   }
14  Game Development / Newbie & Debugging Questions / Re: making an inventory work. on: 2014-08-18 17:47:52
Here's some quick code I wrote up. No time to try it so tell me if it doesn't work.
This is just a mockup of what I would suggest for the "MyButton" class. (Although, I don't recommend naming it that.
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
public class MyButton extends JButton{

   public Item i;

   public MyButton(....., Item i){ // The "......." is whatever arguments you're already passing to create the JButton, if any.
      super(....);
      this.i = i;
   }
   public Item getItem(){
      return i;
   }
}


Here's where your button press would be handled.
1  
2  
3  
4  
5  
6  
7  
8  
public void actionPerformed(ActionEvent e){
   Object o = e.getSource();
   if(o instanceof MyButton){
      MyButton b = (MyButton)o;
      b.getItem().doAction(player);
   }
   
}
15  Game Development / Game Mechanics / Re: [LibGDX] Edges on 3D models on: 2014-08-18 12:00:02
I don't have much experience with 3d, but am I going to see much of a performance drop from using shaders?
16  Game Development / Game Mechanics / [LibGDX] Edges on 3D models on: 2014-08-18 03:13:03
I'm starting to work with 3d and I have an aesthetic that I'm trying to reach. I want to be able to have my models show with extra emphasis on the edges of the models, like in Cel Shading, but without the toonish lighting. I haven't been able to find very much info on this or if this is even possible with LibGDX. If anyone has some insight on this, it would be much appreciated.
17  Game Development / Newbie & Debugging Questions / Re: making an inventory work. on: 2014-08-15 14:40:07
I would make an extension of whatever button class you are using that has an Item variable in it. When you generate all of your buttons, add the item object to the constructor of the button. Then, when you process the actionevent, you can cast the source of the event to your new button class. From your source, you can access the item variable you had stored in it.
18  Game Development / Newbie & Debugging Questions / Re: making an inventory work. on: 2014-08-15 11:40:29
If I were to approach this, I would have to agree with you up until you start throwing actionlisteners in. I'm not sure if this is best practice, but I would have all the "Items" extend one abstract class. In the abstract class, I would have an abstract method called something like "doAction(Player player, Environment env)". Then, you can have each item class have its own instruction, without throwing all the instructions into one class. Of course, the issue with this is that you have to create a new class for every item.
19  Game Development / Game Mechanics / Re: Plane physics on: 2014-08-11 13:59:46
@opiop65
That's a much better way at explaining it that what I had. Thank you.
20  Game Development / Game Mechanics / Re: Plane physics on: 2014-08-11 12:34:48
No, by definition, the wing would not be generating any lift. Lift is defined as , "Upward-acting force on an aircraft wing or airfoil." If the plane is still moving forward when it stalls and begins to fall, that is due to the momentum that the plane has from it's previous movement. Now, assuming the wind speed is 0, you just have the force of the wind moving at the horizontal speed of the plane colliding with the top of the wing, slowing its horizontal speed. I hope that makes sense to you.
21  Discussions / General Discussions / Re: What? Your game isn't a pixelated retro masterpiece? on: 2014-07-18 14:41:16
I use pixel art for my work primarily because I just flat out suck at drawing. Nobody I know is any good with animation, and I find that I can do my best art when I don't need such a finite control on the art and pixels are great to hide that. I'll admit it, I won't call my games "Retro" or "8-bit", because I'm not using the same constraints that they had to abide by and attempt to work around back then. I'd personally rather have a minimalistic look to my games, which I believe can also be provided by pixels.
22  Games Center / Featured Games / Re: [Slick2d] Retro-Pixel Castles > Now on Steam! < on: 2014-07-15 20:32:24
Just downloaded it to try it out. First thoughts, I'm digging all the art. Second thoughts, "Oh, I can only use the map editor". Third Thoughts, "Umm.. It crashes whenever I get to the loading map screen."
23  Game Development / Newbie & Debugging Questions / Re: Libgdx sound lag? [solved] on: 2014-07-14 12:01:51
Yeah, the clip ran perfectly fine on PC. I know I didn't do anything special for it because I downloaded it from freesound and didn't even look at the sample rate until there was an issue.
24  Game Development / Newbie & Debugging Questions / Re: Libgdx sound lag? [solved] on: 2014-07-14 02:53:01
Success has been had! I lowered the sample rate on the clip from about 96k to 44.1k. It plays perfectly fine now!
25  Game Development / Newbie & Debugging Questions / Re: Libgdx sound lag? on: 2014-07-12 01:50:33
Well I'm fairly certain that the issue is NOT with the phone lacking power. It's a newer Samsung Galaxy S4, and I've also run it on a couple of other newer phones as well.
26  Game Development / Newbie & Debugging Questions / Re: Libgdx sound lag? on: 2014-07-11 12:25:14
Well, here's my Audio.java class. It's not the greatest, but hey, I'm open for suggestions.
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  
package com.toasted;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.audio.Music;
import com.badlogic.gdx.audio.Sound;
import com.badlogic.gdx.files.FileHandle;

public class Audio {
   public static Sound beep0 = newSound("blip.wav");
   public static Sound swing = newSound("swing.wav");
   public static Sound crumble = newSound("crumble.wav");
   public static Sound laser = newSound("laser.wav");
   public static Sound vaporize = newSound("vaporize.wav");
   public static Sound thump = newSound("thump.ogg");
   public static Sound siren = newSound("siren.ogg");
   public static Sound wood = newSound("wood.ogg");
   public static Sound chain = newSound("chain.ogg");
   
   public static Sound whiteSedan = newSound("whiteSedan.ogg");
   public static Sound cleanUp = newSound("cleanUp.ogg");
   public static Sound carl = newSound("carl.ogg");
   public static Sound thankYou = newSound("thankyou.ogg");
   public static Sound dairy = newSound("dairy.ogg");
   public static Sound special = newSound("special.ogg");
   public static Sound cashews = newSound("cashews.ogg");
   
   public static final float cleanUpRuntime = 2.0F;
   public static final float whiteSedanRuntime = 5.0F;
   public static final float carlRuntime = 7.5F;
   public static final float thankYouRuntime = 7.75F;
   public static final float dairyRuntime = 5.75F;
   public static final float specialRuntime = 7.0F;
   public static final float cashewsRuntime = 6.0F;
         
   public static Music gameLoop = Gdx.audio.newMusic(Gdx.files.internal("sound/musicLoop.ogg"));
   public static Music rageMusic = Gdx.audio.newMusic(Gdx.files.internal("sound/rage.ogg"));
   
   public final static float SWING_VOL = .5F;
   public final static float VOL = 1.0F;
   public static boolean enabled = true;
   
   public void pauseAll(){
      beep0.pause();
      swing.pause();
      crumble.pause();
      laser.pause();
      vaporize.pause();
      thump.pause();
      siren.pause();
      wood.pause();
      whiteSedan.pause();
      cleanUp.pause();
      chain.pause();
     
      gameLoop.pause();
      rageMusic.pause();
   }
   
   public static void play(Sound s){
      if(enabled)
         s.play(VOL);
   }
   public static void loop(Sound s){
      if(enabled)
         s.loop(VOL);
   }
   public static void loop(Sound s, float vol){
      if(enabled)
         s.loop(vol);
   }
   public static void play(Music m){
      if(enabled)
         m.play();
   }

   
   public static void playRandomPitch(Sound sound, float vol){
      if(!enabled) return;
      float pitch = Global.r.nextFloat();
      sound.play(vol, (pitch * 1.0F) + 1.0F, 0);
   }
   
   private static Sound newSound(String filename){
      return Gdx.audio.newSound(Gdx.files.internal("sound/"+filename));
   }
}

And this is where I believe I'm seeing my problem.
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  
for(int i = 0;i < products.size();i++){
         Product p = products.get(i);
         if(p.position.x < player.position.x && player.position.x - p.position.x > 32){
            products.remove(p);
         }
         if(!p.exists()){
            //shatter
            for(int j = 0;j < 5;j++){
               particles.add(new Particle(p.position, new Vec2D(Global.getRandomInt(1, 10), 0), 2.0F, true, Art.frag(p.item)));
            }
            productCounter[p.ID]++;
            products.remove(p);
            Global.score += (int)Global.multiplier * Product.points[p.ID];
            if(p.sliced) {
               rage += 1 * (Global.crown ? 1.5F : 1F);
               Audio.playRandomPitch(Audio.crumble, .25F);
            }else{
               switch(rageType){
               case lazerVision:
                  Audio.play(Audio.vaporize);
                  break;
               }
            }
            if(rage > 100){
               rage = 100;
            }
         }
      }
27  Game Development / Newbie & Debugging Questions / Re: Libgdx sound lag? on: 2014-07-10 16:04:01
Well, yeah I guess it would just be running slowly. There's not any noticable latency between when the sound is supposed to play and when the sound actually plays. Sorry for the misnomer there.
28  Game Development / Newbie & Debugging Questions / Re: Libgdx sound lag? on: 2014-07-10 15:05:05
I just checked the format on that sound, and ironically, it's one a wav. I'll try converting it over to OGG later. Also, I'm not having any performance trouble on PC, only android.
29  Game Development / Newbie & Debugging Questions / Libgdx sound lag? [solved] on: 2014-07-10 13:55:25
I've been working the kinks out of my game that I've been working on ON an OFF for quite some time and now I'm reaching the end. I've noticed that, while the game runs perfectly fine on my POS PC, I am getting lag whenever I play it on android. The point of this game is to destroy products on shelves, and when they are destroyed, they play a crumble sound with a randomized pitch. Something like 5 or 6 products are all destroyed at the same time. At first, I thought this issue was from all the particles I spawn when the products are destroyed, but I quickly learned that when I disabled in-game sound, I had no more lag. I was wondering if anyone else has had this kind of trouble with sound and libgdx. If necessary, I'll post some code later. Thanks in advance.
30  Game Development / Newbie & Debugging Questions / Re: Collision detection with tiling, fall problems? on: 2014-07-10 12:21:19
Currently, you are getting the the collisions based on two different tiles, when your character is only less than one tile wide.
1  
2  
3  
4  
5  
// Find the tile the robot spans.
int t = player.getY1() / BLOCK_SIZE; // Top tile coordinate.
int b = (player.getY2() / BLOCK_SIZE); // Bottom tile coordinate.
int l = player.getX1() / BLOCK_SIZE; // Left tile coordinate.
int r = player.getX2() / BLOCK_SIZE; // Right tile coordinate.


if the width of the player is less that the tile width, I would only check the center of the player with collision with the ground. So maybe add another variable to your tiles to make it:

1  
2  
3  
4  
5  
6  
// Find the tile the robot spans.
int t = player.getY1() / BLOCK_SIZE; // Top tile coordinate.
int b = (player.getY2() / BLOCK_SIZE); // Bottom tile coordinate.
int l = player.getX1() / BLOCK_SIZE; // Left tile coordinate.
int r = player.getX2() / BLOCK_SIZE; // Right tile coordinate.
int m = ((player.getX2() + player.getX1()) / 2 ) /  BLOCK_SIZE; // The NEW middle tile coordinate

And then change your fall code so that it uses that variable instead:
1  
2  
3  
if(!blocks[b][m].isSolid()) { 
   player.fall(1);
}


With these changes, you may see slight overlap of the character on the wall that he just falls over, but he should be able to move out of it. Just looking at your collisions code, it looks like walls will be troublesome for you as you can't quite get very close to them.

Edit: changed a minus to a plus.
Pages: [1] 2 3 ... 7
 
KaiHH (83 views)
2016-01-31 23:15:29

sci4me (110 views)
2016-01-23 21:47:05

sci4me (97 views)
2016-01-23 21:46:58

KaiHH (130 views)
2016-01-19 13:26:42

theagentd (216 views)
2016-01-05 17:10:00

ClaasJG (231 views)
2016-01-03 16:58:36

chrisdalke (220 views)
2015-12-28 06:31:21

Guerra2442 (240 views)
2015-12-25 03:42:55

Guerra2442 (244 views)
2015-12-25 03:27:21

theagentd (287 views)
2015-12-21 14:43:24
List of Learning Resources
by SilverTiger
2016-02-05 09:39:47

List of Learning Resources
by SilverTiger
2016-02-05 09:38:38

List of Learning Resources
by SilverTiger
2016-02-05 09:35:50

Rendering resources
by Roquen
2015-11-13 14:37:59

Rendering resources
by Roquen
2015-11-13 14:36:58

Math: Resources
by Roquen
2015-10-22 07:46:10

Networking Resources
by Roquen
2015-10-16 07:12:30

Rendering resources
by Roquen
2015-10-15 07:40:48
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!