Doom2 v1.92 - no more visplanes and drawsegs overflows

Actually my description of this was incorrect; I was confusing it with a different but similar limit mentioned in Lee's BOOM changelog which was apparently the spanstart array. However, the openings array *is* still too small; unfortunately Lee didn't leave any mention of how to overflow this limit.

However, given that lastopening is incremented by R_StoreWallRange when drawing 2S middle textures, I'm going to guess that you need to have more way too many middle textures in view on the screen at one time to trigger an overflow. Sounds pretty extreme, but Lee seems to have found the problem while playtesting judging by his comments of using the zone allocator to find where the array overflow was occurring.

Part of the problem is that the overflow is highly dependent on the structure of the area. You can see this by the way a roving pointer into the array is being used:
lastopening += rw_stopx - rw_x;

The pointer gets incremented by the distance between where the texture starts and stops drawing; in other words, it's being used similar to a z buffer in modern rendering engines, where the position of data in the array corresponds to the same position on the screen. Unfortunately, it's not large enough. A z buffer has to be the same size as the screen it is used for, and thus a size of SCREENWIDTH*SCREENHEIGHT is the proper and sufficient size.

Share this post


Link to post
Quasar said:

However, given that lastopening is incremented by R_StoreWallRange when drawing 2S middle textures, I'm going to guess that you need to have more way too many middle textures in view on the screen at one time to trigger an overflow.

You are right

Share this post


Link to post

It's time for first beta release of Ultimate Doom Plus.

The list of the increased limits:

limit                         : old    * k   = new
-------------------------------------------------------
visplanes[MAXVISPLANES]       : 128    * 8   = 1024
drawsegs[MAXDRAWSEGS]         : 256    * 8   = 2048
SAVEGAMESIZE                  : 180224 * 16  = 2883584
activeplats[MAXPLATS]         : 30     * 256 = 7680
vissprites[MAXVISSPRITE]      : 128    * 8   = 1024
linespeciallist[MAXLINEANIMS] : 64     * 256 = 16384
openings[MAXOPENINGS]         : 16384  * 4   = 65536
link for download

If you have some troubles and visual glitches with patched EXE than try to undo vissprites limit removal and let me know if it helps.

Share this post


Link to post

wow, great, I was actually thinking about the lack of an Ultimate Doom Plus just a couple days ago :) /me grabs

On a side note, vv is thinking about trying to do the same thing with heretic.exe v1.3 ... do you think you could help him ?

Share this post


Link to post

doom-plus-1.92.2.zip

VinceDSS said:

On a side note, vv is thinking about trying to do the same thing with heretic.exe v1.3 ... do you think you could help him ?

Yes of course. I can do it blindly now. Are there any wads for Heretic that need the fix? Heretic is not a popular game IMO and has no tons of wads as doom.

Share this post


Link to post
entryway said:

Are there any wads for Heretic that need the fix?

I believe Sinful Discharge is one. And Shadowcaster to some extent (savegame problems, and I'd be surprised if there were no places at all where it could VPO).

Also this WIP project, assuming people stick to the design specs.

Share this post


Link to post

VinceDSS, how about Hexen demo-fix like your one for Heretic?
PS Heretic fix is great job, thanks you a lot!

Share this post


Link to post

I am not familiar with hexen but I am sure the same thing is possible, it is up to vv or eventually entryway :)

Share this post


Link to post

Which version of heretic is the latest? I have HERETIC.EXE with size=728031 and md5=8F7B6BA0CA9F78F5F9004A3EC946ACD1

Share this post


Link to post

I can confirm the size is exact, but for the MD5 I never did that.

Btw, to avoid copyright issues with distributing patched EXE with
the DMX sound module, vv created a .COM patcher to patch the EXE on the fly. It allows for a great flexibility with lots of different options. It's very well thought...

You can get it here :

http://www.geocities.com/peroxyd2s/vvhereticb.zip

Share this post


Link to post
VinceDSS said:

I can confirm the size is exact, but for the MD5 I never did that.

In this case I've already removed the limits from this EXE

Share this post


Link to post

then it would be good to send it to vv, so he can compare it to an unmodified EXE and implement it in his patcher !! :)

Share this post


Link to post
VinceDSS said:

then it would be good to send it to vv, so he can compare it to an unmodified EXE and implement it in his patcher !! :)

There is no necessity for it. You can use vv's heretic.com with my hereticp.exe with following command-line:
heretic.com -exe hereticp.exe
or simply rename mine hacked exe to heretic.exe

Can you provide me with really detailed wad from this topic? For testing my patch.

Share this post


Link to post

I could try indeed, but I will need your patched exe :)

Share this post


Link to post
VinceDSS said:

I could try indeed, but I will need your patched exe :)

heretic-plus-1.32.1

But be careful, Heretic was compiled without RANGECHECK definition and hence does not check for some overflows that Doom does. Hence, some overflows will not be aborted with messages like in Doom ("no more visplanes"), but will overwrite the memory. If an overflow is small it may not crash immediately, but can lead to desynch in comparison with heretic-plus

Share this post


Link to post

Heretic: Shadow of the Serpent Riders v1.3+
-------------------------------------------
by vv <vv@ydin.org>
The main features are :
- long tics

I dislike it. It produces incompatible demos.

Share this post


Link to post

entryway said:
It produces incompatible demos.

Why? The demos use the same version number?

Share this post


Link to post
myk said:

Why? The demos use the same version number?

longtic demos are incompatible with vanilla be default, because they write 5-bytes portions for each tic instead of 4-bytes for Doom and 7 instead of 6 for heretic

Share this post


Link to post

Can you provide me with really detailed wad from this topic? For testing my patch


Aha. I wanna test it too but where are wads?

Share this post


Link to post

entryway said:
longtic demos are incompatible with vanilla be default, because they write 5-bytes portions for each tic instead of 4-bytes for Doom and 7 instead of 6 for heretic

The only real problem is that no one has updated any demo analyzing tools to support them, such as LMPC. I thought about contacting Girlich, but by his work (based around official or commercial releases and not community variants) I'm not very sure he'd care to bother. Maybe someone else could pick up the code and build an LMPC variant that supports them. The source is under the GPL, after all.

Share this post


Link to post

The release version of Doom was compiled with RANGECHECK defined? o_O O_o o_O O_o O_O

Share this post


Link to post
Quasar said:

The release version of Doom was compiled with RANGECHECK defined? o_O O_o o_O O_o O_O

Yes of course. Vanilla shows the messages like:
R_DrawPlanes: drawsegs overflow (%i),
R_DrawPlanes: visplane overflow (%i),
etc.

.000464C0 R_DrawPlanes proc near ; CODE XREF: R_RenderPlayerView+2Ep
.000464C0
.000464C0 var_4 = dword ptr -4
.000464C0
.000464C0 push  ebx
.000464C1 push  ecx
.000464C2 push  edx
.000464C3 push  esi
.000464C4 push  edi
.000464C5 push  ebp
.000464C6 sub   esp, 4
.000464C9 mov   edx, ds_p
.000464CF sub   edx, offset drawsegs
.000464D5 mov   ebx, 30h ; '0'
.000464DA mov   eax, edx
.000464DC sar   edx, 1Fh
.000464DF idiv  ebx
.000464E1 cmp   eax, 100h
.000464E6 jle   short loc_464F6
.000464E8 push  eax
.000464E9 push  offset aR_drawplanesDr ; "R_DrawPlanes: drawsegs overflow (%i)"
.000464EE call  I_Error
heretic.exe does not have these phrases inside, but sources have it as well as in Doom

Share this post


Link to post

Very interesting. I just never realized those messages were in RANGECHECK defines ;)

Share this post


Link to post
entryway said:

Can you provide me with really detailed wad ... For testing my patch.

You can try sinful (which I mentioned earlier). I think E3M6 is its biggest map, and it worked OK for me (though I haven't played it all the way through). I also see some 32-unit gaps in it. :)

Share this post


Link to post
myk said:

The only real problem is that no one has updated any demo analyzing tools to support them, such as LMPC. I thought about contacting Girlich, but by his work (based around official or commercial releases and not community variants) I'm not very sure he'd care to bother. Maybe someone else could pick up the code and build an LMPC variant that supports them. The source is under the GPL, after all.


vv talked making LMPC support longtics ... never got anywhere ... he seems to be active lately , maybe it will happen :)

Share this post


Link to post

I want to increase a maximum for mouse sensitivity which I can change from the Options Menu from 10 up to 127. Should I make it in Doom-Plus or release as independent patch? The reason of doubt is not desire to break Doom2-Plus conception.

Share this post


Link to post

entryway said:
The reason of doubt is not desire to break Doom2-Plus conception.

If any usual settings were to still (otherwise) work as usual, and if the only difference were the place of the lever on the screen, it wouldn't really change much. I use sens 75, so I gather the lever would appear a bit to the right of the middle, instead of off the screen (causing the V_DrawPatchDirect error). If I'm not mistaken, you're still basically raising a limitation.

About something that might well not be Doom+ specific, what about the following bugs?

http://doom.wikia.com/wiki/Fast_doors_make_two_closing_sounds
http://doom.wikia.com/wiki/Ouch_face
http://doom.wikia.com/wiki/Picked_up_a_medikit_that_you_REALLY_need%21

Could they be hacked? Maybe making a separate patcher? What binary changes would be required?

Share this post


Link to post

What is with the sector height limit preventing FORGEX.WAD from running in 1.666 and above? Discussed here

myk said:

A fix would be nice, as they shouldn't break compatibility. Especially the second door closing sound, I always found annoying. Hard to believe the developers didn't notice such a silly bug.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now