how to obtain coordinates from a picture used as map?

Status
Not open for further replies.

Xyonel

Indie Developer, All-in-one artist.
Veteran
Joined
Jul 22, 2018
Messages
183
Reaction score
37
First Language
Italian
Primarily Uses
RMMV
Hello, I'm wondering if someone could help me with a parallax world map that can indicate with a cursor my position in world, I found a solution(with a hidden blank message , the arrow works as an indicator for player position) but if I change resolution of my game, the coordinate stretches.
I'm wondering then if someone know a way to know the map pixel position(parallax image pixel position) then i could put my own made cursor image(parallax too) on top.

maybe this is a script question, then apologize for the inconvenience.

Thanks for your time.
 

Aerosys

Veteran
Veteran
Joined
Apr 23, 2019
Messages
366
Reaction score
336
First Language
german
Primarily Uses
RMMZ
Why dont you use pictures instead of parallaxes?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,273
Reaction score
7,633
First Language
German
Primarily Uses
RMMV
@Xyonel how exactly did you use the picture and how did you make the coordinates?

because with a correctly done parallax the map coordinates are fixed and that problem should not exist at all, so you're doing something wrong.
and we need to see what you did to find your mistake.
(preferably screenshots of the events used)
 

Xyonel

Indie Developer, All-in-one artist.
Veteran
Joined
Jul 22, 2018
Messages
183
Reaction score
37
First Language
Italian
Primarily Uses
RMMV
hold on, I noticed that I'm using pictures showing and move command list, then how can I use parallaxes with items to call a map?(item map)
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,273
Reaction score
7,633
First Language
German
Primarily Uses
RMMV
by starting to give a complete description of what you want in your game.
your short sentences only show that you messed up with some terms, and we can't point you into the correct direction without knowing what you want to do.
You never use parallaxes to call a map, and never use them as items because a parallax picture is the background.
EDIT: Which is also the reason why I asked for screenshots of what you've done so far)
 

Xyonel

Indie Developer, All-in-one artist.
Veteran
Joined
Jul 22, 2018
Messages
183
Reaction score
37
First Language
Italian
Primarily Uses
RMMV
I'm using galv layergraphic which allow me to put parallaxes on top, for now i'm using picture command to call an item map, all works fine except when I change resolution , the white pointer(which is a blank transparent message trick) slide around accordingly with the different resolution.

I Know what I'm doing and even the problem as I wrote here, I simply asked about a different way to make a world map where the coordinates of my cursor(whatever kind of cursor I'll use) will not slide with resolution, so a fixed coordinates of the world map.
I hope this is a better explanation and here are the snapshot(not so much to show.

the only thing I can do(while mantaining this kind of world map) is to redo coordinates accordingly for different resolution, extra work.

thanks for help and sorry for misunderstanding, i'm not eng motherlanguage.
 

Attachments

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,273
Reaction score
7,633
First Language
German
Primarily Uses
RMMV
I Know what I'm doing
but the problem is that we don't know what you're doing, and we can't help or advice without knowing that.
 

Xyonel

Indie Developer, All-in-one artist.
Veteran
Joined
Jul 22, 2018
Messages
183
Reaction score
37
First Language
Italian
Primarily Uses
RMMV
a.jpg
(ignore the "pin" picture addition, was a try)

yes Andar, what do you need more?
you misunderstood my phrase again,
meaning:
"I know how move around scripts and rpg maker"

I described and screenshooted.

How I could know what you miss about my description?
I feel embarrassed.

I make this simple:
I know some ways to make world map, I showed you what method I used and asked if someone know a solution for fitting in different resolution screen, or maybe if there's another method better that can fit dynamically with different resolution:

my world map need a cursor that indicate the current area map in world map

That's all.
 
Last edited:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,273
Reaction score
7,633
First Language
German
Primarily Uses
RMMV
my world map need a cursor that indicate the current area map in world map
that is the complete opposite of what you asked in the title of the topic:
how to obtain coordinates from a picture used as map?

So basically you already have those coordinates you asked for in the title (because they're the player position) and want to know how to place something on their equivalent picture position?
That is relatively straight to handle as it has nothing to do with your title question, it just needs several more calculations and variables that you don't use in your common event.
1) are you talking about a direct map transition (which means one picture for each map) or do you have a picture that combines several game maps?
The second version is much more difficult unless all maps are directly connected parts of a grid
2) how big is the map in tiles and how big is the map picture in pixels?
That will determine how to scale the pointer - and forget about making the picture fit any resolution. The game will only have the screen sizes you'll allow it to have. You can have several different screen sizes but you'll need to provide mathematics for each.
Making a variable screen size calculation would imho break reasonable eventing and need scripting instead.

For a few options you might have to use the script equivalent of the show picture command for better handling.
Never use the move picture command for placing the pointer, that is a bad idea.
 

Xyonel

Indie Developer, All-in-one artist.
Veteran
Joined
Jul 22, 2018
Messages
183
Reaction score
37
First Language
Italian
Primarily Uses
RMMV
ty for the infos even if I knew most of those, now I try to answer your questions:
1)"or do you have a picture that combines several game maps?"
my world map is a simplified vision of all maps of the games, it's not a straight grid, but a more accurate indicator of a positioning, example:
the player is in the village, the cursor show the village indication;
the player now leave the village in a forest trail, long several maps, then the indicator show some point in the world map that lead to next location Example metallic crater, those coordinate are generated by me accordingly of my story and interpretation, so those aren't straight lined.

2)" how big is the map in tiles and how big is the map picture in pixels?"
as I said the coordinates are unique id and must match resolution set by me, not all( the game is for pc and android, I must create at least 2 resolutions)
i knew the mathematics works, i'm used to that, I love math works, but the problem that I have is to understand a way to have the interpreter(rpg maker) recognize my coordinate even if I change resolution, cause as I said if I switch resolution to "android" those will mismatch.
So as you said at the end I mostly need script supporting, someone know how to reach that?
I could find a solution alone but I'm here asking for tips cause I'm doing a commercial game and I am the scripter, the eventer, the graphic guy and the music guy, but fortunately I'm not a crap artist :)
I hope someone could lead me into this kind of dynamic coordinates and save my time, soon I will post updates to my game so you can see the work, working ^_^

Thanks btw Andar for your support, I appreciate your interest and some of your tips were useful for my focus.
Expecially last one, where you say that is bad using move picture for coordinate pointer, there are other reason aside the resolution mismatch?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,273
Reaction score
7,633
First Language
German
Primarily Uses
RMMV
1)
this means you'll have to get you a list of offsets per map, and add that as a third set of variables.

My suggestion would be to print your total map on as large a paper you can and then mark the map-rectangles on that paper-map.
Then for each map-ID, note the offset of that map from the coordinate-corner on a table. This will be your most important table for the calculations.

Next step would be to create one parallel process on every map, consisting of three commands only: two control variables to load the offset of that map into two variables, and an erase event command.
Doing this will guarantee that you'll always have the map-based offset of the current map in those two specific variables.

After that calculating the current position in the coordinate system of the total map picture should be easy by adding the offsets to the current MapX/Y of the player. And the rest should be more or less automatic.

2) your resolution change has to come AFTER the calculation step.
Before the calculation you'll have a fixed map picture and the coordinates fitting to that.

Changing resolution is applying a scale to both that picture and the coordinates you calculated.
Simply calculate the factor between the new resolution and the original map picture size, and then multiply the coordinates calculated by 1) with the same factor.

Do NOT try to calculate the target coordinates after the resolution change. Theoretically that is possible, but it makes the formulae much more complex and introduces a lot more possible bugs, and would be completely unnesseccary.
 

Xyonel

Indie Developer, All-in-one artist.
Veteran
Joined
Jul 22, 2018
Messages
183
Reaction score
37
First Language
Italian
Primarily Uses
RMMV
1) the world map already have a grid base system, I couldn't show the original file cause there are hidden spots that cannot be revealed.
my grid system is alphanumeric, I could fit the rpg maps coordinates in grid(as I've already done it partially) but there's a problem: how to get the offset or coordinates generally?
in Gimp - the program I used to make my game art- there are coordinates but those pixel xy are different from the game, it seems there's some sort of strange ratio in calculating the x y, example:
for every 215 pixels, coordinate x needs one pixel extra to get the exact axis value ;
in gimp "house village" is at 1250 900:
in rpg maker those coordinate are stretched and does not match.
more pixel it take, more distortion it get.
I cannot find a solution for this strange ratio of "1.001"

the World map is a "panorama" created not from the "collage" of rpg maps but instead as a real cartographer would make, like an hand-drawn version of the world, there's not an easy way to get my coordinates unless I resolve the scaling ratio and then apply a math function to offset and scale accordingly for every resolution.

the world map inner size in pixel is 2020 865 (gimp)
what I mean for inner size?
I've added a black frame around the map to simulate another instance, I mean that without frame, when the player goes to a worldmap corner, the worldmap image shows the off-corner transparent, letting see through the map picture and showing the player and background.
I will not allow this for puzzle-purpose and other things, for that reason I added a black frame, huge.
4028 3056 is the world map with the frame, I don't think this size could cause bugs, my parallax maps are same in size.

I had problems to understand what you suggested in some parts, but others were clearly, I hope that this better definition of my world map could help you to understand my needing, otherwise I will read better and try to understand more deeply your suggestion.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,273
Reaction score
7,633
First Language
German
Primarily Uses
RMMV
In my opinion, it is better to solve bugs than find workarounds to hide them (like your black frame or the 1.001 factor).
And you are the one who created the problems you're trying to solve at the wrong end...


One source of your problems is the wrong sizes:
in gimp "house village" is at 1250 900
Even when using parallax pictures, the grid still exists. And the grid size is 48x48 pixels per tile.
Your pictures have to fit that grid or you'll get a lot of problems including display problems.
1248x912 is a picture size that follows map sizes (it's 26x19 tiles).
Use that as a picture size and your parallax map will work 1:1
1250x900 will always cause you problems because it is not a direct grid size.

As I wrote somewhere above you need to select the sizes you want to use for your game screen, and you can't just randomly select numbers for this.

2D works differently than 3D, only in 3D you can choose whatever you want as a screen size, because the display card has special processors to recalculate everything. That does not work the same for programs in 2D.
So your screen size also should be something that can be displayed in full tile sizes. But in those cases you need to use numbers smaller than your max monitor size. If for example your monitor is 900 height then you'll have to use a screen size of 864 instead, because that is the last smaller number divisible by 48. Using a screen size of 1248x864 will make your computers display card put up a black border to 1250x900, no need to do that manually - and there won't be any distortions created as there are when you force the engine to display partial tiles.

If you want to use a panorama picture to mark positions of a top-down map, then you need to use map projection mathematics. No way around that. But you'll have to check those mathematics for yourself, they're to complex to explain in my limited time over the internet, especially as my access will be extremely limited for the next weeks.
 

Xyonel

Indie Developer, All-in-one artist.
Veteran
Joined
Jul 22, 2018
Messages
183
Reaction score
37
First Language
Italian
Primarily Uses
RMMV
very useful, I'll try and check, then I will post some result when possible, thanks.
 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts


My only regret is the portal mirror effect is too subtle to show up in these GIFs. It probably just needs more sparkles. :LZSwink:
Microsoft: Hey, let's waste money advertising the Xbox Series X when nobody has any in stock, we don't seem to be making more, we aren't taking preorders and you can't get on a waiting list. BEST. IDEA. EVER.
So I'm practicing ITC with a spirit box, and decide to try to contact my deceased soulmate. It actually gave me multiple identifiers. Me, still a bit skeptical, asked aloud "Fine but does he still love me?" and the box spoke and printed the word "Forever" at the same time. Been a mess of tears since. :kaocry:
Been scratching away at my game and making progress, but just had a revelation. I'm working in full screen and adjusting all my pictures accordingly, but will they resize if someone's screen is smaller?? I hope this doesn't turn out to be a problem later.

Forum statistics

Threads
105,633
Messages
1,015,131
Members
137,292
Latest member
inkdrips
Top