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] Textured Floor/Ceiling - By Darkone
Page 1 of 3 Goto page 1, 2, 3  Next
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
BrotherTank
Forum Administrator
<B>Forum Administrator</B>


Joined: 01 Mar 2003
Last Visit: 13 Sep 2017

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

PostPosted: Sat Apr 19, 2003 12:45 pm
   Subject: [Code] Textured Floor/Ceiling - By Darkone
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Next PostGoto Bottom of Posts

Darkone's Textured Floor/Ceiling Mod - Edited for Understanding

The purpose of this tutorial is to make textured floor/ceiling in Wolf3D. This feature will give your engine the best boost in visual quality, so letís get to work:

Open the WL_DRAW.C file and find the following line:

::: CODE :::

unsigned  wallheight[MAXVIEWWIDTH];


And modify it to look like this:

::: CODE :::

unsigned  wallheight[MAXVIEWWIDTH], min_wallheight;


Then edit the CalcHeight (void) function to look like:

::: CODE :::

int   CalcHeight (void)
{
   int   transheight;
   int ratio;
   fixed gxt,gyt,nx,ny;
   long   gx,gy;

   gx = xintercept-viewx;
   gxt = FixedByFrac(gx,viewcos);

   gy = yintercept-viewy;
   gyt = FixedByFrac(gy,viewsin);

   nx = gxt-gyt;

  //
  // calculate perspective ratio (heightnumerator/(nx>>8))
  //
   if (nx<mindist)
      nx=mindist;  // don't let divide overflow

   asm   mov   ax,[WORD PTR heightnumerator]
   asm   mov   dx,[WORD PTR heightnumerator+2]
   asm   idiv   [WORD PTR nx+1]         // nx>>8
// Darkone's Textured Ceiling Floor Addtional Code

// update min_wallheight
  asm mov bx,[min_wallheight]
  asm cmp ax,bx
  asm jae noupdate:
  asm mov [min_wallheight],ax
  noupdate:;
// End Addtional Code

}


Then add the following macro declaration just before the start of vgaCeiling array declaration:

::: CODE :::


#define USE_TEX(page) (0x0000|(page))
/*
** use USE_TEX(n) to use floor/ceiling textures for given level
** n should be 1..255 !!!
** it is MAP-ID (from FloEdit). First texture goes to floor, second to ceiling
*/



Now we are about to write the main texturing code....

Add this function just after vgaCeiling array declaration:

::: CODE :::
 
// ------------------------- * Textured flats * -------------------------
/*
** Draw Textured Floor/Ceiling
*/

void DrawFlats(unsigned tex_f, unsigned tex_c)
{
  int x, y, y0, halfheight;
  unsigned top_offset0, bot_offset0, top_offset, bot_offset;
  unsigned top_add, bot_add;
  byte p, color;
  byte far *src_bot, far *src_top;
  fixed dist;            // distance to row projection
  fixed tex_step;        // global step per one screen pixel
  fixed gu, gv, du, dv; // global texture coordinates
  int u, v;              // local texture coordinates

// ------ * prepare * --------

  halfheight=viewheight>>1;
  y0=min_wallheight>>3;      // starting y value
  if(y0>halfheight) return;  // view obscued by walls
  if(y0==0) y0=1;           // don't let division by zero
  top_offset0=80*(halfheight-y0-1);  // and will decrease by 80 each row
  bot_offset0=80*(halfheight+y0);  // and will increase by 80 each row

  src_bot=PM_GetPage(tex_f); // load floor texture
  src_top=PM_GetPage(tex_c); // load ceiling texture

// draw horizontal lines

  for(p=0; p<4; p++)
  {
    asm mov ax,0x0102
    asm mov cl,[p]
    asm shl ah,cl
    asm mov dx,0x3c4
    asm out dx,ax

    for(y=y0, top_offset=top_offset0, bot_offset=bot_offset0; y<halfheight; y++, top_offset-=80, bot_offset+=80)
    {
      dist=(heightnumerator/y)<<5;
      gu= viewx+FixedByFrac(dist, viewcos);
      gv=-viewy+FixedByFrac(dist, viewsin);
      tex_step=(dist<<8)/viewwidth/175;
      du= FixedByFrac(tex_step, viewsin);
      dv=-FixedByFrac(tex_step, viewcos);
      gu-=((viewwidth>>1)-p)*du;
      gv-=((viewwidth>>1)-p)*dv; // starting point (leftmost)
      du<<=2; // 4pix step
      dv<<=2;
      for(x=p, top_add=top_offset, bot_add=bot_offset; x<viewwidth; x+=4, top_add++, bot_add++)
      {
        if(wallheight[x]>>3<=y)
        {
          u=(gu>>10)&63; v=(gv>>10)&63;
          color=*(src_top+((63-u)<<6)+(63-v));

// draw top pixel using <color>

          asm mov es,[screenseg]
          asm mov di,[bufferofs]
          asm add di,[top_add]
          asm mov al,[color]
          asm mov es:[di],al

          color=*(src_bot+(u<<6)+(63-v));

// draw bottom pixel using <color>

          asm mov es,[screenseg]
          asm mov di,[bufferofs]
          asm add di,[bot_add]
          asm mov al,[color]
          asm mov es:[di],al
        }
        gu+=du; gv+=dv;
      }
    }
  }
}



Be careful with it entering the above routine as itís big and itís easy to miss something.

After that change VGAClearScreen from:

::: CODE :::

void VGAClearScreen (void)

to:
::: CODE :::

void VGAClearScreen(unsigned ceiling)

and then comment out or remove this next line:
::: CODE :::

unsigned ceiling=vgaCeiling[gamestate.episode*10+mapon];

As you see Iíve removed ceiling variable from the function and added a parameter with the same name.

The last thing we will modify is ThreeDRefresh function (Be Careful) so it looks like this:

::: CODE :::

void ThreeDRefresh (void)
{
    int tracedir;
    unsigned ceiling;
    boolean flats;

<..stuff skipped..>

//
// follow the walls from there to the right, drawwing as we go
//

    ceiling=vgaCeiling[gamestate.episode*10+mapon];
    if((ceiling>>8)==(ceiling&0xFF))
    {
          VGAClearScreen(ceiling);
          flats=false;
    }
    else
    {
          flats=true;
          ceiling=((ceiling&0xFF)-1)<<1;
    }

    WallRefresh();

    if(flats)
          DrawFlats(ceiling, ceiling+1); // draw textured floor/ceiling

<..stuff skipped to end of routine..>



Ok, enough coding, letís learn how to use this feature. First you should find a pair of images: one for floor, one for ceiling texture. They should look like texture, of course this is not a must, but it would look silly. Then I used FloEdit to import them to my data files. I used indexes 62 and 63 (note that first index must be even and second index must be equal to first plus 1. This would make MAP-ID the same for both of them!), and remembered MAP-ID, 32 in this case.

Then Iíve chosen a level(s) to be textured using these textures (for simplicity it would be e1m1).

So I modified vgaCeiling array like that:
::: CODE :::

unsigned vgaCeiling[]=
{
#ifndef SPEAR
 USE_TEX(32),0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0xbfbf,
0x4e4e,0x4e4e,0x4e4e,0x1d1d,0x8d8d,0x4e4e,0x1d1d,0x2d2d,0x1d1d,0x8d8d,
0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x2d2d,0xdddd,0x1d1d,0x1d1d,0x9898,
0x1d1d,0x9d9d,0x2d2d,0xdddd,0xdddd,0x9d9d,0x2d2d,0x4d4d,0x1d1d,0xdddd,
0x7d7d,0x1d1d,0x2d2d,0x2d2d,0xdddd,0xd7d7,0x1d1d,0x1d1d,0x1d1d,0x2d2d,
0x1d1d,0x1d1d,0x1d1d,0x1d1d,0xdddd,0xdddd,0x7d7d,0xdddd,0xdddd,0xdddd

#else
0x6f6f,0x4f4f,0x1d1d,0xdede,0xdfdf,0x2e2e,0x7f7f,0x9e9e,0xaeae,0x7f7f,
0x1d1d,0xdede,0xdfdf,0xdede,0xdfdf,0xdede,0xe1e1,0xdcdc,0x2e2e,0x1d1d,0xdcdc
#endif
};



Note that I used MAP-ID, I remembered!
Thatís all. Iíve built .exe and started it.

If you've done things correctly, you will now have ceiling and floor textures.

Voila! Thatís it!

I hope this thing helped you on your way to create the best Wolf3D conversion ever made. If so, just drop me a line on DarkOne@navigators.lv. I wish to see your work!


----------------------

Enjoy

Greg
BrotherTank
andy3012
DieHard Guard
DieHard Guard


Joined: 02 Jul 2004
Last Visit: 15 Feb 2008

Topics: 29
Posts: 292
Location: England
uk.gif

PostPosted: Sat Jul 17, 2004 2:39 am
   Subject: Re: [Code] Textured Floor/Ceiling - By Darkone
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

lol sorry, i know it all goes into wl_draw, but where i put it, doesnt seem to work, like give me a clue where to put it.
sentenced
DieHard SS
DieHard SS


Joined: 13 Mar 2004
Last Visit: 22 Oct 2009

Topics: 5
Posts: 381
Location: Liverpool, England
sao_tome.gif

PostPosted: Sat Jul 17, 2004 2:53 am
   Subject: Re: [Code] Textured Floor/Ceiling - By Darkone
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Put the macro declaration into the code as follows:

"}
#endif
//==========================================================================

#define USE_TEX(page) (0x0000|(page))
/*
** use USE_TEX(n) to use floor/ceiling textures for given level
** n should be 1..255 !!!
** it is MAP-ID (from FloEdit). First texture goes to floor, second to ceiling
*/


unsigned vgaCeiling[]=
{
#ifndef SPEAR
0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0xbfbf,
0x4e4e,0x4e4e,0x4e4e,0x1d1d,0x8d8d,0x4e4e,0x1d1d,0x2d2d,0x1d1d,0x8d8d,
0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x2d2d,0xdddd,0x1d1d,0x1d1d,0x9898,

0x1d1d,0x9d9d,0x2d2d,0xdddd,0xdddd,0x9d9d,0x2d2d,0x4d4d,0x1d1d,0xdddd,
0x7d7d,0x1d1d,0x2d2d,0x2d2d,0xdddd,0xd7d7,0x1d1d,0x1d1d,0x1d1d,0x2d2d,
0x1d1d,0x1d1d,0x1d1d,0x1d1d,0xdddd,0xdddd,0x7d7d,0xdddd,0xdddd,0xdddd
#else
0x6f6f,0x4f4f,0x1d1d,0xdede,0xdfdf,0x2e2e,0x7f7f,0x9e9e,0xaeae,0x7f7f,
0x1d1d,0xdede,0xdfdf,0xdede,0xdfdf,0xdede,0xe1e1,0xdcdc,0x2e2e,0x1d1d,0xdcdc
#endif
};

/*
====================="

Then place the funtion here:

"}
#endif
//==========================================================================

#define USE_TEX(page) (0x0000|(page))
/*
** use USE_TEX(n) to use floor/ceiling textures for given level
** n should be 1..255 !!!
** it is MAP-ID (from FloEdit). First texture goes to floor, second to ceiling
*/


unsigned vgaCeiling[]=
{
#ifndef SPEAR
0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0xbfbf,
0x4e4e,0x4e4e,0x4e4e,0x1d1d,0x8d8d,0x4e4e,0x1d1d,0x2d2d,0x1d1d,0x8d8d,
0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x2d2d,0xdddd,0x1d1d,0x1d1d,0x9898,

0x1d1d,0x9d9d,0x2d2d,0xdddd,0xdddd,0x9d9d,0x2d2d,0x4d4d,0x1d1d,0xdddd,
0x7d7d,0x1d1d,0x2d2d,0x2d2d,0xdddd,0xd7d7,0x1d1d,0x1d1d,0x1d1d,0x2d2d,
0x1d1d,0x1d1d,0x1d1d,0x1d1d,0xdddd,0xdddd,0x7d7d,0xdddd,0xdddd,0xdddd
#else
0x6f6f,0x4f4f,0x1d1d,0xdede,0xdfdf,0x2e2e,0x7f7f,0x9e9e,0xaeae,0x7f7f,
0x1d1d,0xdede,0xdfdf,0xdede,0xdfdf,0xdede,0xe1e1,0xdcdc,0x2e2e,0x1d1d,0xdcdc
#endif
};

// ------------------------- * Textured flats * -------------------------
/*
** Draw Textured Floor/Ceiling
*/

void DrawFlats(unsigned tex_f, unsigned tex_c)
{
int x, y, y0, halfheight;
unsigned top_offset0, bot_offset0, top_offset, bot_offset;
unsigned top_add, bot_add;
byte p, color;
byte far *src_bot, far *src_top;
fixed dist; // distance to row projection
fixed tex_step; // global step per one screen pixel
fixed gu, gv, du, dv; // global texture coordinates
int u, v; // local texture coordinates

// ------ * prepare * --------

halfheight=viewheight>>1;
y0=min_wallheight>>3; // starting y value
if(y0>halfheight) return; // view obscued by walls
if(y0==0) y0=1; // don't let division by zero
top_offset0=80*(halfheight-y0-1); // and will decrease by 80 each row
bot_offset0=80*(halfheight+y0); // and will increase by 80 each row

src_bot=PM_GetPage(tex_f); // load floor texture
src_top=PM_GetPage(tex_c); // load ceiling texture

// draw horizontal lines

for(p=0; p<4; p++)
{
asm mov ax,0x0102
asm mov cl,[p]
asm shl ah,cl
asm mov dx,0x3c4
asm out dx,ax

for(y=y0, top_offset=top_offset0, bot_offset=bot_offset0; y<halfheight; y++, top_offset-=80, bot_offset+=80)
{
dist=(heightnumerator/y)<<5;
gu= viewx+FixedByFrac(dist, viewcos);
gv=-viewy+FixedByFrac(dist, viewsin);
tex_step=(dist<<Cool/viewwidth/175;
du= FixedByFrac(tex_step, viewsin);
dv=-FixedByFrac(tex_step, viewcos);
gu-=((viewwidth>>1)-p)*du;
gv-=((viewwidth>>1)-p)*dv; // starting point (leftmost)
du<<=2; // 4pix step
dv<<=2;
for(x=p, top_add=top_offset, bot_add=bot_offset; x<viewwidth; x+=4, top_add++, bot_add++)
{
if(wallheight[x]>>3<=y)
{
u=(gu>>10)&63; v=(gv>>10)&63;
color=*(src_top+((63-u)<<6)+(63-v));

// draw top pixel using <color>

asm mov es,[screenseg]
asm mov di,[bufferofs]
asm add di,[top_add]
asm mov al,[color]
asm mov es:[di],al

color=*(src_bot+(u<<6)+(63-v));

// draw bottom pixel using <color>

asm mov es,[screenseg]
asm mov di,[bufferofs]
asm add di,[bot_add]
asm mov al,[color]
asm mov es:[di],al
}
gu+=du; gv+=dv;
}
}
}
}


/*
====================="

Perhaps not the best way to display the positions for code insertion, but it's the best I can do for now.

The blue colour signifies the current insertion.
The red colour signifies a previous insertion.

_________________
"Listen and exchange with me, as we both share in common a different value system."
andy3012
DieHard Guard
DieHard Guard


Joined: 02 Jul 2004
Last Visit: 15 Feb 2008

Topics: 29
Posts: 292
Location: England
uk.gif

PostPosted: Sat Jul 17, 2004 3:53 pm
   Subject: Re: [Code] Textured Floor/Ceiling - By Darkone
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

hmmm now how do i get the textures too show Confused or should i say i don't understand the last bit... sorry im only a dumb @ss
Haasboy
DieHard Officer
DieHard Officer


Joined: 23 Jul 2003
Last Visit: 12 Oct 2018

Topics: 58
Posts: 581
Location: South Africa, Johannesburg
southafrica.gif

PostPosted: Sat Jul 17, 2004 11:59 pm
   Subject: Re: [Code] Textured Floor/Ceiling - By Darkone
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Wolfenstein is nothing without an odd dumbass now and then. Twisted Evil

andy3012 wrote:
how do i get the textures too show


Ok if you look at the following inserted information:
::: CODE :::
#define USE_TEX(page) (0x0000|(page))
/*
** use USE_TEX(n) to use floor/ceiling textures for given level
** n should be 1..255 !!!
** it is MAP-ID (from FloEdit). First texture goes to floor, second to ceiling
*/

It tells you exactly how to display your floor & ceiling textures, it's even explained in the tutorial it self. It took me quite a bit of time before I understood on how to display the textures, so I suggest go through tutorial again and use your noggen(head) and none of us are going to spoon feed you the info you need, unless you really don't know how to think Too Cool

_________________
Haasboy Engine - Currently under construction (To be used with future mods - F.A.D.E.D. - Mansion X - Rising Evil Series)
andy3012
DieHard Guard
DieHard Guard


Joined: 02 Jul 2004
Last Visit: 15 Feb 2008

Topics: 29
Posts: 292
Location: England
uk.gif

PostPosted: Sun Jul 18, 2004 1:33 am
   Subject: Re: [Code] Textured Floor/Ceiling - By Darkone
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Crying or Very sad i still don't understand, what do i do

#define USE_TEX(page) (0x0000|(page))
/*
** use USE_TEX(n) to use floor/ceiling textures for given level
** n should be 1..255 !!!
** it is MAP-ID (from FloEdit). First texture goes to floor, second to ceiling
*/

where it says Use_TEX(N) do i put the number of my floor, or the level i want to use it in.

and here #define USE_TEX(page) (0x0000|(page)) what do i do? I don't understand sorry folks
sentenced
DieHard SS
DieHard SS


Joined: 13 Mar 2004
Last Visit: 22 Oct 2009

Topics: 5
Posts: 381
Location: Liverpool, England
sao_tome.gif

PostPosted: Sun Jul 18, 2004 2:59 am
   Subject: Re: [Code] Textured Floor/Ceiling - By Darkone
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Just think - Haasboy is right here. Whenever you get stuck programming, the first thing you will want to do is to at least attempt to solve the problem alone, but it's all in black and white:

unsigned vgaCeiling[]=
{
#ifndef SPEAR
USE_TEX(32),0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0xbfbf,
0x4e4e,0x4e4e,0x4e4e,0x1d1d,0x8d8d,0x4e4e,0x1d1d,0x2d2d,0x1d1d,0x8d8d,
0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x2d2d,0xdddd,0x1d1d,0x1d1d,0x9898,
0x1d1d,0x9d9d,0x2d2d,0xdddd,0xdddd,0x9d9d,0x2d2d,0x4d4d,0x1d1d,0xdddd,
0x7d7d,0x1d1d,0x2d2d,0x2d2d,0xdddd,0xd7d7,0x1d1d,0x1d1d,0x1d1d,0x2d2d,
0x1d1d,0x1d1d,0x1d1d,0x1d1d,0xdddd,0xdddd,0x7d7d,0xdddd,0xdddd,0xdddd


That is the ceiling colour code. Sixty levels. Sixty colours. One "USE_TEX" command. Just remeber what wall Ids are...

_________________
"Listen and exchange with me, as we both share in common a different value system."
andy3012
DieHard Guard
DieHard Guard


Joined: 02 Jul 2004
Last Visit: 15 Feb 2008

Topics: 29
Posts: 292
Location: England
uk.gif

PostPosted: Sun Jul 18, 2004 3:39 am
   Subject: Re: [Code] Textured Floor/Ceiling - By Darkone
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Confused still don't get it lol
Guest




Last Visit:





PostPosted: Sun Jul 18, 2004 3:48 am
   Subject: Re: [Code] Textured Floor/Ceiling - By Darkone
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

@andy3012: If you can't get these floor/ceiling to work, then it is not worth to do this thing and forget about this function! That's alot of waste your time to ask someone to help you out...

FOLLOW THE STEP BY STEP OF FLOOR / CEILING TUTORIAL BEFORE YOU CAN UNDERSTAND Wink

I did it before and failed 100 times, forget it for now.. then I did the Outside atmosphere tutorial and got it work w/o any problem. Neutral
Haasboy
DieHard Officer
DieHard Officer


Joined: 23 Jul 2003
Last Visit: 12 Oct 2018

Topics: 58
Posts: 581
Location: South Africa, Johannesburg
southafrica.gif

PostPosted: Sun Jul 18, 2004 4:47 am
   Subject: Re: [Code] Textured Floor/Ceiling - By Darkone
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

sentenced wrote:
Haasboy is right here

Thank You.

It's irritating when you get a newbie who tries a code out that 1000s others tried successfully and then you get one person who is to lazy to try and ready/understand how a code works, but since we're spoon feeders, I might as well as help andy out, ok now open your mouth for some spoon feeding;


The USE_TEX(n) is used instead of the 0x0000 code (ceiling colour), the "n" is the number of the wall graphics you be using for the floor and ceiling textures you'll be using. So if you used USE_TEX(0) you be using the first two images









NB - Brothertank don't delete it'll save time when another newbie asks another stupid question

_________________
Haasboy Engine - Currently under construction (To be used with future mods - F.A.D.E.D. - Mansion X - Rising Evil Series)
andy3012
DieHard Guard
DieHard Guard


Joined: 02 Jul 2004
Last Visit: 15 Feb 2008

Topics: 29
Posts: 292
Location: England
uk.gif

PostPosted: Sun Jul 18, 2004 4:48 am
   Subject: Re: [Code] Textured Floor/Ceiling - By Darkone
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

well even tho im almost there, ill do as u say. Hmmm I doubt if i'll continue my project, because every single code i try add to my game never works!!! apart from the odd things, like death artifact. and summat else...
sentenced
DieHard SS
DieHard SS


Joined: 13 Mar 2004
Last Visit: 22 Oct 2009

Topics: 5
Posts: 381
Location: Liverpool, England
sao_tome.gif

PostPosted: Sun Jul 18, 2004 6:04 am
   Subject: Re: [Code] Textured Floor/Ceiling - By Darkone
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

andy3012 wrote:
well even tho im almost there, ill do as u say. Hmmm I doubt if i'll continue my project, because every single code i try add to my game never works!!! apart from the odd things, like death artifact. and summat else...


At least be grateful that somebody has spent the effort to help you out! "Every single code" you add to your game never works because you have made a mistake when following the tutorial. My advice to you:

Read everything carefully, execute everything carefully and work out mistakes in your own time.

_________________
"Listen and exchange with me, as we both share in common a different value system."
andy3012
DieHard Guard
DieHard Guard


Joined: 02 Jul 2004
Last Visit: 15 Feb 2008

Topics: 29
Posts: 292
Location: England
uk.gif

PostPosted: Sun Jul 18, 2004 7:52 am
   Subject: Re: [Code] Textured Floor/Ceiling - By Darkone
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

I am greatful, I just wish i could put all these codes into my game... I soon hope with experience ill grow to learn, but thanks for helping anyway

EDIT: DUDE Oh my god, i just got it to work, I realised on the ThreeD bit I erased something that i displays stuff, dude thank you guys Ever so Much!


Last edited by andy3012 on Sun Jul 18, 2004 8:17 am; edited 1 time in total
BrotherTank
Forum Administrator
<B>Forum Administrator</B>


Joined: 01 Mar 2003
Last Visit: 13 Sep 2017

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

PostPosted: Sun Jul 18, 2004 8:10 am
   Subject: Re: [Code] Textured Floor/Ceiling - By Darkone
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

andy3012 wrote:
I am greatful, I just wish i could put all these codes into my game... I soon hope with experience ill grow to learn, but thanks for helping anyway


I guess the problem here is that you want to install these modifications to the code and you don't understand them or the original code.

Andy, The "unsigned VGACeiling[]" is an array. It holds the ceiling colours for the game. Each one of the values ie: 0x1d1d is a colour for a floor. The first 60 definitions are for the Wolfenstein side of the code, and the second 21 are for the Spear of Destiny side of the code.

What Darkone did in this tutorial is the following:

If you want a colour for the ceiling for a particular level, then you leave that array pointing to the colour... ie 0x1d1d (gray). If you want to have a texture, then you replace the colour code with "USETEX (number)" - where the number refers to a texture in your vswap. In his example he used "USETEX (1)" which replaced the first floor colour of 0x1d1d.

If you have entered everything properly, and it compiles properly, then you should get the gray stone wall as you floor and ceiling texture on level 1.

If it compiled properly, but you didn't get the texture when you run your game, chances are that you left the original "unsigned vgaCeiling[]" array in your code. Replace (read remove) the original with the new one he provided. Compile and try again.

This tutorial does work, and has been proven to work. But my first suggestion would be to learn more about the code itself. I would suggest going to the Dome or somewhere where they have basic tutorials on changing things within the code. Start with the basics, and learn the code. When you are done, these more difficult tutorials will still be here, waiting for you to install.

Greg
BrotherTank
JackaL
DieHard SS
DieHard SS


Joined: 25 Jun 2004
Last Visit: 04 Apr 2011

Topics: 30
Posts: 335
Location: Rotorua, New Zealand
newzealand.gif

PostPosted: Tue Feb 22, 2005 11:54 pm
   Subject: Re: [Code] Textured Floor/Ceiling - By Darkone
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Hmmm, I have inserted the stars/snow effect in the 1st and 20th level, then how can I make the texture just display on the floor of those levels, as it displays on ceiling also, but I need that for the stars. Is there a way around this? Ther would be because its done in EoD.
Haasboy
DieHard Officer
DieHard Officer


Joined: 23 Jul 2003
Last Visit: 12 Oct 2018

Topics: 58
Posts: 581
Location: South Africa, Johannesburg
southafrica.gif

PostPosted: Wed Feb 23, 2005 9:21 am
   Subject: Re: [Code] Textured Floor/Ceiling - By Darkone
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

A Tutorial has been replaced for combining both of these tutorials, I would give a direct link, but I don't have the link on hand. The tutorial can be found in the "Code Tutorials" section.

_________________
Haasboy Engine - Currently under construction (To be used with future mods - F.A.D.E.D. - Mansion X - Rising Evil Series)
Reactor
DieHard SS
DieHard SS


Joined: 17 Mar 2005
Last Visit: 24 Jan 2013

Topics: 27
Posts: 328
Location: Hungary
hungary.gif

PostPosted: Tue Mar 29, 2005 2:49 pm
   Subject: Texture Terror
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Quote:
#define USE_TEX(page) (0x0000|(page))
/*
** use USE_TEX(n) to use floor/ceiling textures for given level
** n should be 1..255 !!!
** it is MAP-ID (from FloEdit). First texture goes to floor, second to ceiling
*/



I don't have FloEdit. Will this tutorial work anyway, or I'll have change some things in it?
I'm confused now :S

_________________
INCOMING TRANSMISSION
"Marine! Er....never mind..."
TRANSMISSION ENDS
andy3012
DieHard Guard
DieHard Guard


Joined: 02 Jul 2004
Last Visit: 15 Feb 2008

Topics: 29
Posts: 292
Location: England
uk.gif

PostPosted: Wed Mar 30, 2005 1:22 am
   Subject: Re: [Code] Textured Floor/Ceiling - By Darkone
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Yes the code will work, Darkone just left a comment saying in Floedit the first texture goes to the floor and the second goes to the ceiling, So its like your Light blue wall will go on the floor and your Dark blue wall will go on the ceiling.
Reactor
DieHard SS
DieHard SS


Joined: 17 Mar 2005
Last Visit: 24 Jan 2013

Topics: 27
Posts: 328
Location: Hungary
hungary.gif

PostPosted: Wed Mar 30, 2005 1:51 am
   Subject: Texture terror act 2.
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Hmm, okay. So no problem with that.
And how can I insert floor and ceiling graphics, like in End of Destiny? It's a bit idiotic to have just a deep blue ceiling with a cyan floor. Do I need to make something else with the source code?

_________________
INCOMING TRANSMISSION
"Marine! Er....never mind..."
TRANSMISSION ENDS
Guest




Last Visit:





PostPosted: Wed Mar 30, 2005 2:41 am
   Subject: Re: [Code] Textured Floor/Ceiling - By Darkone
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

What do you mean like EOD? Do you want map control?

The code Brother Tank wrote on map control is for solid ceiling and floor but should tell you how to make it with texture floor and ceiling.
Reactor
DieHard SS
DieHard SS


Joined: 17 Mar 2005
Last Visit: 24 Jan 2013

Topics: 27
Posts: 328
Location: Hungary
hungary.gif

PostPosted: Wed Mar 30, 2005 2:59 am
   Subject: Texture terror act 3.
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Naaahhh, I don't want such technology Smile I just want to have textured floor and ceiling. I only modify the original Wolfenstein 3D to have wooden or brick ceilings. I also want a clear blue sky with small clouds and a green grass floor for secret level "Out in the fields" as a tribute to Chris. Remember the Landscape view "walltype"? You always see it,and you can never enter the green fields! AReyeP and MCS made excellent midnight levels in Spear Resurrection and End of Destiny. I want to create a midday green field level. That's why I need a floor/ceiling with graphics. The routine what BrotherTank wrote FIRST time will be enough? Or I'll have to modify the source code with those blue lines,too?

_________________
INCOMING TRANSMISSION
"Marine! Er....never mind..."
TRANSMISSION ENDS
Guest




Last Visit:





PostPosted: Wed Mar 30, 2005 3:12 am
   Subject: Re: [Code] Textured Floor/Ceiling - By Darkone
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

You want texture floor and ceiling for the grass field and cloudy sky (?) for your nice middday sky.
An then are you talking about BT`s routine to put textured floor and ceiling and cloudy sky in one routine
Is that right?
Reactor
DieHard SS
DieHard SS


Joined: 17 Mar 2005
Last Visit: 24 Jan 2013

Topics: 27
Posts: 328
Location: Hungary
hungary.gif

PostPosted: Wed Mar 30, 2005 3:32 am
   Subject: Texture terror act 4.
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

That's right. I want green field grass and blue sky for only ONE level.
The other levels, I need textured ceilings, such as stone brick ceilings,wood planks etc. etc. You played the EoD,right? I want such floor and ceiling graphics, and I'm not sure BrotherTank's first "response" will be enough. I'm a total dumb @ss for programming, so I wonder if there is a tutorial somewhere.

SO! Green field and beautiful blue sky with white clouds is for ONE and only ONE level (Out in the fields).
Other graphics ceilings and floors are for all other levels. I'm fed up with simple gray, dark green, blue etc. ceilings,and the light grey floor. If I want resurrect Wolf3D from its ashes once again, I have to make a REAL Wolf3D instead of a game with that name. Y'know... Confused

_________________
INCOMING TRANSMISSION
"Marine! Er....never mind..."
TRANSMISSION ENDS
sentenced
DieHard SS
DieHard SS


Joined: 13 Mar 2004
Last Visit: 22 Oct 2009

Topics: 5
Posts: 381
Location: Liverpool, England
sao_tome.gif

PostPosted: Wed Mar 30, 2005 8:54 am
   Subject: Re: [Code] Textured Floor/Ceiling - By Darkone
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

You would need to go through the whole of Brothertank's first post in order to import your own custom textures for ceilings and floors (if I understood you correctly Wink ). Once you have finished inputting the code and it all compiles correctly, check out this portion:

unsigned vgaCeiling[]=
{
#ifndef SPEAR
USE_TEX(32),0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0xbfbf,
0x4e4e,0x4e4e,0x4e4e,0x1d1d,0x8d8d,0x4e4e,0x1d1d,0x2d2d,0x1d1d,0x8d8d,
0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x2d2d,0xdddd,0x1d1d,0x1d1d,0x9898,
0x1d1d,0x9d9d,0x2d2d,0xdddd,0xdddd,0x9d9d,0x2d2d,0x4d4d,0x1d1d,0xdddd,
0x7d7d,0x1d1d,0x2d2d,0x2d2d,0xdddd,0xd7d7,0x1d1d,0x1d1d,0x1d1d,0x2d2d,
0x1d1d,0x1d1d,0x1d1d,0x1d1d,0xdddd,0xdddd,0x7d7d,0xdddd,0xdddd,0xdddd

#else
0x6f6f,0x4f4f,0x1d1d,0xdede,0xdfdf,0x2e2e,0x7f7f,0x9e9e,0xaeae,0x7f7f,
0x1d1d,0xdede,0xdfdf,0xdede,0xdfdf,0xdede,0xe1e1,0xdcdc,0x2e2e,0x1d1d,0xdcdc
#endif
};


There are sixty (count 'em) colour codes in the first section for use with Wolf3D's sixty levels. The first is an example of how to use the new command to insert textures. "USE_TEX" pinpoints the game to the specific set of dual textures (walls by default). "32" is the Wall-ID, the funky name given to each consecutive pair of walls (one light, one darker). You will have to use a program like Floedit in order to import your own textures to replace existing wall designs (or you could add new designs without replacing - but that's not immediately necessary).

Try to run the game once the code has compiled. If I remember correctly, "32" should give level one the cave-like texture for the ceiling and floor Sick.

Oh yeah, Floedit's home is offline for now. The setup file has taken temporary refuge on Brian's server. For texture work, you can use either WDC or Floedit.

_________________
"Listen and exchange with me, as we both share in common a different value system."


Last edited by sentenced on Wed Mar 30, 2005 9:57 am; edited 1 time in total
Reactor
DieHard SS
DieHard SS


Joined: 17 Mar 2005
Last Visit: 24 Jan 2013

Topics: 27
Posts: 328
Location: Hungary
hungary.gif

PostPosted: Wed Mar 30, 2005 9:23 am
   Subject: Mid-day massacre act 1.
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Thank you for the tutorial,I think I DO understand now Smile I had to read this and former post several times to make the connections Smile I felt a little dizzy, but hell, I need those graphics! Laughing

My next problem is the mid-day sky with white coulds. As a tribute to Chris, I shall create a green field level, all I need is a mid-day sky with beautiful white clouds, like the rainy day sky, or the starry night sky. Any solutions for this problem? It's not that heavy,I guess Smile

_________________
INCOMING TRANSMISSION
"Marine! Er....never mind..."
TRANSMISSION ENDS
andy3012
DieHard Guard
DieHard Guard


Joined: 02 Jul 2004
Last Visit: 15 Feb 2008

Topics: 29
Posts: 292
Location: England
uk.gif

PostPosted: Wed Mar 30, 2005 9:47 am
   Subject: Re: [Code] Textured Floor/Ceiling - By Darkone
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

what do you mean a tribute to chris did something happen or something Neutral im all confused
sentenced
DieHard SS
DieHard SS


Joined: 13 Mar 2004
Last Visit: 22 Oct 2009

Topics: 5
Posts: 381
Location: Liverpool, England
sao_tome.gif

PostPosted: Wed Mar 30, 2005 10:15 am
   Subject: Re: [Code] Textured Floor/Ceiling - By Darkone
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

@Reactor: If you want to create and add a lovely sky with beautiful clouds ( Crying or Very sad ), open Floedit or WDC and locate the walls used in the game. Lets move to the horrible cave wall I mentioned - to get there, scroll sixty three times (two contrasts for each wall, and you will already be on wall number one, so it won't be sixty four). You should be able to flick between both cave walls and notice somewhere on-screen the Map-ID code displaying the magical number 32.

From here, just export both graphics, make your own gorgeous( Crying or Very sad ) design on paint (hehe, just erase them and do a new design from scratch) and import both back into the game. One will be the ceiling and one will be the floor. I cannot remember if the light wall is either and vice versa, but import them nonetheless and see what happens. If you find yourself walking on sunshine, you'll know for the first time its' lliteral meaning. Laughing

@andy3012: Reactor was referring to Chris' and his great posts discussing how they always wanted to walk around in the outside area displayed by the daytime wall. I actually thought that when I first saw my brother play it back when I was four. On the title screen, I always thought you were the nazi, and not the obvious "I'm hiding behind this wall from the oncoming nazi soldier" BJ. Laughing
I saw him complete E1, and over the years without seeing it ever again my mind screwed up the ending somewhat. By the time I was eleven I thought BJ ran out of the castle with a full exterior view!

_________________
"Listen and exchange with me, as we both share in common a different value system."
Reactor
DieHard SS
DieHard SS


Joined: 17 Mar 2005
Last Visit: 24 Jan 2013

Topics: 27
Posts: 328
Location: Hungary
hungary.gif

PostPosted: Wed Mar 30, 2005 11:19 am
   Subject: Mid-day massacre act 2.
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Andy, just switch to "Add-ons" and find "Reactor's add on" topic. Read the last 4 posts, it will explain everything Smile
But if you're lazy, I shall explain: We always imagined with Chris how lovely would be to exit the dark castle, walk on fresh green grass, screw around in the green fields, sunbath, looking at the beautiful white clouds ( Crying or Very sad ) heh heh heh,sorry about that Very Happy So we imagined this several times how would it feel to be there for a level. And because she gave me lots of help, I decided to create a level "Out in the fields".

I also thought about the cyan-coloured ceiling type. The problem is I can't draw a bit larger white cloud on it. And even if I could, it looks quite idiotic,when you move around in the fields, and the clouds are just painted on the "ceiling", look like they're flattened etc. I want something like the starry night outside sky,like in Spear Resurrection or End of Destiny. You know them,right? So I want to create a light blue sky with clouds to look like that. I wonder how can this be done. Any good (or bad) advices or tutorials? Smile

_________________
INCOMING TRANSMISSION
"Marine! Er....never mind..."
TRANSMISSION ENDS
sentenced
DieHard SS
DieHard SS


Joined: 13 Mar 2004
Last Visit: 22 Oct 2009

Topics: 5
Posts: 381
Location: Liverpool, England
sao_tome.gif

PostPosted: Wed Mar 30, 2005 11:25 am
   Subject: Re: [Code] Textured Floor/Ceiling - By Darkone
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Aha, you want an open-looking sky rather than a tile-based (albeit beautiful Crying or Very sad ) one! Hehe, too advanced for me. The diehard coders of the forum will help you there no doubt, though. Smile

_________________
"Listen and exchange with me, as we both share in common a different value system."
andy3012
DieHard Guard
DieHard Guard


Joined: 02 Jul 2004
Last Visit: 15 Feb 2008

Topics: 29
Posts: 292
Location: England
uk.gif

PostPosted: Wed Mar 30, 2005 11:38 am
   Subject: Re: [Code] Textured Floor/Ceiling - By Darkone
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Bottom of Posts

Oh right i see, i thought something bad had happened oops Confused
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 3 Goto page 1, 2, 3  Next
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 2987 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 2830 Fri Feb 11, 2005 9:18 pm
Zombie_Plan View latest post
No new posts [Code] Adding a Frames per Second Counter - Darkone
Author: BrotherTank
0 2055 Sat Mar 13, 2004 2:07 pm
BrotherTank View latest post
No new posts [Code] Changing an Enemies Attack Strength - BrotherTank
Author: BrotherTank
0 2368 Tue Jan 27, 2004 10:29 am
BrotherTank View latest post
No new posts [Code] Changing Weapons -CheckWeaponChange- BrotherTank
Author: BrotherTank
2 3197 Sun Oct 26, 2003 1:21 am
Guest 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