Map screwed up in-game

smoochy boys on tour

Chalace

Dedicated Member
Dedicated Member
Jan 18, 2014
1,823
275
125
Never had this issue before and i've been making maps for over a year, any idea what's wrong?
The rest of the map is fine, no issues i can see.

Looks fine in all 3 editors.
EoIaej.jpg


But in-game it looks like this:
ARxq6h.jpg


Looks fine on the created miniamap too:
6AWQj5.jpg


---------- Post Merged on 22-04-2018 at 12:16 AM ---------- Previous Post was on 21-04-2018 at 11:54 PM ----------

Found another bit that does the same, there are 2 statues of this style, both do this.

k0eag9.jpg


---------- Post Merged at 12:30 AM ---------- Previous Post was at 12:16 AM ----------

Edit: Looks like it's the actual objects that are the issue, as they do the same when i stick them on any map.
Any ideas how to fix this?

Can't see anything wrong with them, indexing and positions seems fine. And it's strange that some parts work fine but some don't. The gap here is the mines entrance from the image above.

hG9Njz.jpg


---------- Post Merged at 01:02 AM ---------- Previous Post was at 12:30 AM ----------

So I've narrowed it down to the fact they are middle images.

The mine entrance works fine, and is a front image. So i remade a piece as a front image. That now works fine too.
So why are they screwing up when being used as a middle image?

I spent weeks making all these objects, block by block, i really don't want to have to re-make a chunk of them unless i really, really have to. I inevitably screwed up and some were made as middle images.
 
Last edited:

Breezer

Mr Mañana
Legendary
Jul 16, 2004
3,370
539
315
Maybe someone can work out how to convert them from middle to front
 

zedina

Mir3 Dev
Legendary
Dec 22, 2005
3,167
1
1,017
340
What map is this? God damn it looks so beautiful!

Mir2 has some beautiful maps than Mir3 *jealous*
 

1024

Dedicated Member
Dedicated Member
Mar 5, 2015
597
8
60
What map is this? God damn it looks so beautiful!

Mir2 has some beautiful maps than Mir3 *jealous*

it's a custom map made by him using shanda mir2 objects/tiles
 

zedina

Mir3 Dev
Legendary
Dec 22, 2005
3,167
1
1,017
340
it's a custom map made by him using shanda mir2 objects/tiles


Oh really? Thats nice!

Been speaking with my team to adopt the shanda tiles, could do a pretty nice starting map on a mir3 server
 

Chalace

Dedicated Member
Dedicated Member
Jan 18, 2014
1,823
275
125
Have you been building whole objects on middle layer ?

I may have done some yes. When you are sat going through thousands of puzzle pieces, mistakes happen.

What map is this? God damn it looks so beautiful!

Mir2 has some beautiful maps than Mir3 *jealous*
This is your home. :P
It's a map i made yesterday, part of my player housing system.

Still doesn't explain why a middle image would come out all screwed up.
 

Far

tsniffer
Staff member
Developer
May 19, 2003
20,172
30
2,767
540
never seen that happen before, the map editor code 'should' be identical to the client - so shouldn't look any different.

I expect they're both using the same data folder?

It's most likely a difference in code, i cant think what else could cause it - something that might have been fixed in the editors but not applied to the client for some reason. Might be worth just comparing the code to see if you can spot any difference.

Either the mapinfo reader code, or the render code which draws the images on screen. I will compare the 2 on github in a few days if you haven't been able to by then.
 

Chalace

Dedicated Member
Dedicated Member
Jan 18, 2014
1,823
275
125
I'll take a look when i get chance. I re-made all the used Objects using front images and it all looks fine ingame now.
I have used middle images before without an issue, and yes they were both pulling from the same data libs.

Seems that it is ofsetting the ShandaM2 middle tiles Y axis by 50 or so. (By how it was looking ingame).
 

mir2pion

TL;DR
Veteran
Feb 21, 2013
3,093
502
175
I ran into the same problem with middle images while replacing a section of BW town canal a while back. Always wanted to be able to walk on those two landings over the north edge of the canal, there are even steps there that could be used as entrances to fishing areas... originally I thought I would just delete the backlimits on those landings but then your char shows 'behind' them, as behind a wall (it being front image object) when you step on the landing.

I replaced that canal section with the landing area on it by an object built as middle image object (because char in game shows in front of middle layer images). While it worked in the mapedit program, in game I found that image strip was shifted down by its full height, also some of the image strips making up that section were shifted a bit relative to surrounding strips.

Those 'tall' image strips in libraries - single tile width columns and typically around 10 or 12 tiles high (like those meant for building houses or cliffs) simply don't work on live maps when placed in the middle layer (even if the editor allows you to place and save them as such) and won't work because all tiles placed on the map as middle images apparently must be single tiles only.


Code:
Optinal section for those not reading challenged, all others pls skip it, thank you.

If you load official maps and hide front and back images,
 you will see  that all middle images (typically the brown paths in forests
 and grass  patches or various features in sand etc.)  are covered with tags
 all  over (if you have 'show middle tag' selected), whereas front images
 can  be tall columns of tiles and only at the bottom have the single tag!
 It  would seem that all middle images apparently must be single tiles,
 each  with its tag (although you can build them into bigger, multi-cell
  objects  for ready placing on maps, in that case the object will still  be
 solid plastered with middle tags). 
BTW I found some of those 'features' which are middle images
 on the official maps are back-image objects in Akaras object set,
 go figure (before placing those on back tiled maps, you need to remove
 back tiles to make place for these back image objects, or else you get
 graphic mishmash, in both the editor or live map).

At the coordinate, where in the map editor you see the tag of image strip, in live game that's exactly where the 'top tile' of that column strip will be placed with the rest of the tiles lined up underneath it, i.e. the whole image column gets shifted by its full height down. Change made in the client or editor code seems to be due. On live maps the 'bottom tile' in those strips needs to be placed @ the coordinate where the image strip (middle) tag is.


Code:
Optinal section for those not reading challenged, all others pls skip it, thank you.

One positive thing came out of this investigation of mine
 - you recall you asked elsewhere about the huge 2k or 3k size maps
 (for example, BProvince is 700x700, that is 0.7k map), 
if such huge maps won't impact client performance. 
If you ride your tiger down on that map of your's above here
 (btw really nice map, I am impressed how professional it looks)
 where those cliff tiles stick down like a sore thumb, you will notice
 the image strips making up that displaced down cliff disappear
 one by one, and as you move back up, they again reappear in the same order...
 what that tells us is when the images get loaded in the client as you approach
 their tags. Normally you'd never see this loading except for this (happy?) glitch.
 In effect, as you move on a map, the client loads up tiles just outside your game
 view in the direction you move towards to and conversely drops, unloads tiles
 you are leaving behind you just outside your game view. 

BTW Korean Happy server that in Season2 started with 1920x1080 resolution (or even bigger?)
 likely had to adjust in code this image pre-loading, else you'd see white, that is empty expanse
 around the perimeter of game view as you'd see the area where images would be loaded
 into view and which is normally just outside the game view).

I estimate the client loads into memory only about four tiles just outside the perimeter
 of the actual game view, at least for the back and middle tiles, for the tall image strips
 that make up the cliffs or buildings that distance must be longer - otherwise as you
 approach an object on a map that is made of those tall strips, such as buildings, from above,
 their roof would only appear, virtually would jump up to view only as you approached close enough
 to the tags at the base of the building, still some sizable distance underneath, out of view.
 That means the client must load & drop those front images further out behind the client game view,
 than it does for the ground, back & middle tiles, which btw never come in strips of tiles with single tag
 - those single tag image strips are meant only to be employed as front images. 

I see it as a fault of the Xiyue map editor, that it allows placing/saving such multi tile image strips
 as middle layer images/objects.  
From all that, it follows that map size doesn't impact the client performance at all, or at least not
 from the point of view of how much graphic images it needs to handle, although for all I know,
 there might be other technical, code limitations.
Note: I tried to fix that BW water canal fiasco by off-setting the placement of that whole shifted section in the up direction (in the map editor it would be misplaced but look OK in game), see the enclosed pic bellow, but that is not a solution since you see the canal 'being built' as you approach it from bellow, and if that wasn't enough, that still doesn't fix the small, vertical miss-alignment of strips within the canal section that I built as middle layer - the shift is less than a full grid cell size and is a bit beyond me what causes it (as seen in the other pic below).

I wish you a happy object and map building, at least I found it is as addictive as playing the game or almost so. And beware of the middle layer :saturn:

BTW I experimented with both Wemade and Shanda libs tile strips, made no difference.

Code:
Optinal section for those not reading challenged, all others pls skip it, thank you.

It seems on mir maps (official or pservers), 
middle layer very handy  for mappers who build those pathways 
through forests or place features on ground that are walked on,
 as they don't need to remove backtiles under those features. However
 I found some examples where it would be useful to place image strips with single tag
 in middle layer, like in that canal example.
  Another one would be making those BW town ramparts 'walkable'.
 Then those guards on patrol could walk up via one of those provided ramps,
 walk on top of walls that even have walkway already on top of them... and only
 thing needed would be to put those ramparts  on middle layer so the guards sentry
 would appear to walk on top of them, not behind (the towers would need to stay on front layer
 for obvious reason). It would add 3D like dimension to mir.

----------
As they say, if you don't like something on tv, there is a channel or switch off button, it is there for a reason. Likewise, here you can scroll past my posts, there is also the ignore posts feature, just use those and stay polite that way as I do. Negative, slighting comments do you no service or to anybody. Thank you.
 
Last edited:

Chalace

Dedicated Member
Dedicated Member
Jan 18, 2014
1,823
275
125
Edit: I tried to have a look, but to be perfectly honest, most of what I'm looking at i have no idea about.
I compared the loading code to that in the map editor master and can't see any differences.

If you could take a look when you get chance that would be great.

Not a real issue in the OP case as i can just remake objects as front, but not beig able to use middle layer at all is a problem.

@mir2pion
That was hard to read.

While i see that you had similar issues, your conclusion is not quite there. It is undoubtedly a simple issue of the client loading the middle tagged images wrong.

Testing a little more, it is doing as i believe you suggested. Loading the image from the top isnstead of the bottom.

The example here using a 3 cell hight image, it moves down exactly 3 cells.
(Actually after the first column its 4, but only drops 3, so i'm lost)

I can't just re-make ths as front, as it would look silly, flowers appearing infront of your char.
OcSdsA.jpg
 
Last edited:

mir2pion

TL;DR
Veteran
Feb 21, 2013
3,093
502
175
Yeh, not easy read. Not for everybody but object, map building is not easy either, not for everybody. It strikes me you are too much in a hurry to do things to slow down to give it a read and be able to follow. That said, English is not my mother lang, so.

As for those flowers, just look how its done on the official built maps, no problems there with shrubs, flowers, trees, they are all front objects. If you place limit in the place where they have roots, then if its taller shrub you appear behind it when you are behind it or else in front of if in front. In the case of low flowers, the non walkable limit pretty well prevents you from getting hidden behind it and from front your char appears on top of it, hides it with his body. Again, if you hide front objects on maps, you don't see any shrubs or flowers (at least those maps I explored) and even the middle layer holds very few objects, mostly insignificant number of them, barring those pathways.

Code:
I did some object building like you do, but not building whole maps yet.
 Before long, while building objects, I realized I need to disassemble some official maps
 to understand better which objects to build on which layer, how to make
 doors to open when you approach them and many such things. Without
 having such insight you built cliff section as middle layer when there is no
 reason to do that whatever (it either gives no benefit whatever or you can
 even get into trouble at map bottoms where likely your character can walk
 behind cliff promontory and then it would appear on top of such middle layer
 cliff instead of half hidden as behind a wall). I doubt you just miss clicked
 on that drop down menu in the editor, more likely you didn't think twice
 about it or had incorrect interpretation of what the middle layer means.

However if this middle layer placing is a fault and one which can be corrected, then I am all for fixing it, check the examples I added via edit at the end of that big post, how such ability could be put to a good use. Another tip if somebody goes into the source, it would be nice if the editor tabs could have keyboard shortcuts to open them. First three tabs corresponding in order to F1-3, Objects tab F4 and Map tab F5. Save as object F6, clear map F7 and cell info toggle F8. That is my dream. And forget the iJam's mod of that editor - sorry but while the map always open is handy, the small to nonexistent lib or objects preview pretty well kills it in my eyes. Also it seems to collapse a little too much for my taste. :smilet-digitalpoint
Xiyue editor all the way for me. :encouragement:
 
Last edited:

Chalace

Dedicated Member
Dedicated Member
Jan 18, 2014
1,823
275
125
Well that got real fast.... Not entirely sure what yout problem is here :s
Too much in a hurry? My first 2 maps took a month each... I'm never in a hurry.

But believe whatever you like, over the span of a month i made a few thousand objects, block by block. **** happens. I assure you I am well aware of the layers purpose.

As for "look at official maps" we already established that they were lazy ****s. Even with the better Shando ones. Let's take a look at what happens when i use the 'official' front image shall we.

I don't know about you but i don't want to be seeing flowers that im supposed to be stood in front of, thanks.
uH47nB.jpg


In the case of low flowers, the non walkable limit pretty well prevents you from getting hidden behind it and from front your char appears on top of it
Placing move limits on flowers to stop this is not an acceptable solution. I really don't think i need to explain why.
 
Last edited:

mir2pion

TL;DR
Veteran
Feb 21, 2013
3,093
502
175
OK, the last thing I want is step on your toes, what I meant you need to take time to read my post, I can see myself it is not something for casual read. Its just that some things are not easy to put down in few bare lines that can be skimmed over, that all.
Anyway good morn, myself am off to late bed.
 

Chalace

Dedicated Member
Dedicated Member
Jan 18, 2014
1,823
275
125
To summarise.
- Middle images which span multiple cells on a single tag are being offset ingame but not in the editor.
- Single cell middle images work fine.
- Not limited to only Shanda data.
 

Far

tsniffer
Staff member
Developer
May 19, 2003
20,172
30
2,767
540
In effect, as you move on a map, the client loads up tiles just outside your game view in the direction you move towards to and conversely drops, unloads tiles you are leaving behind you just outside your game view.

I skipped most of what you read as it's just a wall of text. But this statement is wrong ^. The client doesn't draw depending on the direction you move, if you move in any direction it clears the whole map and redraws everything from top to bottom.

@Chalace - I have just remembered that Mir3 maps don't actually have a middle layer floor code (they treat it as a front layer) - so would explain why i've never come across this issue myself.

Going by what you've said, it sounds as though its an issue with the middle layer draw code, and not the way images are read from the mapcode.

Does middle layer floor code do the same thing as middle layer objects?

The error must be in private void DrawObjects() (in GameScene.cs) - And since it draws correctly in the map editors, but not in the client their must be some difference.

Strange though as the map editor code was taken from the client - so someone must have either broken the client or fixed the map editor.
 

Far

tsniffer
Staff member
Developer
May 19, 2003
20,172
30
2,767
540
Well that got real fast.... Not entirely sure what yout problem is here :s
Too much in a hurry? My first 2 maps took a month each... I'm never in a hurry.

But believe whatever you like, over the span of a month i made a few thousand objects, block by block. **** happens. I assure you I am well aware of the layers purpose.

As for "look at official maps" we already established that they were lazy ****s. Even with the better Shando ones. Let's take a look at what happens when i use the 'official' front image shall we.

I don't know about you but i don't want to be seeing flowers that im supposed to be stood in front of, thanks.
uH47nB.jpg



Placing move limits on flowers to stop this is not an acceptable solution. I really don't think i need to explain why.

Why can't you place the flowers as back objects?

Your only limitation is you can't have 2 images on the same layer - but a back object should work fine against a back tile.

I've never come across this issue on any official map (or on any map i've seen built up to now) - so you should be able to use back/front objects to achieve everything you need.

Middle layer is rarely used (if i remember correctly Mir3 doesn't even have a middle layer, it just treats it as a front layer) - a middle layer only gives you a third overlay effect for some complex tiles which use depth i guess.
 

mir2pion

TL;DR
Veteran
Feb 21, 2013
3,093
502
175
But this statement is wrong ^. The client doesn't draw depending on the direction you move, if you move in any direction it clears the whole map and redraws everything from top to bottom.

Look, I am not trying to be a layer here, or write as if I wrote a code. I know too well that the drawn tiles are not somehow carried along. You missed my point.

Doesn't your remark come to the exactly the same point I made, if the whole screen view is getting redrawn, as you say? Point I make is how far, past the client game view, that redrawing takes place, that the map outside this limited perimeter - what you see and a small bit of what you just don't see, is all that is redrawn? And the rest of the map outside that can be as large as the map editor allows without affecting the client performance.

But to see, that my point stays, would require you to read what I wrote, not just skim read, I find your plaint about 'wall of text' astonishing see that it comes from someone who works with walls of text on screen - because what else is the source code than an endless wall of text?? Now you can raise another technical point and say, I am wrong, because every code has an end. I mean if you want to find a stick...
 

Far

tsniffer
Staff member
Developer
May 19, 2003
20,172
30
2,767
540
Look, I am not trying to be a layer here, or write as if I wrote a code. I know too well that the drawn tiles are not somehow carried along. You missed my point.

Doesn't your remark come to the exactly the same point I made, if the whole screen view is getting redrawn, as you say? Point I make is how far, past the client game view, that redrawing takes place, that the map outside this limited perimeter - what you see and a small bit of what you just don't see, is all that is redrawn? And the rest of the map outside that can be as large as the map editor allows without affecting the client performance.

But to see, that my point stays, would require you to read what I wrote, not just skim read, I find your plaint about 'wall of text' astonishing see that it comes from someone who works with walls of text on screen - because what else is the source code than an endless wall of text?? Now you can raise another technical point and say, I am wrong, because every code has an end. I mean if you want to find a stick...

I didn't call you a liar, i simply pointed out that your statement wasn't correct - how else would you learn the correct way its done? I did end up reading your essay in full, and many of the points you made were full of assumptions (many of them inaccurate).

Removing the bottom row and adding a new row at the top is not the same as redrawing the entire screen based on a new position - especially when it comes to code. Maybe this wasn't the point you were getting at, but the way you worded it made it sound like it drew differently depending on the direction you moved.

So defensive.