[Help] BF2 coordinate system - Cache spawns

Making or wanting help making your own asset? Check in here
Post Reply
Psyrus
Retired PR Developer
Posts: 3841
Joined: 2006-06-19 17:10

[Help] BF2 coordinate system - Cache spawns

Post by Psyrus »

Hey there,

After playing a fair amount of insurgency lately, I've finally got annoyed enough by having 5/7 caches spawn in the same 1/4 of the map or even next to each other on multiple occasions, so I decided to throw together a cache spawn selector with similar logic to the FOs (cannot be within 200m of any currently alive ones). Basically what I'd like to solve is this:
Image
But really, I'd prefer the caches to jump as much around the map as possible, so that an unknown doesn't spawn in the vicinity of a known that just went down... I mean the insurgents might not be that intelligent but surely they're not that stupid :roll:

I have no modding experience but code is kinda my thing, and I've picked up python to make this attempt. I had a mock set of cache locations, but now I'm at a point that I think the cache locations are well spread, and to make it feasible I want to incorporate a way for the caches.py to use the gameplayobjects.con to get all the cache locations. Thankfully they seemed to be all prefaced (I checked 3 maps) with Object.create a_ but I'm a little confused by 1 thing...

Why on earth are there negative values in there? If the coord system is the logical way that I think it is, top left (NW) of the map should be 0, 0 then x & y iterate up to 1024 & 1024 or 2048 & 2048 etc.

So I got it all parsed into a list ready for cache choosing and it goes wtf is this negatives bs?

It is ->, height, \/ from I can tell for the coords (x, y, z)
['704.122', '22.776', '-152.693']
['767.655', '8.117', '-714.462']
['846.117', '6.787', '-677.002']
['786.496', '6.770', '-647.495']
['388.672', '3.941', '816.237']
['-558.081', '8.068', '49.169']
['201.523', '0.653', '405.865']
['207.136', '1.121', '387.655']
['237.628', '3.331', '356.822']
['236.934', '3.322', '358.723']
['381.210', '7.766', '824.333']
['606.689', '7.614', '695.414']
['629.685', '7.648', '698.770']
['594.400', '7.627', '699.727']
['631.711', '22.858', '-163.310']
['-485.809', '71.573', '-212.195']
['-469.699', '64.504', '-225.845']
Now logically that could just be editor/programmer shorthand to use the (-)bounding to represent:
['554.301', '64.504', '798.155']
as
['-469.699', '64.504', '-225.845']

Is this the case or does it work in a different way...? What is the deal with the negatives in the coordinates?

Edit: I think I've figured it out... 2 hours sleep is what I blame! I assume (0,0,0) starts in the middle of the map and goes -1024 to 1024 for 4km^2 maps. Is that right?
Last edited by Psyrus on 2010-06-27 17:28, edited 3 times in total.
Dev1200
Posts: 1708
Joined: 2008-11-30 23:01

Re: BF2 coordinate system [Cache spawns]

Post by Dev1200 »

While reading through, I was about to say that 0,0,0 is in the middle of the map.


Then I thought, well, X and Y are your "north, east, south, west" directions, on a 2D scope.


However, the Z value, which most of the negatives are on, is the 3D scope, "altitude"

From what I know about charts, co-ordinates, XYZ, etc. I would assume that Z negative would be below the 0 marker for altitude.


However, if your theory from the edit is correct, (0,0,0 being the center of the map) then all but 3 caches are in the top right corner of the map.. and the negative ones are in the top left. Since all your middle numbers (Y) are above negative, all of the maps are in the top hemisphere.
Image
Sniperdog
Retired PR Developer
Posts: 1177
Joined: 2009-02-27 00:06

Re: BF2 coordinate system [Cache spawns]

Post by Sniperdog »

As far as your first question goes, I think having two cache's spawn next to each other is fair enough. It just means you need to concentrate more people on defending that area.

As far as the grid system you've nearly got it.

it is x/y/z, x is the horizontal location on the map in meters (kind of like your longitude) where 0 is at the center. Negative is on the left half of the map positive is on the right. y is your height from the base of the map in meters (kind of like your altitude above sea level), nothing can be negative or below 0 with this as no part of the height map can be below the bottom of the map. This is why the second number is never negative. z is your vertical location on the map in meters, (kind of like your longitude) where 0 is at the center. Negative is on the bottom half of the map and positive is on the top.

Here's a picture :)

Image
Last edited by Sniperdog on 2010-06-27 18:59, edited 3 times in total.
Image

Image

Will Stahl aka "Merlin" in the Squad community
Psyrus
Retired PR Developer
Posts: 3841
Joined: 2006-06-19 17:10

Re: BF2 coordinate system [Cache spawns]

Post by Psyrus »

Yeah thanks guys~ All sorted ^-^
dbzao
Retired PR Developer
Posts: 9381
Joined: 2006-06-08 19:13

Re: BF2 coordinate system [Cache spawns]

Post by dbzao »

We have plans to improve on that issue.

"There's always one more bug." - Lubarsky's Law of Cybernetic Entomology
Post Reply

Return to “PR:BF2 Community Modding”