[Question] Radar Map

Started by !, Mar 26, 2018, 05:16 PM

Previous topic - Next topic

!

How to change the radar I know to make png with 128x128 from 00 to 63 files but my question is

How to find out the correct place of each section?

Is there any software used something like moo mapper or any other to put the radar section in their correct place and leave the rest of sections as empty or water texture.

Discord: zeus#5155

Sebastian

#1
What if you consider a proper point from map, then convert it's position to pixel position on the png ? to make it fit. Then split it in 64files
I've never heard of any software to do this job...
but, doing this, you will know where to start from, and just correct it bit by bit until perfect.

*cough* @GangstaRas  *cough*

GangstaRas

#2
The entirety of the map with all 64 PNGs (00 to 63) equates to a resolution of 1024x1024, that means the map is divided into 8 rows and 8 columns (at 128x128 resolution). So from the top of the map to the bottom:

1st row -  00 to 07
2nd row - 08 to 15
3rd row -  16 to 23
4th row -  24 to 31
5th row -  32 to 39
6th row -  40 to 47
7th row -  48 to 55
8th row -  56 to 63


Now with your image editor of choice (I use GIMP), if you grid the image with rulers into 8 equal parts on the x and the y axis, the full map is now setup to have each of these individual sections. A result like this:



That would give you a general idea of the positioning of where you want to be. Now for the accuracy to get things exact (involves some maths):

The landscape of Vice City is 3900 m x 3900 m (in game units), with the coordinate range setup a specific way for the x and y axis:

X axis = -2350 to 1550
Y axis = -1950 to 1950

Whatever object you look at in Moo Mapper or MEd or KEd, the coordinates of the object will always fall within those X and Y boundaries. Anything that exceeds those boundaries is not on the map, it will be shown in-game but it cannot be accessed by the player. How you would translate this onto the map you're drawing is as follows:

1. Get the coordinate of whatever object you're referencing
- for example sake, let's say the ingame object has a coordinate of 540, 260

2. Calculate the position of the object in percentage
- This is the make or break step that determines whether things will work out moving forward

To calculate the percentage properly, you need to regard the layout of the boundaries. The X axis starts at coordinate -2350, NOT 0. Therefore, you have to calculate that 540 coordinate in relation to -2350, the starting point, and the total range, which is 3900. Forget the ending point of the X axis (1550) for now, it only proves that the total range is 3900.

So, position in percentage (X axis):

[ object coordinate - starting point ] / 3900 x 100%
[ 540 - (-2350) ] / 3900 x 100%
2890 / 3900 x 100%
= 74.10%

You do the same with the Y axis and its respective range and coordinates, so you should get:

[ 260 - (-1950) ] / 3900 x 100%
2210 / 3900 x 100%
= 56.66%


3. Apply these percentages to the pixel coordinates of your image in your image editor
- This is the final step to draw the position accurately onto your radar map

You take the respective X and Y axis percentage value and multiply it against the respective X and Y axis full image resolution, which is 1024 x 1024, NOT the little radar squares from the grid which is 128x128. Don't care about them as yet.

So the position to draw the point is:

74.10% / 100% x 1024 (X axis) = 758.784 = 759   (rounded to the nearest whole number)
56.66% / 100% x 1024 (Y axis) = 580.1984 = 580 (rounded to the nearest whole number)

Remember to round the numbers as there is no decimal pixel

So in your image editor, looking at the status bar to check where your cursor is currently located across the image, you draw your point or representation you'd like of the object on the map at 759 ,580 of the image.

From this coordinate you can also deduce which of the 64 images would likely be the one to edit and replace. This is done by dividing the respective X and Y coordinate by 128 pixels. So with this example you would get:

759 / 128 = 5.93 (X axis = column)
580 / 128 = 4.53 (Y axis = row)

Now with these numbers you need to count correctly. Count the image spaces not the grid lines. You should therefore get that this image lies in the 4th row and is the 5th image.

So, using the table I gave at the start, the 4th row means images 24 to 31 are the options, the 5th image in that row, is image 28, so you would be editing and replacing radar28 from this example.

Hope this helps, and any further questions on the matter, feel free to ask


!

@GangstaRas Thanks man you saved my day.It was really helpful.

Discord: zeus#5155

!

@GangstaRas for coordinates
X: -830.4599999999998
Y: 1077.4720000000002

The above procedure gives
51th section not the correct one.

Similarly
X: -1145.75
Y: 156.719
Gives 37th section but the actual one is 25th section.

Discord: zeus#5155

GangstaRas

#5
Quote from: ! on Apr 02, 2018, 06:01 PM@GangstaRas for coordinates
X: -830.4599999999998
Y: 1077.4720000000002

The above procedure gives
51th section not the correct one.

Similarly
X: -1145.75
Y: 156.719
Gives 37th section but the actual one is 25th section.

Thanks for the headsup. It would appear that my counting is what screwed it up, the very thing I tried to avoid lol.  Count the spaces, forget what I said about the lines (kept thing in my head that 512/128 = 5 when I just said the map is divided into 8 pieces, so its 4 not 5, brainfart moment, it happens) that caused the issue, If you do that you will get the correct answers for both.

The 37th you got was actually suppose to be 34th (that's what I got), if you move one step left and one step up, you will see that you get the correct position which is the 25th. Similarly, with the 51st image, move one step up and one step left and you should get 42nd image as the correct one. Sorry for the mixup. Updated my original post with the fix

Shadow

#6
Maybe this bit of code is useful to you. It is used to map the game coordinates to a square plot of 1024x1024. You can check the defines in the top of the source code (here)

It's in c++ but you should be able to understand. It's taken from here
QuotePS:is trash is ur home language??