Problems encountered:
1. 2048 search items, I wrote from 1 to 2048
From 0 to 2047
2. There is a problem reading the target boundary of each point in the lode map function
for (int dir = 0; dir < 8; dir++) { short value = VALUE[r, c].value1[dir]; if(value == INVALID_GOAL_BOUNDS)//Invalid target { m_jumpDistancesAndGoalBoundsMap[r, c].bounds[dir, (int)GoalBoundsEnum.MinRow] = (short)BLOCK.N_MAP_HEIGHT; m_jumpDistancesAndGoalBoundsMap[r,c].bounds[dir,(int)GoalBoundsEnum.MaxRow] = 0; m_jumpDistancesAndGoalBoundsMap[r, c].bounds[dir, (int)GoalBoundsEnum.MinCol] = (short)BLOCK.N_MAP_WIDTH; m_jumpDistancesAndGoalBoundsMap[r,c].bounds[dir,(int)GoalBoundsEnum.MaxCol] = 0; } else//Effective goals { m_jumpDistancesAndGoalBoundsMap[r, c].bounds[dir, (int)GoalBoundsEnum.MinRow] = VALUE[r, c].value2[dir, 0]; m_jumpDistancesAndGoalBoundsMap[r, c].bounds[dir, (int)GoalBoundsEnum.MaxRow] = VALUE[r, c].value2[dir, 1]; m_jumpDistancesAndGoalBoundsMap[r, c].bounds[dir, (int)GoalBoundsEnum.MinCol] = VALUE[r, c].value2[dir, 2]; m_jumpDistancesAndGoalBoundsMap[r, c].bounds[dir, (int)GoalBoundsEnum.MaxCol] = VALUE[r, c].value2[dir, 3]; } }
When it is not an invalid target, you should set the value of all bounds as value2. The reason for the error is that you should set the minrow of bounds as value
3. Save the target boundary of skip point
The problem is that all the jumping points have the same goal bounds
Because I write in c, which is different from the original program, an array should be set here to save the goalbounds of each point
for (int i = 0; i < 8; i++) { JUMPdiss[r, c].jumpdis[i] = jumpPoints.jumpDistance[i]; } // Save goal boundaries for (int dir = 0; dir < 8; dir++) { if ((m_goalBoundsMap[r,c].bounds[dir,(int)GoalBoundsEnum.MinRow] > m_goalBoundsMap[r,c].bounds[dir,(int)GoalBoundsEnum.MaxRow]) && (m_goalBoundsMap[r,c].bounds[dir,(int)GoalBoundsEnum.MinCol] > m_goalBoundsMap[r,c].bounds[dir,(int)GoalBoundsEnum.MaxCol])) { // Use invalid ﹣ go ﹣ borders to represent all four values for compression use invalid ﹣ go ﹣ borders to represent all four compression values VALUE[r,c].value1[dir] = INVALID_GOAL_BOUNDS; } else { for (int minMaxIndex = 0; minMaxIndex < 4; minMaxIndex++) { VALUE[r, c].value2[dir, minMaxIndex] = m_goalBoundsMap[r, c].bounds[dir, minMaxIndex]; } }
There is still a lot of work to be done in the follow-up. If there is a problem, it must be recorded in time.