Qvin0000 / ExileApi

My version of PoeHud
118 stars 73 forks source link

DirectX 11 issue #64

Open i2um1 opened 4 years ago

i2um1 commented 4 years ago

You should've used DirectX 12 because it's impossible to use SharpDX.Direct3D11 on Windows 7 SP1. Also DirectX 12 is much faster. demo

Steam stats: stats

zaafar commented 4 years ago

@i2um1 Dx12 is only faster if you are developing a game & you know how to make use of those faster APIs. For the stuff this repo is doing, Dx11 and Dx12 is same.

i2um1 commented 4 years ago

@zaafar but for an unknown reason feature level 10.0 is supported. There's no difference between the old SlimDX.Direct3D9 and the new SharpDX.Direct3D11 except Windows 7 supporting and custom old shaders 4.0 when it's possible to use 5.0. Also the current implementation still has all old and my performance issues. If you don't care and you lack of strong technical skills you can simplify UI code: delete SharpDX + IMGUI and use WPF instead.

zaafar commented 4 years ago

-> you lack of strong technical skills This is the reason ppl in HUD community aren’t doing it.

-> Also the current implementation still has all old and my performance issues. Do you have some empirical evidence that using Dx12 or moving to WPF will resolve your issues?

zaafar commented 4 years ago

I think the closest thing to do would be to move to the Vulkan APIs since the UI code from where we copied most of the stuff from (https://github.com/mellinoe/veldrid) supports Vulkan APIs. Issue is (1) no one is technically sound in this area, (2) there is no proof that it will improve the performance of the HUD from where it is now and (3) requires a lot of time and effort.

i2um1 commented 4 years ago

It depends.

First of all, let's have a look on the Steam stats again. Windows 7 is ~20% users which is a lot. Despite of Windows 7 support will end on January 14, 2020 I guess users will continue using Windows 7. Also, thanks to WoW community we are allowed to use DirectX 12 on Windows 7: Microsoft.Direct3D.D3D12On7 package.

Starting with Windows 8, DirectX is no longer a separate SDK that you download and install like the old June 2010 DirectX SDK. Instead, DirectX is a part of the OS and gets updated through Windows Update. You can still use the old DirectX 11.0 SDK but in this case you should use the old Visual Studio 2010 and old C++ libraries. Since DirectX 11.1 Windows 7 users must install Platform Update unfortunately which has compatibility issues. Also you will get limited DirectX 11.1. For instance, a lot of DXGI functions will throws Invalid Call exceptions (my first screenshot). It means you should have a Windows 7 instance to test your code.

SlimDX had been outdated when I decided to use SharpDX. I didn't use DirectX 11 because there was no reason: heavy plugins like HP bars or map icons were not heavy enough. Also I simplified rendering. For instance, Graphics is too similar to GDI+ Graphics. But, as you know, since March 29 2019, SharpDX is no longer being under development or maintenance. Previous versions of SharpDX support DirectX 11.0 (probably before MSVCP140.dll). The latest version doesn't have all low-level features of DirectX 12. Amer Koleci created a fork of SharpDX to support some new features using SharpGenTools.

Regarding Veldrid, I guess it won't support .NET Core 3.0 which is planned for September 23 2019. However, WPF will work on .NET Core 3.0. From my point of view, WPF is better than Vulkan or DirectX 12 because you will have:

Anyway Vulkan is still a good choice if you are not afraid of difficulties. You can even support fullscreen game mode. Also I advice you to read Frank Luna's books and a few books about game developming because you are wrong when you said that it's not game developming. I don't remember it seems you added coroutines about 1-2 years ago but it was a bad idea because there are other common approaches.

zaafar commented 4 years ago

Let me start by saying that I am not trying to be an asshole over here. I am just trying to explain why these things would never happen. If I come as rude or arrogant person, I apologize for that in advance.

First of all, let's have a look on the Steam stats again. Windows 7 is ~20% users which is a lot.

This is not a normal game or a normal gaming company. In them, if you show that the user-base will increase by 20% they will like the stats and may do it. In the ExileApi case, people have to use this opensource/free software to make their game easy to play (or other option is to create their own stuff). So they can do the relevant stuff to ensure that the ExileApi works on their system. So this use-case/reasoning is null and void.

That being said, I know about the fact that SharpDx is not maintained anymore and I am not a big fan of remaining on the old/not-maintained frameworks. So, personally I think WPF, Vulkan and Amer Kolec's Fork would be great options to explore for the future. However, priority of that would be really low in front of updating the offsets and stuff every 3 months and creating new plugins for the new leagues.

Starting with Windows 8, DirectX is no longer a separate SDK that you download and install like the old June 2010 DirectX SDK. Instead, DirectX is a part of the OS and gets updated through Windows Update. You can still use the old DirectX 11.0 SDK but in this case you should use the old Visual Studio 2010 and old C++ libraries.

I did not see this error when running/developing on windows 10 ( fully updated ) with VS 2019 ( fully updated ). So we can talk about that to see why is this happening on your system.

You can even support fullscreen game mode.

This is something I am really interested in. Care to share some details on that?

Regarding Veldrid, I guess it won't support .NET Core 3.0 which is planned for September 23 2019.

Are you sure? Do you have any reference for this statement? The Author is quite active and keeps the stuff up to date.

zaafar commented 4 years ago

Personally, I think your ideas are more suited for the library I am creating for the overlays like these. It's a work in progress. The idea is to decouple the GUI creation technology from this tool and put it into a library that provides backward compatible APIs (with help of ImGui). So that people can just focus on actually creating the UI, updating the offsets and creating new plugins rather than focusing on which graphic technology to use.

https://github.com/zaafar/ClickableTransparentOverlay

i2um1 commented 4 years ago

This is not a normal game or a normal gaming company.

You are right. It's not a game. But all main concepts from game development are used. I'm talking about more general things like Game Loop, Entity Component System and so on. Also the current approach is a custom game engine.

priority of that would be really low

I know. You can skip explanations.

I did not see this error when running/developing on windows 10

My concern is DirectX 11.1 on Windows 7. You need to use Windows 7 SP1 with/without Platform Update to see exceptions. Btw, on the latest UEFI it's a big challenge to use Windows 7. Basically, Windows 7 doesn't support DirectX 11.1 so users must install Platform Update which has bugs. DirectX 11.1 works on Windows 7 in emulating mode. It means not all functions from SDK are available.

Are you sure? Do you have any reference for this statement? The Author is quite active and keeps the stuff up to date.

There are risks. .NET Core 3.0 may be an unsupport feature because:

This is something I am really interested in. Care to share some details on that?

I know two ways: DirectX API-hooking and DLL injection. The first one is better. Both are detectable. https://github.com/nefarius/Indicium-Supra http://spazzarama.com/2011/03/14/c-screen-capture-and-overlays-for-direct3d-9-10-and-11-using-api-hooks/ https://github.com/spazzarama/Direct3DHook https://github.com/nektra/deviare2

put it into a library

DLLs are also detectable.