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       

Significantly improved controls in Wolf4SDL w/Tutorial
Page 1 of 2 Goto page 1, 2  Next
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
Matthew
DieHard Officer
DieHard Officer


Joined: 02 Jul 2007
Last Visit: 11 Nov 2019

Topics: 102
Posts: 515

usa.gif

PostPosted: Wed Mar 25, 2009 2:37 pm
   Subject: Significantly improved controls in Wolf4SDL w/Tutorial
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Next PostGoto Bottom of Posts

I have now released a build of Wolf4SDL that has (among a few other things) the controls system significantly improved.

In it, you can use the W, S, A, and D keys to move forward, backward, left, and right respectively, and the mouse is used only to turn or strafe -- the vertical mouse axis is ignored during gameplay. When you move using W, S, A, and D, running is default, but keep in mind that you can still use them to walk by holding down SHIFT.

This allows you to use the W, S, A, D, and spacebar keys along with the mouse to move, turn, shoot, and use things just like in modern video games. I ONLY recommend using the mouse for turning, NOT strafing -- use A and D to strafe.

I've also increased the range of available mouse sensitivity settings, with a new default setting.

Note that if you don't like the new controls, you can still use the arrow keys like in the original Wolf3D.

Please try this out and tell me what you think of it. I found that although at first I didn't like the new controls as much as the original controls, now that I've gotten used to them (and perfected them) I like them far better than the original controls. They allow you to turn while strafing, run by default, and give you far more flexible control over movement and aiming than the original controls.

Here is the URL:

https://www.dropbox.com/s/qe6ufrmfmxtyr56/Wolf4SDL.zip


Last edited by Matthew on Mon Aug 19, 2013 9:41 pm; edited 1 time in total
TexZK
DieHard SS
DieHard SS


Joined: 07 Feb 2004
Last Visit: 19 Oct 2016

Topics: 19
Posts: 369
Location: Northern Italy
italy.gif

PostPosted: Thu Mar 26, 2009 4:37 pm
   Subject: Re: Significantly improved controls in Wolf4SDL w/Tutorial
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Niiice!

Let me point out a few things which should be modified.

Mouse movements shouldn't be clipped on the X axis, because this heavily affects sensitivity. This always happened in vanilla Wolf3D, and has never been tweaked. In "wl_play.cpp" edit PollControls() like this:
::: CODE :::
//
// bound movement to a maximum
//
    max = 100 * tics;
    min = -max;
/*    if (controlx > max)
        controlx = max;
    else if (controlx < min)
        controlx = min;
*/

    if (controly > max)
        controly = max;
    else if (controly < min)
        controly = min;

This will make mouse movements far better Wink


Another thing: X axis movements, so I mean strafing, shouldn't be faster when running. Player movements are too fast when strafing, so try to edit PollKeyboardMove() like this:
::: CODE :::
/*
===================
=
= PollKeyboardMove
=
===================
*/

void PollKeyboardMove (void)
{
    int delta = BASEMOVE * tics;

    if (Keyboard[dirscan[di_west]])
        controlx -= delta;
    if (Keyboard[dirscan[di_east]])
        controlx += delta;
   
    if (buttonstate[bt_run])
        delta = RUNMOVE * tics;
   
    if (Keyboard[dirscan[di_north]])
        controly -= delta;
    if (Keyboard[dirscan[di_south]])
        controly += delta;
}

Do the same for joystick movements.


I know, your implementation is surely different from this, but you can recognise what must be changed Cool
Matthew
DieHard Officer
DieHard Officer


Joined: 02 Jul 2007
Last Visit: 11 Nov 2019

Topics: 102
Posts: 515

usa.gif

PostPosted: Thu Mar 26, 2009 10:07 pm
   Subject: Significantly improved controls in Wolf4SDL
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

I've made the changes TexZK recommended and updated the file on my site, so download it again.

I will post a tutorial ASAP.

EDIT: I've now posted the tutorial. While I was creating the tutorial, I discovered and fixed a few bugs in the demo code, so if you downloaded it before reading this, please download it again.
Matthew
DieHard Officer
DieHard Officer


Joined: 02 Jul 2007
Last Visit: 11 Nov 2019

Topics: 102
Posts: 515

usa.gif

PostPosted: Fri Mar 27, 2009 12:14 am
   Subject: [Tutorial] Significantly improving the controls of Wolf4SDL
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

This tutorial was last updated on Monday, September 8, 2014.

In this tutorial, you will add the ability to use the directional keys (W, S, A, and D) to move forward, move backward, strafe left, and strafe right respectively. You will also make it so that during gameplay the game completely ignores the Y axis of the mouse and only uses the X axis to turn. The name of the "Run" control will be changed to "Walk". W and S will run by default, but will walk when "Walk" is down.

This will allow you to use the keyboard and mouse to play just like in modern first-person shooters. You will be able to turn while strafing and have far more flexible control over moving and aiming than in the original Wolf3D.

This is accomplished by changing Wolf3D's control system so that it has, instead of two, three control axis: "controlx", which controls side-to-side movement, "controly", which controls forward and backward movement, and "controlh", which controls horizontal turning (remember, there is no vertical turning in Wolf3D).

This will also make it so that, rather than the TAB key, the Q key or the Z key is used to display the status bar in full-screen mode. (The E and X keys are reserved for weapon reloading.)

Before doing this tutorial, you will first need to do the following tutorial:

Fixing Wolf4SDL's mouse input



Do the following:

1. In "wl_play.cpp" and "wl_def.h", change the definition

::: CODE :::
unsigned tics


to

::: CODE :::
int tics


Although it may seem unnecessary for "tics" to be signed, due to some optimizations that this code makes, it IS necessary. Don't worry -- remember, in Wolf4SDL it's 32-bit.

2. In "wl_act2.cpp", change all instances of

::: CODE :::
(unsigned) US_RndT()


to

::: CODE :::
(int) US_RndT()


3. Throughout the entire source code, change all instances of

::: CODE :::
bt_run


to

::: CODE :::
bt_walk


In Microsoft Visual C++, this is extremely easy to do, you can use the "Replace in Files" feature with it set to "Entire Solution".

4. In "wl_def.h", make the following additions:

::: CODE :::
#define BASEMOVE                35
#define BASEMOVEDIAG         24

#define RUNMOVE                 70
#define RUNMOVEDIAG            49
#define BASETURN                35
#define RUNTURN                 70

#define JOYSCALE                2

extern  byte            tilemap[MAPSIZE][MAPSIZE];      // wall values only
extern  byte            spotvis[MAPSIZE][MAPSIZE];
extern  objtype         *actorat[MAPSIZE][MAPSIZE];

extern  objtype         *player;

extern  int            tics;
extern  int             viewsize;

extern  int             lastgamemusicoffset;

//
// current user input
//
extern  int         controlx,controly,controlh;              // range from -100 to 100
extern  boolean     buttonstate[NUMBUTTONS];


5. In "foreign.h", make the following change:

::: CODE :::
#define   STR_MOUSEADJ   "Adjust Mouse Sensitivity"
#define STR_SLOW       "Slow"
#define STR_FAST       "Fast"

#define   STR_CWALK       "Walk"
#define STR_COPEN      "Open"
#define STR_CFIRE      "Fire"
#define STR_CSTRAFE      "Strafe"


6. In "wl_menu.cpp", use the "replace" tool to change all instances of

::: CODE :::
STR_RUN


to

::: CODE :::
STR_CWALK


7. In "wl_play.cpp", make the following changes:

::: CODE :::
//
// replacing refresh manager
//
int tics;

//
// control info
//
boolean mouseenabled, joystickenabled;
int dirscan[4] = { sc_W, sc_D, sc_S, sc_A };
int buttonscan[NUMBUTTONS] = { sc_Control, sc_Alt, sc_LShift, sc_Space, sc_1, sc_2, sc_3, sc_4 };
int buttonmouse[4] = { bt_attack, bt_strafe, bt_use, bt_nobutton };
int buttonjoy[32] = {
#ifdef _arch_dreamcast
    bt_attack, bt_strafe, bt_use, bt_walk, bt_esc, bt_prevweapon, bt_nobutton, bt_nextweapon,
    bt_pause, bt_strafeleft, bt_straferight, bt_nobutton, bt_nobutton, bt_nobutton, bt_nobutton, bt_nobutton,
#else
    bt_attack, bt_strafe, bt_use, bt_walk, bt_strafeleft, bt_straferight, bt_esc, bt_pause,
    bt_prevweapon, bt_nextweapon, bt_nobutton, bt_nobutton, bt_nobutton, bt_nobutton, bt_nobutton, bt_nobutton,
#endif
    bt_nobutton, bt_nobutton, bt_nobutton, bt_nobutton, bt_nobutton, bt_nobutton, bt_nobutton, bt_nobutton,
    bt_nobutton, bt_nobutton, bt_nobutton, bt_nobutton, bt_nobutton, bt_nobutton, bt_nobutton, bt_nobutton
};

int viewsize;

boolean buttonheld[NUMBUTTONS];

boolean demorecord, demoplayback;
int8_t *demoptr, *lastdemoptr;
memptr demobuffer;

//
// current user input
//
int controlx, controly, controlh;         // range from -100 to 100 per tic
boolean buttonstate[NUMBUTTONS];



#define   MOVE1FORWARD()   controly = buttonstate[bt_walk] ? -BASEMOVE * tics : -RUNMOVE * tics;

#define   MOVE1FORWARDRIGHT()   { \
   controlx = buttonstate[bt_walk] ? BASEMOVEDIAG * tics : RUNMOVEDIAG * tics; \
   controly = -controlx; \
}

#define   MOVE1RIGHT()   controlx = BASEMOVE * tics;

#define   MOVE1BACKWARDRIGHT() { \
   controlx = buttonstate[bt_walk] ? BASEMOVEDIAG * tics : RUNMOVEDIAG * tics; \
   controly = controlx; \
}

#define   MOVE1BACKWARD()   controly = buttonstate[bt_walk] ? BASEMOVE * tics : RUNMOVE * tics;

#define   MOVE1BACKWARDLEFT()   { \
   controly = buttonstate[bt_walk] ? BASEMOVEDIAG * tics : RUNMOVEDIAG * tics; \
   controlx = -controly; \
}

#define   MOVE1LEFT()   controlx = -BASEMOVE * tics;

#define   MOVE1FORWARDLEFT()   { \
   controlx = buttonstate[bt_walk] ? -BASEMOVEDIAG * tics : -RUNMOVEDIAG * tics; \
   controly = controlx; \
}

#define   TURNLEFT()   controlh = Keyboard[sc_RShift] ? -RUNTURN * tics : -BASETURN * tics;

#define   TURNRIGHT()   controlh = Keyboard[sc_RShift] ? RUNTURN * tics : BASETURN * tics;

#define   MOVE2FORWARD()   controly = Keyboard[sc_RShift] ? -RUNMOVE * tics : -BASEMOVE * tics;

#define   MOVE2FORWARDRIGHT()   { \
   controlx = Keyboard[sc_RShift] ? RUNMOVEDIAG * tics : BASEMOVEDIAG * tics; \
   controly = -controlx; \
}

#define   MOVE2RIGHT()   controlx = BASEMOVE * tics;

#define   MOVE2BACKWARDRIGHT()   { \
   controlx = Keyboard[sc_RShift] ? RUNMOVEDIAG * tics : BASEMOVEDIAG * tics; \
   controly = controlx; \
}

#define   MOVE2BACKWARD()   controly = Keyboard[sc_RShift] ? RUNMOVE * tics : BASEMOVE * tics;

#define   MOVE2BACKWARDLEFT()   { \
   controly = Keyboard[sc_RShift] ? RUNMOVEDIAG * tics : BASEMOVEDIAG * tics; \
   controlx = -controly; \
}

#define   MOVE2LEFT()   controlx = -BASEMOVE * tics;

#define   MOVE2FORWARDLEFT()   { \
   controlx = Keyboard[sc_RShift] ? -RUNMOVEDIAG * tics : -BASEMOVEDIAG * tics; \
   controly = controlx; \
}



int lastgamemusicoffset = 0;


8. Still in "wl_play.cpp", make the following changes:

::: CODE :::
/*
===================
=
= PollKeyboardMove
=
===================
*/

void PollKeyboardMove (void)
{
   if (Keyboard[dirscan[di_north]])
      if (Keyboard[dirscan[di_south]])
         if (Keyboard[dirscan[di_west]])
         {
            if (!Keyboard[dirscan[di_east]])
               MOVE1LEFT()
         }
         else
         {
            if (Keyboard[dirscan[di_east]])
               MOVE1RIGHT()
         }
      else
         if (Keyboard[dirscan[di_west]])
            if (Keyboard[dirscan[di_east]])
               MOVE1FORWARD()
            else
               MOVE1FORWARDLEFT()
         else
            if (Keyboard[dirscan[di_east]])
               MOVE1FORWARDRIGHT()
            else
               MOVE1FORWARD()
   else
      if (Keyboard[dirscan[di_south]])
         if (Keyboard[dirscan[di_west]])
            if (Keyboard[dirscan[di_east]])
               MOVE1BACKWARD()
            else
               MOVE1BACKWARDLEFT()
         else
            if (Keyboard[dirscan[di_east]])
               MOVE1BACKWARDRIGHT()
            else
               MOVE1BACKWARD()
      else
         if (Keyboard[dirscan[di_west]])
         {
            if (!Keyboard[dirscan[di_east]])
               MOVE1LEFT()
         }
         else
            if (Keyboard[dirscan[di_east]])
               MOVE1RIGHT()
            else
               if (buttonstate[bt_strafe])
               {
                  if (Keyboard[sc_UpArrow])
                     if (Keyboard[sc_DownArrow])
                        if (Keyboard[sc_LeftArrow])
                        {
                           if (!Keyboard[sc_RightArrow])
                              MOVE2LEFT()
                        }
                        else
                        {
                           if (Keyboard[sc_RightArrow])
                              MOVE2RIGHT()
                        }
                     else
                        if (Keyboard[sc_LeftArrow])
                        {
                           if (Keyboard[sc_RightArrow])
                              MOVE2FORWARD()
                           else
                              MOVE2FORWARDLEFT()
                        }
                        else
                        {
                           if (Keyboard[sc_RightArrow])
                              MOVE2FORWARDRIGHT()
                           else
                              MOVE2FORWARD()
                        }
                  else
                     if (Keyboard[sc_DownArrow])
                        if (Keyboard[sc_LeftArrow])
                           if (Keyboard[sc_RightArrow])
                              MOVE2BACKWARD()
                           else
                              MOVE2BACKWARDLEFT()
                        else
                           if (Keyboard[sc_RightArrow])
                              MOVE2BACKWARDRIGHT()
                           else
                              MOVE2BACKWARD()
                     else
                        if (Keyboard[sc_LeftArrow])
                        {
                           if (!Keyboard[sc_RightArrow])
                              MOVE2LEFT()
                        }
                        else
                        {
                           if (Keyboard[sc_RightArrow])
                              MOVE2RIGHT()
                        }
               }
               else
               {
                  if (Keyboard[sc_LeftArrow])
                  {
                     if (!Keyboard[sc_RightArrow])
                        TURNLEFT()
                  }
                  if (Keyboard[sc_RightArrow])
                     TURNRIGHT()
                  if (Keyboard[sc_UpArrow])
                  {
                     if (!Keyboard[sc_DownArrow])
                        MOVE2FORWARD()
                  }
                  else
                     if (Keyboard[sc_DownArrow])
                        MOVE2BACKWARD();
               }
}


/*
===================
=
= PollMouseMove
=
===================
*/

void PollMouseMove (void)
{
    int mousemove;

    SDL_GetRelativeMouseState(&mousemove, NULL);

    controlh += (mousemove << 4) / (13 - mouseadjustment);
}


/*
===================
=
= PollJoystickMove
=
===================
*/

void PollJoystickMove (void)
{
    int joyx, joyy;

    IN_GetJoyDelta (&joyx, &joyy);

   if (buttonstate[bt_strafe])
   {
      if (joyy < -64)
         if (joyx < -64)
            MOVE2FORWARDLEFT()
         else if (joyx > 64)
            MOVE2FORWARDRIGHT()
         else
            MOVE2FORWARD()
      else
         if (joyy > 64)
            if (joyx < -64)
               MOVE2BACKWARDLEFT()
            else if (joyx > 64)
               MOVE2BACKWARDRIGHT()
            else
               MOVE2BACKWARD()
   }
   else
   {
      if (joyx < -64)
         TURNLEFT()
      else if (joyx > 64)
         TURNRIGHT()
      if (joyy < -64)
         MOVE2FORWARD()
      else if (joyy > 64)
         MOVE2BACKWARD()
   }
}

/*
===================
=
= PollControls
=
= Gets user or demo input, call once each frame
=
= controlx              set between -100 and 100 per tic
= controly
= controlh
= buttonheld[]  the state of the buttons LAST frame
= buttonstate[] the state of the buttons THIS frame
=
===================
*/

void PollControls (void)
{
    int max, min, rmax, rmin, i;
    byte buttonbits;

    IN_ProcessEvents();

//
// get timing info for last frame
//
    if (demoplayback || demorecord)   // demo recording and playback needs to be constant
    {
        // wait up to DEMOTICS Wolf tics
        uint32_t curtime = SDL_GetTicks();
        lasttimecount += DEMOTICS;
        int32_t timediff = (lasttimecount * 100) / 7 - curtime;
        if(timediff > 0)
            SDL_Delay(timediff);

        if(timediff < -2 * DEMOTICS)       // more than 2-times DEMOTICS behind?
            lasttimecount = (curtime * 7) / 100;    // yes, set to current timecount

        tics = DEMOTICS;
    }
    else
        CalcTics ();

    controlx = 0;
    controly = 0;
   controlh = 0;
    memcpy (buttonheld, buttonstate, sizeof (buttonstate));
    memset (buttonstate, 0, sizeof (buttonstate));

    if (demoplayback)
    {
        //
        // read commands from demo buffer
        //
        buttonbits = *demoptr++;
        for (i = 0; i < NUMBUTTONS; i++)
        {
            buttonstate[i] = buttonbits & 1;
            buttonbits >>= 1;
        }

        controlx = *demoptr++;
        controly = *demoptr++;
      controlh = *demoptr++;

        if (demoptr == lastdemoptr)
            playstate = ex_completed;   // demo is done

        controlx *= (int)tics;
        controly *= (int)tics;
      controlh *= (int)tics;

        return;
    }


//
// get button states
//
    PollKeyboardButtons ();

    if (mouseenabled && IN_IsInputGrabbed())
        PollMouseButtons ();

    if (joystickenabled)
        PollJoystickButtons ();

//
// get movements
//
    PollKeyboardMove ();

    if (mouseenabled && IN_IsInputGrabbed())
        PollMouseMove ();

    if (joystickenabled)
        PollJoystickMove ();

//
// bound movement to a maximum
//
    max = 100 * tics;
    min = -max;
   rmax = max << 4;
   rmin = -rmax;
   if (controlh > rmax)
      controlh = rmax;
   else if (controlh < rmin)
      controlh = rmin;

    if (controlx > max)
        controlx = max;
    else if (controlx < min)
        controlx = min;

    if (controly > max)
        controly = max;
    else if (controly < min)
        controly = min;

    if (demorecord)
    {
        //
        // save info out to demo buffer
        //
        controlx /= (int)tics;
        controly /= (int)tics;
      controlh /= (int)tics;

        buttonbits = 0;

        // TODO: Support 32-bit buttonbits
        for (i = NUMBUTTONS - 1; i >= 0; i--)
        {
            buttonbits <<= 1;
            if (buttonstate[i])
                buttonbits |= 1;
        }

        *demoptr++ = buttonbits;
        *demoptr++ = controlx;
        *demoptr++ = controly;
      *demoptr++ = controlh;

        if (demoptr >= lastdemoptr - 8)
            playstate = ex_completed;
        else
        {
            controlx *= (int)tics;
            controly *= (int)tics;
         controlh *= (int)tics;
        }
    }
}


9. In "wl_agent.cpp", make the following changes:

::: CODE :::
/*
=======================
=
= ControlMovement
=
= Takes controlx,controly,controlh and buttonstate[bt_strafe]
=
= Changes the player's angle and position
=
= There is an angle hack because when going 70 fps, the roundoff becomes
= significant
=
=======================
*/

void ControlMovement (objtype *ob)
{
    int32_t oldx,oldy;
    int     angle;
    int     angleunits;

    thrustspeed = 0;

    oldx = player->x;
    oldy = player->y;

    //
    // turn
    //
    anglefrac += controlh;
    angleunits = anglefrac/ANGLESCALE;
    anglefrac -= angleunits*ANGLESCALE;
    ob->angle -= angleunits;

    if (ob->angle >= ANGLES)
        ob->angle -= ANGLES;
    if (ob->angle < 0)
        ob->angle += ANGLES;

    //
    // forward/backwards move
    //
    if (controly < 0)
    {
        Thrust (ob->angle,-controly*MOVESCALE); // move forwards
    }
    else if (controly > 0)
    {
        angle = ob->angle + ANGLES/2;
        if (angle >= ANGLES)
            angle -= ANGLES;
        Thrust (angle,controly*BACKMOVESCALE);          // move backwards
    }

    if (gamestate.victoryflag)              // watching the BJ actor
        return;

    //
    // strafing
    //
    //
    if (controlx > 0)
    {
        angle = ob->angle - ANGLES/4;
        if (angle < 0)
            angle += ANGLES;
        Thrust (angle,controlx*MOVESCALE);      // move to left
    }
    else if (controlx < 0)
    {
        angle = ob->angle + ANGLES/4;
        if (angle >= ANGLES)
            angle -= ANGLES;
        Thrust (angle,-controlx*MOVESCALE);     // move to right
    }

}


10. In "wl_draw.cpp", make the following change:

::: CODE :::
    if(Keyboard[sc_Q] && viewsize == 21)
        ShowActStatus();


That's all!

Note: The first time that you run Wolf4SDL after this, make sure that the "config" file is missing so that Wolf4SDL generates a new, proper version of it. Also, take note that although I have attempted to make the necessary changes to make this work with demos, it will not work with old demos and since I am not a big fan of demos, I have not yet tested it to see if it works with new demos.


Last edited by Matthew on Mon Sep 08, 2014 7:28 pm; edited 13 times in total
TexZK
DieHard SS
DieHard SS


Joined: 07 Feb 2004
Last Visit: 19 Oct 2016

Topics: 19
Posts: 369
Location: Northern Italy
italy.gif

PostPosted: Fri Mar 27, 2009 5:57 pm
   Subject: Re: Significantly improved controls in Wolf4SDL w/Tutorial
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Wow, now it's MUCH better than the vanilla system, at least for those who play with mouse+keyboard.

There's only one thing to be improved. Controls are now immediate, and it feels a bit creepy to have the player move instantly when the key is pressed. An RC (1st order) filter should be applied in order to make accelerations smoother. I'm already writing a specific class to make it easy to implement, by using fixed numbers (maybe) or floats/doubles (easier, maybe faster).

Oh, and obviously the user must be allowed to use joystick or only the keyboard... This movement system isn not compatible with Dreamcast or GP2X controllers, you can imagine why.
Matthew
DieHard Officer
DieHard Officer


Joined: 02 Jul 2007
Last Visit: 11 Nov 2019

Topics: 102
Posts: 515

usa.gif

PostPosted: Fri Mar 27, 2009 8:42 pm
   Subject: Significantly improved controls in Wolf4SDL
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Another interesting thing to add would be the ability to use the third axis of a 3-axis game controller to strafe. I happen to own an old 3-axis joystick (the third axis is twisting the stick), so I would be able to test that.

Do the SDL libraries allow programs to read the third axis from a game controller?
Matthew
DieHard Officer
DieHard Officer


Joined: 02 Jul 2007
Last Visit: 11 Nov 2019

Topics: 102
Posts: 515

usa.gif

PostPosted: Thu Apr 23, 2009 11:05 pm
   Subject: Significantly improved controls in Wolf4SDL
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

I've just made a major update to this tutorial, and updated the EXE on my site (see the first post in this thread), so download it again. As it turned out, actually, contrary to what TexZK said, there WERE other things to be improved. Among other things, I have fixed an issue in the original Wolf3D that I haven't ever seen anybody mention: Diagonal movement is faster than straight movement.

I have made it so that diagonal movement is the same speed as straight movement, and at a 45 angle. (Actually, the diagonal speed is very, very slightly slower than straight movement, but that's only because of integer truncation.)

If you already did my tutorial, the steps that you have to do over again are 1, 3, 7, 9, and 10.

Note: With this update, I had to completely rewrite the "PollKeyboardMove" code, and I did not re-add support for the original Wolf3D's keyboard controls. If I hear demand to do so, I will, but I think that the new controls are now so good that most Wolf3D players at least won't mind the switch.

Sometimes being forced to make a change is a good thing. Keep in mind that although at first I didn't like the new controls as much as the originals, now I like the new controls so much I don't even want to use the old controls anymore.
TexZK
DieHard SS
DieHard SS


Joined: 07 Feb 2004
Last Visit: 19 Oct 2016

Topics: 19
Posts: 369
Location: Northern Italy
italy.gif

PostPosted: Fri Apr 24, 2009 7:41 am
   Subject: Re: Significantly improved controls in Wolf4SDL w/Tutorial
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Good news mate! But, where is the code? Confused
BrotherTank
Forum Administrator
<B>Forum Administrator</B>


Joined: 01 Mar 2003
Last Visit: 13 Sep 2017

Topics: 153
Posts: 2248
Location: Ontario
canada.gif

PostPosted: Fri Apr 24, 2009 4:00 pm
   Subject: Re: Significantly improved controls in Wolf4SDL w/Tutorial
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

I don't know Tek... I looked and couldn't see any tutorial either... lol... But for what it is worth... here is what I did with the movement polling functions...

It makes the game a little faster and a little smoother.. While it doesn't fix or bind any specific keys to the movement, it does make a noticable difference when you play the game... This new replacement routine below replaces all the mouse, joystick, and keyboard polling routines (there are 6 different ones)... I think Tricob is using a variation of this from my old Bunker source.. and he also noticed how things were much smoother... and actually faster...

::: CODE :::

/* =============================================
                         USER CONTROL
   ============================================== */

/* ====================================================
= PollControls - Gets user or demo input, call once each frame
=
= controlx      set between -100 and 100 per tic
= controly
= buttonheld[]  the state of the buttons LAST frame
= buttonstate[] the state of the buttons THIS frame
====================================================== */
void PollControls (void)
{
  int max, min, i, val, buttons = IN_MouseButtons ();
  int delta = buttonstate[bt_run] ? RUNMOVE * tics : BASEMOVE * tics;
  int mousexmove, mouseymove, joyx, joyy;
  byte buttonbits;

  IN_ProcessEvents();
  // get timing info for last frame
  if (demoplayback || demorecord)   // demo recording and playback needs to be constant
  { // wait up to DEMOTICS Wolf tics
    uint32_t curtime = SDL_GetTicks();
    lasttimecount += DEMOTICS;
    int32_t timediff = (lasttimecount * 100) / 7 - curtime;
    if(timediff > 0) SDL_Delay(timediff);
    if(timediff < -2 * DEMOTICS)       // more than 2-times DEMOTICS behind?
      lasttimecount = (curtime * 7) / 100;    // yes, set to current timecount
    tics = DEMOTICS;
  }
  else CalcTics ();
  controlx = 0;
  controly = 0;
  memcpy (buttonheld, buttonstate, sizeof (buttonstate));
  memset (buttonstate, 0, sizeof (buttonstate));
  if (demoplayback)
  { // read commands from demo buffer
    buttonbits = *demoptr++;
    for (i = 0; i < NUMBUTTONS; i++)
    {
      buttonstate[i] = buttonbits & 1; buttonbits >>= 1;
    }
    controlx = *demoptr++;
    controly = *demoptr++;
    if (demoptr == lastdemoptr) playstate = ex_completed;   // demo is done
    controlx *= (int) tics;
    controly *= (int) tics;
    return;
  }
// get movement control & button states
  // Keyboard
  for (i = 0; i < NUMBUTTONS; i++) if (Keyboard[buttonscan[i]]) buttonstate[i] = true;
  if (Keyboard[dirscan[di_north]])  controly -= delta;
  if (Keyboard[dirscan[di_south]])  controly += delta;
  if (Keyboard[dirscan[di_west]])   controlx -= delta;
  if (Keyboard[dirscan[di_east]])   controlx += delta;
  if (mouseenabled && IN_IsInputGrabbed())   // Mouse
  {
    if (buttons & 1) buttonstate[buttonmouse[0]] = true;
    if (buttons & 2) buttonstate[buttonmouse[1]] = true;
    if (buttons & 4) buttonstate[buttonmouse[2]] = true;
    SDL_GetMouseState(&mousexmove, &mouseymove);
    if(IN_IsInputGrabbed()) IN_CenterMouse();
    mousexmove -= screenWidth / 2;
    mouseymove -= screenHeight / 2;
    controlx += mousexmove * 10 / (13 - mouseadjustment);
    controly += mouseymove * 20 / (13 - mouseadjustment);
  }
  if (joystickenabled)   // Joystick
  {
    buttons = IN_JoyButtons();
    for(i = 0, val = 1; i < JoyNumButtons; i++, val <<= 1)
    {
      if(buttons & val) buttonstate[buttonjoy[i]] = true;
    }
    IN_GetJoyDelta (&joyx, &joyy);
    if (joyx > 64 || buttonstate[bt_turnright])         controlx += delta;
    else if (joyx < -64  || buttonstate[bt_turnleft])   controlx -= delta;
    if (joyy > 64 || buttonstate[bt_movebackward])      controly += delta;
    else if (joyy < -64 || buttonstate[bt_moveforward]) controly -= delta;
  }
  // bound movement to a maximum
  max = 100 * tics;
  min = -max;
  if (controlx > max)      controlx = max;
  else if (controlx < min) controlx = min;
  if (controly > max)      controly = max;
  else if (controly < min) controly = min;
  if (demorecord)
  { // save info out to demo buffer
    controlx /= (int) tics;
    controly /= (int) tics;
    buttonbits = 0;
    // TODO: Support 32-bit buttonbits
    for (i = NUMBUTTONS - 1; i >= 0; i--)
    {
      buttonbits <<= 1;
      if (buttonstate[i]) buttonbits |= 1;
    }
    *demoptr++ = buttonbits;
    *demoptr++ = controlx;
    *demoptr++ = controly;
    if (demoptr >= lastdemoptr - 8) playstate = ex_completed;
    else
    {
      controlx *= (int) tics;
      controly *= (int) tics;
    }
  }
}


And in the Playloop function, I just removed a few lines and made it look like this:
(This is only part of the routine, but shows the changes that I made....)
::: CODE :::

/*
===================
=
= PlayLoop
=
===================
*/
void PlayLoop (void)
{
#if defined(USE_FEATUREFLAGS) && defined(USE_CLOUDSKY)
  if(GetFeatureFlags() & FF_CLOUDSKY) InitSky();
#endif
#ifdef USE_SHADING
  InitLevelShadeTable();
#endif
  playstate = ex_stillplaying;
  lasttimecount = GetTimeCount();
  frameon = 0;
  anglefrac = 0;
  facecount = 0;
  funnyticount = 0;
  memset (buttonstate, 0, sizeof (buttonstate));
  ClearPaletteShifts ();
  if (MousePresent && IN_IsInputGrabbed()) IN_CenterMouse(); // Clear accumulated mouse movement
  if (demoplayback) IN_StartAck ();
  do
  {
    PollControls ();
    // actor thinking
    madenoise = false;
    MoveDoors ();
    MovePWalls ();
    for (obj = player; obj; obj = obj->next) DoActor (obj);
    UpdatePaletteShifts ();
    ThreeDRefresh ();
    // MAKE FUNNY FACE IF BJ DOESN'T MOVE FOR AWHILE
#ifdef SPEAR
    funnyticount += tics;
    if (funnyticount > 30l * 70)
    {
      funnyticount = 0;
      if(viewsize != 21) StatusDrawFace(BJWAITING1PIC + (US_RndT () & 1));
      facecount = 0;
    }
#endif


Hope that helps...

Greg
BrotherTank


Last edited by BrotherTank on Sat Apr 25, 2009 8:10 pm; edited 1 time in total
Matthew
DieHard Officer
DieHard Officer


Joined: 02 Jul 2007
Last Visit: 11 Nov 2019

Topics: 102
Posts: 515

usa.gif

PostPosted: Fri Apr 24, 2009 10:53 pm
   Subject: Significantly improved controls in Wolf4SDL
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Quote:
Good news mate! But, where is the code?


GEE. I thought I made myself clear. If you look at the very beginning of my post, I said that I UPDATED MY TUTORIAL as well as the compiled EXE on my site. On these forums, there is (apparently) no limit to how long after you post a message you can still edit it, so I just updated the tutorial I had already posted. That tutorial, as I would think you would have noticed by now, is right here in this forum. Here is the URL of it:

Tutorial Merged with This Topic - Up a few Posts - Click here to go to it
If you already did my tutorial, the steps that you have to do over again are 1, 3, 7, 9, and 10.

The code that BrotherTank posted just makes things smoother and faster. My code also MASSIVELY improves the controls themselves.
TexZK
DieHard SS
DieHard SS


Joined: 07 Feb 2004
Last Visit: 19 Oct 2016

Topics: 19
Posts: 369
Location: Northern Italy
italy.gif

PostPosted: Sat Apr 25, 2009 2:54 am
   Subject: Re: Significantly improved controls in Wolf4SDL w/Tutorial
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Aaah ok, I'll dig into it Wink
Thanks Matthew! I'll test the new engine right now.

@ UPDATE: Dammit, I cannot play it here on WinXP, because the player keeps turning right Confused Question I've already had this issue when the Wolf4SDL v1.6 was released, but that was under Ubuntu. I wonder if it's a SDL problem...
Matthew
DieHard Officer
DieHard Officer


Joined: 02 Jul 2007
Last Visit: 11 Nov 2019

Topics: 102
Posts: 515

usa.gif

PostPosted: Sat Apr 25, 2009 1:36 pm
   Subject: Significantly improved controls in Wolf4SDL
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Is it when you've used my tutorial that it doesn't work properly? If so, does it work properly when you use the new version of the EXE on my site? Please tell me as soon as possible, because if it works with my EXE but doesn't work with my tutorial, that means I overlooked something in creating and/or updating the tutorial.
BrotherTank
Forum Administrator
<B>Forum Administrator</B>


Joined: 01 Mar 2003
Last Visit: 13 Sep 2017

Topics: 153
Posts: 2248
Location: Ontario
canada.gif

PostPosted: Sat Apr 25, 2009 8:07 pm
   Subject: Re: Significantly improved controls in Wolf4SDL
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Matthew wrote:
Tek-Zk wrote:
Good news mate! But, where is the code?


GEE. I thought I made myself clear. If you look at the very beginning of my post, I said that I UPDATED MY TUTORIAL as well as the compiled EXE on my site.


Yep.. it did say that you updated your tutorial, but in most cases the tutorial and the questions are posted together... unless the author specifically states that the tutorial is in another thread... In this case, both Tek and I were looking for the tutorial in this thread... Anyhow.. I've merged the two and edited your link in the last post to get everyone to the proper post within this thread...

After looking at your tutorial, I am sort of wondering why you changed the bt_run and all references of it to "bt_altspeed"?? Was there something wrong with the basic Run command?? Or is there something in your tutorial that I am missing... It looks like the strafe tutorial with the bt_run changed and some additional code to change the speed when moving in the strafe mode.. Is that it??

Greg
BrotherTank
Matthew
DieHard Officer
DieHard Officer


Joined: 02 Jul 2007
Last Visit: 11 Nov 2019

Topics: 102
Posts: 515

usa.gif

PostPosted: Sat Apr 25, 2009 11:59 pm
   Subject: Significantly improved controls in Wolf4SDL w/Tutorial
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Quote:
After looking at your tutorial, I am sort of wondering why you changed the bt_run and all references of it to "bt_altspeed"?? Was there something wrong with the basic Run command?? Or is there something in your tutorial that I am missing... It looks like the strafe tutorial with the bt_run changed and some additional code to change the speed when moving in the strafe mode.. Is that it??


Is that it? Heck, no.

In the original Wolf3D, the "run" control was ALWAYS used to make the player RUN when it was held down RATHER than walking. My tutorial adds the ability to use a modern control scheme -- the W, S, A, and D keys along with the mouse. Although the original controls (including the joystick) still walk by default, the new, modern controls run by default -- so with the modern controls, holding down the "run" button makes the player WALK, not run -- since the player runs if that button is NOT held down. Since the "run" control will, depending on which controls are used, EITHER make the player walk OR run, I've changed the name of the control to "Alt. Speed" to avoid confusion.

There are many other things my tutorial does. Most importantly, it adds an ENTIRE NEW CONTROL AXIS. In the original Wolf3D, there were only 2 control axis -- controlx and controly. controly represented forward/backward movement and controlx represented EITHER turning OR strafing -- depending on whether the "strafe modifier" button was pressed. My tutorial changes it so that moving moving left/right, moving forward/backward, and turning are represented by 3 different and distinct control axis -- controlx, controly, and controlh respectively. The movement keys, which this tutorial changes the default of to W, S, A, and D, are now ONLY used for movement, and the mouse is now ONLY used for turning -- the Y axis of the mouse is ignored during gameplay, and the mouse always turns. The range of selectable mouse sensitivities has also been significantly increased, and mouse movement (remember, now only turning) is no longer clipped like it was in the original Wolf3D (for realism, it is clipped, but the range is 16 times what it was in the original Wolf3D).

I highly recommend that you download the EXE I posted and try it out. It has the exact code of my tutorial. In fact, to make my tutorial, I copied code from the source code of that EXE.
TexZK
DieHard SS
DieHard SS


Joined: 07 Feb 2004
Last Visit: 19 Oct 2016

Topics: 19
Posts: 369
Location: Northern Italy
italy.gif

PostPosted: Sun Apr 26, 2009 3:45 am
   Subject: Re: Significantly improved controls in Wolf4SDL w/Tutorial
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Hmmm... it raises an idea in my mind, if using your tutorial for further projects.

I mean, since the Y mouse axis is unused, it could be possible to add a vertical crosshair/weapon movement. With this, we can shoot in the desired spot of the enemy. I know it's almost impossible to have mutilation (it would bring to hundreds sprite textures for a single animation, comprehending all possible cases...), but we can add "localized" damage. For example, shooting at the head will kill it immediately; shooting at legs will make it slower; shooting at arms will lower their accuracy... and so on. Just build a simple "checkboard" damage map for each frame (that's just a C structure) and assign to it the body part ID.


@ Matthew: I'm not able to apply your tutorial, since I might have troubles with SDL communication with my mouse. In fact, as written before, my mouse keeps sending "right move" messages, so than I cannot move comfortably during the game (BJ keeps turning right). I don't actually know if it's a SDL, Logitech driver, or Wolf4SDl problem, since it already happened before under linux (+ vanilla Wolf4SDL v1.6).
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 1:59 ago.

Topics: 167
Posts: 8469
Location: Neo-traditions, Inc.
usa.gif

PostPosted: Tue May 12, 2009 4:42 pm
   Subject: Re: Significantly improved controls in Wolf4SDL w/Tutorial
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

BT - To keep you up-to-date, I *am* still using the update of your Bunker source. Smile
Matthew
DieHard Officer
DieHard Officer


Joined: 02 Jul 2007
Last Visit: 11 Nov 2019

Topics: 102
Posts: 515

usa.gif

PostPosted: Fri May 29, 2009 8:37 pm
   Subject: Significantly improved controls in Wolf4SDL w/Tutorial
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

NOTE: This tutorial has been updated. If you did it before it was updated, do step number 2 again.
Matthew
DieHard Officer
DieHard Officer


Joined: 02 Jul 2007
Last Visit: 11 Nov 2019

Topics: 102
Posts: 515

usa.gif

PostPosted: Mon Jun 01, 2009 8:57 pm
   Subject: Significantly improved controls in Wolf4SDL w/Tutorial
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

NOTE: This tutorial has been updated. If you did it before it was updated, do step number 13 again.
Matthew
DieHard Officer
DieHard Officer


Joined: 02 Jul 2007
Last Visit: 11 Nov 2019

Topics: 102
Posts: 515

usa.gif

PostPosted: Fri Mar 04, 2011 8:06 pm
   Subject: Significantly improved controls in Wolf4SDL w/Tutorial
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

I've now updated this tutorial so that you can still use the original controls as well. If you did it before this update, do step number 8 again.
aardwolf94
Registered User
Registered User


Joined: 17 Oct 2011
Last Visit: 18 Oct 2012

Topics: None
Posts: 5


PostPosted: Tue Oct 18, 2011 5:53 am
   Subject: Significantly improved controls in Wolf4SDL w/Tutorial
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

I downloaded the exe and the config file and the game works fine but the only problem i have is that whenever i save a game and load it, it says that the save file is corrupted and after loading it i see that my health and position in the level is the same as before the game was saved except that i now only have 1 life and all my ammo and weapons are taken away. I did not experience this problem with the original Wolf4SDL.exe. Any help would be greatly appreciated! Sad
insurrectionman
DieHard Mutant
DieHard Mutant


Joined: 07 May 2005
Last Visit: 02 Nov 2019

Topics: 87
Posts: 758
Location: Wisconsin
usa.gif

PostPosted: Tue Oct 18, 2011 6:40 am
   Subject: Re: Significantly improved controls in Wolf4SDL w/Tutorial
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

With the changes made to the controls, the save game is not the same as it used to be. It's reading a few new things, so the save game will not work anymore. There aren't really any work arounds to this. I have brainstormed a "version update" for the config and the save game files, if someone ever updates that, so they don't lose all of their progress.

Either remove the save game, or just overwrite it, it is pretty much a dead file right now.

_________________
I'm back! I missed this community!
Youtube Channel: TreeSapThief

New Site: http://www.treesapthief.com
Twitter: @treesapthief
aardwolf94
Registered User
Registered User


Joined: 17 Oct 2011
Last Visit: 18 Oct 2012

Topics: None
Posts: 5


PostPosted: Tue Oct 18, 2011 7:59 am
   Subject: Re: Significantly improved controls in Wolf4SDL w/Tutorial
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Thanks for the info insurrectionman! Oh well, i guess it's alright as long as i can play the game to my liking. Smile
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 1:59 ago.

Topics: 167
Posts: 8469
Location: Neo-traditions, Inc.
usa.gif

PostPosted: Tue Oct 18, 2011 2:46 pm
   Subject: Re: Significantly improved controls in Wolf4SDL w/Tutorial
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

BTW Aardwolf94, welcome to the DHWs forum. Smile
aardwolf94
Registered User
Registered User


Joined: 17 Oct 2011
Last Visit: 18 Oct 2012

Topics: None
Posts: 5


PostPosted: Wed Oct 19, 2011 5:46 am
   Subject: Re: Significantly improved controls in Wolf4SDL w/Tutorial
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Thanks. Smile
Zach
DieHard Guard
DieHard Guard


Joined: 11 Mar 2003
Last Visit: 17 Mar 2018

Topics: 30
Posts: 257

blank.gif

PostPosted: Fri Jul 25, 2014 6:40 am
   Subject: Re: Significantly improved controls in Wolf4SDL w/Tutorial
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Hey the sample exe is down :C

Would it be very difficult to incorporate these new controls into the Customize controls screen in-game?
Zach
DieHard Guard
DieHard Guard


Joined: 11 Mar 2003
Last Visit: 17 Mar 2018

Topics: 30
Posts: 257

blank.gif

PostPosted: Sun Jul 27, 2014 3:04 pm
   Subject: Re: [Tutorial] Significantly improving the controls of Wolf4
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Matthew wrote:

6. In "wl_menu.cpp", use the "replace" tool to change all instances of

::: CODE :::
STR_RUN


to

::: CODE :::
STR_CALTSPEED


It's actually STR_CRUN, not STR_RUN

This tutorial didn't work for me at all; the exe wouldn't even compile. I followed the directions to the letter but the learner is required to make some guesswork in a few places. I must have guessed incorrectly.
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 1:59 ago.

Topics: 167
Posts: 8469
Location: Neo-traditions, Inc.
usa.gif

PostPosted: Sun Jul 27, 2014 3:20 pm
   Subject: Re: [Tutorial] Significantly improving the controls of Wolf4
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Zach wrote:
This tutorial didn't work for me at all; the exe wouldn't even compile. I followed the directions to the letter but the learner is required to make some guesswork in a few places. I must have guessed incorrectly.
What happens when you try to compile? What messages does the compiler give you?
Zach
DieHard Guard
DieHard Guard


Joined: 11 Mar 2003
Last Visit: 17 Mar 2018

Topics: 30
Posts: 257

blank.gif

PostPosted: Sun Jul 27, 2014 3:22 pm
   Subject: Re: Significantly improved controls in Wolf4SDL w/Tutorial
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Oh thanks Tricob. As soon as I get off work I'll post full details.
Matthew
DieHard Officer
DieHard Officer


Joined: 02 Jul 2007
Last Visit: 11 Nov 2019

Topics: 102
Posts: 515

usa.gif

PostPosted: Tue Sep 09, 2014 5:21 pm
   Subject: Significantly improved controls in Wolf4SDL w/Tutorial
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

I've updated the tutorial.

I've fixed some problems. I've also changed the "Alt. Speed" control to "Walk". That control is now only used to walk, and only modifies the "free look" controls. The "run" control only modifies the original controls; the original controls are hard-coded to their vanilla Wolf3D defaults.



Zach wrote:
This tutorial didn't work for me at all; the exe wouldn't even compile. I followed the directions to the letter but the learner is required to make some guesswork in a few places. I must have guessed incorrectly.


There actually was one step that was completely missing. Maybe I had accidentally removed it; I don't know. In any case, I've now updated the whole tutorial.



If there still are problems, please tell me.
ThunderEnema
DieHard Guard
DieHard Guard


Joined: 05 Jul 2012
Last Visit: 10 Nov 2019

Topics: 4
Posts: 200
Location: Washington
usa.gif

PostPosted: Sat Oct 19, 2019 5:09 pm
   Subject: Re: Significantly improved controls in Wolf4SDL w/Tutorial
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Bottom of Posts

Is there a way that this tutorial could be modified so that there is an option in the menu to activate/deactivate autorun as well as the y-axis movement for the mouse? I recently implemented this tutorial for a project and I like the control scheme but I think having to press shift to walk as well as deactivating the vertical mouse axis would annoy players more accustomed to the classic Wolfenstein control scheme.

_________________
"When I see someone wearing crocs in public, I have all the information I need to know that I will never get along with that person." -Me
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 2 Goto page 1, 2  Next
Jump to:  

Related topics
 Topics   Replies   Views   Last Post 
No new posts Announcement: Wolf4SDL released
Author: Ripper
525 272100 Mon Oct 07, 2019 10:53 pm
Zombie_Plan View latest post
No new posts [help] Adding teleporters in wolf4sdl
Author: Mortimer
35 15627 Fri May 26, 2017 8:19 am
Military View latest post
No new posts [WOLF4SDL Help] Blake Stone Style doors
Author: Haasboy
3 3821 Sun Jul 20, 2008 7:56 am
Haasboy View latest post
No new posts [Wolf4SDL Help] Inserting a second palette (like in SoD)
Author: Andy_Nonymous
10 4439 Mon Jun 02, 2008 3:59 pm
Adam Biser View latest post
No new posts [Help] Problem with Checkweaponchange function (wolf4sdl)
Author: Mortimer
4 4096 Sat May 17, 2008 11:26 am
Mortimer 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