Author |
Message |
Born4battle
DieHard SS


Joined: 24 Mar 2006
Last Visit: 21 Jun 2014
Topics: 37
Posts: 388
Location: Cherry Chocolate Reign!!!

|
Posted: Wed Jun 06, 2007 11:16 am
Subject: Ripper's Shading Tutorial Problem
[ IP : Logged ]
|

 
|
|
That is the set of errors i get, what do I do??? |
_________________
"War is a conflict that does not determine who is right, but who is left."
|
|
 |
Tricob
Moderator


Joined: 14 Mar 2005
Last Visit: 10:11 ago.
Topics: 163
Posts: 8116
Location: Neo-traditions, Inc.

|
Posted: Wed Jun 06, 2007 6:43 pm
Subject: Re: Ripper's Shading Tutorial Problem
[ IP : Logged ]
|

  
|
|
Sorry, but less than a quarter of your screenshot is showing up here.  |
|
|
 |
Dugtrio17
Code Master

Joined: 11 Mar 2003
Last Visit: 03 Oct 2013
Topics: 49
Posts: 903
Location: Seattle

|
Posted: Wed Jun 06, 2007 6:50 pm
Subject: Ripper's Shading Tutorial Problem
[ IP : Logged ]
|

  
|
|
It does that while it loads. After the whole thing loads the whole screenshot will be there. |
_________________
|
|
 |
BrotherTank
Forum Administrator

Joined: 01 Mar 2003
Last Visit: 13 Sep 2017
Topics: 153
Posts: 2255
Location: Ontario

|
Posted: Wed Jun 06, 2007 6:50 pm
Subject: Re: Ripper's Shading Tutorial Problem
[ IP : Logged ]
|

  
|
|
Which tutorial did you follow Born?
The one on Ripper's Site was updated. From what I can see from your screen grab there, it looks like you are using the one that requires the file: Shade_a.asm. If that is the case, you will want to install Ripper's Remove the Scalers tutorial on his homepage.
Basically as he added tutorials on his page it changed the others... so he then went back and updated them. For the shading, the best 2 to install are his Remove the Scalers and then the Shading.. As the file Shade_A.asm is no longer required if you do that.
Hope that helps...
Greg
BrotherTank |
|
|
 |
Born4battle
DieHard SS


Joined: 24 Mar 2006
Last Visit: 21 Jun 2014
Topics: 37
Posts: 388
Location: Cherry Chocolate Reign!!!

|
Posted: Wed Jun 06, 2007 6:51 pm
Subject: Ripper's Shading Tutorial Problem
[ IP : Logged ]
|

  
|
|
that is all that needs to be shown, clicking on the error does nothing, and that is as big as the window goes for me...
--------------------EDIT------------------------
Thanks BT, but Im still a bit confused on a question asked about choosing which levels get it, the answer was very vague to me |
_________________
"War is a conflict that does not determine who is right, but who is left."
|
|
 |
BrotherTank
Forum Administrator

Joined: 01 Mar 2003
Last Visit: 13 Sep 2017
Topics: 153
Posts: 2255
Location: Ontario

|
Posted: Wed Jun 06, 2007 7:13 pm
Subject: Re: Ripper's Shading Tutorial Problem
[ IP : Logged ]
|

  
|
|
Ah...
In his tutorial you will see I believe a section in the wl_play.c file that looks like this:
::: CODE :::
switch (gamestate.episode*10+mapon)
{
case 0:GenerateShadeTable(15,15,15,&gamepal,LSHADE_FOG); break;
case 1:
case 2:
case 6:GenerateShadeTable(0,0,0,&gamepal,LSHADE_NORMAL); break;
case 5:GenerateShadeTable(0,0,0,&gamepal,LSHADE_FOG); break;
default:GenerateShadeTable(10,10,10,&gamepal,LSHADE_NORMAL); break;
}
That is where he is setting up the shading for the different levels. Unfortunately, he doesn't give a great example of what to do to change it to suit your own needs...
Basically what he has done is Episode 1 - the cases for the different levels will be 0 to 9 for those 10 levels. For episode 2 the cases will be 10 to 19, for Ep 3 = 20 to 29, for Ep 4 = 30 to 39, Ep 5 = 40 to 49 and finally Episode 6 = 50 to 59.
If you want certain levels to have a specific shading, then you will create another case switch to set the values you want for that level.
In the code line:
::: CODE :::
GenerateShadeTable(0,0,0,&gamepal,LSHADE_NORMAL);
The first 0 is the Red value, the second 0 is the Green value, and the 3rd 0 is the Blue value.
The &gamepal will be the same for all levels (unless you play some tricks and add a shading palette to the game just for shading).
The last Item can be "LSHADE_NORMAL" or "LSHADE_FOG" if you want fog on that level.
Remember that the level you see on the screen is always "-1" to what the game is looking at, so level 1 is actually 0 to the code....
If you want to get fancy, you can do what I did for the "Map Contest" and use the map to change or set the settings of your shading... what I did was this... I replaced Rippers code shown above with this:
::: CODE :::
GenerateShadeTable(MAPSPOT(0,1,0),MAPSPOT(0,2,0),MAPSPOT(0,3,0),&gamepal,(MAPSPOT(0,4,0)==0?LSHADE_NORMAL:LSHADE_FOG));
And what this does is use the 4 spaces down, on the Left side of the map starting from position 1 to set the shading that you want in the game. It allows you to set the Red, Green, Blue values and the Shading Level by using WALL values placed on the map in those positions....
Hope that helps...
Greg
BrotherTank |
|
|
 |
Born4battle
DieHard SS


Joined: 24 Mar 2006
Last Visit: 21 Jun 2014
Topics: 37
Posts: 388
Location: Cherry Chocolate Reign!!!

|
Posted: Wed Jun 06, 2007 9:32 pm
Subject: Ripper's Shading Tutorial Problem
[ IP : Logged ]
|

  
|
|
I put back in a fresh copy of the source code, and did the tutorial from Ripper's site, but I think it's the same, and its still doing the thing from the screenshot above... |
_________________
"War is a conflict that does not determine who is right, but who is left."
|
|
 |
BrotherTank
Forum Administrator

Joined: 01 Mar 2003
Last Visit: 13 Sep 2017
Topics: 153
Posts: 2255
Location: Ontario

|
Posted: Wed Jun 06, 2007 10:43 pm
Subject: Re: Ripper's Shading Tutorial Problem
[ IP : Logged ]
|

  
|
|
Give me a day or so... I'll upload the virgin code files with the necessary changes for Rippers shading stuff installed along with the Remove the Scalers tutorial...(it will only include the changed files) if that will help you out??? When I've uploaded it, I'll let you know and it will be in the Download section of the forums... Ok??
Greg
BrotherTank |
|
|
 |
Tricob
Moderator


Joined: 14 Mar 2005
Last Visit: 10:11 ago.
Topics: 163
Posts: 8116
Location: Neo-traditions, Inc.

|
Posted: Thu Jun 07, 2007 7:48 pm
Subject: Re: Ripper's Shading Tutorial Problem
[ IP : Logged ]
|

  
|
|
I'll be downloading that one too, BT. Thanks!  |
|
|
 |
BrotherTank
Forum Administrator

Joined: 01 Mar 2003
Last Visit: 13 Sep 2017
Topics: 153
Posts: 2255
Location: Ontario

|
Posted: Fri Jun 08, 2007 11:59 pm
Subject: Source code base you were looking for... Sorry for the Delay
[ IP : Logged ]
|

  
|
|
Ok well... it's not much... and it doesn't have all the tutorials installed into it... but it has the ones that you've asked for and a few of the more difficult ones to get working. It will use either 64x64 or 128x128 sprites - Shading... - Raycastor is installed (which does Blake Style doors and more).
Anyhow... look around the source... it's been tested, so I know that it's working 100%.
Hope that helps both of you out. The file is "BrotherTank's Base Source"... it's in the downloads section (along with other things you might have wanted there Tricob...
Sorry it took so long to get it together and uploaded...
Greg
BrotherTank  |
|
|
 |
Tricob
Moderator


Joined: 14 Mar 2005
Last Visit: 10:11 ago.
Topics: 163
Posts: 8116
Location: Neo-traditions, Inc.

|
|
 |
BrotherTank
Forum Administrator

Joined: 01 Mar 2003
Last Visit: 13 Sep 2017
Topics: 153
Posts: 2255
Location: Ontario

|
Posted: Sat Jun 09, 2007 4:49 pm
Subject: Re: Ripper's Shading Tutorial Problem
[ IP : Logged ]
|

  
|
|
Not a problem... I probably should have installed the Ceiling/Floor Textures into it as well as the values for 128x128 change as well... I have uploaded a replacement "wl_def.h" file in the downloads section. That should give you a little more free memory as well. Just download and replace your original...
Greg
BrotherTank |
|
|
 |
BrotherTank
Forum Administrator

Joined: 01 Mar 2003
Last Visit: 13 Sep 2017
Topics: 153
Posts: 2255
Location: Ontario

|
Posted: Sat Jun 09, 2007 6:04 pm
Subject: Re: Ripper's Shading Tutorial Problem
[ IP : Logged ]
|

  
|
|
If you need the Ceiling/Floor Textures - Here is the latest code that I have for that:
::: CODE :::
//#define CFTEXTUREANIM // Animate Sections of the Ceiling/Floor Textures
//#define CFTEXTURES // Darkone/BT - Ceiling-Floor Textures
//#define CFTEXTURESADAM // Adam Biser - Draw Ceiling/Floor Textures using Map Floor Values
//#define CFTEXTUREADAM2 // Adam Biser - Enable and User 3rd Map Plane to get Texture Values
//#define CFTEXTUREADCOD // CodeTech - Fix Floor Textures between doors
//#define CFTEXTUREGRAPH // BotherTank - Textures are stored After Walls & Before Doors
//#define CFTEXTUREWAVY // Tek_ZK - Make the Floor Textures Wavy
#ifdef CFTEXTURES
#ifdef CFTEXTUREGRAPH
#define CFFIRSTTEXTURE (DOORWALL - NUMTEXTURES)
#define CFLASTTEXTURE (NUMTEXTURES)
#endif
#ifdef CFTEXTUREADCOD
unsigned GetSplitTexture (int u, int v, int x, int y, boolean vert, int plane)
{
if (vert) if ((u&RESVAL3) < RESVAL4) x--; else x++;
else if ((v&RESVAL3) < RESVAL4) y++; else y--;
return MAPSPOT(x,y,plane) - AREATILE+1;
}
#endif
// which -> 0 = Floor 1= Ceiling 2=DoomSky 3=DrawClouds
// texture -> Texture to use
// texture2 -> Texture to use if parallaxed and colour of texture = 255 as overlay
// wavy -> turns on wavy effect
#ifdef CFTEXTUREWAVY
void DrawFlats(int which, int texture, int texture2, boolean wavy)
#else
void DrawFlats(int which, int texture, int texture2)
#endif
{
int x, y, y0, halfheight,u, v, du0, du1, tmp1;
unsigned buf_add, tmp, tmp0;
fixed dist; // distance to row projection
fixed tex_step; // global step per one screen pixel
fixed gu, gv, du, dv; // global texture coordinates
byte p, color, far *src, far *src1;
#ifdef CFTEXTURESADAM
int floorx,floory,plane=0,texturenew, texturelast = -1;
#endif
#ifdef CFTEXTUREADCOD
unsigned door;
int tile;
#endif
#ifdef CFTEXTUREWAVY
fixed shift, shiftmp; // wave shift
#endif
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
tmp0=80*(which?(halfheight-y0-1):(halfheight+y0)); // and will decrease by 80 each row
tmp1=(which?-80:80);
#ifdef CFTEXTUREADAM2
plane = 2;
#endif
switch (which)
{
#ifdef CLOUDYSKY
case 3: { break; }
#endif
case 2: // Parallaxed Floor
{
du0=128-((viewangle%VANG90)<<7)/VANG90;
src=PM_GetPage(texture);
if(texture2)
{
texture2 = ((texture2-1)<<1) + which;
du1=(gamestate.TimeCount>>3)&127; // layered sky, 2nd layer movement
src1=PM_GetPage(texture2);
}
break;
}
default:
{
if (texture < 1) texture = 1;
#ifdef CFTEXTUREGRAPH
src= PM_GetPage(((texture-1)<<1) + which + CFFIRSTTEXTURE);
#else
src= PM_GetPage(((texture-1)<<1) + which);
#endif
break;
}
}
for(p=0; p<4; p++) // start draw horizontal lines of textures in block sections
{
VGAMAPBIT(p);
for(y=y0, tmp=tmp0; y<halfheight; y++, tmp+=tmp1)
{
switch (which)
{
default:
{
#ifdef SHADING
#ifndef RAYCASTOR
curshades = shadetable[0];
#else
colormap=lighttable[0];
#endif
if (gamestate.shading)
{
#ifndef RAYCASTOR
byte shade = (y<<2) / (SHIFTR8(maxscaleshl2)+1+LSHADE_flag);
if(shade>32) shade=32; else if(shade<1) shade=1;
curshades = shadetable[32-shade];
#else
if(spec_lt) colormap=spec_lt; // special lighttable
else if (y<viewheight) colormap=lt[y>>2]; // from shade table
#endif
}
#endif
dist=(heightnumerator/y+(which?1:3))<<(which==2?8:5);
tex_step=SHIFTL8(dist)/viewwidth/175;
du= FixedByFrac(tex_step, viewsin);
dv=-FixedByFrac(tex_step, viewcos);
#ifdef CLOUDYSKY
gu=( viewx+FixedByFrac(dist, viewcos)+(which == 2?cloudx:0))-((viewwidth>>1)-p)*du;
gv=(-viewy+FixedByFrac(dist, viewsin)+(which == 2?cloudy:0))-((viewwidth>>1)-p)*dv;
#else
gu=( viewx+FixedByFrac(dist, viewcos))-((viewwidth>>1)-p)*du;
gv=(-viewy+FixedByFrac(dist, viewsin))-((viewwidth>>1)-p)*dv;
#endif
du<<=2; // 4pix step
dv<<=2;
break;
}
case 2: { v=RESVAL4-(y<<RESVAL13)/halfheight; break; }
}
for(x=p, buf_add=tmp; x<viewwidth; x+=4, buf_add++)
{
if(wallheight[x]>>3<=y)
{
switch (which)
{
#ifdef CLOUDYSKY
case 3: // Rippers Cloudy Sky
u=(gu>>13)&255; v=(gv>>13)&255;
color=*(skyc+SHIFTL8((255-u))+(255-v));
break;
#endif
case 2: // Darkone's Doom Sky (Parallaxed)
u=((unsigned)x<<7)/viewwidth+du0;
color=*(src+((u&RESVAL3)<<RESVAL6)+(v|(u&RESVAL9)>>1));
if(color==0xFF && texture2) { u+=du1; color=*(src1+((u&RESVAL3)<<RESVAL6)+(v|(u&RESVAL9)>>1)); }
break;
default: // Normal Ceiling or Floor
{
u=(gu>>RESVAL5);
v=(gv>>RESVAL5);
#ifdef CFTEXTURESADAM
floorx = TILESHIFTR(gu)&63; floory = (-TILESHIFTR(gv)-1)&63;
texturenew = MAPSPOT(floorx,floory,0);
#ifdef CFTEXTUREANIM // Define static floor object that will triger animated floor
if (MAPSPOT(floorx,floory,1)== 535 && !which) texturenew+= (frameon>>4)&3;
#endif
#ifdef CFTEXTUREADCOD // Split doorway texture
tile = tilemap[floorx][floory];
if ((tile & 0x80) && MAPSPOT(floorx,floory,1) != PUSHABLETILE )
{
texturenew = GetSplitTexture(u, v, floorx,floory, doorobjlist[tile & 0x7f].vertical,plane);
texturenew = ((texturenew-1)<<1) + which;
}
else
#endif
if (texturenew >= 1 && texturenew <= MAXWALLTILES)
{ texturenew = ((texturenew-1)<<1) + 1; } // Under a wall
else
#ifdef CFTEXTUREADAM2
{ // Get Value from 3rd Map Plane by byte High=Ceiling Low=Floor
texturenew = (MAPSPOT(floorx,floory,plane)(which?>> 8:& 0xff));
}
#else
if (texturenew >= AREATILE && texturenew <= AREATILE + NUMAREAS)
{ texturenew = (((texturenew - AREATILE+1)-1)<<1) + which; } // Floor Values
else texturenew = ((texture-1)<<1) + which;
#endif
if (texturenew < 0) break;
#ifdef CFTEXTUREGRAPH
if (texturenew <= 1 && texturenew >= CFLASTTEXTURE) texturenew = which;
texturenew += CFFIRSTTEXTURE;
#endif
if (texturenew != texturelast)
{
texturelast = texturenew;
src=PM_GetPage(texturenew);
}
#endif
#ifdef CFTEXTUREWAVY
if (wavy && !which) // Shift u & v Values to make it look like floor is in waves
{
shift = (u + TimeCount) & 255;
shiftmp = sintable[shift];
shift = (shiftmp & ~0x80000000L) >> 12;
shift = (shiftmp & 0x80000000L) ? -shift : shift;
u += shift;
v += shift;
}
#endif
color=*(src+((u&RESVAL3)<<RESVAL6)+(RESVAL3-(v&RESVAL3)));
if(color==0xFF && texture2) { color = texture2; }
break;
}
}
#ifdef SHADING
if ((gamestate.shading) && which <= 1)
#ifdef RAYCASTOR
color = colormap[color];
#else
color = curshades[color];
#endif
#endif
// draw pixel using [color]
#ifdef CFTEXTURESADAM
if (texturenew)
#endif
asm { mov es,[screenseg]; mov di,[bufferofs]; add di,[buf_add]; mov al,[color]; mov es:[di],al; }
}
gu+=du; gv+=dv;
}
}
}
}
If you install Ripper's Cloudy Sky... you can skip or not install his DrawSky?? routine and just enable the Cloudysky define in your Version.h File. You will also see the version.h defines at the top of the code for the various items within the code itself.
To use it.. Call it 1 or 2 times (or more if you really want to play) after the WallRefresh call in the ThreeDRefresh routine in the wl_draw.c file. As you can see it does a simple Parallax (like Doom) using 1 graphic (or 2 if you tell it to use 2 ). Again, as the rest of the code that I uploaded, the code will self modify over to use 128x128 graphics if you enable the HIGHRESVSWAP in Version.h
The rest of the tutorials are so easy to install that I haven't done them...
If you install Ripper's Cloudsky tutorial, then you need to locate your DrawFlats calls after the 2 new lines that Ripper's tutorial will add.
So that should be a little more help...
Greg
BrotherTank |
|
|
 |
BrotherTank
Forum Administrator

Joined: 01 Mar 2003
Last Visit: 13 Sep 2017
Topics: 153
Posts: 2255
Location: Ontario

|
Posted: Sat Jun 09, 2007 6:15 pm
Subject: Re: Ripper's Shading Tutorial Problem
[ IP : Logged ]
|

  
|
|
Oh...
Almost forgot..
One of the things I've been playing with, to try and get rid of the little space between the corner of the walls when you look at certain angles, is by playing with the value of PI. Change the current define in the wl_def.h file to this:
#define PI 3.14159265358979323846264338327950288419716939937510
And you should notice the problem a whole lot less if at all.
Greg
BrotherTank |
|
|
 |
Tricob
Moderator


Joined: 14 Mar 2005
Last Visit: 10:11 ago.
Topics: 163
Posts: 8116
Location: Neo-traditions, Inc.

|
Posted: Sat Jun 09, 2007 6:59 pm
Subject: Re: Ripper's Shading Tutorial Problem
[ IP : Logged ]
|

  
|
|
Awesome work, BT. I knew *someone* was going to figure out the problem. This might also help the "direct hit" bug where you can sometimes make a direct hit on the enemy, and he isn't even affected (The enemy can't harm you either, when this is the case). You have to change your angle or move in closer whenever this bug shows up. In Adam's WinWolf3D port of the code, it's even more noticeable in high resolutions. |
|
|
 |
Tricob
Moderator


Joined: 14 Mar 2005
Last Visit: 10:11 ago.
Topics: 163
Posts: 8116
Location: Neo-traditions, Inc.

|
Posted: Sat Jun 09, 2007 7:22 pm
Subject: Re: Ripper's Shading Tutorial Problem
[ IP : Logged ]
|

  
|
|
Has anyone managed to get BT's new download working? Windows XP is giving me a "corrupt ZIP" error when I attempt to open it. If the answer is "yes", I guess it's time to run a day-long virus/trojan scan on my machine again ...  |
|
|
 |
BrotherTank
Forum Administrator

Joined: 01 Mar 2003
Last Visit: 13 Sep 2017
Topics: 153
Posts: 2255
Location: Ontario

|
Posted: Sat Jun 09, 2007 7:48 pm
Subject: Re: Ripper's Shading Tutorial Problem
[ IP : Logged ]
|

  
|
|
I just downloaded and opened the file no problem... It shouldn't make any difference but I did compress it with Winzip 8.0 ...
Greg
BrotherTank |
|
|
 |
Tricob
Moderator


Joined: 14 Mar 2005
Last Visit: 10:11 ago.
Topics: 163
Posts: 8116
Location: Neo-traditions, Inc.

|
Posted: Sun Jun 10, 2007 11:06 am
Subject: Re: Ripper's Shading Tutorial Problem
[ IP : Logged ]
|

  
|
|
I'll try WinZIP, then. I remember having Version 10 on a CD someplace. |
|
|
 |
BrotherTank
Forum Administrator

Joined: 01 Mar 2003
Last Visit: 13 Sep 2017
Topics: 153
Posts: 2255
Location: Ontario

|
Posted: Sun Jun 10, 2007 7:27 pm
Subject: Re: Ripper's Shading Tutorial Problem
[ IP : Logged ]
|

  
|
|
I also went back to the DOS version of PKZIP and re-uploaded the file. That way it has nothing to do with Windows - I've downloaded and opened the file with both the DOS version of PKZIP and the Windows 8.0 Winzip...
So if you are still having problems, then it's something on your machine.
Greg
BrotherTank |
|
|
 |
Tricob
Moderator


Joined: 14 Mar 2005
Last Visit: 10:11 ago.
Topics: 163
Posts: 8116
Location: Neo-traditions, Inc.

|
Posted: Sun Jun 10, 2007 9:11 pm
Subject: Ripper's Shading Tutorial Problem
[ IP : Logged ]
|

  
|
|
Turns out it keeps marking the download as "done" when it's only half-finished. I'll try a different browser and a different machine and let you know what happens tomorrow. |
|
|
 |
Tricob
Moderator


Joined: 14 Mar 2005
Last Visit: 10:11 ago.
Topics: 163
Posts: 8116
Location: Neo-traditions, Inc.

|
Posted: Tue Jun 12, 2007 6:16 pm
Subject: Re: Ripper's Shading Tutorial Problem
[ IP : Logged ]
|

  
|
|
Both IE and Firefox hack off the ZIP, marking it as "finished" after about 5 minutes of downloading it. Not a problem if you have something faster than dial-up, but I don't, so the download never completes.
Suggestions, anyone? I'm also open to someone E-Mailing the ZIP to me as well.  |
|
|
 |
Tricob
Moderator


Joined: 14 Mar 2005
Last Visit: 10:11 ago.
Topics: 163
Posts: 8116
Location: Neo-traditions, Inc.

|
|
 |
Tris
Can I Play Daddy

Joined: 02 May 2017
Last Visit: 19 Apr 2018
Topics: 2
Posts: 44
Location: Wien

|
Posted: Sat Dec 02, 2017 5:33 am
Subject: Re: Ripper's Shading Tutorial Problem
[ IP : Logged ]
|

  
|
|
will try this out to make floor texturs possible.
is there a way to "uncall" the shading? |
|
|
 |
Tricob
Moderator


Joined: 14 Mar 2005
Last Visit: 10:11 ago.
Topics: 163
Posts: 8116
Location: Neo-traditions, Inc.

|
Posted: Sat Dec 02, 2017 11:31 am
Subject: Re: Ripper's Shading Tutorial Problem
[ IP : Logged ]
|

 
|
|
Just put a wall with the value of Zero in the upper-left corner of the map. |
|
|
 |
|