Bug Unable to position enemy battlers in Troops tab, possibly due to resolution?

Having a bit of an issue with positioning my enemy battlers, and I think it's due to the resolution I have the game set as...

1658373208293.png


My game is meant to mimic the style of an NES game, and so I have the resolution set at 768 x 720, which is exactly 3x the resolution of the NES (which was 256 x 240), so it pretty much NEEDS to be this resolution in order to keep it looking (mostly) authentic.

But yeah, the problem is... that when the program is set to this resolution, battlers appear in weird places on the troops tab in the database. For example, if I try and place a Goblin sprite...

1658373436318.png

He's way down there, only just peaking above the edge of the Troops editor. Problem is... if I try and add something that's even smaller than this little Goblin, like a Slime...

1658373499085.png

...The sprite is offscreen, and thus cannot be grabbed to move it to a more desirable location. And if I were to just leave it like this and run a battle test...

1658373574222.png


...It definitely doesn't look right. But there's no way, so far as I can see, to actually move the little guy around the Troops tab...

So uh... What can I do about this?
You can try something like https://github.com/theoallen/RMMZ/blob/master/MIT/Theo_ResolutionBasedPlacement.js

you can also edit the Troops.json file by hand. go to `data/Troops.json` and open it in your favorite text editor. Look for and edit the numbers after "x" and "y" of the "enemyId"
You can try something like https://github.com/theoallen/RMMZ/blob/master/MIT/Theo_ResolutionBasedPlacement.js

you can also edit the Troops.json file by hand. go to `data/Troops.json` and open it in your favorite text editor. Look for and edit the numbers after "x" and "y" of the "enemyId"

I just tried that Theo plugin but... it doesn't seem to do anything? At least not that I can tell?
I'm having this error too. I can drag the enemy inside the troops display only on the X direction but not on the Y.
This looks to me like a bug in the editor, so...

I've moved this thread to MZ Feedback. Thank you.

I'm guessing it is related to the difference in aspect ratio between your chosen game resolution and the fixed-size viewport on the Troops tab?

At the moment I think your only options are to either:
  • Position the enemies at a different resolution (with an aspect ratio more similar to the default?) then change to your desired resolution; or

  • Manually input enemy coordinates, which would require directly editing Troops.json (like MechPen suggested) or using an appropriate plugin/script call to configure things.

    • A script call alone would probably not be ideal because the earliest battle event trigger (Turn 0) starts after the emerge messages are dismissed.

    • A plugin for this could be awkward to write/use because troops have no Note field. So you'd either need to configure coords in the Plugin Manager, or follow tradition and put the tags elsewhere, e.g. troop name or event comments.
It'd be nice if the GUI actually worked in these situations! Thoughts:
  • Placement of enemies could be clamped to the viewport. It'd be nice if the Align feature also accounted for different aspect ratios when calculating positions, if that is the problem here.

  • The default status window area could be shown (e.g. a dark box) without restricting placement of enemies inside that area. That could be helpful for low resolutions, or when someone wants to place an enemy covering the full screen.
I am using a larger than normal resolution for my game (1536x864) and I needed a fix for it and I managed to come up with this. I can place them in my editor at almost the correct positions now.
1660218488371.png

1660218747110.png

(The red box you can see was the previous placement area needed due to the resolution, and using that box would have left my battle sprite in the far lower right of the battle arena, under the window and almost touching my characters "section" of the battleback)

Code:
Game_Enemy.prototype.setup = function(enemyId, x, y) {
    this._enemyId = enemyId
    this._screenX = x * 0.50
    this._screenY = y * 0.55
    this.recoverAll()
}

This is just the function that sets up the enemy formation for battle. You would need to edit the "x * 0.50" and the "y * 0.55" to get your battlers where you want them, if you are using a resolution SMALLER than the default you probably need to go greater than 1.xx, if you are using a resolution larger than I am you will need to go SMALLER on the 0.xx value.

Using this above fix, that same battle now appears like this:
1660218573284.png

Which is as accuracy I could get without going too many decimal places for the multiplier...
@Ahuramazda - that doesn't look like the same issue to me...are you using plugins, and if you turn them all off, save your project to apply changes, and test, does the problem disappear?

Unless I've misinterpreted: the OP's problem is that adding an enemy to the troop may cause them to be placed out of bounds, thus unable to be repositioned. That's not the same as what you described.

Enemy position scaling was implemented in the v1.3.0 editor update, by writing scaled coordinates to the data files. As far as I know, nothing in the core scripts has ever scaled enemy positions like your screenshots suggest, so I imagine you are/were using a plugin feature intended for an older editor version, e.g. the Reposition Enemies parameter of VisuStella Core Engine:
I can double check, but I swore that I was having this issue in a clean project too... and I don't have anything VS related, and nothing else in my plugin list (should) have been moving battlers around that I know of.

I'll edit this once I do a clean test and make sure I've not lot my nut over here 😀

Edit: OK... so apparently in a completely clean project it does work fine... so now I am going to rip all my plugins apart to see who is the guilty party of what was happening to me >__>

Edit 2: Thank you @caethyril, because you pointed that out to me I was able to find out it was a plugin... one that replaces enemies with others in a troop. Never realized it was resetting the home value the way it was and apparently it was not taking into account some changes since MZ updated (Project was originally MZ 1.0 and I just recently upgraded everything finally to MZ 1.5)

Edit 3: Got it working correctly now and no longer needed my fix... so looks like my posting above was useless >.< sorry for the bother!
This looks to me like a bug in the editor, so...
Moved to: MZ Feedback I'm guessing it is related to the difference in aspect ratio between your chosen game resolution and the fixed-size viewport on the Troops tab?

At the moment I think your only options are to either:
  • Position the enemies at a different resolution (with an aspect ratio more similar to the default?) then change to your desired resolution; or

  • Manually input enemy coordinates, which would require directly editing Troops.json (like MechPen suggested) or using an appropriate plugin/script call to configure things.
    • A script call alone would probably not be ideal because the earliest battle event trigger (Turn 0) starts after the emerge messages are dismissed.

    • A plugin for this could be awkward to write/use because troops have no Note field. So you'd either need to configure coords in the Plugin Manager, or follow tradition and put the tags elsewhere, e.g. troop name or event comments.
It'd be nice if the GUI actually worked in these situations! Thoughts:
  • Placement of enemies could be clamped to the viewport. It'd be nice if the Align feature also accounted for different aspect ratios when calculating positions, if that is the problem here.

  • The default status window area could be shown (e.g. a dark box) without restricting placement of enemies inside that area. That could be helpful for low resolutions, or when someone wants to place an enemy covering the full screen.

You know... your first suggestion sounds like it would probably work! All I would have to do is set it to a normal resolution, place the troops higher on the window, and then set it back to my preferred resolution, right?
@Ahuramazda - no worries! Others may have had similar thoughts, and you got a simpler solution to your problem, so it wasn't useless~

@TakumaGao - yep, it's a bit clunky to have to change the resolutions back and forth but it should work. In your case, you could reduce the height (e.g. 768 x 587) or increase the width to bring those enemies fully into view.

Original thread: https://forums.rpgmakerweb.com/threads/unable-to-position-enemy-battlers-in-troops-tab-possibly-due-to-resolution.149669/