Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (707)
Games in Android Showcase (208)
games submitted by our members
Games in WIP (781)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 ... 5 6 [7] 8 9 10
 61 
 on: 2017-01-18 19:32:22 
Started by philfrei - Last post by J0
So... this is only a title screen?

 62 
 on: 2017-01-18 19:27:25 
Started by BurntPizza - Last post by hwinwuzhere
made a cake!

Are... are you sure the cake isn't a lie?  persecutioncomplex

 63 
 on: 2017-01-18 19:24:45 
Started by daemor - Last post by daemor
All I am really after is the raw polling data. This is for a robotics project and not really for a game so I will be taking the raw data and converting it into something the robot can interpret. I looked at the code you posted on my other topic but the problem is that it really doesn't tell me anything new, and you reference classes that are not apart of the JInput library. I also took a look at the link to the full game source code you posted but it was not that helpful since It is incredibly long. As far as testing goes, I have downloaded the actual source code for the Controller test that Jinput has to look at, and confirmed it works with my controller. There seems to be something I am missing as far as polling goes. As I understand it, after grabbing the object for your specific gamepad (which works in my code above, as I can see all of the components for the gamepad and such), you simply call
1  
gamepad.poll()
. Then you work through the list of components and get their float representing the poll data using
1  
component.getPollData()
. However when I do this none of the values change regardless of input.

 64 
 on: 2017-01-18 19:12:46 
Started by buddyBro - Last post by Archive
To be honest, your renderer would be faster if you didn't use Java2D and it would look much better too :p
But I'm not going to force you to do anything, it's your engine Smiley


 65 
 on: 2017-01-18 17:24:33 
Started by daemor - Last post by FabulousFellini
Hi again!  I see you didn't get it working yet.  Also, I gave you a skeleton of working code that I always use, so you could compare it with yours.  I did not just copy and paste it directly from my game.  Have you tried any other tests?  Such as if the A button is pressed, then do something?  Or are you strictly looking at what the poll data returns?

 66 
 on: 2017-01-18 17:15:32 
Started by daemor - Last post by daemor
I have been for a long time now (4-5 months) been trying on and off to get JInput to work. I have installed it correctly, all of the testing programs work with my controller, but anytime I try to get poll data it is all either 0.0 for buttons, or -1.5258789E-5 for joysticks. Ive posted in the Jinput section of the forum but only got one answer that told me nothing but gave me code for another game (not an answer). Ive also posted on Stack Overflow with no avail. I have read through and followed the JInput getting started guide on this forum, along with looking anywhere I can on the internet to get something that might help me. All I find are dead links, links to the same tutorials I have already seen, or simply code for games that seems to do nothing different than me. I know this is the not the exact spot to be putting this post but I am getting desperate as nobody seems to visit that section of this forum anymore. Here is the code I am using to test my controller:
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  
public class ControllerTest {

   public static void main(String[] args){
      ControllerTest test = new ControllerTest();
      test.controllerTest();
   }

   void controllerTest(){
      //System.out.println("Hello World");

      Controller[] ca = ControllerEnvironment.getDefaultEnvironment().getControllers();
      Controller gamepad = null;
      Component[] components = null;
      // Run through the list of available input devices and get the gamepad
      for(int i = 0; i < ca.length; i ++){
         if(ca[i].getType().equals(Controller.Type.GAMEPAD)){  // Snag the first instance of a gamepad
            gamepad = ca[i];
         }
      }
      // Print the name of the controller and its type
      if(gamepad != null){
         System.out.println(gamepad.getName() + ": " + gamepad.getType());
         components = gamepad.getComponents();
         System.out.println("COMPONENTS:");
         for(int i = 0; i < components.length; i ++){
            StringBuffer buffer = new StringBuffer();
            buffer.append("Component #" + i + ": ");  // Get the Component #
            buffer.append("\t" + components[i].getName());  // Get the component name
            // Check if the component is analog or relative
            // Relative relies on its past position for values
            // Analog is a current position
            // Analog absolute is a toggle (think your a,b,y,x button)
            if(components[i].isRelative()){
               buffer.append(" [Relative]");
            }
            else if(components[i].isAnalog()){
               buffer.append(" [Analog]");
            }
            else{
               buffer.append(" [Analog Absolute]");
            }
            System.out.println(buffer.toString());
         }
      }
      else{
         System.out.println("No gamepad connected");
      }
     
      float data = 0f;

      while(gamepad.poll()){
         for(int i = 0; i < components.length; i ++){
            if(i == 0){
               data = components[i].getPollData();
               System.out.println(components[i].getName() + ": " + components[i].getPollData());
            }
            else if(i == 1){
               data = components[i].getPollData();
               System.out.println(components[i].getName() + ": " + components[i].getPollData());
            }
            else if(i == 4){
               data = components[i].getPollData();
               System.out.println(components[i].getName() + ": " + components[i].getPollData());
            }
         }

         try{
            Thread.sleep(20);
         }
         catch(Exception e){
            e.printStackTrace();
         }
      }
      System.out.println("Exited");
   }
   
}


The reason I only print out the polled values of components[] at 0,1, and 4 is because those are the axis I am most interested in.
(I also realize I am not using the data variable for anything, I was simply using that variable for debugging)

Sorry for the long post, any help would be greatly appreciated.

 67 
 on: 2017-01-18 16:49:27 
Started by voidburn - Last post by voidburn
I promise it's not going to help, just fuel preconceptions, the issue is terribly random:

1  
2  
3  
4  
5  
Exception in thread "Client" com.esotericsoftware.kryonet.KryoNetException: Incorrect number of bytes (2 remaining) used to deserialize object: com.unobtanium.data.world.WorldRegionData@6f92f2f3
   at com.esotericsoftware.kryonet.TcpConnection.readObject(TcpConnection.java:146)
   at com.esotericsoftware.kryonet.Client.update(Client.java:255)
   at com.esotericsoftware.kryonet.Client.run(Client.java:338)
   at java.lang.Thread.run(Thread.java:745)


Edit: I included it in the README of the repository, it was cut down but I think you're right and should be front and center there.

 68 
 on: 2017-01-18 16:45:43 
Started by voidburn - Last post by princec
Stacktrace!

Cas Smiley

 69 
 on: 2017-01-18 16:44:33 
Started by buddyBro - Last post by buddyBro
Yep, no zbuffer. Just a small update, trailing camera done. Next step, allowing user to control the ship.

<a href="http://www.youtube.com/v/2yQoAaePREA?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/2yQoAaePREA?version=3&amp;hl=en_US&amp;start=</a>

 70 
 on: 2017-01-18 16:40:18 
Started by voidburn - Last post by voidburn
Hello everyone,

[Preamble]

I've explored this as far as I could before accepting the obvious fact that I cannot figure it out by myself. It's well beyond my ability to follow the byte stream inside kryonet's sources to figure out what can possibly go wrong, this is the kind of issue that is best debugged when you're intimately familiar with all the expected states of the software you're writing, and I quickly lose the bundle when trying to follow this one.

So ultimately I devised a test that can navigate this issue, help finding a broken state and reproduce it with accuracy, in the hope that someone smarter than me can understand what's going on, what causes it, and ultimately inspire a solution to retain the ability to compress data sent by kryonet's endpoints without random crashes.

[Problem description]

The problem arises when sending a object over the wire and using the DeflateSerializer provided by Kryo: it crashes when the object contains some specific payload as the result of the compression.

Cheers!

[Solution]

Edit: It was not a kryo/kryonet problem, faulty NIC -_-



Pages: 1 ... 5 6 [7] 8 9 10
 
Galdo (415 views)
2017-01-12 13:44:09

Archive (570 views)
2017-01-02 05:31:41

0AndrewShepherd0 (1043 views)
2016-12-16 03:58:39

0AndrewShepherd0 (967 views)
2016-12-15 21:50:57

Lunch (1099 views)
2016-12-06 16:01:40

ral0r2 (1334 views)
2016-11-23 16:08:26

ClaasJG (1428 views)
2016-11-10 17:36:32

CoffeeChemist (1415 views)
2016-11-05 00:46:53

jay4842 (1499 views)
2016-11-01 19:04:52

theagentd (1251 views)
2016-10-24 17:51:53
List of Learning Resources
by elect
2016-09-09 09:47:55

List of Learning Resources
by elect
2016-09-08 09:47:20

List of Learning Resources
by elect
2016-09-08 09:46:51

List of Learning Resources
by elect
2016-09-08 09:46:27

List of Learning Resources
by elect
2016-09-08 09:45:41

List of Learning Resources
by elect
2016-09-08 08:39:20

List of Learning Resources
by elect
2016-09-08 08:38:19

Rendering resources
by Roquen
2016-08-08 05:55: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!