Joystick feedback?
Blitz3D Forums/Blitz3D Beginners Area/Joystick feedback?
| ||
Hi people.. I'm pretty new to Blitz but I'm getting up to speed pretty quick. A lot of joysticks and joypads on the market these days seem to offer vibration or force feedback, but I haven't found any direct support for anything like this in Blitz. Is there any way to do it? |
| ||
I'm not sure, because I've never tried, but I don't think BB has commands to control force feedback. But maybe you could find someone to make you a DLL that can do that sort of thing? :-\ |
| ||
Blitz does not support FF (yet!), hopefully mark will release it in a update. It is possible to create a userlib, but i have no idea how to access it with direct x api.... now if someone was to help me with this we might be ablr to release a dx api dll....... |
| ||
. It is possible to create a userlib, but i have no idea how to access it with direct x api.... now if someone was to help me with this we might be ablr to release a dx api dll....... I have been seeing a lot of posts somewhat similiar to this lately. I have lost all hope of most Blitzers ever learning the difference between a "lib", a DLL and API calls. |
| ||
I know hot to create userlibs and access dll's (that i wrote) and windows api, i just don't know enough about windows/directx api. I have seen C++ examples in the DX9 SDK but im not a c++ coder and realy don't know how to do this in purebasic. |
| ||
I know hot to create userlibs and access dll's (that i wrote) and windows api, i just don't know enough about windows/directx api. I have seen C++ examples in the DX9 SDK but im not a c++ coder and realy don't know how to do this in purebasic. Why would you need to use PureBASIC? |
| ||
U dissin purebasic? I'd suggest u read up on what i can realy do.... IMO purebasic is better then blitz +. And i don't think i can access dx - directinput force feedback api just by using userblibs... |
| ||
I'd suggest u read up on what i can realy do.... I would suggest you read up on what Blitz Plus and Blitz 3D can do and take the time to learn the difference between a LIB, DLL and API. You are using them interchangably and they are three completely different things. Spending time learning about the OS you are trying to develop for will also be beneficial as will studying some info on DX7 (the version Blitz uses). You do NOT have to write bootstrap DLLs to access Windows API with Blitz 3D/+ . Heck, although I think you do need to use Direct Input to use ForceFeedback, you do not need to use Direct Input or Blitzs native Joystick commands (which may still use direct input), with Blitz Plus & Blitz 3D to access the default joystick unless you want to. You can access it the same way you have been able to since Windows 3.1 |
| ||
Brice, have you actually tried to do any of this? Userlibs are great for simple API calls, but the limitations on pointers, the fact you can't make callbacks, and the fact that none of the DX7 hooks Blitz uses are exposed to the user make this an absolute joke of a proposition. To write anywhere near manageable code you would need to write your own wrapper DLL at minimum. |
| ||
Brice, have you actually tried to do any of this? .. the fact you can't make callbacks, Yes/No I have not tried the force feedback, as I do not use joysticks in my games I am writing and I certainly would not bother to implement a feature like forcefeedback that less than 1% of the "average" gamers will even be able to take advantage of. Might be great for others, but just not something that interests me. Keyboard is still the #1 control method with the $5-$15 joypads a close second, so thats what I stick to. FOr the "YES" I have used various other API functions in Blitz Plus that I am still seeing people write bootstraps for. Using a joystick via mmsystem.dll or winmm.dll works fine with languages that do not support callbacks. In fact, virtually every language I have used it in has not supported callbacks. The confusion and lack of understanding being exhibited about libs, API and DLLs on these forums has alerted me. I have pretty much adopted the policy of no longer downloading programs, demos, etc from the community, with the exception of a small handful of people who I know are experienced programmers. I will not use my system as a guinea pig for those who have absolutely no understanding of the operating system they are programming for. Somebody suggested a BlitzLite a while back. Initially I did not like the idea, but since I have had the time the past few weeks to actually spend some time at the forums (usually a rarity for me), I now support a BlitzLite. Strip out the advanced stuff so its easier for newbies to grasp and nothing they can get into trouble with. |
| ||
Umm, the point is to get force feedback support. What good do the old mm API functions do for that exactly? Do they even support USB devices? I have no idea what you're referring to by libs, but I do know what DLLs are, what an API is, and I've been programming the Win32 API professionally for some time now. Most of the API is well enough documented for the majority of Blitz users to hit the MSDN site and actually implement something. If we could get proper support for passing around string pointers and the like (instead of all the bank work arounds), then we'd definately see some more reliable and safer Userlibs coming out of the community. I don't think there's a need from a technical perspective (maybe a marketing one though) to dumb down Blitz, it is not necessity for the majority of users to access Userlibs, or even some of the LockBuffer functions, and they can simply be ignored. My problem with the forums of late is that people continually suggest UserLibs as a blanket answer to every single problem or feature request, without even considering how they might be used. You can do a hell of alot with them, for sure, but it's not always all that practical. Blitz3D is a game programming language, and BlitzPlus is heading for applications programming. Any requests within these areas for the respective programs are reasonable, no matter how useless you may think they are for whatever the hell you're doing. |
| ||
Yipe. Things seem to have deviated from my simple question.. Anyway, I don't think a dumbed-down version of Blitz is needed. I come from the dying world of web development, so I'm used to Perl and JavaScript and other "not real programming languages" like that. Blitz has been really easy for me to pick up (although I do wish it had proper pointers you could put into arrays and such). I think what a "lib" means in this case is some functions of Blitz code in an includable .bb file that will go talk to the DLLs and the API for you.. Correct me if I'm wrong here. Anyway, from what I've read, it sounds like getting vibration and force feedback support through DLLs would be much more trouble than it's worth (if not utterly impossible), but I also think Brice is greatly underestimating the number of users with a rumble device in their joypads. |
| ||
A lib in that case would be a UserLib, which is a text file that specifies which DLL is called, and how the functions in that DLL are made available to Blitz. It is perfectly possible to get force feedback support through purpose written wrapper DLLs, Pepsi had a DLL going once before Userlibs even came along (although there were some problems with it), but that's really a specialist thing. UserLibs cannot directly provide this functionality, at least as far as I know, because Blitz doesn't support callbacks. I don't think it's reasonable to suggest to someone who bought Blitz thinking it's an easy way to bypass the hassles of C++ and DirectX for their games programming, to actually forget all that, and now do it themselves. And yes, I think a lot of people here seriously underestimate the amount of people that own FF capable devices, or that will do by the time their software is released. |
| ||
Umm, the point is to get force feedback support. What good do the old mm API functions do for that exactly? Do they even support USB devices? Simply making a point on the capabilities of Blitz Plus if people actually learn how to use it I know what userlibs are and what they can do i know what windows api is (Why don't u learn to read...). Then please quit using API,DLL and LIBs interchangably. but I also think Brice is greatly underestimating the number of users with a rumble device in their joypads. Based strictly on sales of a little local company by the name of Interact (Ironicaly the largest supplier of 3rd party game controllers). We have gone from force-feedback to rumble devices now? :cD easy to talk the way you do id like to see you bring out a force feedback dll just for fun. As I said, I do not see why you need to write a DLL to utilize it. Although I have not dealt with DirectInput for several years, I have seen force feedback implemented in languages that do NOT support callbacks and without the use of a bootstrap DLL. |
| ||
Kindly provide examples. |
| ||
Isn't it funny how a program like Blitz comes along and all of the sudden everyones a professional programmer, and uses that as if that adds any leverage to their arguement. Don't they realize that all you have to do to become a professional programmer, is program something in exchange for money, goods or other services? The 10 year old kid who writes a small calorie counting program for his family in exchange for twice his normal allowance is, in effect, a professional programmer. That doesn't really make you an authority on programming tho'. Instead of just saying "I am a professional programmer" you could say "I was co-author of successful game x" or "I wrote mega application y" and during my experiences I spent a lot of time studying whatever (DirectInput in this case). What I can say without a question is that the self-proclaimed professional programmer who says "it can't be done" isn't a very successful programmer. Instead of just saying "it can be done using Userlibs" or "It's impossible without callbacks" perhaps you could explain *why* you think it isn't possible, and then try to figure out if a wrapper dll is such a bad idea after all. I mean after all any professional programmer worth his salt with as extensive DirectX and Win32 API experience as you guys should be able to write one in 20 minutes. |
| ||
Just scanning this thread... just want to say with the DirectInput Dll that I made concerning the forcefeed back, the problem it had with it was using multiple FFB game controllers at once on the same computer. I didnt have any problems with it myself, but one guy was getting wierd results when using 2 FFB game controllers with the FFB effects themselfs. I think he said with using just one controller it worked fine. I had a hard time trying to figure out why he had this problem since I couldn't duplicate it. But when my hardrive crashed back then, I lost my code for it and just gave up on that aspect of DirectX programming for the meantime. I could do a specific dll for blitz again as I personally think making a DirectX wrapper library is easy ( as in getting it to work on my hardware ), but... ... I now have DirectX 9 installed on my machine. Thus, my dll would require DX9 on the user machine to run it. I get the impression from reading from just these Blitz forums through time I've been on it that alot of people are reluctant to simply upgrade/download at least the latest home user DirectX Dlls if they dont have it. So, I probably wouldnt have a good size "Blitz programmer" user base at least to support my efforts. Or would I? I really dont know. <rant> With the new userlib functionality to make REAL pointers from my dll more easily accessable, I'm almost inclined to give a go to do things the right way, not the java way. But for one reason, my laziness is holding me back from doing it because I despise the akward workaround hack to "Find" or "Get" the Blitz Window's Handle. IMHO, selfishness and stubborn way I rather not support that one thorn in my side when Blitz itself SHOULD freak'n simply supply me the Window Handle and Instance Handle Directly to use at my own whim! </rant> Besides my above rant, I just might be willing to give it another try if people here really would like me to make it. Ofcoarse, I too support the idea of rather seeing FFB support in Blitz instead of using an outside library to abtain the wanted results. Here, Mark can easily keep the FFB functionality using the current DirectX version that the Blitz products uses, whereas I simply can not. Ofcoarse, if I do it now, I can get that aspect of my DX Libray out of the way for other stoof. Just thought I would throw in my 2 cents... :) |
| ||
You make some really good points, Pepsi, and I'd sure be interested in such a DLL if it supported vibration as well as true FFB. A lot of the gamepads on the market today have vibration, but typically only gamers with too much money have full FFB joysticks. I don't think that the DX9 requirement would be too big of a problem, since any half-serious gamer is bound to have it installed by the time I actually finish a game (heck, DX11 will probably be out by then). And remember, folks, you don't have to take the time to rebutt every jerk who disagrees with you (especially if they can't find the time to spell out "you" and "are"). |
| ||
Kindly provide examples. If you send me the DX7 SDK on a CD (I no longer have it) and send me a joystick with forcefeedback I would be more than happy to have a go at it for you. |
| ||
Ok, I give in. :) I'll go for it again. Unfortunitly, I dont think I'll be able to do it in 20 minutes though. ;) I forsee it being a little bit more invloved then my last libray though. We'll see how it turns out... |
| ||
Nope, I meant of programs implementing force feedback without the use of callbacks. I would like to see them. Because if it CAN be done that way, I would like to see how. I can't figure out HOW it can be done that way, and even if it can, I have serious concerns about just how manageable the code would be. Apparently that makes me a failure as a professional though, even though I'm not a career DirectX developer of whatever the hell people assume when I use the term professional. And FlameDuck, pull your head out would you. Pepsi I think we all appreciate your efforts in this regard, and I don't want to discourage you, but like I said, and you said, this would be much better implemented in Blitz itself. It'd be great though if you could get something going, and I'd be quite happy to help you test it. |
| ||
Oh, forgot to say that because my library uses the DirectInput component, it will override any blitz DirectInput stuff. So this means I have to put in regular joystick commands aswell. Correct me if I'm wrong, but Mark has move keyboard and mouse functionality outside of directinput by using the win32 api internally. I shouldnt have to worry about that stoof. |
| ||
Thanks Craig. As far as callbacks are concern, as we all know, the blitz programming language doesn't support it... if ever( mabie blitzmax will ). Unfortunitly, DirectX isn't like OpenGl, as you may know, as where you can't simply call the DirectX function itself via the userlib's DECLS file like you can with OpenGL function calls. You could come close as in writting a library to call the functions through COM directly, but again there is a library to be created and to go through. With wrapping the DirectX functions to a managable usage for one to use with Blitz, there you have control inside the dll itself to work out any functions that require callbacks. Leave that kind of work for the dll to do and just have a wrapper function itself call the required work for you. Once the callback stuff is done, process the data anyway you like through extra functions. Hope that made some sense. |
| ||
Yeah, that's as much as I figured out from my own research. Thanks for the input. If I say anything else, I'll be ending up a broken record, so I'll just wait to hear how you get on with the DLL. |
| ||
No problem :) I just got my new dll setup working with a userlib/blitz app and I think I finally got my debug output code just the way I need it this time. So now I just need throw all the dx stoof in there. :) |
| ||
So Pepsi whats the word? in the dll... |
| ||
Welp, I didn't get to work on it last night as I went out with me friends club'n. I slept in this morning to get rid of me hangover and now setting everthing back up. Need to wipe the dust off of my MS FFB Joystick and hook that up too. I would say I'm @ 60-70% done now. Just need to add more functionality and start testing my joysticks with it. Hopefully, I should have something done later today. But I do need to get someth'n to eat right now. I'm hungry. :) |
| ||
. |
| ||
if you need any testers i've got a variety of pads with rumble. |
| ||
Ive got teh latest Logitech Chordless Wingman Gamepad with rumble, id be happy to help. I was woundering how are you gonna do this. I suppose you're gonna use an external dll and a user lib to pass strings/ints. But more specificly what function values will be able to pass? Dang I can't wait to get my hands on this..... |
| ||
Darklordz, I got that same gamepad, but still a sense of mind that if this lib works for you even with the same gamepad, less stress for me. Yes, I'm doing the dll & userlib thing. :) I just found out that I'm going to have to rewrite my dll again since I completely went left on my thoughts of how I'm doing it. [Deleted another c pointer rant here] I got the goods in the bag where it shouldn't take me to long now to finish the first version of it up. |
| ||
WOW thats great Pepsi, i'll be waiting filled with antisipation... |
| ||
Alrighty peopleskins, I have a userlib dealing with game devices and playing pre-made FFB effects. You can grab it at my link below. Pwease, I really need more people's input on whethor this works or not for you even though I find it hard to see how I can make it even better besides adding more functionality. Sorry for dredging up an old post, but I need feedback. Please respond in the Userlib forum, thankyou. :) |