MV3D - 3D rendering for RMMV with Babylon.js

Ahh, I didn't even try to attack without it, but the Visual State Effects crash happens before even reaching the battle screen.
that's because visual state effects start the animations as soon as battle starts.
so really, it is more because an animation was used in battle than plugin compatibility.

And @Dread_Nyanak I found the problem!
The plugin itself is compressed so it is hard to see in it, but on the webpack/srcfolder, in the animations.js file, I can see that you check if the map has the mv3d disabled... but not if it is a battle. meaning that unless the mv3d is disabled in that map it'll try to do things it'd do in the 3d map in the battle too, fail and give an error.

In line 65, function Sprite_Base.prototype.startAnimation, I'd suggest changing "if(mv3d.mapDisabled){ return; }" to "if($gameParty.inBattle() || mv3d.mapDisabled){ return; }"

In line 73, function Sprite_Animation.prototype.updateFlashScreen, to change "if(!mv3d.mapDisabled){" to "if(!$gameParty.inBattle() && !mv3d.mapDisabled){"

And in line 82, function Sprite_Base.prototype.updateAnimationSprites, to change "if(mv3d.mapDisabled||!this._animationSprites.length){ return; }" to "if($gameParty.inBattle() || mv3d.mapDisabled||!this._animationSprites.length){ return; }"

...
ok, so all my changes are just to change the three places related to animations I found that check if the map has 3d disabled to check if the party is in battle first.
Still think it should fix the problem.
Yeah, it looks like I broke battle animations. Fixed now though.
Also changed the forest note tag so player isn't turned incorrectly.
Also fixed a bug where leading commas and multiple bars in a row didn't work in configuration functions.
err.png
Is there any way we can turn off the 3d rendering midgame or perhaps turn the rendering off for certain map?
Need more than that. How was it got, what have you done to make t happen? What does the console say when it happens?

Is there any way we can turn off the 3d rendering midgame or perhaps turn the rendering off for certain map?
There is a notetag to turn if off in a map. Since maps that use it have to be made a special way, doing any other way wouldn't be so good.
game_oiXyxDZvAy.png


A wild mewtwo appeared
I have a question about rotating the camera, aside from using the Q and E buttons.Can I use call script for ?
I want to create a custom event in which the characters are turned In the specified direction but how can I do?
I have a question about rotating the camera, aside from using the Q and E buttons.Can I use call script for ?
I want to create a custom event in which the characters are turned In the specified direction but how can I do?
In the help file AND the github page there are plugin commands you can use.
for your question the answer would be one of
mv3d camera pitch <n> <t>
mv3d camera yaw <n> <t>
mv3d camera dist <n> <t>
mv3d camera height <n> <t>

<n> is the value to change and <t> the number of frames it would take to do it
There is a notetag to turn if off in a map. Since maps that use it have to be made a special way, doing any other way wouldn't be so good.
How?
How as in "what is the notetag" or "how is mapping different"?

The notetag is, on the map notebox,
Code:
<mv3d>
    disable()
</mv3d>

The mapping itself...
you don't put wall pieces, only ceiling pieces. Walls will be the ceiling pieces being raised.
You don't put two-tiles-tall B-E tiles by putting one tile above the other in the editor with the upper one being a star. You use the fact the editor allow you to put two tiles on the same space in the upper layer and you put both pieces in the same place, the one supposed to be above second so it is... well, above.
You can't put things like the default blaxk pits right on the ground, else the ground will cover it. You need to put some transparent tile there and put the pit on that tile.
And probably more differences I can't remember right now out of my head.
<n> is the value to change and <t> the number of frames it would take to do it
Small correction, <t> is in seconds.

To set the yaw to zero over one second:
mv3d yaw 0 1
To rotate counterclockwise 45 degrees over one second:
mv3d yaw +45 1
To rotate clockwise 45 degrees over one second:
mv3d yaw +-45 1
Oh... I was sure it was frames, sorry.
Is there any way we can turn off the 3d rendering midgame or perhaps turn the rendering off for certain map?

Disable per map with map config:
<mv3d>disable()</mv3d>
Or disable mid map with plugin command:
mv3d disable
mv3d enable

Note that disabling the plugin mid map probably won't look good. I recommend having separate maps for the 3D parts and 2D parts.
Or, instead of disabling the plugin you can use the orthographic camera instead.

Set camera mode in map config:
<mv3d>camera(mode: orthographic)</mv3d>
<mv3d>camera(mode: perspective)</mv3d>
Set camera mode with plugin command:
mv3d camera mode orthographic
mv3d camera mode perspective
Just some things I wanted to point out while messing around with 3d models:

- The map coordinates in Babylon are inverted (had to use negative values to place a model on the map)
- The Z and Y coordinates in Babylon are switched (Y is height)
- Models have some problem with lighting, probably some conflict with ambient light although I'm still not sure what the culprit is.
@0zuma
Yeah, RPG Maker and Babylon use different coordinate systems. In addition to having different up directions they're also inverted. I have some alias properties that use RPG Maker's coordinate system though.

o.x == o.position.x
o.y == -o.position.z
o.z == o.position.y
Can someone tell me, what button are being changed because of this plugin. Cuz I just knew some, just like Q and E to rotate camera. Thank you.
Are there any plans for non-tile-based movement for this plugin? also, is it possible to use textures that are larger than 48x48 so the textures are higher res? (sorry if any of this is written poorly, I'm not good at articulating my thoughts haha)
@Zekken
WASD to move, Q and E to rotate, and Pageup and pagedown to look up and down.

@Echuwu
Non-tile-based movement is a planned feature. And higher res textures will probably be possible in the future. There are plugins to change tile size, but I haven't tested them yet so they might not work properly together.

Update 0.3.10 (premium):
Added plugin commands and configuration functions for dynamic shadows.
Increased bias of the shadow generator to hopefully reduce self-shadowing issues.
Added option to change how fences and cross tiles interact with directional light.
hmm... @Zekken 's question reminded me that wasd for moving and q and e for left and right shoulder buttons is not the default controls, a default game uses the arrow keys and q and w... aldo page up adn down are the same as q and w...
that means that you are changing the controls and I did not even notice...

...now I wonder how they control on an actual controller with this plugin...

...do you mind if in the future I make - and put here - an extension for changing the controls based on Quxios' QInput and QInput+Remap?
Quxios' Terms of Service say there is no problem as long as there is on the plugin's help or somewhere else visible.
Of course, this plugin is yours, so if you already has plans for this or something be free to say no.
hmm... @Zekken 's question reminded me that wasd for moving and q and e for left and right shoulder buttons is not the default controls, a default game uses the arrow keys and q and w... aldo page up adn down are the same as q and w...
that means that you are changing the controls and I did not even notice...

...now I wonder how they control on an actual controller with this plugin...

...do you mind if in the future I make - and put here - an extension for changing the controls based on Quxios' QInput and QInput+Remap?
Quxios' Terms of Service say there is no problem as long as there is on the plugin's help or somewhere else visible.
Of course, this plugin is yours, so if you already has plans for this or something be free to say no.
I Agree. Is there any way to change the control? Maybe through .json or plugin parameters? Because sometimes, this makes this plugin not compatible with other plugin. And I think that moving with wasd is not nessecary because we can move with arrow key. And it can be done with other plugin such as YEP KeyboardConfig.

Original thread: https://forums.rpgmakerweb.com/threads/mv3d-3d-rendering-for-rmmv-with-babylon-js.114971/