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       

CalcRotate and Atmosphere for high resolutions?
Page 1 of 1
DieHard Wolfers Forum Index -> SDL Code Crackers View Previous TopicRefresh this PageAdd Topic to your Browser FavoritesSearch ForumsPrint this TopicE-mail TopicGoto Page BottomView Next Topic
Post new topicReply to topic
Author Message
KyleRTCW
DieHard Officer
DieHard Officer


Joined: 30 Jul 2003
Last Visit: 09 Nov 2017

Topics: 45
Posts: 510
Location: Ohio
usa.gif

PostPosted: Mon May 09, 2011 4:02 pm
   Subject: CalcRotate and Atmosphere for high resolutions?
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Next PostGoto Bottom of Posts

I was wondering if anyone has toyed around with these routines to obtain better results at high resolutions. I like to play at 1680x1050 and it's a bit annoying to have guards who are moving north but appear to be moving west/east if they are on the edge of my screen.

With outside atmosphere, I'm sure you already know what I'm talking about. The snow/rain y position & speed does not scale with resolution and the stars rotate awkwardly.

I've been toying around with these but am wondering if anyone else has found a solution for these little quirks.

_________________
Steam: http://steamcommunity.com/id/stormx312
KyleRTCW
DieHard Officer
DieHard Officer


Joined: 30 Jul 2003
Last Visit: 09 Nov 2017

Topics: 45
Posts: 510
Location: Ohio
usa.gif

PostPosted: Tue May 10, 2011 6:41 pm
   Subject: Re: CalcRotate and Atmosphere for high resolutions?
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

For CalcRotate, I found changing
::: CODE :::
viewangle = player->angle + (centerx - ob->viewx)/8;

to
::: CODE :::
viewangle = player->angle + 319*(centerx - ob->viewx)/(8*centerx);


yielded much better results in enemy rotations

For snow/rain position, I found changing
::: CODE :::
y = -(heightnumerator<<7) + ((((pt->y << 6) + rainpos) & 0x0ffff) << 11);

to
::: CODE :::
y = -57278464 + ((((pt->y << 6) + rainpos) & 0x0ffff) << 11);

and
::: CODE :::
height = (heightnumerator<<10) / z;

to
::: CODE :::
height = (458227712) / z;


yielded better results (magic numbers ftw?) I actually got those numbers from the default resolution heightnumerator for viewsize = 20 I think.

_________________
Steam: http://steamcommunity.com/id/stormx312
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 0:36 ago.

Topics: 160
Posts: 8011
Location: Neo-traditions, Inc.
usa.gif

PostPosted: Mon Jul 04, 2016 5:26 pm
   Subject: Re: CalcRotate and Atmosphere for high resolutions?
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

I suggest to Ron that we post a link to this in the Code Tutorials section.
Ginyu
I am Death Incarnate
I am Death Incarnate


Joined: 29 Jan 2016
Last Visit: 10 Jun 2017

Topics: 2
Posts: 186

france.gif

PostPosted: Fri Dec 30, 2016 8:31 am
   Subject: Re: CalcRotate and Atmosphere for high resolutions?
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

About CalcRotate, I found that this works better :
::: CODE :::

viewangle = player->angle + (centerx - ob->viewx)/ (8 * viewwidth / 320);


centerx is the center X of the screen
ob->viewx is the where the object is on screen.

Dividing 8 was working really well in 320x resolution.
So for exemple if the resolution is 640 then centerx - ob->viewx will be twice as big.
So it makes more sense to me to just multiply 8 by how much bigger the screen is compared to the original 320X resolution : viewwidth / 320.
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 0:36 ago.

Topics: 160
Posts: 8011
Location: Neo-traditions, Inc.
usa.gif

PostPosted: Fri Dec 30, 2016 1:56 pm
   Subject: Re: CalcRotate and Atmosphere for high resolutions?
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Ginyu wrote:
Dividing 8 was working really well in 320x resolution.
So for exemple if the resolution is 640 then centerx - ob->viewx will be twice as big.
So it makes more sense to me to just multiply 8 by how much bigger the screen is compared to the original 320X resolution : viewwidth / 320.
Why not use the scaleFactor variable as a guide for this?
Matthew
DieHard SS
DieHard SS


Joined: 02 Jul 2007
Last Visit: 10 Oct 2017

Topics: 91
Posts: 464

usa.gif

PostPosted: Fri Dec 30, 2016 9:27 pm
   Subject: CalcRotate and Atmosphere for high resolutions?
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

CalcRotate doesn't calculate the angle correctly. It only uses the screen "x" coordinate as an approximation.

I wonder why iD programmed it this way. To correctly determine which angle range it is in, it only needs the tangents of the boundary angles, which can be pre-calculated.

I've been planning to fix this in my modified version of Wolf4SDL.
linuxwolf
Bring 'em On
Bring 'em On


Joined: 16 Oct 2012
Last Visit: 15:16 ago.

Topics: 6
Posts: 145


PostPosted: Sat Dec 31, 2016 4:26 am
   Subject: Re: CalcRotate and Atmosphere for high resolutions?
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Please feed this change back into Github Wolf4SDL. Talk to AlumiuN. I fixed the same bug in my own Wolf4SDL.

It was not a bug for ID since the game always ran at 320 pixels.
Ginyu
I am Death Incarnate
I am Death Incarnate


Joined: 29 Jan 2016
Last Visit: 10 Jun 2017

Topics: 2
Posts: 186

france.gif

PostPosted: Sat Dec 31, 2016 11:11 am
   Subject: Re: CalcRotate and Atmosphere for high resolutions?
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Tricot >> You're right.

Matthew >> You're right. It's an approximation.
But from what I tested, it seems to work decently even when the target is not so motivated to kill you.
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 0:36 ago.

Topics: 160
Posts: 8011
Location: Neo-traditions, Inc.
usa.gif

PostPosted: Sat Dec 31, 2016 12:20 pm
   Subject: Re: CalcRotate and Atmosphere for high resolutions?
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Bottom of Posts

Matthew wrote:
CalcRotate doesn't calculate the angle correctly. It only uses the screen "x" coordinate as an approximation.

I wonder why iD programmed it this way. To correctly determine which angle range it is in, it only needs the tangents of the boundary angles, which can be pre-calculated.
John Carmack has admitted that what he did in the Wolf3D code wasn't the best way of doing things. He said he did what he did because it was the simplest thing to do at the time. By the time the mid-1990s came around, Carmack was already disgusted with Wolf3D's game engine ... and such disgust more or less appears in some versions of Wolf3D (The F1 Help page).
Display posts from previous:   
Post new topicReply to topic Time synchronized with the forum server time
DieHard Wolfers Forum Index -> SDL Code Crackers View Previous TopicRefresh this PageAdd Topic to your Browser FavoritesSearch ForumsPrint this TopicE-mail TopicGoto Page TopView Next Topic
Page 1 of 1
Jump to:  

Related topics
 Topics   Replies   Views   Last Post 
No new posts Announcement: Wolf3d & Spear of Destiny Shareware SDL Downloads
Author: BrotherTank
10 13131 Tue Aug 24, 2010 10:18 am
dcbasic View latest post
No new posts [help] Three things & questions
Author: RichterBelmont12
54 4666 Sat Mar 12, 2011 8:56 pm
gerolf View latest post
No new posts Mathew's Questions about SDL & Wolf3d
Author: Matthew
45 3727 Fri Mar 13, 2009 11:43 am
TexZK View latest post
No new posts [Help] Disabling "Full Screen" Mode
Author: WSJ
4 1026 Sat Aug 02, 2008 6:42 pm
Tricob View latest post
No new posts [CODE] Health Shown as a message with full screen view
Author: Raziel
13 2111 Thu Jul 31, 2008 8:07 pm
Raziel 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