Free Game Research Forum | Official QuickBMS support | twitter @zenhax
It is currently Thu Feb 02, 2023 9:23 pm

All times are UTC

Post new topic  Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Thu Aug 25, 2022 9:52 pm 

Joined: Thu Jul 14, 2022 6:24 pm
Posts: 9
I've used Rick Gibbed's tools to extract the files from pc0.arc and convert the BIN files to XML. I'm looking at \settings\icons_global.xml and I see lines like this.

<value name="world_pos" type="vec">-9019.082,486.125,2830.436</value>

This line is the location of a military base named "Kem Komander Sutherland".

My problem is that I have no idea how to take these values and turn them into map coordinates like the ones used in-game. I've looked into vector algebra, but it doesn't appear that these values represent a Euclidean vector. I am certain that the first value is X and the last is Y. The middle value is unknown, but probably Z (altitude).

For reference, the above village is roughly located at (7360,19200) in-game. It's important to note that in-game coordinates do not have pinpoint accuracy due to the way the world map works. The game uses a 2048x2048 pixel image for the world map and the coordinates run from (0,0) in the top-left to (32768,32768) in the bottom-right. This means that each pixel on the map represents 16 meters.

Does anyone have any idea how this world_pos becomes the map coordinates?

Last edited by Pickle on Sun Aug 28, 2022 4:10 pm, edited 1 time in total.

PostPosted: Sat Aug 27, 2022 9:43 pm 

Joined: Mon Jun 07, 2021 8:20 pm
Posts: 42
I think it can be not ingame world coords, but its position of icon on 3d map model from PDA. Try to rip this map with 3d Ripper DX, for save forms, and check getted geometry. Maybe it push the mind to the right solution ;)

PostPosted: Sun Aug 28, 2022 4:43 pm 

Joined: Thu Jul 14, 2022 6:24 pm
Posts: 9
Thanks for the reply, grandshot. I forgot the PDA map is 3D; however, 3D Ripper DX won't work because JC2 is a DX10 game. Fortunately, I have found the solution a different way.

I used a memory scanner to find the player position in RAM. The player position uses the exact same coordinates as the world_pos vector. I was then able to determine the following info.

world_pos vector = (x,z,y)
(0,0,0) is center of map, this is (16384,16384) in map coordinates
North is -Y
South is +Y
East is +X
West is -X

Now converting world_pos to map coordinates is simple.

Kem Komander Sutherland world_pos = (-9019.082,486.125,2830.436)
X = 16384 + -9019.082 = 7364.918
Y = 16384 + 2830.436 = 19214.436
Kem Komander Sutherland map coordinates = (7364.918,19214.436)

These map coordinates are an exact match to the ones found in JC2MapViewer.

Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 3 posts ] 

All times are UTC

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 post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Limited