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       

Hi-res (128x128) code tutorial
Page 1 of 1
DieHard Wolfers Forum Index -> 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
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 16 Sep 2018

Topics: 163
Posts: 8189
Location: Neo-traditions, Inc.
usa.gif

PostPosted: Tue Nov 20, 2012 5:54 pm
   Subject: Hi-res (128x128) code tutorial
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Next PostGoto Bottom of Posts

Anyone have a link to Ripper's Hi-res (128x128 graphics) tutorial? His site seems to be hanging on my internet browser. Sad

As you might have guessed, I'm trying to use this code as a reference to build a Wolf4SDL-compatible code tutorial to enable 256x256 graphics. I don't expect to succeed at this single-handedly, but I'll see how far I can get. Smile
insurrectionman
DieHard Mutant
DieHard Mutant


Joined: 07 May 2005
Last Visit: 31 Aug 2018

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

PostPosted: Tue Nov 20, 2012 7:51 pm
   Subject: Hi-res (128x128) code tutorial
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Seems to be working fine now.

Just in case: here's a copy+paste

::: CODE :::
High resolution tutorial
By Ripper

Please take a seat before I welcome you to my seventh Wolf tutorial ;D

This tutorial will show you how to use 128x128 textures instead of those pixelized 64x64 ones. This doesn't mean at all, that you should blend all your standard textures and sprites to 128x128 pixel as shown below to give it this ugly "Oh, I lost my glasses" fealing :

 
Nice, isn't it?
   
"Look at my flatly blended uglyness!!"

Requirements:

    Our "Removing the scalers" tutorial
    An Wolfenstein 3D editor capable of editing 128x128 textures and sprites (e.g. ChaosEdit or WDC)


Let's go (after making a backup of your source, of course):

Update:    The following code contained a bug which limited the number of EMS pages used by Wolf3D to 1 instead of 4. Together with the PMFrameCount Wolf3D bug mentioned later it made different floor and ceiling textures impossible (8.5.2005)

Open ID_PM.H and change the green marked part to look like this:

   #define   EMSPageSizeKB   (EMSPageSize >> 10)
#define   EMSFrameCount   4
#define   PMPageSize      16384
#define   PMPageSizeSeg   (PMPageSize >> 4)

For the sounds still to work, we mustn't let ID_SD.C see these changes! Therefore add the following blue lines at the begining of the file after the includes:

   #pragma  hdrstop
#pragma  warn  -pia

#undef   PMPageSize
#define  PMPageSize 4096

#ifdef   nil
#undef   nil

If you didn't already apply my PMFrameCount bugfix (see http://diehardwolfers.areyep.com/viewtopic.php?p=9517#9517), go to the PML_GetEMSAddress function in ID_PM.C and add the blue line:

         EMSList[emspage].baseEMSPage = emsbase;
      PML_MapEMS(page / PMEMSSubPage,emspage);
   }

   if (emspage == -1)
      Quit("PML_GetEMSAddress: EMS find failed");

   PM_NextFrame();
   EMSList[emspage].lastHit = PMFrameCount;
   offset = emspage * EMSPageSizeSeg;
   offset += emsoff * PMPageSizeSeg;
   return((memptr)(EMSPageFrame + offset));
}

This makes sure, that every loaded texture has its own age, so 4 different high resolution textures in EMS can be used at the same time (of course, you can have any number of textures in main memory, as long as there's enough room ).

Now open WL_DRAW.C and change the green marked code in the ScalePost function:

         yoffs+=((postx+i)>>2);
      yendoffs=viewheight/2+ywcount-1;
      yw=127;
      while(yendoffs>=viewheight)
      {
         ywcount-=64;
         while(ywcount<=0)
         {
            ywcount+=yd;
            yw--;
         }
         yendoffs--;
      }
      if(yw<0) break;
#ifdef SHADE_COUNT
      col=curshades[((byte far *)postsource)[yw]];
#else
      col=((byte far *)postsource)[yw];
#endif
      yendoffs=yendoffs*80+((postx+i)>>2);
      while(yoffs<=yendoffs)
      {
         vmem[yendoffs]=col;
         ywcount-=64;
         if(ywcount<=0)

Now change the following green marked parts in HitVertWall, HitHorizWall, HitHorizPWall and HitVertPWall as follows:

      texture = ([x OR y]intercept>>2)&0x3f80;
and
      texture = 0x3f80-texture;

In HitHorizDoor and HitVertDoor change this:

      texture = ( (yintercept-doorposition[doornum]) >> 2) &0x3f80;

If you're using DarkOne's Texture/Ceiling tutorial, you'll need to change the following green marked lines in the DrawFlats functions:

          if(wallheight[x]>>3<=y)
       {
          u=(gu>>9)&127; v=(gv>>9)&127;
          color=*(src_top+((127-u)<<7)+(127-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<<7)+(127-v));

// draw bottom pixel using <color>

Go to the WL_SCALE.C and remove the red marked characters in ScaleShape and SimpleScaleShape:

      pixheight=scale*2;
   actx=xcenter-scale;
   upperedge=viewheight/2-scale;

If you're going to use the Directional 3D Sprites tutorial, you'll have to change the following green parts and remove the red part in the Scale3DShaper function. (Be sure to have a recent version of the D3DSprites tut, as it wasn't possible to have a sprite at a width smaller than a full tile whatever the real sprite width was):

      fixed height,dheight;
   int xpos[129];
   int slinex;

[...]

   dxa=-(dxx>>1),dza=-(dzz>>1);
   dxx>>=7,dzz>>=7;
   dxa+=shape->leftpix*dxx,dza+=shape->leftpix*dzz;

[...]

#endif

            pixheight=scale1*2;
            upperedge=viewheight/2-scale1;

Now codewise everything is prepared for quality textures and sprites! You can even try your old vswap now to see something "beautiful" like this:


With DarkOne's Floor/Ceiling textures and Directional 3D Sprites (as said above, those "HiRes" sprites are really complete rubish...) it looks like this:



Here you may download my "HiRes" VSWAP (base content copyrighted by ID Software), but please don't use those sprites without a huge touch up! I don't want to see any shitty mods using those sprites!! This file is just provided for giving you an nearly acceptable hires wallset (this also needs quite some touch up) and for making the game playable as long as you don't have enough hires sprites.
So here it is: HiresVswap.zip

Thanks for reading, give us some credits and start painting ;D

Ripper

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

New Site: http://www.treesapthief.com
Twitter: @treesapthief
RichterBelmont12
DieHard Wolfer
DieHard Wolfer


Joined: 14 Aug 2004
Last Visit: 13 Sep 2018

Topics: 97
Posts: 1508
Location: New Jersey
usa.gif

PostPosted: Tue Nov 20, 2012 8:19 pm
   Subject: Re: Hi-res (128x128) code tutorial
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Tricob wrote:
As you might have guessed, I'm trying to use this code as a reference to build a Wolf4SDL-compatible code tutorial to enable 256x256 graphics. I don't expect to succeed at this single-handedly, but I'll see how far I can get. Smile


I find it funny that no Editor that i know of can edit 256x256 Sprites....I only one i feel comfy with is chaosedit

_________________
http://www.youtube.com/RichterBelmont12

https://www.facebook.com/RichterBelmont123

https://twitter.com/Richterbelmont6
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 16 Sep 2018

Topics: 163
Posts: 8189
Location: Neo-traditions, Inc.
usa.gif

PostPosted: Wed Nov 21, 2012 5:51 pm
   Subject: Re: Hi-res (128x128) code tutorial
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Thanks, Insurrectionman; I jus tried the site again, but haven't had any luck loading it. Maybe the problem is related to the IP (Comcast)? Confused

There's a new Wolf3D editor out there that might support 256x256, but I honestly don't know; I haven't even tracked down the link lately. I'll probably do that when I move my compiler to another computer (which doesn't have Windows 7).
Tris
Guest



Last Visit:





PostPosted: Wed Feb 11, 2015 12:50 pm
   Subject: Hi-res (128x128) code tutorial
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Does anyone else notice that when you change to 128x128, it becomes much more difficult to shoot a guard?
It's as if the code doesn't increase the hitpoint range on a sprite. (does that make any sense?)
Is there a fix for this?
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 16 Sep 2018

Topics: 163
Posts: 8189
Location: Neo-traditions, Inc.
usa.gif

PostPosted: Wed Feb 11, 2015 1:22 pm
   Subject: Re: Hi-res (128x128) code tutorial
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

The range of your guns does seem to be decreased when this feature is enabled. I remember posting all sorts of "fixes" for this in my WolfDX DOS demos, and none of the fixes actually worked. Confused I need to look into this a little bit more before I can find out how to make the shooting range equal to what it was.
AlumiuN
DieHard Wolfer
DieHard Wolfer


Joined: 29 Nov 2007
Last Visit: 2:20 ago.

Topics: 38
Posts: 2481
Location: Christchurch, New Zealand
newzealand.gif

PostPosted: Wed Feb 11, 2015 3:09 pm
   Subject: Re: Hi-res (128x128) code tutorial
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

I'm afraid that this must be a placebo effect or something similar, because there's nothing in the code related to the resolution of the textures that has anything to the accuracy or range of the weapons.
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 16 Sep 2018

Topics: 163
Posts: 8189
Location: Neo-traditions, Inc.
usa.gif

PostPosted: Wed Feb 11, 2015 7:29 pm
   Subject: Re: Hi-res (128x128) code tutorial
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Unless the range of the weapon is completely unaffected, and - instead - the horizontal alignment of the sprites is slightly off, depending on its distance.
AlumiuN
DieHard Wolfer
DieHard Wolfer


Joined: 29 Nov 2007
Last Visit: 2:20 ago.

Topics: 38
Posts: 2481
Location: Christchurch, New Zealand
newzealand.gif

PostPosted: Wed Feb 11, 2015 9:51 pm
   Subject: Re: Hi-res (128x128) code tutorial
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

As far as I can tell the horizontal alignment of sprites is not affected either.
Tris
Guest



Last Visit:





PostPosted: Thu Feb 12, 2015 4:28 am
   Subject: Re: Hi-res (128x128) code tutorial
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

well, then I guess the combination of Dosbox memory and 128x128 affects my mod, lol.
Thanks for the pointers!
Tris
Guest



Last Visit:





PostPosted: Tue Apr 07, 2015 12:48 pm
   Subject: Hi-res (128x128) code tutorial
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Hi fellas,

Since using this feature, the game lags enormously. Not in gameplay, but after "Get Psyched!" it takes FOREVER to load a level. (Using Dosbox, ofcourse).
Any pointers?

Regards,

-Tristan
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 16 Sep 2018

Topics: 163
Posts: 8189
Location: Neo-traditions, Inc.
usa.gif

PostPosted: Tue Apr 07, 2015 5:56 pm
   Subject: Re: Hi-res (128x128) code tutorial
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

This actually has nothing to do with the hi-res graphics feature. This is a side effect of enabling the "shading" feature. It's creating the shading tables before it begins playing the level.

I'm sure there's a way to have it make the tables on the sign-on screen instead, but I honestly don't know how to do that just yet ...
Tris
Guest



Last Visit:





PostPosted: Tue Apr 07, 2015 10:53 pm
   Subject: Hi-res (128x128) code tutorial
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Thanks for the swift reply mate, really appreciate it. Smile
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 16 Sep 2018

Topics: 163
Posts: 8189
Location: Neo-traditions, Inc.
usa.gif

PostPosted: Wed Apr 08, 2015 4:02 am
   Subject: Re: Hi-res (128x128) code tutorial
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

If it makes you feel better, when I enabled both shading and hi-res textures, I, too - at first - thought the hi-res textures code was what was giving me that long black screen. I didn't know the code was creating a shading table simply because I didn't look over the code all that well. Smile
Tris
Can I Play Daddy
Can I Play Daddy


Joined: 02 May 2017
Last Visit: 16 Sep 2018

Topics: 3
Posts: 44
Location: wien
austria.gif

PostPosted: Tue May 02, 2017 12:22 pm
   Subject: Re: Hi-res (128x128) code tutorial
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

hello there! is there any way to add the 128x128 textures without the shading part?

_________________
Download the Kurlandfront TC now at moddb
AlumiuN
DieHard Wolfer
DieHard Wolfer


Joined: 29 Nov 2007
Last Visit: 2:20 ago.

Topics: 38
Posts: 2481
Location: Christchurch, New Zealand
newzealand.gif

PostPosted: Tue May 02, 2017 4:08 pm
   Subject: Re: Hi-res (128x128) code tutorial
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Wolf4SDL has them already implemented, just uncomment the USE_HIRES line in version.h.
Tris
Can I Play Daddy
Can I Play Daddy


Joined: 02 May 2017
Last Visit: 16 Sep 2018

Topics: 3
Posts: 44
Location: wien
austria.gif

PostPosted: Sat Dec 02, 2017 5:27 am
   Subject: Hi-res (128x128) code tutorial
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Bottom of Posts

is it perhaps so that I can choose not to trigger the shading?
Will that remove the problem of the long loading?
Display posts from previous:   
Post new topicReply to topic Time synchronized with the forum server time
DieHard Wolfers Forum Index -> Code Crackers View Previous TopicRefresh this PageAdd Topic to your Browser FavoritesSearch ForumsPrint this TopicE-mail TopicGoto Page TopView Next Topic
Page 1 of 1
Jump to:  

Related topics
 Topics   Replies   Views   Last Post 
No new posts Sticky: [Info] Help for newbie coders! C++ Tutorial
Author: Dugtrio17
20 9415 Sun Jan 10, 2010 12:26 pm
Fragstein3D View latest post
No new posts [Info] Black & White Effect - Tutorial
Author: Guest
10 297 Thu Mar 17, 2005 6:24 pm
Dugtrio17 View latest post
No new posts [Code] Run with Stamina - TekZK
Author: BrotherTank
8 3172 Sun May 16, 2004 12:54 am
Codetech84 View latest post
This topic is locked: you cannot edit posts or make replies. [Info] Source code for Darkone's NewWolf Classic
Author: Raistlin
1 1753 Tue Feb 10, 2004 10:18 am
BrotherTank View latest post
No new posts [Info] Slideshows Between Levels? - SoD side of Code
Author: Hair Machine
2 1496 Fri Dec 26, 2003 11:02 am
jamez 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