Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
LF2 dlls for left-right facing issues.
#1
Update from TheScar in LFE Discord: https://lf-empire.de/forum/showthread.ph...#pid209526

LF2 uses a graphics card function that flips images horizontally.
However, some modern graphics cards today (notably NVidia) don't have this function.

As a result, Marti made a fix in the v2.0a EXE that allows direct loading of _mirror.bmp sprites.
Unfortunately, many mods were made back then under v.19/1.9c.

While most mods can still run properly with v2.0a EXE, there are others that rely on certain tricks or have heavily modded EXEs that won't work with this method.
Also, some people may be too lazy to use A-Man's sprite mirrorer to make _mirror files for the 2.0a EXE to load.

Hence, here is a set of 3 DLLs that you can place inside LF2 folder directly, containing:
  1. ddraw.dll (587kb)
  2. libwine.dll (1769kb)
  3. wined3d.dll (1397kb)
Once placed, you can simply run the lf2.exe directly as per normal.


.zip   LF2_leftright_DLLs.zip (Size: 1.35 MB / Downloads: 407)
Mediafire Mirror: https://www.mediafire.com/file/e58c7jv2r...s.zip/file

What these DLLs do is allow you to run very old LF2 mods(generally running on 1.9/1.9c exe) without facing the left-facing sprite issue.
This is useful if those old mods use particularly many/large sprites that cannot be loaded properly on 2.0a EXE, or have heavily modified EXE.

Personally, I found that this very slightly blurs the game's image quality and it won't allow OBS to capture the game window directly(you have to use capture monitor instead), but its a minor tradeoff compared to actually fixing the left-right issue when playing on older LF2 versions.

Do exercise caution with DLL files and don't download them if you don't trust the source(including me).
[Image: uMSShyX.png]
~Spy_The_Man1993~
Steiner v3.00 (outdated), Challenge Stage v1.51
Luigi's Easier Data-Editor, A-Man's Sprite Mirrorer
Working on the LF2 Rebalance mod.
Avatar styled by: prince_freeza
Reply
Thanks given by: MangaD , Bamboori , Silverthorn
#2
Oh my where did you find this treasure?! Great job!
[Image: random.php?pic=random]
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
The meaning of life is to give life a meaning.
Stop existing. Start living.
Reply
Thanks given by:
#3
Great find, thanks for sharing! On a side-note, in particular in relation to your last remark:
(04-19-2020, 07:20 AM)STM1993 Wrote:  Do exercise caution with DLL files and don't download them if you don't trust the source(including me).

I'm considering to upload it to LFE but before that, I'll have to be sure that it's clean and whatnot, especially remembering when this happened. Do you have a reliable source that it only does the flipping stuff with no phoning back home etc.?
Silverthorn / Blue Phoenix
~ Breaking LFE since 2008 ~

"Freeze, you're under vrest!" - Mark, probably.

» Gallery | » Sprites | » DeviantArt
Reply
Thanks given by:
#4
The ddraw.dll was provided by the user "InfiniteZero"(who made some EXE edits) on the ztage forums around mid-2018(July).
He did not write the dll himself, but rather took it from another site.
Quote:(From the Chinese LF2 Discord)
我沒那麼偉大能做出那些ddraw.dll, 其實基本都是些希望能在現代系統中玩到古董級遊戲的玩家們開發的, 坊間有很多種不同的ddraw.dll可以用
ddwrapper
DxWnd
DDrawCompat
WineD3D
dgVoodoo 2
DXGL
我知道的大致有以上這些, 不確定您用的是哪一種, 但畢竟我不是開發者, 只能請您試試其他作者的ddraw.dll, 如果問題仍然存在, 也只能透過關閉DDraw的硬體加速來解決鏡像圖問題, 但很可能就無法使用任意寬度的圖片

---
(Translated with DeepL)
I'm not that great at making those ddraw.dlls, they're basically developed by players who want to play vintage games in modern systems, there are a lot of different ddraw.dlls out there
ddwrapper
DxWnd
DDrawCompat
WineD3D
dgVoodoo 2
DXGL
I'm not sure which one you're using, but I'm not a developer, so I can only ask you to try the other author's ddraw.dll. If the problem persists, you can only solve the mirror image problem by turning off the hardware acceleration of ddraw, but you probably won't be able to use images of any width

Translated with www.DeepL.com/Translator (free version)
Unfortunately, ztage is down and the only backup of the ztage forums aren't that recent, plus InfiniteZero has since left the Discord server, so I can no longer pinpoint the exact source of the dll.
[Image: uMSShyX.png]
~Spy_The_Man1993~
Steiner v3.00 (outdated), Challenge Stage v1.51
Luigi's Easier Data-Editor, A-Man's Sprite Mirrorer
Working on the LF2 Rebalance mod.
Avatar styled by: prince_freeza
Reply
Thanks given by: MangaD
#5
I see, thanks for the clarification! I assume this is all play-tested already? Can't do so myself as I miraculously don't have the graphics bugs on this machine. If it is, I'll put it up on LFE Wobble
Silverthorn / Blue Phoenix
~ Breaking LFE since 2008 ~

"Freeze, you're under vrest!" - Mark, probably.

» Gallery | » Sprites | » DeviantArt
Reply
Thanks given by:
#6
Yeah, it worked for me in the manner that I've described in 1st post, so its great for playing 1.9 or older era mods and old official versions.

I do hear that image quality may vary a bit between users, but the dll functions for mirroring on Windows.
No idea for Mac or Linux.
[Image: uMSShyX.png]
~Spy_The_Man1993~
Steiner v3.00 (outdated), Challenge Stage v1.51
Luigi's Easier Data-Editor, A-Man's Sprite Mirrorer
Working on the LF2 Rebalance mod.
Avatar styled by: prince_freeza
Reply
Thanks given by:
#7
Alright, published it: https://lf-empire.de/lf2-empire/introduc...ing-issues (edit: quality URL-parser shortening just right!)

Was pondering for a while where the article should go; ended up with putting it on a fairly global level. Let me know if you have a better idea Wobble
Silverthorn / Blue Phoenix
~ Breaking LFE since 2008 ~

"Freeze, you're under vrest!" - Mark, probably.

» Gallery | » Sprites | » DeviantArt
Reply
Thanks given by: STM1993
#8
Posting on TheScar's behalf as he does not have an LFE account and its related to this thread.
Copying straight from LFE Discord.

tl;dr - TheScar found an optimally configured version of the left-right mirror ddraw.dll

Mediafire Download Mirrors:
The collection of ddraw wrappers.
The specific ddraw.dll which TheScar has already configured optimally.


TheScar Wrote:Hi. Today i want to share some small research results.
Topic is
"Real solution for issue for mods on 1.9c engine with left-sided sprites".
It was so close but no one reached it properly (but someone could ? )

As you know 1.9c engine doesn't work properly with left-sided sprites because  the "left-right" mirror function of DirectDraw
is no longer supported on most of GPUs. And solution was found: https://lf-empire.de/forum/showthread.php?tid=11047 [this thread]

But it is not final solution for mods based on 1.9c since it causes problems.
For example (in NTSD 2.4 or other big mods) when you have a lot of files in data.txt in <object></object> zone then some PCs randomly cause
'Couldn't create art surface' error on loading and crash like the engine are out of limits. Always the same files. Removing dlls or removing some lines from file can help but that's still bad decision.

I've decided to look into post above. As it was revealed later all 3 dlls were taken from WineD3D - a DirectX 1-11 to OpenGL wrapper (Also almost full implementation of DirectX used in Wine but nvm).
This wrappers does +- same actions:
It works by providing a proxy DLL, which the application connects to and treats like the real DDRAW.DLL. It intercepts ddraw calls and
performs various actions before forwarding to the real DirectDraw interface.

It generally uses for making better compatibility for old games since it can use deprecated functions and even has hardware emulation.
And in original post @Stm93 [LFE] added comment where InfiniteZero (original author) mentioned names of such wrappers.
(05-09-2020, 06:47 AM)STM1993 Wrote:  (Translated with DeepL)
I'm not that great at making those ddraw.dlls, they're basically developed by players who want to play vintage games in modern systems, there are a lot of different ddraw.dlls out there
ddwrapper
DxWnd
DDrawCompat
WineD3D
dgVoodoo 2
DXGL
I'm not sure which one you're using, but I'm not a developer, so I can only ask you to try the other author's ddraw.dll. If the problem persists, you can only solve the mirror image problem by turning off the hardware acceleration of ddraw, but you probably won't be able to use images of any width
Thing that interested me was in this sentence:
There are a lot of different ddraw.dlls

So firstly i decided InfiniteZero took wrappers (ddraw.dll) from different projects but for some reason only 1 was called as ddraw.dll and other do nothing because they must be renamed to ddraw.dll to start work. But this theory was ruined fast since i read WineD3D docs and revealed that libwine.dll and wined3d.dll are just supporting dlls.

Actually InfiniteZero took ddraw.dll only from WineD3D since it worked well for LF2.

And now we get to main point: ddraw.dll from each wrapper could be a decision for left-sided sprites issue. I went deeper and checked all the known wrappers:
ddwrapper, DxWnd, DDrawCompat, WineD3D, dgVoodoo2, DXGL, DxWrapper, ddhack10.

These wrappers has different features and work from simple copy-paste method with few options in config (ddwrapper,ddhack10) to MEGA ddraw.dll CONFIGURATOR with tons of settings (DxWnd,dgVoodoo2,DXGL) [pics 2,3]. Most of them are also open-sourced.

original pic2: https://cdn.discordapp.com/attachments/5...1539/2.JPG
[Image: CaLcKty.jpg]
original pic3: https://cdn.discordapp.com/attachments/5...3394/3.png
[Image: MbZNIgK.png]

First of all i wanted to test default ddraw.dll included in this projects out of the box on old ntsd 2.4 and i've got these results:
1. ddwrapper - doesn't work (actually works perfect, but see below).
2. DxWnd - works fine, except weird game resolution while game isn't maximized [pic 4]. Also got barely visible weird glass lens effect. I guess it is possible to make perfect config.
3. DDrawCompat - very slow speed in game. It feels like i play with 200ms ping. Win 98 style window. Got a 'Couldn't create art surface' and crash. Impossible to configure.
4. WineD3D - As i mentioned before this wrapper uses as current fix. Got 'Couldn't create art surface' and crash. Impossible to configure.
5. dgVoodoo2 - 'Couldn't create art surface' almost in the beginning of loading and crash. Possibly right config can fix it. Didn't check.
6. DXGL - Works but weird. Mirror bug is fixed but it feels as 1000ms ping in all menus (and only in menus). Various graphic glitches in char selection menu and broken UI for 1-4p [pics 5,6].
7. DxWrapper - simply doesn't work. Possibly right config can fix it. Didn't check.
8. ddhack10 - It tries to open game in some weird resolution 1920x640 or so. A lot of errors from beginning and crash. Possibly right config can fix it. Didn't check.
pics 4 to 6: various screenshots from NTSD (Click to View)
Then i decided to re-check non-working wrappers and simple doc of ddwrapper made me change 1 parameter in config (turn on deprecated horizontal flipping) and here we go! Perfect fix. Tested on win 7 and win 10 (thanks @Shad90).
From this moment i decided there is no necessity in configuring other wrappers since ddwrapper has few but extra important settings as using deprecated functions and full hardware emulation. See more here: http://bitpatch.com/ddwrapper.html .
You still can try to configure other wrappers but for what if there is possibly the best fix that doesn't affect anything at all and possibly works on all PCs.

Now let's separate wrappers into few groups:

Properly working  wrappers:
1. DxWnd. Configurable through app.

Weird work:
1. DXGL. Configurable through app.
2. WineD3D. Non-configurable. Works only for small (by object using) data.txt.

Non-working without proper configuring/ at all after configuring:
1. ddwrapper . Easy configurable through file to start work perfectly. Still my top 1.
2. dgVoodoo2. Configurable through app. Configuring isn't tested.
3. DxWrapper. Configurable through file. Configuring isn't tested.
4. ddhack10. Configurable through file. Configuring isn't tested.

Non-working wrappers:
1. DDrawCompat . Non-configurable.

That's the end.  Attempts to use other wrapper was close, names were known but seems no one tried it. Fix was really on surface. See ya and good luck.
Here is collection of wrappers out of the box with default configs

Attachment file type: archive
ddraw_collection.zip
https://cdn.discordapp.com/attachments/5...ection.zip
3.41 MB

put in %yourLF2mod% folder
ddwrapper with working config
Attachment file type: archive
ddwrapper_configured.zip
https://cdn.discordapp.com/attachments/5...igured.zip
11.59 KB

Actually in theory there is sense in configuring DxWnd for example for resizing window or some other stuff
[Image: uMSShyX.png]
~Spy_The_Man1993~
Steiner v3.00 (outdated), Challenge Stage v1.51
Luigi's Easier Data-Editor, A-Man's Sprite Mirrorer
Working on the LF2 Rebalance mod.
Avatar styled by: prince_freeza
Reply
Thanks given by:




Users browsing this thread: 1 Guest(s)