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       

[Solved] Accurately reproducing holowall trick in Wolf4SDL
Page 1 of 1
DieHard Wolfers Forum Index -> SDL 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
Andy_Nonymous
Moderator
<B>Moderator</B>


Joined: 02 Apr 2003
Last Visit: 17 Feb 2015

Topics: 99
Posts: 589
Location: New Jersey, USA
usa.gif

PostPosted: Sun Sep 23, 2012 5:54 pm
   Subject: [Solved] Accurately reproducing holowall trick in Wolf4SDL
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Next PostGoto Bottom of Posts

I am having problems reproducing the holowall trick in John Bucksnort's Mutantstein III. It is required to work correctly for the player to get the yellow key and to get 100% kills on level 1.

I tried the version 1.5, 1.6, and 1.7 Activision EXEs from ChaosEdit, and only the v1.5 behaves like the original DOS version did. In the others (and in my own compilation) the guards do not come out at you, but *might* be bothered if you shoot right at the area where they reside in the wall.

So I did an svn checkout of revision 214 (v1.5), thinking that I could just do a revision by revision update and see exactly where it breaks. However, the initial revision 214 didn't even work for me.

I suspect the problem may be compiler-related. The older ChaosEdit executables were made with Visual C++ 6.0 IIRC, and I use Dev-C++.

If anyone can think of something else that may be going on (DLL versions?), chime in by all means! Smile

I'd like to submit my source code for others to compile using:

Visual C++ 6.0
code::blocks
Visual C++ Express 2005
Visual C++ Express 2008
Dev-C++ (sanity check! Laughing )
other compilers I may not be aware of

Anyone who would like to help me out, please respond here and let me know which version you would compile for me.

I will be working some strange shifts at work over the next couple of days, so once I am coherent again, I will respond here and post the source code.

Thanks in advance!
Andy


Last edited by Andy_Nonymous on Tue Sep 25, 2012 1:02 pm; edited 1 time in total
Chris
DieHard Wolfer
DieHard Wolfer


Joined: 11 Mar 2003
Last Visit: 17 Dec 2017

Topics: 55
Posts: 2116
Location: Canada
blank.gif

PostPosted: Mon Sep 24, 2012 4:19 pm
   Subject: Re: [Solved] Accurately reproducing holowall trick in Wolf4SDL
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Try this in SpawnStand() of wl_act2.cpp:

::: CODE :::
    map = mapsegs[0]+(tiley<<mapshift)+tilex;
    tile = *map;
    if (tile < AREATILE)
    {
        if (tile == AMBUSHTILE)
        {

            tilemap[tilex][tiley] = 0;
            newobj->flags |= FL_AMBUSH;
        }


        if (*(map+1) >= AREATILE)
            tile = *(map+1);
        if (*(map-mapwidth) >= AREATILE)
            tile = *(map-mapwidth);
        if (*(map+mapwidth) >= AREATILE)
            tile = *(map+mapwidth);
        if ( *(map-1) >= AREATILE)
            tile = *(map-1);

        *map = tile;
        newobj->areanumber = tile-AREATILE;

        // newobj->flags |= FL_AMBUSH;

    }

Or try this in wl_play.cpp:

::: CODE :::
void DoActor (objtype * ob)
{
    void (*think) (objtype *);

    if (ob->areanumber >= NUMAREAS)
        ob->areanumber = player->areanumber;


    if (!ob->active && !areabyplayer[ob->areanumber])
        return;

The first one gives them the room floorcode (more stable). The second one alerts them whenever you shoot (closer to DOS).

If you want to try the first and second ideas together, add this to the bottom of the first also:

::: CODE :::
        *map = tile;
        if (newobj->flags & FL_AMBUSH)

            newobj->areanumber = tile-AREATILE;

        // newobj->flags |= FL_AMBUSH;
    }
Andy_Nonymous
Moderator
<B>Moderator</B>


Joined: 02 Apr 2003
Last Visit: 17 Feb 2015

Topics: 99
Posts: 589
Location: New Jersey, USA
usa.gif

PostPosted: Tue Sep 25, 2012 1:02 pm
   Subject: [help] Accurately reproducing holowall trick in Wolf4SDL
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Chris,

Once again, you come through! Smile Thumbs Up

Both fixes actually did the exact same thing, reproducing the DOS behaviour:

- The guards embedded in the wall always see you and react
- All guards (embedded and behind them) hear you shoot and react

Both fixes together also worked, just to be thorough.

I'll use the first one, since you cite it as being more stable.

Should this be considered as a fix to the base Wolf4SDL source code? IMO it restores an original DOS Wolf3d behaviour (although merely an exploitable bug) that is missing in Wolf4SDL. Currently, the embedded guards do not see you, but the ones behind them respond to your shots, but do not shoot at you. Only if you shoot directly into an embedded guard and kill him can anyone get in or out of the holowall.

I will not persist in investigating the compiler angle mentioned in the first post, though it would have been interesting to know what happened.

Thanks again,
Andy
Chris
DieHard Wolfer
DieHard Wolfer


Joined: 11 Mar 2003
Last Visit: 17 Dec 2017

Topics: 55
Posts: 2116
Location: Canada
blank.gif

PostPosted: Thu Feb 23, 2017 8:00 pm
   Subject: Re: [Solved] Accurately reproducing holowall trick in Wolf4SDL
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Bottom of Posts

I noticed that in longer holowall mazes (like some of the FF maps in Super Upgrades) there was still a few more things to be accounted for so that holowalls with guards and the player inside of them interact like DOS (and without getting stuck) in SDL.

A patch has been added to AlumiuN's repository to address them:
https://github.com/AlumiuN/Wolf4SDL/commit/cb827a4939bd68757db70f392854133f72105434

::: CODE :::
diff -ru Wolf4SDL-old/WL_ACT2.CPP Wolf4SDL-master/WL_ACT2.CPP
--- Wolf4SDL-old/WL_ACT2.CPP   2017-02-22 04:08:37.000000000 -0500
+++ Wolf4SDL-master/WL_ACT2.CPP   2017-02-22 22:25:36.000000000 -0500
@@ -2909,7 +2909,7 @@
 ////////////////////////////////////////////////////////
 void A_MechaSound (objtype *ob)
 {
-    if (areabyplayer[ob->areanumber])
+    if (ob->areanumber >= NUMAREAS || areabyplayer[ob->areanumber])
         PlaySoundLocActor (MECHSTEPSND,ob);
 }
 
@@ -3477,7 +3477,7 @@ void T_Shoot (objtype *ob)
 
     hitchance = 128;
 
-    if (!areabyplayer[ob->areanumber])
+    if (ob->areanumber < NUMAREAS && !areabyplayer[ob->areanumber])
         return;
 
     if (CheckLine (ob))                    // player is not behind a wall
diff -ru Wolf4SDL-old/WL_DRAW.CPP Wolf4SDL-master/WL_DRAW.CPP
--- Wolf4SDL-old/WL_DRAW.CPP   2017-02-22 04:08:37.000000000 -0500
+++ Wolf4SDL-master/WL_DRAW.CPP   2017-02-22 22:25:36.000000000 -0500
@@ -1558,6 +1558,8 @@ void ThreeDRefresh (void)
 #ifdef PLAYDEMOLIKEORIGINAL      // ADDEDFIX 30 - Chris
     if (DEMOCOND_SDL)
 #endif
+    if (!tilemap[player->tilex][player->tiley] ||
+         tilemap[player->tilex][player->tiley] & BIT_DOOR)
     spotvis[player->tilex][player->tiley] = 1;       // Detect all sprites over player fix
 
     vbuf = VL_LockSurface(screenBuffer);
diff -ru Wolf4SDL-old/WL_PLAY.CPP Wolf4SDL-master/WL_PLAY.CPP
--- Wolf4SDL-old/WL_PLAY.CPP   2017-02-22 04:08:37.000000000 -0500
+++ Wolf4SDL-master/WL_PLAY.CPP   2017-02-22 22:25:36.000000000 -0500
@@ -1155,7 +1155,7 @@ void DoActor (objtype * ob)
 {
     void (*think) (objtype *);
 
-    if (!ob->active && !areabyplayer[ob->areanumber])
+    if (!ob->active && ob->areanumber < NUMAREAS && !areabyplayer[ob->areanumber])
         return;
 
     if (!(ob->flags & (FL_NONMARK | FL_NEVERMARK)))
diff -ru Wolf4SDL-old/WL_STATE.CPP Wolf4SDL-master/WL_STATE.CPP
--- Wolf4SDL-old/WL_STATE.CPP   2017-02-22 04:08:37.000000000 -0500
+++ Wolf4SDL-master/WL_STATE.CPP   2017-02-22 22:25:36.000000000 -0500
@@ -732,7 +732,7 @@ void MoveObj (objtype *ob, int32_t move)
     //
     // check to make sure it's not on top of player
     //
-    if (areabyplayer[ob->areanumber])
+    if (ob->areanumber >= NUMAREAS || areabyplayer[ob->areanumber])
     {
         deltax = ob->x - player->x;
         if (deltax < -MINACTORDIST || deltax > MINACTORDIST)
@@ -741,8 +741,8 @@ void MoveObj (objtype *ob, int32_t move)
         if (deltay < -MINACTORDIST || deltay > MINACTORDIST)
             goto moveok;
 
-        if (ob->hidden)          // move closer until he meets CheckLine
-            goto moveok;
+        if (ob->hidden && spotvis[player->tilex][player->tiley])
+            goto moveok;         // move closer until he meets CheckLine
 
         if (ob->obclass == ghostobj || ob->obclass == spectreobj)
             TakeDamage (tics*2,ob);
@@ -1236,7 +1236,7 @@ boolean CheckSight (objtype *ob)
     //
     // don't bother tracing a line if the area isn't connected to the player's
     //
-    if (!areabyplayer[ob->areanumber])
+    if (ob->areanumber < NUMAREAS && !areabyplayer[ob->areanumber])
         return false;
 
     //
@@ -1483,7 +1483,7 @@ boolean SightPlayer (objtype *ob)
     }
     else
     {
-        if (!areabyplayer[ob->areanumber])
+        if (ob->areanumber < NUMAREAS && !areabyplayer[ob->areanumber])
             return false;
 
         if (ob->flags & FL_AMBUSH)

The fix should be in Barry's "Updated SDL EXEs" thread soon now too: http://diehardwolfers.areyep.com/viewtopic.php?t=7740
Display posts from previous:   
Post new topicReply to topic Time synchronized with the forum server time
DieHard Wolfers Forum Index -> SDL Code Crackers View Previous TopicRefresh this PageAdd Topic to your Browser FavoritesSearch ForumsPrint this TopicE-mail TopicGoto Page TopView Next Topic
Page 1 of 1
Jump to:  

Related topics
 Topics   Replies   Views   Last Post 
No new posts Announcement: Wolf4SDL released
Author: Ripper
522 155230 Mon May 22, 2017 2:04 pm
Tricob View latest post
No new posts [help] Adding teleporters in wolf4sdl
Author: Mortimer
35 7362 Fri May 26, 2017 8:19 am
Military View latest post
No new posts [WOLF4SDL Help] Blake Stone Style doors
Author: Haasboy
3 2197 Sun Jul 20, 2008 7:56 am
Haasboy View latest post
No new posts [Help] Problem with Checkweaponchange function (wolf4sdl)
Author: Mortimer
4 2335 Sat May 17, 2008 11:26 am
Mortimer View latest post
No new posts [help] Wolf4sdl's implemented tutorials
Author: Mortimer
6 2482 Tue May 06, 2008 1:15 pm
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