Removing DirectPlay Code

Blitz3D Forums/Blitz3D Programming/Removing DirectPlay Code

RustyKristi(Posted 2016) [#1]
Since B3D can be modified to fix some issues, is it possible to remove DirectPlay parts so it does not search for it on Win 8/10 if you're not going to use it anyway?


RemiD(Posted 2016) [#2]
Yes i already requested to remove it, but you need somebody who has a good enough understanding of c++ to not mess everything, and personally i can't do it...


RustyKristi(Posted 2016) [#3]
wow ok ikr. thanks, at least we're on the same page :D


kfprimm(Posted 2016) [#4]
I've been playing around with the Blitz3D source lately. Here's a version that has the DirectPlay commands removed. Note that because it's been compiled with the free version of fmod, you'll need to copy fmod.dll (included in the ZIP) to your Blitz3D/bin folder & distribute it with any exes you build going forward.

https://www.dropbox.com/s/128coyi7eh3gilr/blitz3d_runtime_no_directplay.zip?dl=0

I don't have a Windows 8/10 machine available to test, so let me know how it works for you!


RustyKristi(Posted 2016) [#5]
Thanks kfprimm, do you have the sources for this? or at least the files where you made those changes?

cheers.


kfprimm(Posted 2016) [#6]
All I did was demo dplayx.lib from the list of libraries that link to runtime.dll, removed the bbruntime/multiplayer files, & commented the multiplayer_create, multiplayer_link, & multiplayer_destroy lines here: https://github.com/blitz-research/blitz3d/blob/master/bbruntime/bbruntime.cpp

Also, I just figured out that I didn't properly rebuild the DLL (stupid MSVC!). I've updated the zip file.

[edit] Forgot to mention, I was planning on uploading that branch to GitHub this evening.


RustyKristi(Posted 2016) [#7]
wow, awesome thanks! looking forward to it :D problem solved!


xlsior(Posted 2016) [#8]
IIRC It's not just the embedded fmod library, you also lose the blitz3D fmod *license* for those custom builds, meaning you'll have to PAY the fmod organization to use their DLL with your programs. (Whatever their licensing fees are)


kfprimm(Posted 2016) [#9]
Seems you're on to something xlsior! From the README,


FMOD may not be used in a commercial product, or product that directly or
indirectly receives income with the aid of the FMOD sound library, without
a commercial license from Firelight Technologies. Releasing a product
without a commercial license in this instance is a breach of the FMOD EULA
and parties who violate this license will be prosecuted under the full
extent of the law.



I almost have FMOD broken into it's own module as a byproduct of cleaning up the code. Perhaps someone wants to work on a replacement?


RustyKristi(Posted 2016) [#10]
If I'm not mistaken, Ploppy has already done this with hardwired but that is closed source.


RustyKristi(Posted 2016) [#11]
I still think it's safe because here's some news from Firelight (2014)

http://www.gamasutra.com/view/news/212696/FMOD_Studio_audio_tools_now_completely_free_for_indies.php

I remembered that news from using Torque3D, which also uses FMOD as packaged sound

Still I think it's better if we can just use DirectX Audio like in BMX, so why was that not an option? :/


Yue(Posted 2016) [#12]
@kfprimm

Thanks You. :)


Yue(Posted 2016) [#13]
@kfprimm


Hey, for some reason I dont know Dll accordance with the inconveniences that had display problems .




Rick Nasher(Posted 2016) [#14]
Many thanks. Haven't tried it yet, but if works properly then takes away a major headache/concern for a lot of people and ensures Blitz3D's survival for yet some time again.


Yue(Posted 2016) [#15]
Tests performed indicate that it works very well .


Rick Nasher(Posted 2016) [#16]
That's marvelous news. Thanks Yue.


Yue(Posted 2016) [#17]
@kfprimm
The error is that the runtime.dll is not compatilbe with Fastlibs . It's really a shame , there is some way to create a separate dll for version 1.106 of Blitz3D + Fastlibs to disable DirectPlay ?.

Best regard.


RustyKristi(Posted 2016) [#18]
If you're going to use fastlibs then you can't do these changes. during 1.106, it was closed source and the changes was not documented.

I don't think you can't have both until fastlibs.com upgraded to latest blitz


Yue(Posted 2016) [#19]
My humble opinion is that if you can, because the jump to version 1.107 it did was update to solve the problem performance drop in full screen in Windows 8 and therefore not play anything DirectPlay. Well the truth is not much, it's just what I think.

Perhaps you can create a dll to disable commands DirectPlay, Is it possible that?


RustyKristi(Posted 2016) [#20]
Perhaps you can create a dll to disable commands DirectPlay, Is it possible that? 


That kind of procedure is similar to cracking, it would make the app look suspicious. It would be best to let that directplay manually done by users than going for this route.

That is why the best option would be modifying the code so you can have a clean solution. If you're talking about intercepting a feature requirement yet alone a legacy component of windows, I don't think so.

I know you got your high hopes Yue with these 2 both working together, but if that is a possibility then it would be the first option for the guys here whereas the goto solution is still to modify the source.

Yes, it can be done but this method you're talking about is even complicated yet alone impractical than modifying the source imho.

The big question would be, who's up for it? ;-)


RemiD(Posted 2016) [#21]
Personally, i don't care about FastExt, but it would be good if this modification would be compatible with the upgrades (new functions) added by Bobysait !
you can find more infos and the sources here : http://www.blitzbasic.com/Community/posts.php?topic=105408


RustyKristi(Posted 2016) [#22]
I agree and frankly I have moved on and trying not to rely on FastExt or any other 3rd party libs. I'm sure you can do without the enhancements or worry about that later and focus on game components instead.

@RemiD Those extended features with BobbySait are great additions btw!


Yue(Posted 2016) [#23]
Well I thought it was much easier .

The fact is that not think I ever update the Fastlibs , at least it gave me to understand its creator, while not leave the Russian army , the fastlibs is a project stalled.




RustyKristi(Posted 2016) [#24]
Actually this is nothing to be sad about as this kind of situation makes you think to work on other things and to be independent yet still seeking some help where it is really needed.

If you want to duplicate FastExt features while staying B3D, you're best option is using Irrlicht wrapper which supports decent shadows (stencil) and shader support to recreate those effects or create your own shadow system eventually. On Blitzmax side, there's OpenB3D and MiniB3D to choose from.


Rick Nasher(Posted 2016) [#25]
Hmm, well. FastExt has a lot more features than just simple stencil shadows. For instance really nice water, which I don't see happening other wise, for would eat up too much speed.

A pity MichaelV doesn't want to update for now it should be much easier for him to do so, as Blitz3d is now open source. If not planning to, then releasing his source would be a beautiful thing for him to do, so other capable people(not me;-) can adjust and make it last.


Yue(Posted 2016) [#26]
Totally agree with Rick Nasher , however I agree with what mentioned RustyKristi , but not with the engine mentions seeing these obstacles , in one way or another have always thrown other engines in my learning process , and I think the best option today is Unity .

What the creator of the FastLibs , the last to talk to him is mentioned that an update needs several days of work time which does not account for their current job and expeculo that the situation in their locality geopolitico level is not the best . But hey , I think I will always have in mind that somehow Blitz3D has given me you need to understand the C # .

Gallery Fastlibs.
http://fastlibs.com/gallery.php


RemiD(Posted 2016) [#27]
From what i remember, Fastext does not provide stencil shadows functionality... It is rather shadow mapping (for directlight, not for omnilight).
For stencil shadows you can use devil shadow system.

But shadows are not important in a game anyway (except if your gameplay is based around that), i often deactivate shadows so that i can play on my laptop...


Yue(Posted 2016) [#28]






Not everything is so bad, the good news is :

The library does not break Ashadow time nor in Windows 10 , where everything works perfectly .
This has always intrigued me , This library Never breaks .

And it works with runtime.dll removing the DirectPlay .

I have the latest versiónd and Ashadows and examples . If someone wants I get on dropbox .


Rick Nasher(Posted 2016) [#29]
I used to have Ashadow, but is a long time ago. I do not know if still have it on my hard disk, so please share.


Yue(Posted 2016) [#30]
@Rick Nasher =)



Download DropBox. >>>> https://goo.gl/AZVHTu


RustyKristi(Posted 2016) [#31]
Yes, with AShadows I don't see any problem but you brought up FastExt and as we all know there have been issues with versions later than 1.106.


kfprimm(Posted 2016) [#32]
Hey everyone,

https://github.com/kfprimm/blitz3d-ng

Here's the source (a few days late!) as promised. You'll find the DirectPlay related tweaks on the aptly named no-directplay branch.

I decided I'm going to take a shot at modernizing Blitz3D, but there is a lot of ground work to do before that can happen. If you have any sane ideas, such as Bobysait's tweaks, I'd be happy to incorporate them along the way. Submit them as GitHub issues. Better yet, code them up & submit pull requests. :)

This weekend I am going to work on setting up some type of CI tool to automatically compile builds so that binaries will be available. I hope that will help to enable a wider test audience.

Thanks!


RustyKristi(Posted 2016) [#33]
Awesome kfprimm, thanks for this :D

This weekend I am going to work on setting up some type of CI tool to automatically compile builds so that binaries will be available.


..even better :) first time seeing blitz repo using CI tool


I decided I'm going to take a shot at modernizing Blitz3D, but there is a lot of ground work to do before that can happen.


Switching to at least DX9 with shader support while keeping the current command set intact is all that is needed in modernizing B3D.

Adding to that, what BobbySait has done with the extended features is still the proper way of extending functionalities with Userlibs imho.


RustyKristi(Posted 2016) [#34]
hmmm.... I'm seeing premake files and config, that does it mean it now builds with other compilers like MinGW? wow interesting! :D

Edit: So how do you get started with this build? I'm only seeing DSW file that was used on older VStudio..

premake5 only generates fmod and freeimage projects..


Rick Nasher(Posted 2016) [#35]
Dunno if you are already using this, but Plopply already reworked and released the source for being compiled with a more up to date VisualStudio's so that potentially could save you some work.

See here: Blitz3d source - VS2010 version


RemiD(Posted 2016) [#36]

I decided I'm going to take a shot at modernizing Blitz3D, but there is a lot of ground work to do before that can happen. If you have any sane ideas, such as Bobysait's tweaks, I'd be happy to incorporate them along the way.


one useful mod would be to separate updateworld() in 2 functions : one to update the rigged skinned animated meshes, one to detect collisions and reposition the ellipsoids (stop or slide)
for example :
updateskinnedmeshes()
updateellipsoids()

another useful mod would be to give the possibility to activate/deactivate an ellipsoid anytime and only consider the ellipsoids which are activated to detect collisions. (resetentity() does not work in all cases not sure why...) (the only way to do this at the moment is to delete an ellipsoid and to create another one...)

Thanks for your contributions.


RustyKristi(Posted 2016) [#37]
@Rick Nasher

I thought I'd suggest that earlier but then I checked out the repo and it seems kpfrimm is onto something..

https://github.com/kfprimm/blitz3d-ng/blob/master/premake5.lua

not sure if it's work in progress or already done..


kfprimm(Posted 2016) [#38]
Hey guys,

I'm going to put together a better README that includes info on how to compile the project & a general roadmap.

My short term goal is to get a working Direct3D9 driver in place, while my (ambitious) long term goal is for cross-platform support.

In theory, it should be relatively straight forward to swap D3D7 calls for D3D9 since the API isn't that far off. However, that requires the entire project to be torn apart & put back together. So, I'd rather focus on implementing a driver system similar to BlitzMax. That way, we only have to do the tough work once & later other drivers (such as OpenGL...) are a simple addition.

A large part of making that happen (the aforementioned ground work) is systematically detangling all the subsystems (graphics, input, audio, etc.) from each other. My plan of attack is to extract code from the current directory structure, and move it into the new "src" directory. The other motivation for doing this is that it allows us to slowly update the source to make it MinGW compatible so we can get away from MSVC6. To make life easier, I'm using premake to generate the Makefile.

For the time being though, MSVC6 is a necessary evil. It's the last version to support MFC, which the IDE & debugger require. Down the road, I would love to rewrite the IDE & debugger with a cross-platform toolkit (Qt maybe?), but I'm trying to stay focused on the bare minimum requirements (D3D9!).



Rusty, you have to use MSVC6. At this point, the premake file is incomplete as it represents only what MinGW can compile. As more code is migrated, that file will grow.

Rick, thanks for the link. As mentioned, I'm intentionally staying with MSVC6. Of course, I'm not coding in it! I have Windows XP running in vmware on my Ubuntu 14.04 machine. I am using Visual Studio to compile/test the project in XP, while simultaneously cross-compiling (no linking yet!) the src directory in Ubuntu.

RemiD, that seems like a reasonable suggestion. I need to come up with a feature suggestion template for GH, but in the meantime, if you write up some sample code that demonstrates a use-case, let's have a discussion on GitHub.


If anyone has thoughts or ramblings they'd like to share separately, feel free to email me. The address is in my profile.

Thanks!


Yue(Posted 2016) [#39]
I no nothing about it , but I think you know very well how to make Blitz3D better. So I wish existos in your project. :)


Rick Nasher(Posted 2016) [#40]
Thanks for the download Yue. Wish they could put those Ashadow/FastLibs commands in B3D + the PhysX engine and BlitzPlus Gui commands. ;-)


RustyKristi(Posted 2016) [#41]
@Rick Nasher

I think it is just a matter of finding resources that points to how they (ashadow and fastlib) manage to apply shaders in a DX7 rendering system. I would assume it is in some form of hack, like assembly level code wise.

@kfprimm
Thanks for that info. I have to find my old copy of VS6, is there any way you can update it to VS2010?


RustyKristi(Posted 2016) [#42]
Hey kfprimm,

I just noticed this recently and it looks like that you are separating b3d component devices which I think is really awesome. FMOD is a great library but if you can integrate other options as well it would be better!

https://github.com/kfprimm/blitz3d-ng/commit/b388a68c4afd8151c1c4ce3e54a245d49f74376d

What got my attention is the BBNullAudioDriver class, does this mean it would be easy now to replace FMOD as default sound driver?

https://github.com/kfprimm/blitz3d-ng/blob/master/bbruntime/bbaudio.cpp#L11-L32