to get input from both joysticks

BlitzMax Forums/BlitzMax Programming/to get input from both joysticks

Nate the Great(Posted 2009) [#1]
Hi, I have a dual joystick controler and as much as I try, I cant get it to give me input from the right joystick... Is there a way to do this via raw bmax. no dlls or mods?


Oddball(Posted 2009) [#2]
JoyU() and JoyR() are usually the right stick, but individual joypads may differ.


Nate the Great(Posted 2009) [#3]
thanks oddball!

by the way, I was thinking about your module physlite and wondering why it isnt all that fast with the grid you implemented? As soon as I implemented a grid, I went from 800 points max to 2500 max at 60 fps


Oddball(Posted 2009) [#4]
Not sure I follow your question. In my tests on my crappy 1.6GHz laptop I get a sizable speed increase when using PhysLite's grid occlusion. When set to the minimum I get a x2 speed increase and when set to maximum I get a x11 speed increase. I also get a x2 speed increase when the collision event callback queue is set to discard, but most games require the event queue. On my rig a simulation running at 60fps will start skipping frames at approx. 3000 masses with 4800 constraints. Seems fast enough to me.


Nate the Great(Posted 2009) [#5]
Not sure I follow your question. In my tests on my crappy 1.6GHz laptop I get a sizable speed increase when using PhysLite's grid occlusion. When set to the minimum I get a x2 speed increase and when set to maximum I get a x11 speed increase. I also get a x2 speed increase when the collision event callback queue is set to discard, but most games require the event queue. On my rig a simulation running at 60fps will start skipping frames at approx. 3000 masses with 4800 constraints. Seems fast enough to me.



hmmm thats odd.... In your tutorial pack (downloaded from your site) I get about 60 fps until 240 boxes in the grid demo thing which is 960 with the grid on. after that, it lags. that is on a 2.6 ghz!?! Ill go test it out again.


Nate the Great(Posted 2009) [#6]
ok did a test I optimized my system (got rid of all of those annoying background things that take up cpu time) and with the grid on I get to 300 boxes, then it lags to 30 fps... I am still a bit confused about the figures you gave me...

x11? shouldnt that put me over 11,000 if it can handle about 1,000 without a grid

I looked at the source for this demo (number 15) and you set your grid size to 40... I assume this is the max diameter of any of the points... then you toggle the grid on and off.... so isnt that the smallest possible grid size and therefore, I should get an 11x speed up...

hmm I guess we are not seeing eye to eye or at least our cpu's arent


Oddball(Posted 2009) [#7]
Nate the Great wrote:
hmmm thats odd.... In your tutorial pack (downloaded from your site) I get about 60 fps until 240 boxes in the grid demo thing which is 960 with the grid on. after that, it lags. that is on a 2.6 ghz!?! Ill go test it out again.
The tutorial pack doesn't contain a stress test. Tutorial 15 is a tutorial on how to use grid occlusion. Each box has five masses and eight constraints. It uses a grid size of 40, the maximum is 128, and it also has the iterations set to two, so it's not suprising it only gets to 240 boxes(1200 masses). Like I said it's not a stress test.
x11? shouldnt that put me over 11,000 if it can handle about 1,000 without a grid
No, not even close. You are assuming that the time increase for adding masses is a constant gradient, but it is not. The increase is in fact a steep curve with the time increase itself increasing with each mass added. My x11 figure comes from running a stress test with 3000 masses which had a ~16ms(60fps) update time. Switching the grid occlusion off increased the update time to ~180ms. I calculate that as an x11 speed increase. Conversely starting without grid occlusion I get 900 masses at ~16ms update time, then switching the grid on gives an update time of ~3ms. That's a speed increase of about x5. Do you see how the speed increase for grid occlusion is dependent on the amount of masses within the the simulation and not the other way around?

Feel free to check out my stress test on your own rig. I'd be interested to see the results. Physlite stress test [345KB]


Nate the Great(Posted 2009) [#8]
ok now I dont want to be a party pooper, but I made a little demo (I tried to make it similar to yours for some good comparison) which I am uploading soon and running one after the other, my machine gets 4500 on yours but with my example, I get a whoping 8500! I know your saying.... I dont believe it, I gotta see that to believe it.... well thats why im uploading it.


Nate the Great(Posted 2009) [#9]
ok upload available here

http://naillproductions.synthasite.com/resources/verlet%20max%20stress%20test.zip


Oddball(Posted 2009) [#10]
With yours I get 800 boxes when the update hits ~16ms. How many masses and constraints are there per box? I'm just curious as I don't really wish to get into a cock waving contest with you. As I see it once you are throwing thousands of particles around a few thousand here and there are by the by. I'm more interested in stability and recoverability.

Edit: Sorry just noticed the mass count at the top (It was off screen first time I ran it). Your test only has four masses per box and so I presume only six constraints per box?


Nate the Great(Posted 2009) [#11]
Edit: Sorry just noticed the mass count at the top (It was off screen first time I ran it). Your test only has four masses per box and so I presume only six constraints per box?


yeah... doesnt yours have 4 masses and 6 constraints?

Edit I never looked at number of boxes... just number of pointmasses as those have the biggest speed hit

side by side I get 4800 and 8500 point masses regardless of how many boxes there are... heck, I could make each box a single point or 2 or 3 or 5 or 6 points for that matter... It wouldnt have much effect on speed.


edit2: what do you mean by recoverablility?


Oddball(Posted 2009) [#12]
I can see you are quite zealous about the numbers, personally it doesn't make much difference to me. I was only trying to figure out how many constraints were in your stress test. As I said early my boxes had five masses and eight constraints, and I also clearly displayed them on the screen. I also just used the vanilla version of PhysLite. I could probably get lots more speed by dropping some of the functionality and stability fail safes, but I wouldn't want to misrepresent PhysLite to people who may wish to purchase.

Recoverability is the simulations ability to recover after bodies have been forced to collapse by excessive force.


Nate the Great(Posted 2009) [#13]
I can see you are quite zealous about the numbers, personally it doesn't make much difference to me.


I care about the number of boxes because I love doing mass (no pun intended) physics simulations and I always prefer my engine to using something somebody else made... it just never feels the same.

I was only trying to figure out how many constraints were in your stress test.


a lot lol

As I said early my boxes had five masses and eight constraints, and I also clearly displayed them on the screen.


If mine were any bigger, they jam the screen but I see what you mean... each one was 2 pixels in radius and they were 4 pixels apart, a bit small... maybe I should have provided a zoom in functionality like google maps does.

I also just used the vanilla version of PhysLite. I could probably get lots more speed by dropping some of the functionality and stability fail safes, but I wouldn't want to misrepresent PhysLite to people who may wish to purchase.


My engine is at a much earlier stage than yours at the moment, but I would assume since we are basically bound to the same methods for optimization and stability etc, both engines have the same upper limit for speed.

I simply want to push as close to that upper limit as possible then add some other much needed functionality so it will be easily implemented in games. What I want is for anyone who is building say a platformer or a physics based game of any sort to be able to add boxes or players or whatever other shape without thinking.. oh I have a limit because the limit will be so high.