MetalMap Return Values

MetalMap Return Values

Requests for features in the spring code.

Moderator: Moderators

Post Reply
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

MetalMap Return Values

Post by Argh »

Basically, the value that is returned by Spring.GetGroundInfo(x,z) needs to return a Metal value that reflects the value, R, of the pixel, or Lua needs to be able to return the value of the MaxMetal multiplier.

I don't care how it's solved- the way that the current return works is totally worthless, though, because we can't currently read the MaxMetal multiplier, so have no way to deduce the real value of R.

If anybody has any clever ways around that, I'd like to hear it- I looked at stuff like CA's mining Gadget, and they're doing the same stuff I am, and are probably seeing totally bizarre values for metal output, frankly, or nobody's noticed yet because they've just been testing on a few maps with properly-designed metal spots, and no whacked-out multipliers. Or maybe I've just overlooked something, dunno. I don't most mappers ever really considered the effect of how they did their multipliers, and just tweak until it all comes out right, so this is a fairly nasty problem- I've seen returned values as low as 80, as high as 1000, for metal patches that still give about 1.0 in a OTA game :P
User avatar
REVENGE
Posts: 2382
Joined: 24 Aug 2006, 06:13

Re: MetalMap Return Values

Post by REVENGE »

Can't you get the max metal multiplier from the map smf file (or smd, whichever one holds all the configs)?
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: MetalMap Return Values

Post by Argh »

If there's a reasonable way to do this via VFS, I'd be interested in doing it that way, absolutely. So far as I know, though, there isn't any way to do that very easily however.
User avatar
Evil4Zerggin
Posts: 557
Joined: 16 May 2007, 06:34

Re: MetalMap Return Values

Post by Evil4Zerggin »

It returns the exact amount of metal in that spot, and you can add up the values over an area to get the extraction (sum up over a grid with 16x16 sized squares). I wrote a gadget that so far as I can tell returns exactly the same amount of metal as the built-in system. I'm pretty sure Max. Metal is already multiplied in; for example, the total calculated global metal from the gadget for 4Skulls (Max. Metal = 0.005) is 222.79339599609, while for Painted Desert Remake v2 (Max. Metal = 5.5) it is 110.63808441162. Both are reasonable values, and I doubt I would get such values if there was factor of over a thousand that I wasn't accounting for.

Or am I misinterpreting your question? Are you looking for the end-result metal, or the value of the pixel in the metal bitmap that was used when the map was created? If it's the latter, I suppose you could assume that the square with the most metal had a green value of 1 and divide everything by that amount of metal to get something like the value in the original bitmap.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: MetalMap Return Values

Post by Argh »

I'm looking for the pixel value of the original metalmap, which is why this is a problem. I'll look into doing it as an area and doing a calculation based on the total value of the area, maybe that'll work well enough...
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: MetalMap Return Values

Post by imbaczek »

I have no idea how it works in the engine, but first guess would be to divide by map's maxmetal... you should be able to get it via VFS and TDF parsing, right?
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: MetalMap Return Values

Post by Argh »

you should be able to get it via VFS and TDF parsing, right?
Er, yeah, I would think so... I just dunno how to do that and get a string value... just load up that TDF and do a String.Find on the contents?
Post Reply

Return to “Feature Requests”