MV3D - 3D rendering for RMMV with Babylon.js

Waterguy

Veteran
Veteran
Joined
Jun 6, 2014
Messages
1,399
Reaction score
316
First Language
Portuguese
Primarily Uses
RMMV
@fizzly ...yes?
In the demo, in the Outside tileset's D tab, there is a tile of a square like the leaves labyrinth with a transparent square in the middle. It is mostly used in the forest map.
In the tileset's notetags, that tile is set to be a floating treetop, with the dark tile under it as the bottom of it.
D,0,1:top(A4,6,0),side(A4,6,1),height(0.5),bottom(D,1,1)
 

fizzly

Veteran
Veteran
Joined
Mar 23, 2012
Messages
460
Reaction score
312
First Language
Polish
Primarily Uses
RMMV
@fizzly ...yes?
In the demo, in the Outside tileset's D tab, there is a tile of a square like the leaves labyrinth with a transparent square in the middle. It is mostly used in the forest map.
In the tileset's notetags, that tile is set to be a floating treetop, with the dark tile under it as the bottom of it.
D,0,1:top(A4,6,0),side(A4,6,1),height(0.5),bottom(D,1,1)
Hm, looks like it does not work for me. I have holes uder the trees...
1580031354630.png
 

Parallax Panda

Got into VxAce ~2014 and never stopped...
Veteran
Joined
Oct 29, 2015
Messages
796
Reaction score
1,069
First Language
Swedish
Primarily Uses
RMMV
@Dread_Nyanak
So, I've found a "bug", or at least I'd consider it as such. I've evented a simple system where I check if an event that crashes into the player (event touch) is standing in front of you, behind you to your left or to your right. This is all in 1st person mind you.

It all works until I start strafing. If I strafe into the event it'll read this as if it touches me from the front - until I stop moving. If I finish moving it seems to read the correct direction based on where the camera is facing. I guess this means that you're not actually "direction fixed" while moving sideways (as one would assume), but rather turned to face the right direction at the end of movement? At least this is how it seems to me. I think it would be much better if the player sprite was always set to face the direction of the camera in 1st person as it would make more sense.

I actually have another bug/problem as well. If said event is chasing me (which it is) and the the distance between us is zero (it's standing on the tile right next to me), it'll keep pushing me into the ceiling when I try to run away. This only happens if it's right behind me or right in front of me (right in front of me means I'd be running backwards). If it runs along side me it works fine.
 

Waterguy

Veteran
Veteran
Joined
Jun 6, 2014
Messages
1,399
Reaction score
316
First Language
Portuguese
Primarily Uses
RMMV
@fizzly testing myself right now... you are right, I didn't even notice... I am sure it was working in an earlier version, but now looking up from bellow on those with bottom shows the ceiling, and even those without, tho ones in your screenshot (they are supposed to have the bottom of the top since it wasn't set by hand), are empty there, meaning that it probably applies to all bottoms, not just the ones set on the code...

@Parallax Panda that actually makes sense... as directions are changed through the camera's yaw even when not in first person, it is easier to make straffing not change the yaw instead of fixing direction... actually, would direction fix even matter in this case? would it still work like you want without mv3d if the direction was fixed? if not, it would be better to change your checks to check for yaw instead of direction, but if so yeah, Dread_Nyanak would need to add a small "fix" to this (better add it either way, to be honest, but I am saying it for you to keep it until then).
the "push" thing is more of a bug that needs immediate attention to me. so and event colliding with the player when both are moving pushes them up a bit... makes sense it not happening when they are on the side, since the event is walking alongside you for that frame instead of trying to collide.
 

Dread_Nyanak

Veteran
Veteran
Joined
Feb 24, 2019
Messages
131
Reaction score
171
First Language
English
Primarily Uses
RMMV
I wasn't aware the tile bottoms had stopped working. It was caused by the fix I made to pit culling.

@Parallax Panda
Direction fixing the player while strafing in 1st person seems like a sensible change. I'll add that.
As for the bug where chasing events push you upwards. It seems like this happens when the event has a shorter collision height than the player.
I decided to fix it by ignoring event platforms while they're moving, since moving platforms don't work at the moment anyway.
Moving platforms would be a neat feature to have though, so when I decide to implement them I'll need to find a better solution.

Update 0.4.4.5:
Moving platforms are ignored to avoid pushing the player up.
When moving in 1st person mode, player direction is locked to camera direction.
Tile bottoms are now working properly again.


Also for those asking for a link to my patroon, the forum doesn't allow linking directly to it, or even mentioning its name for some reason. So I have the link on my github page. The link can also be found in the help text in the plugin manager.
 

Waterguy

Veteran
Veteran
Joined
Jun 6, 2014
Messages
1,399
Reaction score
316
First Language
Portuguese
Primarily Uses
RMMV
guess that means no official elevators then... I'll have to lower and raise both the player and event's zs now...
Eh, was surprised I wouldn't have to before anyway.

@Dread_Nyanak
not pushing, but any plans on my suggestions on screenX and screenY for the future, plus something to give the event's/player's/follower's "height" (on accounting for the sprite, the scale and zoom due to distance from camera")? As I said at the time, I think quite a few plugins will be compatible, or easier to patch them to be, if you add them...
 

glaphen

Veteran
Veteran
Joined
Jan 13, 2019
Messages
187
Reaction score
59
First Language
English
Primarily Uses
RMMV
I wasn't aware the tile bottoms had stopped working. It was caused by the fix I made to pit culling.

@Parallax Panda
Direction fixing the player while strafing in 1st person seems like a sensible change. I'll add that.
As for the bug where chasing events push you upwards. It seems like this happens when the event has a shorter collision height than the player.
I decided to fix it by ignoring event platforms while they're moving, since moving platforms don't work at the moment anyway.
Moving platforms would be a neat feature to have though, so when I decide to implement them I'll need to find a better solution.

Update 0.4.4.5:
Moving platforms are ignored to avoid pushing the player up.
When moving in 1st person mode, player direction is locked to camera direction.
Tile bottoms are now working properly again.


Also for those asking for a link to my patroon, the forum doesn't allow linking directly to it, or even mentioning its name for some reason. So I have the link on my github page. The link can also be found in the help text in the plugin manager.
It seems to have broken climbing higher than 1 stair threshold, I can't get on anything from a 0.4->0.8 to 1.2 anymore and climbing the 2nd seems glitchy as it falls through the floor first and teleports onto it after even with a 3rd at 0.99 it does it but setting it to 1.00 or higher it won't step on it just falls through the floor. Also falling onto a platform with like only 0.4 difference falls through slightly and teleports up, doesn't with 0.8 difference though.

guess that means no official elevators then... I'll have to lower and raise both the player and event's zs now...
Eh, was surprised I wouldn't have to before anyway.

@Dread_Nyanak
not pushing, but any plans on my suggestions on screenX and screenY for the future, plus something to give the event's/player's/follower's "height" (on accounting for the sprite, the scale and zoom due to distance from camera")? As I said at the time, I think quite a few plugins will be compatible, or easier to patch them to be, if you add them...
You can still make raising platforms without falling and moving platforms never worked anyway.

Also it does it even with walk off edge off, letting you still fall off those edges but not if you try the direction that doesn't have a platform.
 
Last edited:

Waterguy

Veteran
Veteran
Joined
Jun 6, 2014
Messages
1,399
Reaction score
316
First Language
Portuguese
Primarily Uses
RMMV
@glaphen what do you mean "broke climbing higher than the stair threshold"? you couldn't walk to anywhere with a higher height difference than it before, that is exactly what the threshold was supposed to block doing.
 

glaphen

Veteran
Veteran
Joined
Jan 13, 2019
Messages
187
Reaction score
59
First Language
English
Primarily Uses
RMMV
@glaphen what do you mean "broke climbing higher than the stair threshold"? you couldn't walk to anywhere with a higher height difference than it before, that is exactly what the threshold was supposed to block doing.
I mean staircases made of events, with 0.4 stair threshold you can walk from a 0.4->0.8->1.2->1.6->2.0, but current update you can't walk higher than 1 you fall through to floor even with walk off edge off.
 

Dread_Nyanak

Veteran
Veteran
Joined
Feb 24, 2019
Messages
131
Reaction score
171
First Language
English
Primarily Uses
RMMV
@Waterguy
No, elevators should still work fine. Moving up and down doesn't actually count as moving, since I'm using the built-in isMoving function

The default collision height should already take into account the sprite size and scale.

Can you remind me what your suggestions were?

@glaphen
I was accidentally checking when the player was moving instead of the event. Should be fixed now.
 

glaphen

Veteran
Veteran
Joined
Jan 13, 2019
Messages
187
Reaction score
59
First Language
English
Primarily Uses
RMMV
Both problems are fixed.

New problem going 0 to 1.0 it seems to ignore exact stair threshold, if I go from 0.4->0.8->1.2 I can't step on 1.2 without holding ctrl in test but after I can walk onto 1.6, I can walk on it with 1.19 though.

It only seems to do it from 0.8 to 1.2, I made it extend up to 3.2 and I can get on it from 2.8.

I tried changing to 0.3 stair threshold but I couldn't climb 0.3->0.6 and 0.9->1.2. Increased to 3.6 and I couldn't climb 2.1->2.4 only. 3.6->3.9 is another spot. 5.1->5.4. No other spots all the way up to 8.4.

It seems to do with ground height as well, I was doing all this at height(2) region, but at ground level I could walk 0.3-0.6 but not 0.6->0.9.

It does it to tiles as well, changing to a 2.6 height tile I can't walk 0.3 platform to 0.3 difference tile, can't walk a 2.3 to 2.6 height tile with 0 event involvement. But naturally all this can be ignored entirely if you set stair threshold to be 0.31.

Also bug with z still exists player can walk onto any 0.99 difference or less regardless of stair threshold if the event uses z for height, I think rest is fixed. Events using crystal sprite can walk on any z 0.99 or less as well, so probably anything larger than 48x48. I used a huge sprite that is a building and it could walk on even 3.99 z.
 
Last edited:

Waterguy

Veteran
Veteran
Joined
Jun 6, 2014
Messages
1,399
Reaction score
316
First Language
Portuguese
Primarily Uses
RMMV
@Dread_Nyanak
You see, most plugins putting an image or the like around a character's position, like those setting a message box over them, use the screenX and screenY's functions. Those two functions show the current position X and Y of the character on the screen in pixels. That doesn't work properly with mv3d, so you'd need to add an alias to them so they calculate properly when it is active.

Also, a good thing to add would be a function to calculate the current "height" of the characters if not set to flat, and I don't mean height from the ground but visible height of their sprites, taking in account their scale set on the notetags and the zoom due to distance (and if set to something that rotates vertically, the changes made by it too, I think they are fence/wall and cross/xcross?). Some plugins use the event's graphic's height, and I think would be a good idea to have a function on hand for compatibility patches with those.

Since you plan to make this plugin easier to make compatible with other plugins that deal with the map, I think those three things would save a lot of time on those.
 

fizzly

Veteran
Veteran
Joined
Mar 23, 2012
Messages
460
Reaction score
312
First Language
Polish
Primarily Uses
RMMV
@Dread_Nyanak there is also a bug, from the very beggining, if you go to the forest or house (where there is 1st person camera) then often player goes repeadly right or left (you can stop that), you need to leave (change camera view).

Ps. Thank you for the bottom texture fix!
 

PixelHeart

The Pixel Heartist!
Veteran
Joined
Oct 26, 2013
Messages
3,738
Reaction score
1,827
First Language
English
Primarily Uses
Other
Ive been in and out on this topic, just wondering, any chance of including support for using 3d objects, like made in blender, in the future? Just wondering. So far this has been looking really awesome!
 

Dread_Nyanak

Veteran
Veteran
Joined
Feb 24, 2019
Messages
131
Reaction score
171
First Language
English
Primarily Uses
RMMV
Update 0.4.5:
Fixed strafing bug by clearing input when switching into 1st person mode.
Added overrides for screenX and screenY to get the correct screen position


@PixelHeart
Yes, this is a planned feature.
 

safermike

Villager
Member
Joined
Nov 30, 2016
Messages
29
Reaction score
6
First Language
swedish
Primarily Uses
@Dread_Nyanak

This by plugin 0.4.5
Heres a video about how I made some stuff with landscape and objects.

I have a few problems thought, and suggestions.

1. If we activate Qmovement, no interactions with event is working. If you just have scenes on map its fine, since auto and parallel process works.

2. Teleportation through doors seems to make your character drop from ceiling to the ground.
If you add fade out, wait a second, fade in, you can work around it.

3. When adding fringe height too slopes, as seen in the video, a weird flat surface is happening.
I tried disabling the slope with side(0,0,0) or top(0,0,0), it just results in a loading screens.

Right now we also could use more customization to meshes from textures and more options to events

Walls/Fence - Can we get a a customization where we can tilt these so they behave like / or \ ?. This can be useful for roofs or other stuff, not reached that point yet.

Sides meshes - Right now sides mesh cover all 4 directions, but we cannot actually choose what sides on those 4 is rendered or choose to replace them with another texture.
Example. Front, left and right sides uses same texture, but you want another texture in the back. Because of this we are forced to use events with shape:flat to compensate.

And lastly objects. Right now every tile is calculated as a square. Every side is a square.
Could we have implentations that for example a side is calculated as a cylinder, sphere or cone.

You mentioned adding 3d models later, but until then, extra functions to already avaiaible commands would help alot with mapping. Especially with objects and round edged objects.
 

fizzly

Veteran
Veteran
Joined
Mar 23, 2012
Messages
460
Reaction score
312
First Language
Polish
Primarily Uses
RMMV
@safermike, I love how you made interior of that house. How did you made the toilet? It's not block, not a xcross, not a flat 2d model, it's amazing!

Edit: also fireplace and the cooker hood? how did you do that?!
 
Last edited:

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

Latest Threads

Latest Posts

Latest Profile Posts

Updated my state Stacker Script on itch.io, github is down for some reason (probs just me).
Wife watching Locke and Key. This show is so bad!! You can't just acclimate to discovering magic or magical worlds in less than 60 seconds.
I think I still prefer RPG Maker over Dreams. Been playing around with it, and the controls are really the biggest flaw for me.
Watching Dragon Quest: Your Story on Netflix and already like 5 mins in we've passed over like 3 hours of gameplay.

Forum statistics

Threads
94,329
Messages
919,956
Members
124,078
Latest member
Enkidu
Top