Page 2 of 2 FirstFirst 12
Results 16 to 25 of 25

Thread: Latest patch - scaling error

  1. #16
    Registered User
    Join Date
    Aug 2002
    Posts
    189
    Play around with this diff. It ignores spawns that are way outside the map boundary.

    Code:
    diff -u -r1.3 mapcore.h
    --- mapcore.h   31 May 2002 21:49:28 -0000      1.3
    +++ mapcore.h   6 Jan 2003 16:09:36 -0000
    @@ -565,22 +565,22 @@
       printf("in x: %i, in y: %i, max(%i,%i) Min(%i,%i)\n", x, y, m_maxX, m_maxY, m_minX, m_minY);
     #endif /* MAP_DEBUG */
    
    -  if (x > m_maxX)
    +  if (x > m_maxX && x < 2 * m_maxX)
       {
         m_maxX = x;
         flag = true;
       }
    -  if (y > m_maxY)
    +  if (y > m_maxY && y < 2 * m_maxY)
       {
         m_maxY = y;
         flag = true;
       }
    -  if (x < m_minX)
    +  if (x < m_minX && x > 2 * m_minX)
       {
         m_minX = x;
         flag = true;
       }
    -  if (y < m_minY)
    +  if (y < m_minY && y > 2 * m_minY)
       {
         m_minY = y;
         flag = true;
    Last edited by ksmith; 01-16-2003 at 03:41 PM.

  2. #17
    Registered User
    Join Date
    Apr 2002
    Posts
    59
    Originally posted by ksmith
    Play around with this diff. It ignores spawns that are way outside the map boundary.

    Code:
    +  if (y > m_maxY && y < 2 * m_maxX)
    Shouldnt that be maxY?


    Code:
    +  if (y > m_maxY && y < 2 * m_maxY)
    Curio

  3. #18
    Registered User
    Join Date
    Aug 2002
    Posts
    189
    yeah... max_Y

  4. #19
    Registered User
    Join Date
    Dec 2001
    Posts
    951
    could you change that in your original post? :)

  5. #20
    Registered User
    Join Date
    Aug 2002
    Posts
    189
    Someone on irc (quckrabbit?) mentioned that they had better luck with

    if (x > m_maxX && x < m_maxX + 2500)

    and so on, rather than multiplying by 2.

    I've yet to test it with anything other than multiplying by 2, but expect a patch to be submitted soon.

  6. #21
    Registered User
    Join Date
    Aug 2002
    Posts
    189
    Ok, I found that making changes in mapcore.h didn't seem to help, so I moved my changes into spawnshell.cpp

    Code:
    diff -u -r1.30 spawnshell.cpp
    --- spawnshell.cpp      10 Jan 2003 02:02:07 -0000      1.30
    +++ spawnshell.cpp      20 Jan 2003 14:47:46 -0000
    @@ -508,6 +508,12 @@
        if (s.NPC == SPAWN_SELF)
          return;
    
    +   // check for out of bounds loc on spawn
    +   if (s.x == 0 && s.y == 0 && s.z == 0)
    +        return;
    +   if (s.x > 25000 && s.y > 25000)
    +        return;
    +
        // not the player, so check if it's a recently deleted spawn
        for (int i =0; i < m_cntDeadSpawnIDs; i++)
        {
    This is not an ideal solution, but it does get rid of the phantom spawn at 0,0,0 and the wierd spawns that are way off the map.

  7. #22
    Registered User Mr. Suspicious's Avatar
    Join Date
    May 2002
    Posts
    667
    And what does it do when a zone does not have a map, or possibly worse: only a partly done map? Delete all spawns that are actually there, but not on the map surface?
    Before asking anything read the pre-face section of http://www.smoothwall.org/download/p....9/doc.faq.pdf

    after you've read it, you know what to do next...




    "Stay alert! Trust noone! Keep your Lazers Handy! Have a nice day." -- Provided courtesy of the Computer. The Computer never lies.

  8. #23
    Registered User
    Join Date
    Aug 2002
    Posts
    189
    checkPos() gets called every time a mob moves. Therefore the map would slowly expand as mobs near the first spawn that called checkPos() moved (this is only if there is no map). With a partial map (like Podisease has been), the mobs in the caves on the south side of the zone did show up and the map resized properly. In any case, mobs were *never* deleted from the spawnlist, the map was just not resized to show them until they moved into range (either max_X * 2 or max_X + 2500 and such).

    HOWEVER... the changes I made to spawnshell.cpp mean you don't have to touch mapcore.h. The 25000 max range for positive x and positive y were chosen because no *existing* zone that I know of comes close to that size and it is still less than the x and y coordinates of the spawn that is causing the map to scale out. The changes to spawnshell.cpp do not care if there is a map or not.

  9. #24
    Registered User quackrabbit's Avatar
    Join Date
    Mar 2002
    Posts
    139
    I use "if (x > m_maxX && x < m_maxX + 2500)" example above.

    It should be noted that m_maxX/Y and m_minX/Y get grow and get updated each time a spawn moves between the min/max and the min/max + 2500. The min/max values are not static based on the map.

    QR

  10. #25
    Registered User
    Join Date
    Jan 2002
    Posts
    87
    Was the code to address the scaling issue moved to CVS? I did a search but didn't see any clear response to that but could have missed it.

    I realize that the opcode issue currently breaks SEQ.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

You may post new threads
You may post replies
You may post attachments
You may edit your posts
HTML code is Off
vB code is On
Smilies are On
[IMG] code is On