The online racing simulator
d3d8.dll and LFS ?
(14 posts, started )
#1 - ndiw
d3d8.dll and LFS ?
just like ghostcar mod by kegetys, it is possible to 'draw' over existing screen to directX application. can U guys give us a short explanation how to build such application? of course I try the newest technology so called 'www.google.com' to find the answer, but those result are too cryptics to me..

Thanks.
Yea you can, it's been done, as you have said in the program such as gost car.
What I want to do is have Live For Speed with the F1 GUI, you know, it shows things such as this ...
in game on the screen.
All in due time. All In due time.
#3 - ndiw
you read my mind

isn't it great to share knowledge and experience to let everybody else build a good LFS mod?

so please please share with me (us) :balloons:
#4 - axus
Caring is sharing! I'd love to see a better set of gauges also....
Theres basically 2 ways to inject extra poly's into LFS - either by directly modifying the memory, or by hooking into the DX dll's and then storing pointers so that you can modify it in a nice way.

A good starting reference to look at would be http://www.gamedev.net/communi ... topic.asp?topic_id=359794

With regards to adding things like F1 style signs on top, then overlays would probably suffice.
The basic concept used by the ghostcar mod for example is quite simple, you just place the D3D8.dll in the game directory, and because of the way LFS looks for the DLL's it will link that dll instead of the "real" one from the system32 dir.

Your DLL should export the same functions that the real one does, ie. Direct3DCreate8. When this function gets called you can do whatever you want in between and then call the real Direct3DCreate8 function and return whatever it returns to LFS. You can overwrite the COM interface function pointers to pointers to your own functions that again do what you want until doing the real thing.

The hardest part is knowing what to do and when, since what you get is a whole load of D3D functions passing through your DLL, with no idea what LFS is actually doing at that time. So you need to analyse all that data to find ways to recognise what LFS is doing. For example, you could detect that LFS is about to draw a car model by watching the currently active vertex shader ID's in SetVertexShader... GUI "additions" are somewhat easier, since you can just do your thing when LFS calls the Present function to display a completed frame. However you would still need to know when to do this so you wont draw over the options menus for example...
I've looked into this too, for my own application, but only briefly. I don't think I will ever be able to make something like this (since I'm programming in java, and not c++), but it would be nice if someone could make some sort of generic dll that can be used to draw anything from a secondary program onto lfs.

The attachment is a little scematic of what I mean. I know nothing of dlls, so I guess you cant make some d3d8.dll that can also communicate with an external program?

Maybe someone could give some insight if this is possible or not.
Attached images
insimd3d8.jpg
Man, I really wish I had the skill to do all of this.
(MUST LEARN C++ BETTER, MUST LEARN D3D INTERFACE and while I am at it, MUST LEARN THE ENGLISH LANGUAGE BETTER). If anyone wants to give this a shot (with the F1 overlays) I would be more then happy to supply the art work.
Any word from the people that have worked with the d3d8.dll stuff? Im really interested if something I describe above would be possible.
It would depend on what you wanted to communicate between the hook and the InSim app to be honest, but off the top of my head I cant think of much that could be done easily...
Quote from the_angry_angel :It would depend on what you wanted to communicate between the hook and the InSim app to be honest, but off the top of my head I cant think of much that could be done easily...

Use overlays (as I think you said it would be easyer) to get informatiom form Insim about the race and use that to output F1 style GUI on to each client's screen via Direct 3D Overlays.
The communication would be the image that is going to be projected on top of lfs.
#13 - ndiw
mm... errr... ahem..

a simple example code and little explanation would be greatly appreciated..

sire Kegetys?

.. please?


Yea, that would be very cool if you could give us some code that would use Overlays for LFS specialty. I find the code that Angry Angel linked to be quite abit over my head. What's more eveytime I look on google for the use of hooking into D3D it is more towards DX9, and there is very little on overlays. While I am at it, they talk more about it being used for stuff like wall hacks.
When I try to run the code that LFS posted to, it does not work (That could be due to my own stupidity, or that I am running Window XP x64.)

d3d8.dll and LFS ?
(14 posts, started )
FGED GREDG RDFGDR GSFDG