DieHard Wolfers Forum Index DieHard Wolfers
A Wolfenstein 3d Fan Community


  Hosted by: MCS & Areyep.com - Designed by: BrotherTank

Original Yahoo Forum - Die Hard Archives

AReyeP HomepageAreyep Homepage DieHard Wolfenstein BunkerDieHard Wolfenstein Bunker Log inLog in RegisterRegister Banlist FAQFAQ Search ForumsSearch

  Username:    Password:      Remember me       

Bugs & Fixes in the Original Wolf3d Code
Page 2 of 2 Goto page Previous  1, 2
DieHard Wolfers Forum Index -> Code Crackers View Previous TopicRefresh this PageAdd Topic to your Browser FavoritesSearch ForumsPrint this TopicE-mail TopicGoto Page BottomView Next Topic
Post new topicReply to topic
Author Message
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 10:29 ago.

Topics: 163
Posts: 8120
Location: Neo-traditions, Inc.
usa.gif

PostPosted: Sun Feb 05, 2006 7:01 pm
   Subject: Re: Bugs & Fixes in the Original Wolf3d Code
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Next PostGoto Bottom of Posts

Here's a new bug I keep forgetting to mention: When the player is pointed at an angle, he might shoot directly at an "Actor", and the actor isn't affected by the shot at all, despite taking what appears to be a direct hit. I think this is a gap in the algorithm used to determine how much damage the Actor is taking when he's hit. For example, the code might cover values 59 through 60, and 60.1 to 61, but not any values *in between* 60 and 60.1.

Have you noticed that the "wall gaps" you mentioned always happen when the game is displaying the walls at an angle as well? I can't help but believe that the "gaps" I'm mentioning in both algorithms of this post are somehow connected, or replicate many of the same routines.
Dugtrio17
Code Master
Code Master


Joined: 11 Mar 2003
Last Visit: 03 Oct 2013

Topics: 49
Posts: 903
Location: Seattle
usa.gif

PostPosted: Sun Feb 05, 2006 7:26 pm
   Subject: Re: Bugs & Fixes in the Original Wolf3d Code
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Tricob wrote:
Here's a new bug I keep forgetting to mention: When the player is pointed at an angle, he might shoot directly at an "Actor", and the actor isn't affected by the shot at all, despite taking what appears to be a direct hit. I think this is a gap in the algorithm used to determine how much damage the Actor is taking when he's hit. For example, the code might cover values 59 through 60, and 60.1 to 61, but not any values *in between* 60 and 60.1.

This can happen from US_RndT() (the random number function) being too low or just plain zero. There's no damage being dealt, so nothing happens to the actor. There may be another cause, though, I'm just saying that'll do it.

_________________
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 10:29 ago.

Topics: 163
Posts: 8120
Location: Neo-traditions, Inc.
usa.gif

PostPosted: Mon Feb 06, 2006 7:02 pm
   Subject: Re: Bugs & Fixes in the Original Wolf3d Code
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Dugtrio17 wrote:
Tricob wrote:
Here's a new bug I keep forgetting to mention: When the player is pointed at an angle, he might shoot directly at an "Actor", and the actor isn't affected by the shot at all, despite taking what appears to be a direct hit. I think this is a gap in the algorithm used to determine how much damage the Actor is taking when he's hit. For example, the code might cover values 59 through 60, and 60.1 to 61, but not any values *in between* 60 and 60.1.

This can happen from US_RndT() (the random number function) being too low or just plain zero. There's no damage being dealt, so nothing happens to the actor. There may be another cause, though, I'm just saying that'll do it.

If it happened only with one or two shots, yes - I could agree with you. The problem is, this condition continues until the angle or distance between the player and actor changes. Until that happens, neither the player nor the actor can hurt each other.
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 10:29 ago.

Topics: 163
Posts: 8120
Location: Neo-traditions, Inc.
usa.gif

PostPosted: Fri Feb 17, 2006 7:45 pm
   Subject: Re: Bugs & Fixes in the Original Wolf3d Code
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Another bug discovered ... and fixed! Thanks to Architect for pointing this one out, and Dugtrio17 and Adam Biser for helping to fix the problem. Smile

http://diehardwolfers.areyep.com/viewtopic.php?t=3569
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 10:29 ago.

Topics: 163
Posts: 8120
Location: Neo-traditions, Inc.
usa.gif

PostPosted: Thu Jun 15, 2006 9:20 pm
   Subject: Re: Bugs & Fixes in the Original Wolf3d Code
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

One last bug I'd like to fix - The more smoothly the game is running, the less responsive the game is to the movement of the mouse. Setting the mouse speed to maximum helps a little, but when the framerate is really good, you can - at best - run about 1/4 the speed you can just holding down the Up arrow key. Not good.

Anyone have a suggestion on how to fix this problem?
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 10:29 ago.

Topics: 163
Posts: 8120
Location: Neo-traditions, Inc.
usa.gif

PostPosted: Mon Apr 30, 2007 9:06 pm
   Subject: Re: Bugs & Fixes in the Original Wolf3d Code
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Another bug in the code was revealed involving enemies that "jump" to different squares when going from one phase type to another (The Mecha Hitler becoming Hitler without armor, for instance). MCS kindly gave us a bugfix for this, as well.

http://diehardwolfers.areyep.com/viewtopic.php?t=4434
Codetech84
Code Master
Code Master


Joined: 12 Mar 2003
Last Visit: 01 Apr 2018

Topics: 22
Posts: 1283
Location: Rauma - Finland
finland.gif

PostPosted: Tue May 01, 2007 2:38 am
   Subject: Re: [Info] Freeing Up Memory - A Must Read!
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Chris wrote:
Ah, I changed it's max to 128 (as it didn't go above 99 originally).


Actually, momentarily it'll go up to 106 = 98 + 8 and in spear of destiny 123 = 98 + 25 when you're picking up ammo.

_________________
Click here to visit KFH Games website!
*UPDATED* Spear of Destiny Reloaded
KFH Games on Facebook
Matthew
DieHard SS
DieHard SS


Joined: 02 Jul 2007
Last Visit: 24 Dec 2017

Topics: 92
Posts: 466

usa.gif

PostPosted: Sun Jul 15, 2007 12:57 pm
   Subject: Bugs & Fixes in the Original Wolf3d Code
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Another thing that you may have noticed is that although you can open doors while they are closing, you can't close doors while they are opening. In other words, if a door is opening, you have to wait until it is completely open before you can start closing it.

From the way the OperateDoor function is written, it appears that ID Software intended for it to be possible to close doors while they are opening, but because of what is perhaps an oversight it is not possible to do that.

To fix this and make it possible to start closing a door while it is still opening, make the following modification to WL_ACT1.C:

::: CODE :::

void CloseDoor (int door)
{
   int   tilex,tiley,area;
   objtype *check;

//
// don't close on anything solid
//
   tilex = doorobjlist[door].tilex;
   tiley = doorobjlist[door].tiley;

   if (doorposition[door] == 0xffff)
      if (actorat[tilex][tiley])
         return;

   if (player->tilex == tilex && player->tiley == tiley)
      return;
Codetech84
Code Master
Code Master


Joined: 12 Mar 2003
Last Visit: 01 Apr 2018

Topics: 22
Posts: 1283
Location: Rauma - Finland
finland.gif

PostPosted: Sat Aug 18, 2007 3:53 am
   Subject: Re: Bugs & Fixes in the Original Wolf3d Code
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

BrotherTank wrote:
I've run across that bug as well... When the player opens the door, the door must be fully opened before the player or anything may pass through it, while when an enemy opens the door you can pass through it before it has opened completely.


Ok, time for me to present a fix that works atleast for me:

WL_AGENT.C

Add in the code in blue...

::: CODE :::

boolean TryMove (objtype *ob)
{
   int     xl,yl,xh,yh,x,y;
   objtype     *check;
   long     deltax,deltay;
   int       door;



And in the same function a bit lower...

::: CODE :::
//
// check for solid walls
//
   for (y=yl;y<=yh;y++)
      for (x=xl;x<=xh;x++)
      {
         check = actorat[x][y];
         if (check && check<objlist)
            return false;

         door = tilemap[x][y];
         if (door && (door & 0x80))
         {
            if (doorobjlist[door & ~0x80].action == dr_closed
            ||  doorobjlist[door & ~0x80].action == dr_closing
            ||  doorobjlist[door & ~0x80].action == dr_opening)
               return false;
         }

      }


Now the door must be fully open before you can go through it. Ofcourse you would get the same results using doorposition instead of door action, but then this code would need adaptation for Adam's split doors tutorial.

_________________
Click here to visit KFH Games website!
*UPDATED* Spear of Destiny Reloaded
KFH Games on Facebook
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 10:29 ago.

Topics: 163
Posts: 8120
Location: Neo-traditions, Inc.
usa.gif

PostPosted: Sat Aug 18, 2007 7:07 pm
   Subject: Re: Bugs & Fixes in the Original Wolf3d Code
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Good work, 'Tech. I was waiting for a code change like this to be documented. Smile
bitshifter
Can I Play Daddy
Can I Play Daddy


Joined: 16 Dec 2009
Last Visit: 01 Jul 2015

Topics: 7
Posts: 33
Location: Massachusetts
usa.gif

PostPosted: Wed Dec 23, 2009 2:30 am
   Subject: Bugs & Fixes in the Original Wolf3d Code
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Hello
I have found a problem with coding logic in original sources.
In file WL_MAIN.C within procedure InitGame we will find this code...
::: CODE :::

void InitGame (void)
{
   int                     i,x,y;
   unsigned        *blockstart;

   if (MS_CheckParm ("virtual"))
      virtualreality = true;
   else
      virtualreality = false;

   MM_Startup ();                  // so the signon screen can be freed

   SignonScreen ();

   VW_Startup ();
   IN_Startup ();
   PM_Startup ();
   PM_UnlockMainMem ();
   SD_Startup ();
   CA_Startup ();
   US_Startup ();

   ...

Now notice that the SignonScreen procedure sets the VGA into unchained mode
but VW_Startup (which checks if VGA even exists) has not been called yet...

So the fix is to change the following code to...
::: CODE :::

void InitGame (void)
{
   int                     i,x,y;
   unsigned        *blockstart;

   if (MS_CheckParm ("virtual"))
      virtualreality = true;
   else
      virtualreality = false;

   MM_Startup ();                  // so the signon screen can be freed

   VW_Startup();   // Moved it to here

   SignonScreen ();

   ////VW_Startup ();   // Comment this out
   IN_Startup ();
   PM_Startup ();
   PM_UnlockMainMem ();
   SD_Startup ();
   CA_Startup ();
   US_Startup ();

   ...


I guess since VGA is standard on almost every chip these days
that this is why no one has noticed this before...
bitshifter
Can I Play Daddy
Can I Play Daddy


Joined: 16 Dec 2009
Last Visit: 01 Jul 2015

Topics: 7
Posts: 33
Location: Massachusetts
usa.gif

PostPosted: Thu Dec 23, 2010 7:28 am
   Subject: Re: Bugs & Fixes in the Original Wolf3d Code
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Hmm, while playing around with Quit() i found this...
Quit() relies on CA_ being started so it can cache the error\end screens.
But CA_Startup is not called until just before US_Startup...
So any of those Quit() calls outside of US_ will explode.
My solution was to just fixup Quit() so it does not use CA_ anymore.
There are a few ways to fix this, some easy, some not.
Maybe you would like to talk about this?
Matthew
DieHard SS
DieHard SS


Joined: 02 Jul 2007
Last Visit: 24 Dec 2017

Topics: 92
Posts: 466

usa.gif

PostPosted: Mon Oct 10, 2011 1:02 pm
   Subject: Bugs & Fixes in the Original Wolf3d Code
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Quote:
Heh. That brings me back some funny memories. I remember when I first started using Mapedit, I tried testing each object to see what it was (as the objlist for v4.1 was very strange and incomplete). One thing I found particularily interesting was how you could put object 0086-0089 near the enemies, and many of them would transform into slow moving dogs once they got alarmed, or it would make dead guards come back to life so you could get over 100% kill ratio. I didn't understand why those objects worked that way at the time, but I just labeled those 4 objects "Dog Transformers" in Mapedit and used them in various strange mapping ideas ever since. It was cool having slower moving dogs in maps, I always thought of them as the wiser/older dogs or something. I think MCS noticed one of my posts about this or seen the effect inside some of my older levels one day, so he PMed me a link to this page. You probably already know the details, but to me it was quite interesting at the time.


In all the years I've played Wolf3D, I never knew about this until now.

I'll try it soon. Smile
Aryan_Wolf3D
I am Death Incarnate
I am Death Incarnate


Joined: 21 Jul 2011
Last Visit: 25 Apr 2018

Topics: 6
Posts: 178

blank.gif

PostPosted: Wed Apr 05, 2017 8:42 am
   Subject: Re: Bugs & Fixes in the Original Wolf3d Code
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Bottom of Posts

I've just discovered yet another bug in the original Wolf3D... Has anyone ever noticed how, when the screen is red while taking damage, if you go to the menu and start a new game, the statusbar and play borders will flash just before the Get Psyched! screen appears? Well, it seems to be something to do with the palette shifting... If you put this in the NewGame function in WL_MAIN.C:

::: CODE :::

void NewGame (int difficulty,int episode)
{
   memset (&gamestate,0,sizeof(gamestate));
   FinishPaletteShifts ();
   gamestate.difficulty = difficulty;
   gamestate.weapon = gamestate.bestweapon
      = gamestate.chosenweapon = wp_pistol;
   gamestate.health = 100;
   gamestate.ammo = STARTAMMO;
   gamestate.lives = 3;
   gamestate.nextextra = EXTRAPOINTS;
   gamestate.episode=episode;

   startgame = true;
}

That seems to fix it... But there might be drawbacks to this, since I haven't tested it extensively. The bug exists in Wolf4SDL as well, which is actually where I found it first.

_________________
"Way too many #ifdefs in the code!" - John Carmack
Display posts from previous:   
Post new topicReply to topic Time synchronized with the forum server time
DieHard Wolfers Forum Index -> Code Crackers View Previous TopicRefresh this PageAdd Topic to your Browser FavoritesSearch ForumsPrint this TopicE-mail TopicGoto Page TopView Next Topic
Page 2 of 2 Goto page Previous  1, 2
Jump to:  

Related topics
 Topics   Replies   Views   Last Post 
No new posts Sticky: [Info] Help for newbie coders! C++ Tutorial
Author: Dugtrio17
20 8521 Sun Jan 10, 2010 12:26 pm
Fragstein3D View latest post
No new posts [Info] Tricks - Dogs that shoot - Modifying Behaviour
Author: Guest
19 288 Sat Mar 20, 2004 7:31 am
Dugtrio17 View latest post
No new posts [Info] Alarm Sounding in game?? WSJ...??
Author: Guest
7 309 Tue Jun 17, 2003 10:04 pm
Reivax44 View latest post
No new posts [Info] Silent Gun? - Adding a Silencer
Author: Guest
4 194 Fri Apr 18, 2003 8:34 am
BrotherTank View latest post
No new posts [Info] Adding Locked Doors
Author: Guest
3 243 Thu Apr 17, 2003 6:30 am
Ripper View latest post
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
   You cannot delete your posts in this forum
You cannot vote in polls in this forum


Copyright ©2003-2008 DieHard Wolfers
A Modified subBunker Theme by BrotherTank
Powered by phpBB © 2001, 2005 phpBB Group