[MOD] Actual support for Force Feedback

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

Post Reply
Neo Angelus
Posts: 12
Joined: Sat, 1. Sep 07, 14:32

[MOD] Actual support for Force Feedback

Post by Neo Angelus » Fri, 31. Oct 08, 17:21

Update:
First release.
Enabled force feedback effects, when getting hit by projectiles or `laser` fire.



Download



Greetings Everyone,

I currently working on a Mod to give X3:TC real support for Force Feedback instead of the bump you feel when you hit something(which I only try to do to feel the FF, and try to avoid when actually playing the game).

I'm early in dev so far I have build the first working version. So far I have used Direct Input to activate the Force Feedback and am writing a separate program(or DLL) for the force feedback events. The problem I run into though is how to get the game information from the game to my program.

Now the G15 app from Cycrow seems to get game information from the game to an external program. As far as I understand through a log of some kind.

So I wanted to ask, does anyone know how exactly it gets the information from the game?(and if this method can be used to get shield/hull/speed information(as with those hits can be calculated))

Thanks in advance...
Last edited by Neo Angelus on Mon, 3. Nov 08, 18:57, edited 3 times in total.

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22228
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow » Fri, 31. Oct 08, 18:46

its fairly easy tbh, it just depends how often you want the information.

how the G15 mod does it, is by having a script in game, that creates a log file and dumps all the stats it needs to the log file. It does it every second the game is running.

then theres the G15 plugin, that runs in the backgroun, this basically waits for the log file to be created and reads everything from it, formating it in a way to be displayed as stats.


if all you need is the shields/hull and speed, then this should be fairly simple, just write a log file with those 3 things via a script.

btw, y do you need the speed ? u should be able to use just the hull and shields to determine when a ship is hit. Althou it'll be difficult to tell if this is from a collosion or from weapons fire

Neo Angelus
Posts: 12
Joined: Sat, 1. Sep 07, 14:32

Post by Neo Angelus » Fri, 31. Oct 08, 19:06

To start thanks for the information.

I think I have to experiment with the frequency at which the data is updated. To low and the effects will probably be a bit unnatural, to high and it all slows down(writing/reading).

And I will try to use that method then. There is no possibility of sending Windows messages or using sockets right?

And I wanted the shields/hull to check for a hit...and the speed to rumble a bit when going at max speeds...is there any one to also get the weapon energy?(as through that I can check if a player is firing)

Again thank you for the information

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22228
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow » Fri, 31. Oct 08, 19:30

Neo Angelus wrote:To start thanks for the information.

I think I have to experiment with the frequency at which the data is updated. To low and the effects will probably be a bit unnatural, to high and it all slows down(writing/reading).

And I will try to use that method then. There is no possibility of sending Windows messages or using sockets right?

And I wanted the shields/hull to check for a hit...and the speed to rumble a bit when going at max speeds...is there any one to also get the weapon energy?(as through that I can check if a player is firing)

Again thank you for the information
nope the only way to get the game to communicate outside is via log files

modders dont have access to anything that could create and use sockets

Neo Angelus
Posts: 12
Joined: Sat, 1. Sep 07, 14:32

Post by Neo Angelus » Mon, 3. Nov 08, 18:57

Update:
Released the first version.
Added Force Feedback effects, when getting hit by projectiles or `laser` fire.

See installation notes in the readme.

I will try to improve the scripting side(this is my first script) and add new effects.

mrjingo
Posts: 114
Joined: Tue, 2. Dec 03, 16:05
x4

Post by mrjingo » Tue, 4. Nov 08, 06:15

I installed this but it seemed like it wasn't doing anything. I have a Logitech Force 3D Pro. I used the 100ms exe, ran the ffb script, selected null in the script editor when it asked. :?:

Neo Angelus
Posts: 12
Joined: Sat, 1. Sep 07, 14:32

Post by Neo Angelus » Tue, 4. Nov 08, 11:51

Mhmm...strange...did you run the 100ms exe in the directory where X3:TC writes the log files to?(my documents\egosoft\X3TC)

If I might ask are you using XP or Vista?

And I'll write a debug version...which just gives force feedback and doesn't need X3:TC to narrow down the problem...

Update:
Here is the debug version, it should still work like it has to, but now it give a strong force to the Left whenever someone clicks on the program `window`(except when clicking on the exit button of course)
Download

mrjingo
Posts: 114
Joined: Tue, 2. Dec 03, 16:05
x4

Post by mrjingo » Tue, 4. Nov 08, 15:32

I'll try that when i get home from work. I'm using XP. Thanks for attempting this, ffb is something that I was very disappointed in Reunion and TC.

Neo Angelus
Posts: 12
Joined: Sat, 1. Sep 07, 14:32

Post by Neo Angelus » Tue, 4. Nov 08, 16:07

Same here.

That is why I started making this. Too bad though, that it has to be achieved through something like this, because if they would have coded it in it would have been a lot more efficient.

I hope I can find out why it doesn't work.

mrjingo
Posts: 114
Joined: Tue, 2. Dec 03, 16:05
x4

Post by mrjingo » Wed, 5. Nov 08, 06:58

I tested the debug, I get no sharp pull to the left when I click on the window (not exit button). It's running from the folder with the log file. I retested in game, and there is still no feedback. :(

Neo Angelus
Posts: 12
Joined: Sat, 1. Sep 07, 14:32

Post by Neo Angelus » Wed, 5. Nov 08, 11:57

Mhmm, then it probably isn't the connection between X3:TC and the program, but the actual force feedback. Strange...I'm using the max value so that might give problem(wouldn't know why)...

I have one final test...this is the example program that came with the DirectX SDK, could you test if that works? Because then I have messed something up in my code and will rewrite it...otherwise the problem may lie beyond my capabilities...

Download

Two extra questions if you don't mind: Are you using Xp or Vista? and you do have at least DirectX 8 installed right?(second one is a bit obvious)

mrjingo
Posts: 114
Joined: Tue, 2. Dec 03, 16:05
x4

Post by mrjingo » Wed, 5. Nov 08, 14:49

I'm using XP with latest DX 9. I'll try again when i get home from work. What type of joystick are you using? Could that make a difference?

Neo Angelus
Posts: 12
Joined: Sat, 1. Sep 07, 14:32

Post by Neo Angelus » Wed, 5. Nov 08, 16:26

I too have Xp and DX 9 so those are the same...(makes testing easier)...I'm using a Cyborg Force Evo from Saitek, I don't know if that makes a difference...

mrjingo
Posts: 114
Joined: Tue, 2. Dec 03, 16:05
x4

Post by mrjingo » Thu, 6. Nov 08, 04:27

I tested that last file you posted. I'm definately getting feedback from it. I'm just not getting it in game. :?

Neo Angelus
Posts: 12
Joined: Sat, 1. Sep 07, 14:32

Post by Neo Angelus » Thu, 6. Nov 08, 16:48

Mhmm...that shouldn't be happening...and I messed up the Force Feedback in my program and I think I know how...(my joystick is just a obedient little joystick and even does it job when told incorrectly, that's why I never noticed it myself...)

I'll rewrite the program and hope to have another version up tonight...

Downlad

Again the debug version..he should work properly...but it still activates the force feedback when clicking on the dialog:)(to see if it works...)

My apologies for all the errors...

mrjingo
Posts: 114
Joined: Tue, 2. Dec 03, 16:05
x4

Post by mrjingo » Fri, 7. Nov 08, 07:32

Still nothing that I can tell.. :( If it works for you, maybe its a problem on my end since I have a different brand joystick.

WuDeN
Posts: 29
Joined: Tue, 7. May 13, 16:00
x3ap

Re: [MOD] Actual support for Force Feedback

Post by WuDeN » Tue, 9. Oct 18, 18:28

Nooo what happenned to this ? I really want FB to work badly in this game :( Can I help somehow ? Would be nice to have it for throttle and laser as well.

Alan Phipps
Moderator (English)
Moderator (English)
Posts: 30436
Joined: Fri, 16. Apr 04, 19:21
x4

Re: [MOD] Actual support for Force Feedback

Post by Alan Phipps » Tue, 9. Oct 18, 18:34

Whatever happened to it took place about 10 years ago. :wink:
A dog has a master; a cat has domestic staff.

WuDeN
Posts: 29
Joined: Tue, 7. May 13, 16:00
x3ap

Re: [MOD] Actual support for Force Feedback

Post by WuDeN » Tue, 9. Oct 18, 18:43

Alan Phipps wrote:
Tue, 9. Oct 18, 18:34
Whatever happened to it took place about 10 years ago. :wink:
lol mixed the dates. So really there's no mod that adds real forcefeedback to the game ? That sucks

Post Reply

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”