Hard Light Productions Forums
Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: ##UnknownPlayer## on March 16, 2003, 07:26:03 am
-
You read right - I've got the DX8 branch merged into the main branch properly and stably. There might be a few bugs (I haven't tested extensively yet) but as far as I can tell its all going along smoothly.
I haven't committed it to the CVS yet because my freakin ADSL is acting up so I'll do it tomorrow afternoon (my time - probably morning for you americans).
The OpenGL people when its uploaded might want to check that still works as there were a few compile errors from that direction which were fixed a little haphazardly in my opinion. Should vram_full be set anywhere? I see a lot of checks against it but nowhere where it's determined so right now I'm just initializing it to 0. When I commit the code you might want to look into that.
So yeah - any comments, questions - post here!
-
one question: Compile. When?
-
As per Inquisitors request the DX/main branch merge has been commited to the DX branch, so hopefully after some testing we'll catch any bugs that are in there.
Right now the whole thing compiles and runs perfectly.
-
Nice one
-
Ok - I thought I had this thing down pat, but CVS isn't being friendly to me so I could use some advice - I have all the files checked out as the main branch merged with the DirectX 8 branch. How do I tell CVS (I'm just using wincvs 1.3) to upload all of that into the DX8 branch and overwrite what was already there.
-
One more question. Does the DX merge mean that the movies play now in full screen. I did in the DX build, so I hope it does in the merged one.
-
Stuneap, no it does not yet.
UP, catch me on ICQ, I need to know where you are in the CVS process, that way I can help figure out why it won;t commit :)
-
Originally posted by ##UnknownPlayer##
wincvs 1.3
1.3 has given me no end of trouble. :doubt: Go back to 1.2, it's the most recent stable version and it works fine. I mirrored it on the warpcore site at the link below.
http://fs2source.warpcore.org/WinCvs120.zip
-
Ok I'll try doing that. It just looks like it won't clear the conflict markers from the file even though I manually cleared the all my self. Damn this sucks - I'm all roaring to dive into some other aspect of fs2_open development right now (my long leave has seen me return with heaps more DX ability, hence I'd like to get to work on HW T&L or some experimentation with it ASAP).
EDIT: Ok that didn't solve my problem...
-
me too!!
-
Ok, I'm possibly a horrible monster and millions will pray for my death, but I've uploaded the merge straight to the main CVS branch since no matter what I did I couldn't upload it to the DX one. I'm downloading the new merge right now to check it still compiles and runs, but no doubt there'll be plenty of bugs to sort out. Hopefully we'll get that done quickly though and everyone will benefit out of it. For those of you with frame rate concerns, I'm going to be actively working to optimize rendering as much as I can for you.
If you have any problems/requests/questions please post them here.
-
Sorry for the double post, but this is just an update on 'Don't commit anything temporarily' (which needs to be deleted now).
I've fixed up the obvious bugs from my sudden massive merge (to which I apologize to Inquisitor for my rash actions - it won't happen again). The exe file can be compiled and installed perfectly now, but I don't guarantee that some functions added by you guys survived through the merge (but that's why we've gotta test it! test it! test it!).
EDIT: Goober5000 - go have a look at the latest SEXP you added (the trigger explosion one) - the bug which was making the game crash after the merge wasn't even a bug introduced by me - you messed up the SEXP operator queries and such. I've commented out the offending lines and everythings peachy, though you may want to do a cvs diff on the current sexp.cpp and your current local one.
Now, to compile this!
Make sure you have the DirectX 8.1 SDK installed on your system - you can get it from the Microsoft website here -
Next up (these are the instructions as appropriate for MSVC6):
- Go into MSVC and goto Tools-->Options
- Go to the 'Directories' tab
- From the drop down box goto 'Include Files'
- Add a new entry in the list box that points to the directory where you installed the DX8 sdk's subdirectory 'include' - for example my entry says "C:\DXSDK\Include"
Build and run DX8.1 Freespace 2! I'll endeavour to start the process of speeding it up ASAP.
-
Excellent excellent news.
Question: RT mentioned that the DX8 build was actually incompatible with his
Dshow movie code? Something about switching video fullscreen?
Any thoughts?
-
DX8 cant switch properly yet. Dshow needs that.
Not that difficult. You just need to stop it calling DX8 functions while its minimized thats whats causing crashes.
-
hey can the beta testers get a un-official release to start testing for bugs. Also video code, does that allow SCP exes to play the in game videos like the opening video to the game?
-
Yes, we'll get a test release.
No it does not play MVE's.
RT: Ahh, cool, sounds like a direction we can explore quickly.
-
eh thats too bad...do we have any future plans the imlement the mve code? Or is the mve format licensed by interfart, sorry interplay. or is is licensed by volition.
-
No plans whatsoever.
Licensing difficulties. Long story, search da forums if you want the scoop :)
-
Anyone whose up to building the current EXE off the CVS is welcome to beta test, but as Inquisitor said otherwise there'll be a beta release for the rest of you.
Next on my agenda will be fixing RT's movie play code for DX8 (simply so the merge won't have removed a feature).
EDIT: Just a quick question if RT's reading this - why aren't you using the internal FS2 file routines to check for the existence of the movie file?
-
I wrote that code ages ago so its difficult to remember. Does it cause problem?
-
Mmph. Two major problems already...
* fred2_open doesn't compile; says something about unresolved linker errors with D3D stuff. The project file will have to be updated to fix this.
* Computer freezes when I go into the tech room mission loader. Everything stops, including the mouse, though oddly enough the music keeps playing. The freeze happens right before the dialog pops up showing the file search.
As for the SEXP bug, I thought I had fixed that. :nervous: I'll look into it again as soon as the mission load freeze is fixed.
Another minor problem - How can I run the game in 640x480 mode now that the only options on startup are for 1024x768?
-
K, another freeze. I tried running a campaign so I'd get to play a mission, and then I pressed escape. Freeze. (Both freezes necessitated a hard reboot.) Based on this, I'm positive the bug lies in the pop-up dialog routine.
Specs: Win98 PIII, 256 RAM, running 32-bit.
-
Originally posted by Goober5000
Another minor problem - How can I run the game in 640x480 mode now that the only options on startup are for 1024x768?
[size=8]GAAAAHHHH!!!![/I][/SIZE]
That is NOT a minor problem! Not minor at all. May I strongly suggest this be fixed...
-
Minor means it doesn't crash the game. ;)
-
*fingers personal rifle meaningfully*
I am not interested in terminological trivialities...
(;) at Goober, though not at the situation.)
-
Originally posted by Goober5000
K, another freeze. I tried running a campaign so I'd get to play a mission, and then I pressed escape. Freeze. (Both freezes necessitated a hard reboot.) Based on this, I'm positive the bug lies in the pop-up dialog routine.
Specs: Win98 PIII, 256 RAM, running 32-bit.
Ok this is odd since I haven't been able to replicate the freezes you mentioned on my machine. Can you give me some more information - debug or retail build, mods or no mods - etc.
-
Retail build, FS1 port installed.
-
Ugh. I started it again, then pressed ESC to bring up the quit dialog - while I was still in the main hall - and it crashed. :ick
Then I rebooted, renamed all my mods, created a new pilot, and entered the main hall. It crashed immediately - probably because of the New User Tip dialog.
Crash happens in both 32 and 16 bit resolutions, using both kinds of antialiasing. I'm running DX8.1 retail, using the release compile. :doubt:
It's gotta be with the dialog code. Everything else runs fine.
EDIT: Video card is 3D Prophet II MX, by Hercules.
-
Hmm...for the time being try using a debug compile and see if that helps, as I suspect it will. I'm gonna have to look into this.
In the mean time, I've also uploaded some new code to the CVS which makes FS2 pick whatever res you have set in your registry to use as the res for the windowed mode.
-
Debug build works. :yes: However, to add another complication, I got a whole bunch of table parse warnings that I don't get with the release version. :confused:
And the game doesn't run in 640x480 - the launcher still pops up, as it does every time I run the program, and offers me only 1024x768 choices. :doubt:
(However, it all runs in full-screen. Is windowed mode actually a window?)
-
I strongly suggest that people with problems are given a DX8 exe that was made before the merge to determine if these problems occured before the merge.
-
Eh, well, do you have one? The latest one on the site was posted in November.
-
This is interesting, the problem only seems to show up with the DX8 merge in retail mode. The debug build works fine.
And the latest version on the CVS will run in 640x480 mode BUT ONLY IF YOUR REGISTRY ENTRY TELLS IT TO. Otherwise it'll go for 1024x768. It's done this way because it'd be painful at that point in the game to re-size the game window.
-
The registry entry does say 640x480. Retail FS2 runs that way and so does the fs2_open build right before I updated to fs2_dx8, but for some reason fs2_dx8 runs in 1024x768 no matter what. Unless there's a new registry entry, something's wrong with the mode selector.
EDIT: The November DX8 build (version 3.2) runs fine, although it forces to 1024x748 res as well.
-
Well, at the very least, can we have it default to the smaller window?
Once you get the other things sorted?
-
Dialog freeze fixed. :) But it still won't run in 640x480... :doubt:
Here's one weird thing - I can't minimize or Alt-Tab. The program re-maximizes itself. :lol: I managed to get it twice, by clicking really fast while the screen flashed, but it won't stay maximized of its own Volition. :p Can this be fixed?
Cut and paste of the FRED linker errors...
--------------------Configuration: fred2_open - Win32 Release--------------------
Compiling...
Sexp_tree.cpp
Linking...
code.lib(GrD3D.obj) : error LNK2001: unresolved external symbol _Direct3DCreate8@4
code.lib(GrD3D.obj) : error LNK2001: unresolved external symbol _DXGetErrorString8A@4
code.lib(GrD3DRender.obj) : error LNK2001: unresolved external symbol _D3DXSaveSurfaceToFileA@20
code.lib(GrD3DTexture.obj) : error LNK2001: unresolved external symbol _D3DXFilterTexture@16
C:\Games\Freespace2\fred2_open.exe : fatal error LNK1120: 4 unresolved externals
Error executing link.exe.
-
did you try a complete clean rebuild?
-
yes
-
you know looking at it more I'm thinking that maybe you didn't put the dx libs or headers in right
-
But fs2_open compiles just fine. I'm guessing that there's something in the project settings that needs fixing.
-
you get an EXE!?!
from the looks of that error mesage you shouldn't
-
Ahh yes, I was meaning to tell you all last night (my time) that I'd fixed the dialog error - also nailed the black screen around dialogs bug with the same fix.
In your registry, the game needs to be set to run at 640x480, only then will windowed D3D mode run in a 640x480 window at 640x480.
To do this:
1) Goto HKEY_LOCAL_MACHINE\SOFTWARE\Volition\FreeSpace2
2) Goto the string value "Videocard"
3) Ok, mine says Direct 3D - Primary Display Driver (32 bit) (1024x768)
Now if you wanted 640x480 mode then change it to read Direct 3D - Primary Display Driver (32 bit) (640x480)
4) Run the game in windowed mode.
It's for the complexity of the above that FS2 originally had a launcher.
-
Originally posted by ##UnknownPlayer##
In your registry, the game needs to be set to run at 640x480, only then will windowed D3D mode run in a 640x480 window at 640x480.
To do this:
1) Goto HKEY_LOCAL_MACHINE\SOFTWARE\Volition\FreeSpace2
2) Goto the string value "Videocard"
3) Ok, mine says Direct 3D - Primary Display Driver (32 bit) (1024x768)
Now if you wanted 640x480 mode then change it to read Direct 3D - Primary Display Driver (32 bit) (640x480)
It already says that. :rolleyes: Read my above posts.
4) Run the game in windowed mode.
This is the only sticking point. How do I do that?
Originally posted by Bobboau
you get an EXE!?!
from the looks of that error mesage you shouldn't
Bobboau, reread my posts above. I was talking about FRED, not FS2.
-
Windowed mode is enabled by using the "-window" command line parameter.
-
Is there no way to use 640x480 in fullscreen?
-
Its a bug, so there will be went its fixed
-
Wait wait wait - 640x480 in full screen? Just have your registry set as I said but don't run it with the -window command line option. I was doing it just then on my system (doesn't look nice on a 21" monitor though)
BTW - I just killed off a bug brought in by the OGL people which was causing the shield ani's to always display in low-detail mode for all who may be concerned.
-
Originally posted by ##UnknownPlayer##
Wait wait wait - 640x480 in full screen? Just have your registry set as I said but don't run it with the -window command line option. I was doing it just then on my system (doesn't look nice on a 21" monitor though)
:wtf: That's what I'm doing. The registry is set for 640x480 resolution. I start fs2_open without the -window option. Yet it insists on going to 1024x768.
-
What OS are you running?
-
Try using the seperate launcher instead.
Note to ##UnknownPlayer##:
Once the External Launcher is fully tested and working you should remove the internal launcher built into FS2 DX8.
-
The Latest RT launcher is actually i nthe exes download folder on the site.
-
Of course. It's only in the previous necessity of testing and such w/o the hassle of registry editing. We will need a new flag (or a longer video card string) to specify AA though (which incidentally makes everything look silky smooth when I use it)
-
Win98SE.
And now a bug. After I ran the custom launcher, fs2_open refuses to start, saying "error initializing direct3d: failed to create device". :wtf: Even using the old fs2 launcher fails to fix it. Retail fs2 runs fine, however.
-
Does it really say "direc3d"?
-
No. ;)
-
Just checking :)
-
Originally posted by Goober5000
--------------------Configuration: fred2_open - Win32 Release--------------------
Compiling...
Sexp_tree.cpp
Linking...
code.lib(GrD3D.obj) : error LNK2001: unresolved external symbol _Direct3DCreate8@4
code.lib(GrD3D.obj) : error LNK2001: unresolved external symbol _DXGetErrorString8A@4
code.lib(GrD3DRender.obj) : error LNK2001: unresolved external symbol _D3DXSaveSurfaceToFileA@20
code.lib(GrD3DTexture.obj) : error LNK2001: unresolved external symbol _D3DXFilterTexture@16
C:\Games\Freespace2\fred2_open.exe : fatal error LNK1120: 4 unresolved externals
Error executing link.exe.
UP, do you know what's causing this? It happens when I try to build fred2_open.
-
Goob: Project->settings
go to the "link" tab (IIRC)
and in the object/library modules you need to add d3d8.lib (I THINK!)
-
that wasn't quite it...
but it allowed me to figure out where I did have to fix it. It's working now, and I'm committing. Thanks. :)
-
Originally posted by Goober5000
that wasn't quite it...
but it allowed me to figure out where I did have to fix it. It's working now, and I'm committing. Thanks. :)
:lol: glad I could help :lol:
-
Great work Goober, saved me some trouble. Are you still having that problem with fs2_open?
If so could you tell me what the videocard string in the aforementioned freespace 2 registry entry says.
-
HKEY_LOCAL_MACHINE\Software\Volition\Freespace2\Videocard sez Direct 3D - Primary Display Driver (640x480). Yet the DX8 build loads in 1024x768.
And after I ran the SCP launcher, I got that "error initializing direct3d: failed to create device" message, which didn't go away even after I used the retail FS2 launcher. I had to restore my registry to be able to run FS2 again.
-
DX8 FS2 does not use the same registry for vid selections as the others. This means you can still run the original FS2 exe OK.
I'll fix the launcher bug. Do no attempt to change the mode selection method used in the FS2 DX8 code.
-
We should change that, it should use the same registry entries, just like OGL.
That introduces another management crisis otherwise.
Anywho, long overdue for a meeting, I am in Provo next week, how about the week afterwards?
-
Originally posted by RandomTiger
DX8 FS2 does not use the same registry for vid selections as the others. This means you can still run the original FS2 exe OK.
I'll fix the launcher bug. Do no attempt to change the mode selection method used in the FS2 DX8 code.
I see the different registry values RT, but I still don't understand why Goober is getting problems. I modified the dialog box code to automatically pick the most suitable resolution and bit depth for DX8 as the default entry, and it works from the Videocard registry entry.
-
So call me a simpleton But how is direct x 8 going to change Freespace 2?
-
Well, it'd let us eventually implement hardware T&L which above all other things would give us the ability to have super-detailed (30000) poly ships and such. You can also do things like specular highlighting and hardware supported bumpmapping and anti-aliasing, just to scratch the surface.
-
oooooh. A high poly count babylon 5 :D
may be someone will make a new sathanas.
Or maybe a vorlon planet killer.
what is hardware t&l. and what is the benefit of anti lacing?
-
Okay, let's start with hardware T&L.
Basically, a 3d scene is comprised of many vertices (3D points), and lists of polygons that reference to these points (As in, polygon A is made of points 1,2,3, polygon B is made from points 3,4,5, etc.).
To simulate movement, for example, when the viewpoint (the player, generally) moves X units forward, the whole world is actually translated (moved) X units backwards. If the viewpoint turns Y degrees right, the world is rotated Y degrees left.
Rotation and translation (And scaling and shearing, for the matter) are grouped into Transformations.
Up until the GeForce 256, transformations were generally preformed by the CPU with specialized code. The advantage of using the graphics card to do those calculations is that first of all the CPU is offloaded of those calculations, letting it utilize its power in things like AI and physics, and the great advantage comes from general case circuitry (CPUs floating point math units, in this case) are usually an order of magnitude slower than circuitry made for a specific use.
The second part of T&L, lighting, is just as it sounds. What the graphics processor generally does is compute how brightly lit each vertice is, according to the basic lambertian reflection model, which says that the intensity of light on a point is equal to the light's strength multiplied by the cosine of the angle between the light vector, and the normal vector of the point. As vertex normals are usually stored, and both they and the light vectors are generally stored normalized (stored as vectors with the length of 1), and the dot product of two vectors, u·v, is defined as |u|*|v|*cosè (|u| being the length of the vector u, |v| being the length of vector v, and è being theta, the angle between them), |u|*|v| equals one, therefore the dot product gives exactly what is required for the lighting equasion. Sorry if it got too mathematical (Even though it is only basic vectors), but that's about it regarding T&L.
Anti-aliasing is a technique to reduce image artifacts, called aliasing (Makes you wonder how they thought of the name 'Anti-aliasing', eh? :) ), which is a general name for artifacts caused by two inherent problems of the computer monitor. First of all, pixels are inherently square. Therefore, only square shapes can be displayed without any artifacts. Secondly, the resolution of monitors isn't high enough to fool the eye into thinking there are no artifacts (at least not yet). The best case in which you can see aliasing is the 'stair-steppes' effect, where a polygon is nearly horizontal or vertical, and slow-moving on the screen, and you can see how the pixels on the edges of the polygon are slowly moving.
All anti-aliasing algorithms generally draw the image in a sub-pixel precision, and then sample it down to fit the monitor (called 'supersampling', as you draw more pixels than you can see (as in, in a higher resolution), and then sample them down), or just take several samples from the screen and blend them (called multisampling). The result of all of them, to some degree, is eliminating those jaggies, by making the lines have smooth gradients, instead of hard edges.
-
[color=66ff00]I was about to say 'wow Fry_day really knows a lot of 3D mechanics' but I guess that it's pretty common knowledge for todays games programmers. :)
I've only ever messed with 2D graphics, drawing 2D layers and sprites seems a lot less complicated in comparison but I see there are a good deal of similarities between 2D and 3D 'world manipulation' (sorry for the bad decription, I can't think of a more accurate one).
Interesting stuff and well explained. :nod:
[/color]
-
Originally posted by ##UnknownPlayer##
I see the different registry values RT, but I still don't understand why Goober is getting problems. I modified the dialog box code to automatically pick the most suitable resolution and bit depth for DX8 as the default entry, and it works from the Videocard registry entry.
OK, originally I designed DX8 FS2 to not interfere with normal FS2, which at the time was a good idea but now maybe causing problems.
Today I got a crash where the code was trying to run glide then a problem with the resolution. I have fixed both these issues by making use of the Videocard registry enter that I was avoiding in the first place. I am about to send Inquistor the ammended launcher.
But theres another problem which UP will have to attend to. Unless you feel you have a better solution (which would most likely require more work on the launcher) you need to understand the difference in how the mode indices are created.
The external launcher indices all modes and only shows the ones that are valid. The chosen number is stored in the registry to be picked up by the game.
The game DX8 launcher gave index numbers to only the modes that where valid. So you can see the problem, the indices dont match up. The solution is strip out the internal launcher and make the game query for the mode directly with D3d rather than using that array of indices.
Sorry if that not so clear, I have no time sadly. If you have problems or want more clarity or even code give me an e-mail and I'll get onto it as soon as I can.
-
Ok, I'm totally unfamiliar with the external launcher (having never used it) but I get where your coming from RT.
It would be easy enough to remove the internal launcher (I'd need to comment out maybe 10 lines at most - you did a good job), but I'll need to know the specs of what registry entries I'm to be querying to get that the external launcher is telling FS2 launch with, and as importantly, the process it uses to enumerate the list of modes (I could code one, but chances are I'd do something which doesn't result in the indices matching up).
If you could just post me some more info of what I need to do in this thread I'll go right ahead do it.
-
apparently some of the dx8 stuff isn't compiling on my machine
D3DFMT_A2B10G10R10
D3DXSaveSurfaceToFile
D3DXIFF_BMP
are not found in my dx8 stuff
-
Weird.
But i have the full SDK, lemme look at it...
-
Originally posted by ##UnknownPlayer##
Ok, I'm totally unfamiliar with the external launcher (having never used it) but I get where your coming from RT.
It would be easy enough to remove the internal launcher (I'd need to comment out maybe 10 lines at most - you did a good job), but I'll need to know the specs of what registry entries I'm to be querying to get that the external launcher is telling FS2 launch with, and as importantly, the process it uses to enumerate the list of modes (I could code one, but chances are I'd do something which doesn't result in the indices matching up).
If you could just post me some more info of what I need to do in this thread I'll go right ahead do it.
Please contact me with questions by e-mail, Im sorry I really dont have time to keep up with the boards at the moment.