MV3D - 3D rendering for RMMV with Babylon.js

glaphen

Veteran
Veteran
Joined
Jan 13, 2019
Messages
323
Reaction score
114
First Language
English
Primarily Uses
RMMV
Here's this bird script if anyone wants it, needs yanfly moveroute and event chase and put below, to use I made a movement route to fly randomly with script call and a setting to say it's a bird, also a random script since move route one is different than event settings one. I also remade the sightLock system so it makes enemies leave after x frames even when in sight instead of constantly refreshing unless out of chase conditions.
For the one test event I made it uses this move route.
Script: Random
Script: Random
Script: Random
Script: Random
Script: FlyRand
this._chaseRange = 5
this._chaseSpeed = 5.1
this._seePlayer = false
this._sightLock = 300
this._bird = true
this._returnWait = 200
this._returnAfter = false
Event notetag I have it as <Always Update Movement><mv3d:trigger(0,1)> as an above event with event touch. Only problem I see is there's a bug or something that forces you to use first page as just self switch D and second page with D being an autorun with the actual fight, took me another hour and a half to fix that, otherwise if you just stand still the fight won't trigger and bird will eventually leave. I'm not sure how well it works without through on right now since mv3d seems bugged and you can't walk through the birds without it. Oh and use highest frequency.

And as for the bug it seems to be that you just can't walk under above events at any height right now, doesn't even need z.

Oops said self switch D but somehow it's set to A easy to switch if you want to.

Uploaded new version with D self switch and fixed distance to trigger since changing to Walk on Events seems to have changed it. Also probably better with trigger(0,0). Forgot to turn off through, seems like it lags horribly when chased if the event doesn't have through on or pass(*). So turn it on through if you want the bird to fly over other objects regardless of stair threshold or pass(*) in notetags if you want it to not.

Uhh just realized it lags badly on non birds as well, and with plugin off it still lags, so I guess mv3d broke yanfly event chase player recently. Testing why it seems to have to do with collision, if you turn events to below or pass(*) it won't lag and you don't really need same as for chase events. Actually seems to be both collision and platform, if you turn off both it doesn't lag, if either is on its jittering for me at 30 FPS. But both off with collide(false) or pass(*) work but platform(false),collide(0) don't work. NVM it does work I accidentally wrote collision, it's just collision not platform.

I think I found the problem line in updateChaseMovement.
var direction = this.findDirectionTo($gamePlayer.x, $gamePlayer.y);
If I change it to 2 it doesn't lag, but then it just goes foward over and over, no idea how to fix it at all but it's something to do with that line.

It's definitely the problem if I make a custom move route on an event with just
this.findDirectionTo($gamePlayer.x, $gamePlayer.y);
on repeat I get like 3 fps as soon as I enter the map, doesn't even move the event with it though.


Oops forgot to copy and paste something into plugin so it didn't let it chase again after in last upload.
Also as for this.findDirectionTo($gamePlayer.x, $gamePlayer.y); it is does it in demo even, but if collide(0) it doesn't lag.

Ok for some reason it isn't flying up anymore for me, I didn't change anything over night and settings look the same so I have no idea ATM.

I managed to get it working again, I have no idea why, but somehow overnight
var RNG = Math.floor(Math.random(150) / 10)
stopped working yet I change it to
var RNG = Math.floor(Math.random(15) * 10) / 10
and it works??? Worked yesterday.
 
Last edited:

YoraeRasante

Veteran
Veteran
Joined
Jun 6, 2014
Messages
1,453
Reaction score
336
First Language
Portuguese
Primarily Uses
RMMV
@glaphen dread_nyanak mentioned earlier how to make events passable without setting them as through, and even added the usual passability code from tiles to them to make it easier. is your version of mv3d updates? did you use any of those settings and they still didn't work?
 

glaphen

Veteran
Veteran
Joined
Jan 13, 2019
Messages
323
Reaction score
114
First Language
English
Primarily Uses
RMMV
@glaphen dread_nyanak mentioned earlier how to make events passable without setting them as through, and even added the usual passability code from tiles to them to make it easier. is your version of mv3d updates? did you use any of those settings and they still didn't work?
Ok I figured out what causes it, I had Walk on Events off in my game somehow, so it's bugged with Walk on Events off and makes above events impassible. Not just above any height difference, I don't really care to test since I don't plan on using it off. Actually you can walk through belows. Also only non flat events.
 
Last edited:

YoraeRasante

Veteran
Veteran
Joined
Jun 6, 2014
Messages
1,453
Reaction score
336
First Language
Portuguese
Primarily Uses
RMMV
@Dread_Nyanak and @Zekken and whoever else said they wanted SRD's Character Creator Ex compatible with this...
I did it! It was complicated, stressed me for a bit and everything, but now I tested it and I'm pretty sure all CCEx does on normal sprites this one allows with the 3d characters.
It was not easy, but actually doing it is so satisfying...

I put all CCEx plugins, that is SuperTools, the original and my enhancement plugin (but I'm pretty sure you won't need it), above mv3d, and this one bellow it.
 

Attachments

glaphen

Veteran
Veteran
Joined
Jan 13, 2019
Messages
323
Reaction score
114
First Language
English
Primarily Uses
RMMV
Ok I think I fixed all problems, here is probably final version and a no chase version, if you don't want to use movement core then just delete the Game_Character.prototype.processMoveRouteScriptCall = function(line) {
line of code and use this.flyRandom or this.Randommove in move route script. To edit it more you can change the RNG or even replace it with a variables with like var RNG = $gameVariables.Value(whatever variable); can also copy the paste everything with different values and different calls easily enough. I also have a leash set with
if (this.z >= $gamePlayer.z + 5) {
Can delete the code of the if or change the + to different things or add - if you want them to be able to go below MC. I also fixed the descent since it always went to the floor, but I kept the chase to that, change if you need. Also fixed the returnAfter = false, now it will stay in place and still be possible to chase again after time set. This is designed for 1080p or high pitch, otherwise you probably wouldn't look good or right.

Here is a flock of Harolds.

I feel I should clarify how to make more move scripts for flight.
Code:
Game_Character.prototype.flyRandom = function() {
    switch (Math.randomInt(8)) {
    case 0: case 1:
    if (this.z <= $gamePlayer.z) {
        this.ascend();
        break;
    }
        this.descend();
        break;
     case 2: case 3: case 4: case 5: case 6: case 7:
    if (this.z >= $gamePlayer.z + 5) {
        this.descend();
        break;
    }
        this.ascend();
        break;
    }
};

Game_Character.prototype.ascend = function() {
        var fly = new Game_Interpreter()
        var RNG = Math.floor(Math.random(15) * 10) / 3
        fly.pluginCommand('mv3d', ['@e' + this.eventId(), 'elevation', '+' + RNG, '0.853']);
};

Game_Character.prototype.descend = function() {
        var fly = new Game_Interpreter()
        var RNG = this.z - Math.floor(Math.random(30) * 10) / 3;
        fly.pluginCommand('mv3d', ['@e' + this.eventId(), 'elevation', '' + RNG, '0.853']);
};

All you have to do is copy and paste those 3 and change the names like Game_Character.prototype.flyRandom and Game_Character.prototype.ascend and change them to like say Game_Character.prototype.Batascend and Game_Character.prototype.BatflyRandom then change the names in the code from the previous ones then change this.
fly.pluginCommand('mv3d', ['@e' + this.eventId(), 'elevation', '+' + RNG, '0.853']);
Change those numbers to whatever you want, best to change them through that var RNG = with like this.z - or + a number. The last number is the time it takes to complete so 0.853 seconds changing it to higher will make it longer and more smooth kinda. Changing this if (this.z >= $gamePlayer.z + 5) { will change leash so I made it so if it reaches 5 z higher than player it will instead descend, and if it is equal or lower it will ascend. Can change the frequency of ascent or descent by changing the switch (Math.randomInt(8)) { number and adding case:x to that line until 1 less than number is all filled. This shouldn't lag game in the slightest even with 1000s of different script calls for movement routes for specific flight patterns. If you do that though probably better to use the specific call in script like this.BatflyRandom(); and just delete the yanfly movement core part of the code.

EDIT: bug fix since I just realized sight required don't chase if you turn and forgot to make only birds fly when returning.
 

Attachments

Last edited:

YoraeRasante

Veteran
Veteran
Joined
Jun 6, 2014
Messages
1,453
Reaction score
336
First Language
Portuguese
Primarily Uses
RMMV
@Dread_Nyanak
so yeah, after I finished the mv3d-CCEx compatibility patch, that gave me quite a bit of work, I downloaded the latest version and the problem someone else mentioned still happened...
When you change maps, if you are still pressing a key,you'll keep walking in that direction.
For example, in the original big map, when I went to the forest without changing the camera, I was still pressing left when the transfer happened... so in the map itself I kept straffing to the left no matter my direction.
Same happened when going from a 1st person to a 3rd person map, so I immagine it will happen in any combination if a key is still being held when transfer happens...
 

Zekken

Programmer? Pro-Gamer? Pro-Grammar?
Veteran
Joined
Aug 29, 2019
Messages
105
Reaction score
24
First Language
Indonesian
Primarily Uses
RMMV
@glaphen What is the difference between that two plugins?
 

glaphen

Veteran
Veteran
Joined
Jan 13, 2019
Messages
323
Reaction score
114
First Language
English
Primarily Uses
RMMV
@glaphen What is the difference between that two plugins?
One is using yanfly event chase players to make birds descend and enter combat when near player,ect, also changed sightLock to make enemies stop chasing after x frames instead of always chasing unless out of range for sightLock frames, other is just the movement script. To use chase player you need to set it to trigger(0,0) in notetags and turn on self switch D as touch event, 2nd page should require self switch D and make a battle event happen with parallel or autorun. Top of page shows movement route example used. Also mv3d broke yanfly event chase players so you need to set it to through, pass(*), collide(0), collide(false), below event, any one of those things if you want to use it on every event with chase. Through lets it ignore stair threshold while the rest don't but you can move through it, which if you are making them combat events it doesn't make too much of a difference.
 
Last edited:

Zekken

Programmer? Pro-Gamer? Pro-Grammar?
Veteran
Joined
Aug 29, 2019
Messages
105
Reaction score
24
First Language
Indonesian
Primarily Uses
RMMV
One is using yanfly event chase players to make birds descend and enter combat when near player,ect, also changed sightLock to make enemies stop chasing after x frames instead of always chasing unless out of range for sightLock frames, other is just the movement script. To use chase player you need to set it to trigger(0,0) in notetags and turn on self switch D as touch event, 2nd page should require self switch D and make a battle event happen with parallel or autorun. Top of page shows movement route example used. Also mv3d broke yanfly event chase players so you need to set it to through, pass(*), collide(0), collide(false), below event, any one of those things if you want to use it on every event with chase. Through lets it ignore stair threshold while the rest don't but you can move through it, which if you are making them combat events it doesn't make too much of a difference.
So what is the usage of the bird. It's just a normal bird that fly and give a realistic environment, or the bird is a enemy?
 

glaphen

Veteran
Veteran
Joined
Jan 13, 2019
Messages
323
Reaction score
114
First Language
English
Primarily Uses
RMMV
So what is the usage of the bird. It's just a normal bird that fly and give a realistic environment, or the bird is a enemy?
Movement script for looks, chase as enemy to start battle, only looks really.

I mean what looks better, boring

or superior random movement that isn't even optimized for each type of animal.
 
Last edited:

palatkorn

Veteran
Veteran
Joined
Nov 1, 2019
Messages
121
Reaction score
32
First Language
thai
Primarily Uses
RMMV
I need a way I will lock the camera rotation. From the plugin command Is there a way to do it?
For example, this map used is a scene that is currently being played Which the player can not press to spin anything
 

YoraeRasante

Veteran
Veteran
Joined
Jun 6, 2014
Messages
1,453
Reaction score
336
First Language
Portuguese
Primarily Uses
RMMV
@KaYsEr so, I just had an idea for a separate plugin expansion... one just for touch input while in 1st person view, based on your post earlier.
You see, SRD years ago released a plugin that allows fordetecting swipes on input. That means my idea would take that.
So... by using swipes for up and down to adjust the pitch, and left and right to either rotate or strife, and allowing the developer to set the position and size of the left, right, down, up and center presses (center can be both up and action depending on if action would do something) just in case they want a part of the screen for touchable images.
I'm going to do it now. SRD's Swipe Input plugin will be needed though...

@palatkorn from the github page, probably help file too:
mv3d rotationMode <mode>

Set the keyboard control mode for rotating the camera.

Modes:

  • OFF - Can't rotate camera with keyboard.
  • AUTO - A&D while in 1st person mode. Otherwise Q&E.
  • Q&E - Rotate camera with Q&E keys.
  • A&D - Rotate camera with left & right or A&D. Move with Q&E.
mv3d pitchMode <true/false>

Allow player to control camera pitch with pageup and pagedown.
So.. yeah, use "mv3d rotationMode OFF" and "mv3d pitchMode false" I guess
 

Dread_Nyanak

Veteran
Veteran
Joined
Feb 24, 2019
Messages
156
Reaction score
228
First Language
English
Primarily Uses
RMMV
Actually I don't think those commands work any more. I actually forgot about those. I'll have to re-implement them. I'll work on an update real quick.

Update 0.4.4.4:
New plugin commands:
mv3d allowRotation <true/false>
mv3d allowPitch <true/false>
mv3d lockCamera <true/false>
Old commands rotationMode and pitchMode will act as aliases to allowRotation and allowPitch.


allowRotation and allowPitch are intended to set keyboard control for certain maps or areas. For cutscenes you should use lockCamera. LockCamera doesn't change allowRotation or allowPitch, so when you turn it off they will retain their previous values.
 
Last edited:

glaphen

Veteran
Veteran
Joined
Jan 13, 2019
Messages
323
Reaction score
114
First Language
English
Primarily Uses
RMMV
Flock of Harolds taking a break.


Here's the movement script if anyone wants it, probably last one I'll post, guide above and this 2nd example should mean you can do it yourself easily.
Code:
Game_Character.prototype.RandomTree = function() {
    switch (Math.randomInt(5)) {
    case 0: case 1:
        this.moveRandom();
        break;
    case 2: case 3: case 4:
        this.moveForward();
        break;
    }
    if (this.terrainTag() === 3) {
        this.setStepAnime(true);
        var fly = new Game_Interpreter()
        fly.pluginCommand('mv3d', ['@e' + this.eventId(), 'elevation', '-0.5', '0.853']);
        this._waitCount = 60 - 1;
    }
};

Game_Character.prototype.TreeRandom = function() {
    switch (Math.randomInt(8)) {
    case 0: case 1:
    if (this.z <= 3) {
        this.Treeascend();
        break;
    }
        this.Treedescend();
        break;
     case 2: case 3: case 4: case 5: case 6: case 7:
    if (this.z >= 5) {
        this.Treedescend();
        break;
    }
        this.Treeascend();
        break;
    }
};

Game_Character.prototype.Treeascend = function() {
    var fly = new Game_Interpreter()
    fly.pluginCommand('mv3d', ['@e' + this.eventId(), 'elevation', '+0.3', '0.853']);
};

Game_Character.prototype.Treedescend = function() {
    var fly = new Game_Interpreter()
    fly.pluginCommand('mv3d', ['@e' + this.eventId(), 'elevation', '--0.3', '0.853']);
};

Game_Character.prototype.TreeFix = function() {
    if (this.terrainTag() === 3) {
        this.setStepAnime(false);
        this._pattern = 2;
        this._waitCount = Math.randomInt(300 - 180) + 180;
    }
};

To use it I use this.RandomTree(); followed by this.TreeFix(); as I can't get the stepping part to work in the same movement, did them 4x into a TreeRandom();. I turn it to pattern 2 because most of the birds look more landed at 2, but you could always change the index of the picture instead to a landed bird. For notetags I have it set to z(2), so that it doesn't add to its height whatever is below it but through off so it doesn't fly through walls. But z is still pretty bugged I think ATM. Set them to below and stepping, why below, I forgot why I set it to below.


Oh and for the trees set the top part to terrain tag 3, that's how they know what to land on. I use this for tileset settings.
B,5,11:shape(cross),pass(o)
B,5,12:shape(cross),height(2)
 
Last edited:

seaotter

Veteran
Veteran
Joined
Mar 2, 2019
Messages
115
Reaction score
28
First Language
Chinese
Primarily Uses
RMMV

When can I wait until the update I want is a conflict with the rmv-chrono-engine plugin?

 

YoraeRasante

Veteran
Veteran
Joined
Jun 6, 2014
Messages
1,453
Reaction score
336
First Language
Portuguese
Primarily Uses
RMMV
@seaotter
that engine is in conflict with a bunch of plugins too, for example Yanfly's Event Spawner. This plugin having a conflict is not special. In fact, it is a very minor one, yanfly's event spawner can cause a game breaking error.
as I said to you earlier, this problem is caused by the plugin using the map's original coordinates to see where the animations will be shot from and to make them move on the screen, probably direction too if you moved the camera for the same reason. As you can see, the "missile" animations are the only real problem there, the hit events have their "hit" animation on them perfectly.

To be honest, I think you are expecting too much wanting the plugin to be automatically compatible with everything you want to use out of the box. I did a couple of compatibility patches already and I can say this is not just a simple work.

Not only that, you never mentioned earlier what plugin you were using, only showed a video with this same problem and expected a fix to come soon. It is like wanting a new controller for a videogame but not telling anyone if it is an xbox or ps4.
I remember I specifically asked what plugin you were using that was having this problem and you ignored me.
 

gRaViJa

Veteran
Veteran
Joined
Mar 16, 2012
Messages
807
Reaction score
291
First Language
Dutch
The plugin also introduces WASD-movement. Is there a way to turn this off? (or comment out a piece of code if needed)?
 

YoraeRasante

Veteran
Veteran
Joined
Jun 6, 2014
Messages
1,453
Reaction score
336
First Language
Portuguese
Primarily Uses
RMMV
@gRaViJa not really, since the plugin is made in separate files then put together in a way that also minimizes it...
but if you wait a bit, I'm making right now a 1st person touch control plugin extension and then I'll work on my plans for an input remap one.
 

gRaViJa

Veteran
Veteran
Joined
Mar 16, 2012
Messages
807
Reaction score
291
First Language
Dutch
@gRaViJa not really, since the plugin is made in separate files then put together in a way that also minimizes it...
but if you wait a bit, I'm making right now a 1st person touch control plugin extension and then I'll work on my plans for an input remap one.
That would be absolutely awesome :)
 

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

Latest Threads

Latest Profile Posts


After 5 days, it only need some more details, a few places to furnish and it's done.
I can start the eventing :3
(For the no travel jam)
I feel like I'm living in a ghost town.
Tried playing Panzer Dragoon Remake to fill the empty hole in my heart due to no Star Fox on Switch. Finished it with an even bigger hole. Nothing compares to Star Fox :'(
Is there not a police Character sprite for mv?
... finally, I think I'm making progress with this lookwise. and I even have custom ATB gauges.

Forum statistics

Threads
95,844
Messages
932,370
Members
126,282
Latest member
Ankh9z
Top