View Distance Variable

General Mech2 related Developments go here. Discussions welcome!

Moderator: Skyfaller

Forum rules
If you are writing a guide please do not post it here! Post in the Dev FAQ section please.
Post Reply
User avatar
Sir MMPD Radick
Clan Nova Captain
Clan Nova Captain
Posts: 1625
Joined: Tue Jan 22, 2008 10:07 am

View Distance Variable

Post by Sir MMPD Radick »

This question was over at mektek so i figure I should port it over here.

Quotes ported from Mektek

Repromancer:
Everything mission-specific is in the .bwd. A .bwd can include others (and usually does -- and they can include other ones too, ad infinitum), so the draw distance may not (read: will almost certainly not) be in the top-level mission description .bwd. Result: you'll have to dig around, but if you insert a new draw distance after the inclusion, say at the end of the .bwd describing the mission "world", it'll override the previous one.

For most of the development, the files were .wld (world), a readable text format. We stuck in an assembler to turn them into binaries, partially to save space but mostly as a simple encryption. Binary world = bwd.

The .prj is the "project" file, where most of the game assets (sounds, bitmaps, models, etc.) reside.
Skyfaller:
I think I found it.

According to the documentation on how to build user worlds for MW2
(tools\mw2doc.htm in the English DOS Mercs CD), the drawing distance
variable resides in the VIEW tag of the WLD files, which has the same
name in the BWD files.

I used a hex editor to replace all occurrences of this variable in the mw2.prj,
and now the missions I tested *no longer have a far clipping plane*!

Replace the hex values

5649455710000000400000003f3f3f3f

with

56494557100000004000000000350c00

to set the viewing distance to maximum values. I used WinHex, which uses
3F as a wildcard.

Can anyone confirm? I tested this with MW2:31st CC (Titanium).
MMPD
Nope, I cannot confirm it for DOS, least at this time I probably could if I had more time, but need to get back to my hw.

Basically my results are the following:

After playing around with it for a while I did a wildcard search and found 73 occurances of the VIEW variable, but after changing the value to a reasonable unsigned int value i could not get the game to let me in.



CODE
564945571000000040000000****48525A4D


The **** are the parts to change and is different throughout the PRJ file.

the 48525A4D is not part of the variable from what i can tell, so it could be safely omitted.

btw the editor I use is 010



I would also note that mercs does have a different architecture than MW2 in that it is made for usercreated maps, so there may be other differences which I am not aware of.
So, does anyone have any ideas?
James 3:5-10: My Reminder
And the tongue is a fire, a world of iniquity: so is the tongue among our members, that it defileth the whole body. Out of the same mouth proceedeth blessing and cursing. My brethren, these things ought not so to be.
User avatar
Cyril
House Steiner Warrant Officer First Class
House Steiner Warrant Officer First Class
Posts: 357
Joined: Tue Jan 22, 2008 4:04 pm
Location: Richmond, VA

Re: View Distance Variable

Post by Cyril »

Sir MMPD Radick wrote:This question was over at mektek so i figure I should port it over here.


The **** are the parts to change and is different throughout the PRJ file.

So, does anyone have any ideas?
ok, i'm very tipsy right now, taquila and yingling,,,,but what is that word that got blanked out? i cant imagine mmpd using any work that would be a no-no off hand,,,so it has to be a mistake. so what is it? i was kinda understanding untill i saw that, and it compleatly took over my thoiught process:P


anyway, what i find,,,,infurating,,,that might be the word,,,repo knows all this "stuff" about mech 2, and the guys that are messing around with mech 2 are stubbling in the dark.

i'm not saying anything bad, or negative about repo,,,i just wish we could download all he knows about mech 2 into a database we could all access.


on top of that i wish i really knew what mmpd and others know to play around with it:P


repo,,,,your any input into the game is greatly appreciated,,and to mmpd and others that have tinkered with mech 2,,,thanks for your effort:P




ok,,that is my nice post while i am tipsy,,,,now to other forums to nit pick arguments:P
Image
Image
User avatar
Skyfaller
Clan 1st MechWarrior
Clan 1st MechWarrior
Posts: 1017
Joined: Sat Apr 12, 2008 2:58 am
Location: Germany
Contact:

Re: View Distance Variable

Post by Skyfaller »

No need to be angry at Repomancer. I think he helped in an adequate fashion.

If anyone cares, I've attached a tiny installer that works for Titanium, I haven't tested it with other Windows versions of MW2. Please post your experiences.

If you don't have or don't like Titanium, I can't help you yet, but I've not exhausted all possibilities. So just wait and everything should turn out nicely.
Attachments
TitanFarPatcher.zip
Titanium Far Clipping Plane Patcher - Experimental - Backup your MW2.PRJ if necessary
(6.56 KiB) Downloaded 2206 times
User avatar
Cyril
House Steiner Warrant Officer First Class
House Steiner Warrant Officer First Class
Posts: 357
Joined: Tue Jan 22, 2008 4:04 pm
Location: Richmond, VA

Re: View Distance Variable

Post by Cyril »

uuummm i didnt say i was angry at him,,,i have no idea why i would be.

i was saying that he knows more about mech 2 than anyone i think we have ever talked with,,,and what is infurating, is that information cant be downloaded yet, that we can't have acceess to it. i'm not saying he does anythuing negative,,no one is paying him to teach us:P

i'm glad for all the contrabutions repo has made. so if you got the oppisite idea of that,,then i mistransladed from my barin to my fingers:)


but i sure would like to have a copy of the netmech files he has stored in his head
Image
Image
User avatar
Sir MMPD Radick
Clan Nova Captain
Clan Nova Captain
Posts: 1625
Joined: Tue Jan 22, 2008 10:07 am

Re: View Distance Variable

Post by Sir MMPD Radick »

It does work on DOS as well Skyfaller; I am not sure why, because it is very similar to what i tried last night, but your patch hit all 73 occurances that I had and patched it perfectly.
I would note, as I said on Mektek: you may want to consider a slightly smaller value, there is a noticeable framerate decrease which might become painfully obvious in a comp that is say 1.7 ghz or something.

so, awesome development I would say!
Before
Before
MW20000.GIF (29.65 KiB) Viewed 18059 times
After
After
MW20000.GIF (29.67 KiB) Viewed 18062 times
James 3:5-10: My Reminder
And the tongue is a fire, a world of iniquity: so is the tongue among our members, that it defileth the whole body. Out of the same mouth proceedeth blessing and cursing. My brethren, these things ought not so to be.
User avatar
npsbre
House Steiner Sergeant Major
House Steiner Sergeant Major
Posts: 212
Joined: Wed Jan 30, 2008 8:44 am

Re: View Distance Variable

Post by npsbre »

Frame rate drops? So does this increase the total # of polys per scene or just removes the artificial "fog"? I.e., does this get rid of the "mountains disappearing" artifact, or the mech models changing LODs?
User avatar
Sir MMPD Radick
Clan Nova Captain
Clan Nova Captain
Posts: 1625
Joined: Tue Jan 22, 2008 10:07 am

Re: View Distance Variable

Post by Sir MMPD Radick »

you know that i wonder, i had not considered that side effect(Speaking about polygon limit).
Basically all this does is get rid of the 'mountains dissappearing' problem.

I think we will need to do some online tests to see if it changed the number of weapons in the air.
Cause if the polygons increased, then there is a chance the limit is much lower than 2.5 racks of lrms.

The patcher appears to work well on the NET.prj as well.
James 3:5-10: My Reminder
And the tongue is a fire, a world of iniquity: so is the tongue among our members, that it defileth the whole body. Out of the same mouth proceedeth blessing and cursing. My brethren, these things ought not so to be.
-Myg
House Steiner Sergeant Major
House Steiner Sergeant Major
Posts: 220
Joined: Wed Jan 23, 2008 7:50 pm

Re: View Distance Variable

Post by -Myg »

Thanks for testing and showing the results of this MMPD.

To be honest, I actually knew about this and tried to implement it, but didnt see any difference (suppose I did it wrong). I found out while looking into why the training missions had such a far LOS for the terrain.

From my experience with mech2; it shouldn't increase the number of polygons allowed for all non-map/terrain objects, only allow you to see without the "fog".

I highly recommend someone seeing how the 3dfx version look with this patch.
User avatar
Skyfaller
Clan 1st MechWarrior
Clan 1st MechWarrior
Posts: 1017
Joined: Sat Apr 12, 2008 2:58 am
Location: Germany
Contact:

Re: View Distance Variable

Post by Skyfaller »

The fog is left in place. This is essential for missions such as Wolf's "Aquiline Fire", where you search for a dropship on a world with many crystals, because the dropship is hard to find in the fog (tested in Titanium Trilogy). My previous statement "the missions I tested *no longer have a far clipping plane*" is a bit misleading, because the far plane is still there, it's just considerably farther away. AFAIK, most MechWarrior II editions apparently use "Painter's algorithm", which uses the far clipping plane to reduce the number of polygons to render, but I think the 3DFX versions use z-buffering, and that algorithm requires a far clipping plane. It is possible that a large value for the far clipping plane would increase z-fighting with the z-buffering algorithm, which is a rendering error that allows you to see objects through normally opaque objects. So I agree, testing the patch with a 3DFX version would be worthwhile. I don't have any of the 3DFX versions, but I can test Titanium on a Diamond Monster in the weekend.

My preliminary tests with DOS indicate that it works there as well, allowing you to see and target mechs and objects well over a kilometer away that previously popped into sight at 500m, for example.

I've added the newer version of the patch which allows you to configure the distance of the far clipping plane. The previous version didn't run on my XP SP2 install, but this one should. Please post your experiences with it.

The thread at
http://www.mektek.net/forums/index.php? ... 9142&st=20
has a number of interesting screenshots, but aside from MMPD and me things have become pretty calm there after the "Legacy MechWarrior" label they put on us.
Attachments
FarPatcher.zip
Far clipping plane patcher with configurable distance
(6.06 KiB) Downloaded 3288 times
User avatar
Sir MMPD Radick
Clan Nova Captain
Clan Nova Captain
Posts: 1625
Joined: Tue Jan 22, 2008 10:07 am

Re: View Distance Variable

Post by Sir MMPD Radick »

Yah, I was kinda dissapointed to see that they did that as well, it really killed the section off.
The other Support section is getting more hits now, but its all mech3 stuff.

I will test the Mech2 3dfx version I have tommarow on my Voodoo 5 on 98 and let ya know the results.
I suspect it will be the same, but much laggier on an older machine, so it will definitely be a good test to see if i was right about the frames on an older machine. (It truly is sad that new AGP slots cannot take Voodoo 5')

btw Cyril, the **** were wild cards.
James 3:5-10: My Reminder
And the tongue is a fire, a world of iniquity: so is the tongue among our members, that it defileth the whole body. Out of the same mouth proceedeth blessing and cursing. My brethren, these things ought not so to be.
Post Reply