CFS2 Perma-stickied help / problem / tweaking thread

Tinker Toy update

2.80 gig processer dual x 2 but 64 bit system ---- window 7

intell graphic -- on board

4 gigs of ram --- should be ample

direct x 10



Ok Frustrated , I started hunting ,

Top header Cfs-2 Cfg---root directory --add on

[JOBSCHEDULER]
affinitymask=3 ---------- Usage Dual core 2.8 , Yes major help , uses 2 cores I,m told ,
cache_size=1024000M ---------- smoother seems to apply
stack_overflow=256K,512K ------unknown
tripple_buffer=1 ----- if it works, distance ,,
clean_on_exit=1 ----- Ram I would guess
pre_cache_gauges=C:/battle_of_britain/gauges ----- Gauges are a drain on resources ?? didn,t work !
read_ahead_cashe=20480M ----- Unknown
page_flip=1 ------ Unknown
read_write=1 ---- Unknown

My average gun chart was 18 to 25 hit percentage -- before --

Smoother sim now , and that means tracking is greatly improved ,
To see a gun chart produce -- 530/968 = 55 % on Q-C taking out 5 x Bf110 ,
and the Wing man got the 6th , Was rather cool , when you consider the mouse .
was the controller ! and the sim running 100-% ,

Testing 2 Bf110,s for Eai compatibility , Asa Bf110 , and Alen,s Bf110 Destroyer ,
Each a little different , in responces , Asa would climb faster , piviot angle quicker ,
But maintain 8 aircraft , Alen,s would loose 1 / 2 of 8 , to pilot error , and crash out ,
undamaged , like the computor was just excluding them , and ocassionly 1 of 6 , would crash ?
could just be the lack of good Vidio card , Still looking for the reason ,
 
“ai_playr.dll”, Not What We Hoped?

I keep saying to myself I will write this one up proper but I never do. It came when I was in a deep dive into CFS2 (I like the challenge of doing what hasn't been done) and I worked so hard at it. Many complaints of the AI in CFS2 – the possibility of rewriting it (via dll wrapping?) – a holy grail.


Below is evidence that leads me to think “ai_playr.dll” does not do what many, including myself, hoped it does.


Point 1:


There's a thing in programming called calling convention. As programming progressed in the early days it moved towards a main engine calling into subroutines (functions in c). This was a natural progression and the first inklings of reusable code. For c google “c name mangling”. For c++, which reveals more of the actual names and arguements called, “ai_playr.dll”, it it is largely c++ calls. Given that in those days c++ wasn't very fast (am i correct?), and that I see a lot of menu/utillity calls here in c++ format, this dll is not part of the real time CFS2 engine?


Point 2:


There is a more simple checkwhich anyone can do. Rename “ai_playr.dll” to anything else and fire up CFS2. What breaks? I only did this once, but free flight and the Mission builder failed. I have no idea why free flight failed (it has always been an oddball), but that the mission builder failed supports that this is not a real time dll.


Indicative but not proof – wanted to share.

Mike
 
Thanks and very interesting AC. It is, of course, one of the the 'holy grails' of the sim. Unfortunately, until the whole sim can be unlocked/read, then one part really creates more questions than answers....

As we all know M$ will NEVER let us have the source code, but more power to your programming investigation...I can but hope..:applause:

Cheers

Shessi
 
Hi,

Mike, as you probably know if you've taken a look inside the ai_playr.dll is that it's mostly tied into the mission builder. There's a few dialog boxes which are hidden and don't get displayed in game like the ai guidance panel for starters.

ai_guidance.jpg

Freeflight is based on situation files found in the SITUATIO folder. defair.flt is when you start in the air and defgnd.flt is if you start on the runway. You can adjust a few settings in those files to set the default zoom or change it to load the VC as the default view.

Most of the other AI controllers and behaviors are found in the PID section of the .air file.

Cheers
Aussie
 
Shessi,


The kind words are appreciated. This effort only lead to the "DumpGauges.exe". I did figure out how to read the tokenvars as requested by Klein but it needs some reorganizing. Perhaps I'll get back to that.


Aussie,


Actually, I didn't know any of that. Thanks for the contributing even more evidence. The level of knowledge in this basement is striking.


Additionally, I've long noticed that some dll's of Cfs2 have two exports which are odd. For the non-coder, dll exports are exposed for use by the parent executable code. The two odd exported names are "ImportTable" and "Linkage". One normally thinks of a dll compiled to a dll extension as a library of exposed functions (subroutines in other languages) that are called dynamically (when the exe is running). The gauges file "gauges.h" reveals quite a lot about these two exposed names. They are not functions at all but structures (in c/c++, a grouping of data under one variable name). I can post my proof but it is a bit involved.


Dll's are found in three places and have the follow pattern ...


1. Main Cfs2 directory - none have "ImportTable" and "Linkage"
2. Modules sub-directory – all have "ImportTable" and "Linkage" but some also have c/c++ functions
3. Gauges sub-directory – only "ImportTable" and "Linkage"


This is the tricky part because it's only a hunch but digging into them all makes me think "ImportTable" and "Linkage" are for real time access. Let me emphasize this is only an informed guess. They could have been used just to thwart “white hat hacking” (I mean here legal modifications of the game). And it could be that this approach was chosen for both: “white hat hacking” and speed. Note that I do not know if such a method, just exposing data, is faster, but I suspect it could be.




Aka Mike


AC
 
Hi Mike, think of dll’s as being able to export variables, functions and resources which are imported by cfs.exe. To my understanding the linkage table refers to information being used by the linker from the header .h files during compilation of the dll. Now the problem is without having a cfs specific SDK knowing the various names is impossible to workout with a white hat on.

Take into consideration that much of what’s under the surface of cfs is from fs and doesn’t function properly, like dynamic scenery, atc and logbook just to name a few. There’s even reference to an F-18 in cfs 😂

I’ve been programming some gauges lately and had to customise the fs gauges.h so it creates proper cfs2 gauges

Cheers
Aussie aka Ossie 😝
 
Hi All,

Sarg Willy makes an interesting point regarding adding affinitymask in the cfs2.CFG.

[JOBSCHEDULER]
affinitymask=n


There's a calculator you can use to get the right numbers for your cpu and if it utilizes hyper threading or not. Find the link below.

Gatwick Flight Simulation Group (gfsg.co.uk)

As you mention Sarg you will see temperature increases due to the fact the cpu is working harder which is to be expected and also establishes proof of concept.


Cheers
Aussie
 
Ali Cat

You seem to be able to poke around the CFS2 .dlls any chance you could look at them or the CFS2.exe and find the one that "Enable hardware acceleration" and make it always check-able or make it have "Enable hardware acceleration" always on?
 
That won't help. CFS2 is a DirectX 7 game that doses't play nice with modern cards. Simply put CFS2 doesn't see modern cards as hardware acceleration capable and grays the option out. Editing the CFS2.cfg works but the editing has to be done just about any time you change any other setting too. Annoying AF to do over and over.
 
Allen,


I afraid I do not know of a way to accomplish your request. This investigation I have done into the cfs2 dll's, while I don't regret it, has largely been a bust. From these binary's I can see very little – so many questions left unanswered. In that you sparked my curiosity, I did some searches of the DirectX 7 SDK. There is a sample program that shows how detect if hardware acceleration is supported. It is almost 2 pages long. It could be that there is some 32 bit value in the cfs2 binaries that does what you wish (which I could not find anyway), but I really doubt it is that simple. My somewhat educated guess is that it is buried in code, in binary, which would make it pretty much impossible to decipher.


Aussie,


I know exactly what the “Linkage” export does -- for a gauge file at least. DumpGauges.exe would not be doable if I did not. It is a variable length array of the PGAUGEHDR structure. This structure contains all the data that cfs2 needs to display the gauge. And you went on explaining to me what a dll is? I have written code for 40 years. A request – stay off my threads.


AC but call me Mike
 
Mike,
My apologies but I haven't read your resume. I will most certainly refrain in future from trying to assist you. :untroubled:

Aussie
 
Guys, I have a question, probably a rather stupid one, but anyway..
I bought a new widescreen monitor for my computer. Now, when I run CFS2, and of course also FS9, I get this distorted picture, as the proportions of the new screen are different from the old one.
I didn't find anything in the settings menu of either sim to change the screen proportions.
Is there anything I can change in the settings of the computer itself to get the old picture back? Or maybe in the config files of the sims?
Any help would be highly appreciated.
Thanks.
 
I had the same problem around two years ago, I have a display 3440x1440 but cfs2 can't use the full size without trouble, I suggest making a backup of your "cfs2.CFG" file than hand-edit the cfs2.cfg, after doing that, never ever open the quality settings in cfs2 because cfs2 falls back to "16bit"



open the cfs2.CFG with editor, than serch for Display

my settings are


CFS2.CFG

[DISPLAY]
Device=NVIDIA GeForce RTX 3060
Mode=1920x1200x32
Dither=0
AntiAlias=1


For FSDS2 User: If you have a new big display (>1920x1080) , you will find out that you always get a DirectX error if you use the full screen.
When working with FSDS2, I set the "Windows" display settings to 2560x1440 and everything works fine.

wolfi
 
Wolfi,
Thanks for your suggeston,I tried it but the picture sill looks he same.
However, I now tierd running the sim in windowed mode, and this works okay.
 
When it comes to display settings, here is what I use:

to get hardware texture lighting, and other options to work, I found that I have to had edit them in.

[DISPLAY]
Device=NVIDIA GeForce RTX 3070 Ti
Mode=1920x1080x32
Dither=0
AntiAlias=1
HWTnL=1

CFS2 supports resolutions up to 2048 x 1536.

Other display settings to try in the cfg. file:
Dither=0
Filter=1
TriLinear=1
MipMap=1
AntiAlias=1
HWTnL=1
 
Back
Top