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       

[Code] 64+ Walls Work-Around - Wolf Skevo-Jones
Page 1 of 1
DieHard Wolfers Forum Index -> Code Tutorials 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
WSJ
Guest



Last Visit:





PostPosted: Sun Jul 27, 2003 4:41 pm
   Subject: [Code] 64+ Walls Work-Around - Wolf Skevo-Jones
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Next PostGoto Bottom of Posts

I've found a method of getting around the 64 walls limit. By using this method, you can replace an existing wall texture with another texture which would otherwise not appear in Wolf3d. This is done by placing a special "tile-object" on one of Wolf3d's usable 64 walls.

The tile-object will add a value of 128 to the wall you place it on, thus increasing its texture by 64. For example, say you want to use a 65th wall. You would place the tile-object on a wall with a MAP-ID of 1 and its texture would be replaced with the 65th texture (1 + 64 = 65).

This is NOT the method BrotherTank came up with for Spear Resurrection. It doesn't actually add new walls per se, since the old wall IDs are used. But it does allow for more than 64 wall textures to be used, probably even more than in Spear Resurrection. Think of it as a kind of "patch."

I'd like to thank DarkOne since I got this idea from his "animated walls" tutorial.

Now, there are a few drawbacks which come with this method:

1. You cannot use the new textures with pushwalls.

2. If you have a row of walls with the same texture, you must use the tile on ALL walls which have that texture. However, you don't have to place it on walls of different textures.

3. You'll have to remember which textures replace the old ones. Be careful, if you place the tile on a wall and you don't have a texture that is 64 places further in the VSWAP, you'll get "screen garbage."

There may be other drawbacks since I've not fully explored this feature, but these are the only ones I've found so far.

--------

Aight! Enough babbling. Time to begin!!! Add your new textures using FloEdit. Make sure that you have one which displays a MAP-ID of 65.

In WL_DEF.H, search for "#define ALTELEVATORTILE 107" (no quotes.) Below that, add:

::: CODE :::
#define NEWWALLTILE 100


This is the tile-object we're going to use. In this example, I use an ID of 100. You will need to add this as an object definition in FloEdit or MapEdit in order to use the tile.

In WL_DRAW.C under the HitVertWall function, look for this:

::: CODE :::

      if (tilehit & 0x40)
      {                        // check for adjacent doors
         ytile = yintercept>>TILESHIFT;
         if ( tilemap[xtile-xtilestep][ytile]&0x80 )
            wallpic = DOORWALL+3;
         else
            wallpic = vertwall[tilehit & ~0x40];
      }
      else
         wallpic = vertwall[tilehit];


Modify all that to look like this:

::: CODE :::

      if (tilehit & 0x40)
      {                        // check for adjacent doors
         ytile = yintercept>>TILESHIFT;
         if ( tilemap[xtile-xtilestep][ytile]&0x80 )
            wallpic = DOORWALL+3;
         else
         {
            if (*(mapsegs[1]+farmapylookup[ytile]+xtile) == NEWWALLTILE)
               wallpic = vertwall[tilehit & ~0x40]+128;
            else
               wallpic = vertwall[tilehit & ~0x40];
         }
      }
      else
      {
         if (*(mapsegs[1]+farmapylookup[ytile]+xtile) == NEWWALLTILE)
            wallpic = vertwall[tilehit]+128;
         else
            wallpic = vertwall[tilehit];
      }


Notice that I edited in 2 different places so that it will be possible to use the NEWWALLTILE on walls which are next to doors. Make sure that you type all this in correctly.

Now we have to do the same thing for the HitHorizWall function. Look for this:

::: CODE :::

      if (tilehit & 0x40)
      {                        // check for adjacent doors
         xtile = xintercept>>TILESHIFT;
         if ( tilemap[xtile][ytile-ytilestep]&0x80 )
            wallpic = DOORWALL+2;
         else
            wallpic = horizwall[tilehit & ~0x40];
      }
      else
         wallpic = horizwall[tilehit];


And modify that so it looks like this:

::: CODE :::

      if (tilehit & 0x40)
      {                        // check for adjacent doors
         xtile = xintercept>>TILESHIFT;
         if ( tilemap[xtile][ytile-ytilestep]&0x80 )
            wallpic = DOORWALL+2;
         else
         {
            if (*(mapsegs[1]+farmapylookup[ytile]+xtile) == NEWWALLTILE)
               wallpic = horizwall[tilehit & ~0x40]+128;
            else
               wallpic = horizwall[tilehit & ~0x40];
         }
      }

      else
      {
         if (*(mapsegs[1]+farmapylookup[ytile]+xtile) == NEWWALLTILE)
            wallpic = horizwall[tilehit]+128;
         else
            wallpic = horizwall[tilehit];
      }


Save and compile everything.

Now to test this feature, open up your map editor, and draw 1 block of the grey wall (the first wall) in a room. Place the new tile-object on that block. Save your map and test it in your game. If all went well, you will see your 65th wall where the grey wall should've been.

Well, I hope this information will be somewhat helpful to add-on makers like me who want to have detailed environments. I'm not a programmer, and I don't pretend to know all or even most of what's going on in the code, so if anyone thinks of any ways in which this feature could be improved, feel free to post your suggestions.

Enjoy,
WSJ
Codetech84
Code Master
Code Master


Joined: 12 Mar 2003
Last Visit: 04 Nov 2018

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

PostPosted: Mon Jul 28, 2003 5:00 am
   Subject: Re: 64 Walls Work-Around
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

That's pretty damn good coding, feom someone who says he's not a coder. Wink
Laughing

_________________
Click here to visit KFH Games website!
*UPDATED* Spear of Destiny Reloaded
KFH Games on Facebook
jamez
I am Death Incarnate
I am Death Incarnate


Joined: 16 Mar 2003
Last Visit: 17 Jan 2019

Topics: 13
Posts: 186
Location: Yorkshire, UK
uk.gif

PostPosted: Mon Jul 28, 2003 10:44 am
   Subject: Re: 64 Walls Work-Around
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Quote:
new tile-object


Is a tile object (in say flo edit) a wall or and object? And if i wa going to use wall id 65, i'd put down a grey wall and then how would i know what id number to put down??

Thanks

_________________
~ James
Guest




Last Visit:





PostPosted: Mon Jul 28, 2003 10:55 am
   Subject: Re: 64 Walls Work-Around
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

jamez wrote:


Is a tile object (in say flo edit) a wall or and object?


A "tile object" (I couldn't think of a better name) is an object, like guards, static objects, etc. This tile-object is the same kind of object as the "Pushwall tile" or a player start position. FloEdit 1.1 will say that it's a "static object," but it isn't. You can use as many of them as you want. Smile

jamez wrote:

And if i wa going to use wall id 65, i'd put down a grey wall and then how would i know what id number to put down??


If you wanted to use wall ID 65, you'd use wall ID 1. The tile adds 64 to whatever wall ID you use. So, if you wanted to use, say, 85, you'd place the tile-object on a wall with an ID of 21. (21 + 64 = 85.)

@ Codetech: I try. Laughing
jamez
I am Death Incarnate
I am Death Incarnate


Joined: 16 Mar 2003
Last Visit: 17 Jan 2019

Topics: 13
Posts: 186
Location: Yorkshire, UK
uk.gif

PostPosted: Mon Jul 28, 2003 11:41 am
   Subject: Re: 64 Walls Work-Around
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

So if id number 21 was a key or something it would matter??

If thats it then what about secret totals etc lol because if the id was one of them it would add onto it if u see what i mean? Question

_________________
~ James
Guest




Last Visit:





PostPosted: Mon Jul 28, 2003 3:26 pm
   Subject: Re: 64 Walls Work-Around
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

jamez wrote:
So if id number 21 was a key or something it would matter??

If thats it then what about secret totals etc lol because if the id was one of them it would add onto it if u see what i mean?


No, I think you're confusing "wall ids" with "object ids." A wall with an id of 21 would not interfere with an object which had an id of 21. The pushwall marker (object #98) is not a wall, but an object. Same thing with the "newwalltile" which I created (object #100). That's why you can place it inside walls to make the walls show a different texture. But as I said, it can't be used with secret pushwalls, for this very reason.

I hope this makes more sense. Try it, it works.
jamez
I am Death Incarnate
I am Death Incarnate


Joined: 16 Mar 2003
Last Visit: 17 Jan 2019

Topics: 13
Posts: 186
Location: Yorkshire, UK
uk.gif

PostPosted: Tue Jul 29, 2003 10:26 am
   Subject: Re: 64 Walls Work-Around
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

What so id 100 you put in the walls like you would with a push wall..

_________________
~ James
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: Tue Jul 29, 2003 11:12 am
   Subject: Re: 64 Walls Work-Around
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

jamez wrote:
What so id 100 you put in the walls like you would with a push wall..


@James...

He's defined an object as a modifier to the wall... Just like the "pushwall" is a modifier to a wall.. In his example, he is using the object "100" as the modifier.

When the draw routines look to see what wall is to be drawn, it looks to see if the object modifier is set... if yes.. then it adds 64 to the selected wall chosen... Thus he gets another 64 walls to chose from.. Using only one set of definitions in Mapedit or Floedit (your choice)...

@WJS...

Nice Job... I like it... Interesting solution to the 64+... I'm still looking at the routine to see if it can be incorperated into my solution to have the best of both worlds.. Smile

Greg
BrotherTank
jamez
I am Death Incarnate
I am Death Incarnate


Joined: 16 Mar 2003
Last Visit: 17 Jan 2019

Topics: 13
Posts: 186
Location: Yorkshire, UK
uk.gif

PostPosted: Tue Jul 29, 2003 12:21 pm
   Subject: Re: 64 Walls Work-Around
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

ok thanks greg, I wasn't too sure there... Razz

_________________
~ James
Codetech84
Code Master
Code Master


Joined: 12 Mar 2003
Last Visit: 04 Nov 2018

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

PostPosted: Tue Jul 29, 2003 2:30 pm
   Subject: Re: 64 Walls Work-Around
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Another Work-Around would be, to get it directly from mapseg:

Look into WL_DEF.H

You should find this...

::: CODE :::
#define MAPSPOT(x,y,plane)   (*(mapsegs[plane+farmapylookup[y]+x))


Using MAPSPOT(x,y,plane) instead of TileMap(x,y) would enable you much more new walls. Pay attention to the plane value in the definition.
I don't know the values, but in wolf there are three planes One for walls one for Floor codes and one for actors/objects...

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




Last Visit:





PostPosted: Tue Jul 29, 2003 8:10 pm
   Subject: Re: 64 Walls Work-Around
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

BrotherTank wrote:


Nice Job... I like it... Interesting solution to the 64+... I'm still looking at the routine to see if it can be incorperated into my solution to have the best of both worlds.. Smile


Thanks. I'm glad to hear it. Smile Theoretically, it should also be possible to create a second modifier which adds "128" so that you can have even more walls... but I think that 128 walls is plenty for most people to start with... Smile
Reivax44
Bring 'em On
Bring 'em On


Joined: 25 Apr 2003
Last Visit: 26 Aug 2010

Topics: 3
Posts: 140
Location: Adelaide.
australia.gif

PostPosted: Tue Jul 29, 2003 10:54 pm
   Subject: Re: 64 Walls Work-Around
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Great work WSJ!! Very useful when you've got heaps of really nice wallpapers you want to add into your next TC... There's also another way to do it which dosen't require any coding at all (if you're using textured floors and ceilings)... all you do is use the 64ID's set aside for walls as you normally do, then put your floor and ceiling textures in the ID's 65> to 104 (Max. i think).

Very basic way I thought I'd share with you (*I'm probably the last person here to work that out*)

Cool

_________________
95% of people tip-toe through life hoping to make it safely to DEATH!
Codetech84
Code Master
Code Master


Joined: 12 Mar 2003
Last Visit: 04 Nov 2018

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

PostPosted: Sun Aug 03, 2003 2:40 pm
   Subject: Re: 64 Walls Work-Around
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

How about altering the ScanInfoPlane function in a way that it would automatically spawn the item when the tile value goes over 64...

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




Last Visit:





PostPosted: Mon Aug 04, 2003 3:20 pm
   Subject: Re: 64 Walls Work-Around
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Codetech84 wrote:
How about altering the ScanInfoPlane function in a way that it would automatically spawn the item when the tile value goes over 64...


That would make things a little easier... The person making the maps wouldn't have to worry about adding in the object manually...

However, wouldn't that limit the number of walls to 105? MAP-IDs 106 and above are reserved for floor codes, aren't they? Using this current method gives you up to 128 walls because you don't have to worry about new MAP-IDs.
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: Mon Aug 04, 2003 5:43 pm
   Subject: Re: 64 Walls Work-Around
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

WSJ wrote:
Codetech84 wrote:
How about altering the ScanInfoPlane function in a way that it would automatically spawn the item when the tile value goes over 64...


That would make things a little easier... The person making the maps wouldn't have to worry about adding in the object manually...

However, wouldn't that limit the number of walls to 105? MAP-IDs 106 and above are reserved for floor codes, aren't they? Using this current method gives you up to 128 walls because you don't have to worry about new MAP-IDs.


That is correct in both cases... The map ID's above 105 are floor codes, so you could only have it scan to 105 - Thus you limit the WSJ 64+ routine to 41 new walls - but that is still 15 more than what my routine does. Although my routine does remove the door bug (I'll explain that another time).

So... Let the person making the maps worry about it, because it is their job if they are making the maps? Makes sense to me... and that way you have access to 64 more wall values.

Greg
BrotherTank


Last edited by BrotherTank on Sat Feb 07, 2004 7:28 pm; edited 2 times in total
Codetech84
Code Master
Code Master


Joined: 12 Mar 2003
Last Visit: 04 Nov 2018

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

PostPosted: Wed Aug 06, 2003 1:50 pm
   Subject: Re: 64 Walls Work-Around
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Thank you.

_________________
Click here to visit KFH Games website!
*UPDATED* Spear of Destiny Reloaded
KFH Games on Facebook
Reivax44
Bring 'em On
Bring 'em On


Joined: 25 Apr 2003
Last Visit: 26 Aug 2010

Topics: 3
Posts: 140
Location: Adelaide.
australia.gif

PostPosted: Wed Aug 13, 2003 3:45 pm
   Subject: Re: 64 Walls Work-Around
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

@ WSJ... works perfectly, thanks...

You'll be in my TC's credits for this!

Cool

_________________
95% of people tip-toe through life hoping to make it safely to DEATH!
Guest




Last Visit:





PostPosted: Wed Aug 13, 2003 8:00 pm
   Subject: Re: 64 Walls Work-Around
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Bottom of Posts

Reivax44 wrote:
@ WSJ... works perfectly, thanks...

You'll be in my TC's credits for this!


Thanks. I'm glad it works for you. Smile
Display posts from previous:   
Post new topicReply to topic Time synchronized with the forum server time
DieHard Wolfers Forum Index -> Code Tutorials 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 [Code] Add Text to Screen at Skill Level select - Chris
Author: Chris
3 3691 Tue Sep 28, 2010 6:59 pm
Tricob View latest post
No new posts [Code] Display Different Ammo Types on Statusbar-BrotherTank
Author: BrotherTank
1 3309 Fri Feb 11, 2005 9:18 pm
Zombie_Plan View latest post
No new posts [Code] Changing an Enemies Attack Strength - BrotherTank
Author: BrotherTank
0 2736 Tue Jan 27, 2004 10:29 am
BrotherTank View latest post
No new posts [Code] Changing Weapons -CheckWeaponChange- BrotherTank
Author: BrotherTank
2 3653 Sun Oct 26, 2003 1:21 am
Guest View latest post
No new posts [Help] Different Enemy Dying Frames/Views
Author: Guest
7 609 Tue Jul 29, 2003 3:00 pm
Codetech84 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