How can I get a map's info and where ?
- Terminator
- Regular
- Posts: 1077
- Joined: 05 Aug 2006, 13:46
- Location: Ukraine
- Contact:
How can I get a map's info and where ?
I wanted to add a map preview for my warzone Launcher. I dont need textures info just a heights and size of the map. ... and probably starting players coordinates.
I've look at http://developer.wz2100.net/wiki/MapFormat - is it current working format right ? Guide me plz where to look at. so I don't waste muck time in the wrong direction. Or may be point to some source code that parses map file.
I've look at http://developer.wz2100.net/wiki/MapFormat - is it current working format right ? Guide me plz where to look at. so I don't waste muck time in the wrong direction. Or may be point to some source code that parses map file.
Last edited by Terminator on 12 Jun 2016, 08:39, edited 1 time in total.
Death is the only way out... sh*t Happens !
Russian-speaking Social network Group http://vk.com/warzone2100
Russian-speaking Social network Group http://vk.com/warzone2100
Re: How can I get a map's info and where ?
there has been some work done already in that area look at jamesNZ's repo https://github.com/JamesWrigley/moodloader
- Terminator
- Regular
- Posts: 1077
- Joined: 05 Aug 2006, 13:46
- Location: Ukraine
- Contact:
Re: How can I get a map's info and where ?
wait... there are an *.ini files in maps ? Some maps does has it, some doesn't. What if no ini files in map's pack, how warzone handles that where is "he looking" at for a info. Seems like that wiki not really up-to-date map format or something.
Death is the only way out... sh*t Happens !
Russian-speaking Social network Group http://vk.com/warzone2100
Russian-speaking Social network Group http://vk.com/warzone2100
Re: How can I get a map's info and where ?
Some more recent map editors would produce .ini files. They are no longer used, however. Version 3.2 and onward uses .json files, including a <map name>.json that can include default team setups. There is no documentation for this (yet), but you can get a feel for it by browsing around in the data/mp/multiplayer/maps directory in 3.2.
- Terminator
- Regular
- Posts: 1077
- Joined: 05 Aug 2006, 13:46
- Location: Ukraine
- Contact:
Re: How can I get a map's info and where ?
ok. json and ini - I got its, seems fine. But if I want to support maps from 2.3.x+ I need game.map to parse and *.obj files (json for 3.2) - right ?
So where is in source files the game parses "game.map" so I may look at ? plz.
So where is in source files the game parses "game.map" so I may look at ? plz.
Death is the only way out... sh*t Happens !
Russian-speaking Social network Group http://vk.com/warzone2100
Russian-speaking Social network Group http://vk.com/warzone2100
Re: How can I get a map's info and where ?
The map loader is mapLoad() in src/map.cpp
- Terminator
- Regular
- Posts: 1077
- Joined: 05 Aug 2006, 13:46
- Location: Ukraine
- Contact:
Re: How can I get a map's info and where ?
ok. I've get loaded start-up game.map file, but I have a problem I dont know what is wrong with it. It like a accuracy loss or something
quick look at code http://pastebin.com/bPiLYp7E
quick look at code http://pastebin.com/bPiLYp7E
- Attachments
-
- strtup_issue.jpg (33.79 KiB) Viewed 6808 times
Death is the only way out... sh*t Happens !
Russian-speaking Social network Group http://vk.com/warzone2100
Russian-speaking Social network Group http://vk.com/warzone2100
- Terminator
- Regular
- Posts: 1077
- Joined: 05 Aug 2006, 13:46
- Location: Ukraine
- Contact:
Re: How can I get a map's info and where ?
Am I right that map heights in range from -128 to 128 ? (or -127 to 127) ? May be the problem in this line with color
color = (dots[counter] + 128) / 2.56f / 100; (java's function requires color from range 0 to 1.0, so that's why I'm making this calculations)
color = (dots[counter] + 128) / 2.56f / 100; (java's function requires color from range 0 to 1.0, so that's why I'm making this calculations)
Death is the only way out... sh*t Happens !
Russian-speaking Social network Group http://vk.com/warzone2100
Russian-speaking Social network Group http://vk.com/warzone2100
Re: How can I get a map's info and where ?
Map height is stored as an 8 bit unsigned value, so map heights would be 0 ... 255
- Terminator
- Regular
- Posts: 1077
- Joined: 05 Aug 2006, 13:46
- Location: Ukraine
- Contact:
Re: How can I get a map's info and where ?
yea. I was converting byte in a wrong way. Oh this java with unsigned "support".
Death is the only way out... sh*t Happens !
Russian-speaking Social network Group http://vk.com/warzone2100
Russian-speaking Social network Group http://vk.com/warzone2100