Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Out of Bounds Errors
Author Message
Mordaunt
Super Moderator
****

Posts: 1,237
Likes Given: 26
Likes Received: 55 in 43 posts
Joined: Mar 2012
Reputation: 35



Post: #1
Out of Bounds Errors
Ok. I'm unfortunately back at this one, clearly I buggered something, server ran for 90 minutes after running the script before I got the error:

Code:
18:44:ERROR:Point(2132,-1): trying to get a sector for point on map #0 out of bounds for this map(7168,4096). Defaulting to sector 0 of the map.
18:44:WARNING:Attempting to access invalid memory block at 2132,-1,-5.
18:44:WARNING:GetMapBlock failed at 2132,-1,-5.
18:44:ERROR:Point(3711,-1): trying to get a sector for point on map #0 out of bounds for this map(7168,4096). Defaulting to sector 0 of the map.
18:44:WARNING:Attempting to access invalid memory block at 3711,-1,-5.
18:44:WARNING:GetMapBlock failed at 3711,-1,-5

This is coming from part of my background spawning system, which I have just updated to prevent some "silly" spawning going on.
The part of the script responsible for the placing of the gembits, and thus this stupid error is:

Code:
    WHILE (<EVAL <VAR0.TEMPX>> <= 4904)
        VAR.TEMPY=20
        WHILE (<EVAL <VAR0.TEMPY>> <= 3992)
            f_spawnbackground_check_terrain <ARGN1>
            VAR.TEMPY=<VAR0.TEMPY> + <ddef.gembit_gap>
        ENDWHILE
    VAR.TEMPX=<VAR0.TEMPX> + <ddef.gembit_gap>
    ENDWHILE
    SYSMESSAGE @0,0 Spawning for Map: <EVAL <ARGN1>> Complete!

ARGN1 is derived from the function which calls this script, not an issue.

My sphere.ini is set in the manner posted by RanXerox.
Code:
// To activate ML-sized map #0 uncomment the next line (don't forget to uncomment
// sphere_map0_ml.scp and sphere_map_points0_ml.scp in spheretables.scp if you want
// to use the default areas)
Map0=7168,4096,-1,-1

// To activate ML-sized map #1 uncomment the next line
//Map1=7168,4096,-1,-1


MAP2=2304,1600,32,2,2
MAP3=2560,2048,32,3,3
MAP4=1448,1448,8,4,4
MAP5=1280,4096,64,5,5

// To enable the use of MapDif*.mul and StaDif*.mul files, set this to 1.
UseMapDiffs=1

The answer to this is probably staring me in the face, I just need a fresh set of eyes on it...

[Image: 2nis46r.jpg]
(This post was last modified: 08-16-2012 10:23 AM by Mordaunt.)
08-16-2012 10:22 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Shaklaban
Master
**

Posts: 378
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Mar 2012
Reputation: 8

DOT

Post: #2
RE: Out of Bounds Errors
you only checked for maximum values of x and y coordinates, you also need to check for minimum values.
08-16-2012 03:31 PM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Mordaunt
Super Moderator
****

Posts: 1,237
Likes Given: 26
Likes Received: 55 in 43 posts
Joined: Mar 2012
Reputation: 35



Post: #3
RE: Out of Bounds Errors
Actually the X&Y are set earlier in the function...
Think I have solved it... Y is set too low each time the loop goes back to the top, even though it had a positive number the distance setting of the spawns would cause them to stray beyond the map

Allowing the script to run for a few hours to make sure the errors don't pop up once it fully populates the background before I replace the bugged script in the downloads section

[Image: 2nis46r.jpg]
08-17-2012 04:26 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Extreme
Grandmaster Poster
***

Posts: 1,140
Likes Given: 217
Likes Received: 89 in 76 posts
Joined: May 2012
Reputation: 20

SphereCommunity

Post: #4
RE: Out of Bounds Errors
Mord, why it was trying to reach in a -1 in Y coord?

Quote:18:44:ERROR:Point(2132,-1): trying to get a sector for point on map #0 out of bounds for this map(7168,4096). Defaulting to sector 0 of the map.
18:44:WARNING:Attempting to access invalid memory block at 2132,-1,-5.
18:44:WARNING:GetMapBlock failed at 2132,-1,-5.
18:44:ERROR:Point(3711,-1): trying to get a sector for point on map #0 out of bounds for this map(7168,4096). Defaulting to sector 0 of the map.
18:44:WARNING:Attempting to access invalid memory block at 3711,-1,-5.
18:44:WARNING:GetMapBlock failed at 3711,-1,-5
Something appear very wrong because its impossible, you know it.
Maybe your function is getting negative values for Y coord and thats why you're getting this error.

STEPS BEFORE CREATE A THREAD
- Check the revisions log;
- Use the search button and use the keywords of your problem;
- Check the WIKI;
- Create a thread.
08-17-2012 04:48 AM
Find all posts by this user Like Post Quote this message in a reply
Mordaunt
Super Moderator
****

Posts: 1,237
Likes Given: 26
Likes Received: 55 in 43 posts
Joined: Mar 2012
Reputation: 35



Post: #5
RE: Out of Bounds Errors
I beleive it is because the gembit were being placed too close to the edge of the map and occasionally a creature would spawn in the negative causing the error, not the actual gembit itself as the script doesn't allow for negatives. The script has now been running for 90+ minutes with no errors. the world is at 2/3 complete background spawn from the bit, I think the error would have appeared again by now.

And so I have replaced the script in the script library, both here and my own, though I will continue to monitor if for a couple more hours I am reasonably certain the error is fixed.

[Image: 2nis46r.jpg]
08-17-2012 05:59 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Mordaunt
Super Moderator
****

Posts: 1,237
Likes Given: 26
Likes Received: 55 in 43 posts
Joined: Mar 2012
Reputation: 35



Post: #6
RE: Out of Bounds Errors
Server now at full load for background spawns, error free!
Hurray!

[Image: 2nis46r.jpg]
08-17-2012 07:06 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Extreme
Grandmaster Poster
***

Posts: 1,140
Likes Given: 217
Likes Received: 89 in 76 posts
Joined: May 2012
Reputation: 20

SphereCommunity

Post: #7
RE: Out of Bounds Errors
U talking about a world spawner?

STEPS BEFORE CREATE A THREAD
- Check the revisions log;
- Use the search button and use the keywords of your problem;
- Check the WIKI;
- Create a thread.
08-17-2012 10:34 AM
Find all posts by this user Like Post Quote this message in a reply
Mordaunt
Super Moderator
****

Posts: 1,237
Likes Given: 26
Likes Received: 55 in 43 posts
Joined: Mar 2012
Reputation: 35



Post: #8
RE: Out of Bounds Errors
Mine yes...

Doesn't do monsters per say, unless you tell it to, but that might be a bit overkill. Spawns all those annoying spawns, the regular animals that trundle around the map

[Image: 2nis46r.jpg]
08-17-2012 11:10 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Extreme
Grandmaster Poster
***

Posts: 1,140
Likes Given: 217
Likes Received: 89 in 76 posts
Joined: May 2012
Reputation: 20

SphereCommunity

Post: #9
RE: Out of Bounds Errors
It looks awesome, works only in OSI Maps?
I got one new map, its amazing and I am intending to make it works.
I'm testing your environ system, did you tested it with players?
The @EnvironChange is fired ~3 times at once for each player.. it can make some lag...

STEPS BEFORE CREATE A THREAD
- Check the revisions log;
- Use the search button and use the keywords of your problem;
- Check the WIKI;
- Create a thread.
08-17-2012 12:16 PM
Find all posts by this user Like Post Quote this message in a reply
Mordaunt
Super Moderator
****

Posts: 1,237
Likes Given: 26
Likes Received: 55 in 43 posts
Joined: Mar 2012
Reputation: 35



Post: #10
RE: Out of Bounds Errors
No... it'll work on any map.. you just would have to make sure that the map bounds were altered to suit if the map is a different size, or the dungeon section was in a different place. It will spawn according to whatever the tile type is that the gembit gets placed on.

I did hear that the environ system had problems when running with lots of players, something which unfortunately I never had the opportunity to test. I know someone has a version they fixed, though I forget who it was and given it was posted on the old sphereserver forums, there's no way for me to find out.

I will look into it at some point, still refreshing my scripting knowledge after 5 or so years away, been working up to it by fixing some of my other old scripts, like the spawner.

[Image: 2nis46r.jpg]
08-17-2012 12:28 PM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 2 Guest(s)