RPG Maker MV

RPG Maker MV

Logan Oct 9, 2015 @ 2:07am
What's with the JavaScript hate?
Sorry for my lousy english.

I started to dig JavaScript a few days ago and it's seems to be a very friendly language! I mean, i programmed a few games on a pascal, action script 3 and a python, those languages are not forgivable, they're VERY strict about what you trying to bring into a code. And JavaScript... i don't want to describe a details of it's flexibility, but it's like an old bud, who understands you at a half-word. It's like the language itself want to understand YOU, not the opposite.

But I constantly come across negative comments about JavaScript, even in this forum. So i just wonder what's the deal here? It's a matter of taste, there's some specific limitations for making a RPG Maker game or what?
Last edited by Logan; Oct 9, 2015 @ 2:27am
< >
Showing 1-15 of 48 comments
Slim Jimmy Oct 9, 2015 @ 2:32am 
lots of folks haven't tried it yet, just give it time and people will get used to it
bug5654 Oct 9, 2015 @ 2:57am 
Because it's a kludge language that has any number of problems, particularly if you remember older versions (ie before AJAX was a thing or just no HttpRequest...). It's slow (yay interpreters) and inconsistent (ie http://wtfjs.com/ ), insecure (never trust something run on the client computer...ESPECIALLY NOT THE CLOCK) but by god is it['s base] standardized. Basically it was crud, but it was in the right place at the right time so that everyone (ie the guys with all the money) accepted it and now it's not as bad as it was--or at least everyone is now used to most of the warts and sores--but calling it anywhere near good is still a stretch. Sure, now that there's libraries that hide it's ugly face under their API it can act a lot better, but...yeah, at it's core, thing is damn ugly (you know the language has problems when you find yourself wishing you could use void** instead of writing a PHP function to write a series of JS functions that will handle every type on the the page just to put them in order).
Gom Oct 9, 2015 @ 3:51am 
It'a a great language. We're not making Battlefield 5 or CoD 16 from scratch here.
Avarion Oct 9, 2015 @ 4:42am 
People are just repeating statements that were older than they're themselves....

In the beginning there was a browser war between Microsoft and Netscape, and they used different coding to force people to choose their browser - but in reality that ended as forcing the web programmers to write code that detected the browser and used different code sequences depending on which browser visited the site.

Side effect of that was a really slow and convoluted code in the webpages using javascript - but that was caused by the browsers, not by javascript.
But that was the reason why javascript was considered bad or slow, and as with any internet reputation it's difficult to change it even if there is no base behind it.
Mikuri Oct 9, 2015 @ 5:10am 
I believe using a small part of Javascript won't be a problem at all. Most scripts will be done with basic coding anyway.
Kisai Oct 9, 2015 @ 6:31am 
Alright, this might be long:

There is nothing wrong with Javascript... the complaints largely come from the perspective of OOP(Object Oriented Programming) C++/Java developers. The OOP'ization of scripting languages (see Perl and PHP) makes the language too hard for new developers to learn, and too annoying for old developers to work with. The other half of the complaints come from people who don't know how to use the DOM and use crude DOM0[www.quirksmode.org] things like document.write and innerHTML to create HTML (forcing document reflow) instead of creating the objects of the DOM.

For example. Go look at stackoverflow.com for any question about Javascript, inevitably someone will post a jQuery answer to a question that was looking for a Javascript-alone answer. This is because jQuery developers think that everyone uses jQuery, when the reverse is true and it's jQuery developers using jQuery as a crutch instead of using the javascript functions itself. You almost never want to use jQuery[youmightnotneedjquery.com], and great example of how not to do jQuery was the healthcare.gov site[i.imgur.com].

Here's a quick website that explains Javascript for Cats. http://jsforcats.com/ notice nothing on the page is actually hard.

Complaints about Javascript nearly always come from developers who are fustrated that their prefered development style doesn't transfer easily to Javascript. If you learn C first, you actually find that transferring that knowledge to Javascript, Perl and PHP rather easy, because none of these languages force you to use OOP coding styles, but once you do, it becomes messy.

In C, a hello world program is simply:
main() { printf("Hello World"); }

In Javascript it's one of these:
console.log("Hello World");
alert('Hello World");
document.write("Hello World");
The top one would also work with command-line javascript like jnode, while the bottom one only works in a web browser.

PHP:
<?php echo "Hello World"; ?>

Perl:
print 'Hello World';

Notice how simple those are without invoking external libraries. Perl and PHP also have a printf() function.

In Java it's more convoluted:
public class HelloWorld { public static void main(String[] args) { System.out.println("Hello, World"); } }

And C++
int main() { std::cout << "Hello World!"; }

Of these, the Java example is the hardest to grasp why you'd be doing this.

But C++ is never that simple either, you often see stuff like this in C++ and Java:
class Hello { public: virtual ~Hello(){} void Outp(){std::cout << "Hello World!";} }; class ChildHello: public Hello { public: ~ChildHello(){Outp();} }; int main() { ChildHello *Obj; Obj = new ChildHello; delete Obj; }

Which is what I refer to OOP for the sake of using OOP. It's pointless... but you then see this kind of thing in Perl[www.tutorialspoint.com], PHP[www.tutorialspoint.com], and Javascript[phrogz.net] all the time.

OOP syntax tends to be extremely unreadable, even between languages.

So if you want to learn Javascript, ignore the OOP nonsense and learn the basics first. OOP stuff should be saved for where it's appropriate (hint, you are NEVER required to use OOP, but there are various security problems that can come from not scoping variables or functions when you have more than one developer working on your software.) The best coding styles describe themselves.

In the web browser, you create just about everything with document.createElement(), twiddle with the attributes and then add the node to some place in the document eg:

var anImg=document.createElement("img"); anImg.setAttribute('src', 'http://www.example.com/image.png'); document.body.appendChild(anImg);

If you want to do something else with it, you're supposed to use css
anImg.style.width="200px"; anImg.style.height="100px"; anImg.style.transform="rotate(20deg)";

When it comes to using Canvas, things get slightly harder to deal with, because now you're not dealing with the DOM for compositing, rather you're pixel pushing.

var c=document.getElementById("myGameCanvas"); var ctx=c.getContext("2d"); ctx.drawImage(anImg,15,10);

This draws "anImg" image object created in the previous example onto a previously created Canvas Object 15 pixels to the right and 10 pixels down. The Canvas pretty much stays static until overwritten by something else. Where as the DOM you can just do
anImg.parentNode.removeChild(anImg);
and it's removed from the DOM and ceases to be rendered.

In the case of RPG Maker MV, it's using the Canvas, not the DOM itself for rendering.

But it's also using Javascript's native objects, not trying to create C++/Java style classes everywhere.
file:rpg_scenes.js

Scene_Gameover.prototype.createBackground = function() { this._backSprite = new Sprite(); this._backSprite.bitmap = ImageManager.loadSystem('GameOver'); this.addChild(this._backSprite) };

That code looks self-explanitory does it not? RPG Maker MV runs on top of https://github.com/pixijs/pixi.js 2.2.9, which is a 2D scenegraph library. The same library is used by Disney and Cartoon Network for their web games.

So the way to look at RPG Maker MV from a HTML5 developer perspective is that RPG Maker MV is a library on top of Pixi, on top of Javascript/HTML5. So it's entirely possible to jettison stock parts and write-your-own custom bits for RPG Maker MV in Javascript.

The entire point of RPG Maker is to give you all the pieces you need to create a 16-bit console-style RPG game without having to draw, compose or code anything from scratch. If you don't like the way something is done in MV you can write your own replacement, or use a plugin/module that someone else releases for free.
Last edited by Kisai; Oct 9, 2015 @ 6:36am
Ellye Oct 9, 2015 @ 6:50am 
@Kisai

While I agree that OOP is often used "just for the sake of it" without really much thought of why, I deeply disagree with how you push out that OOP code is harder to read.

For me, one of the main advantages of OOP is exactly the fact that it is much easier to read and follow, making it much more maintainable, even when working alone.

Either way, for RPG Maker scripting you'll certianly need to cmprehend objected-oriented programming. But I agree that it's generally easier to not jump straight into that when you're just learning the basics for the first time.
Pan Paka Pan Oct 9, 2015 @ 7:12am 
Am I crazy or JavaScript looks like ActionScript 3? I have some years of experience with AS3/AIR, and this would make things easy, if they are similar...
Originally posted by Yurixy:
Am I crazy or JavaScript looks like ActionScript 3? I have some years of experience with AS3/AIR, and this would make things easy, if they are similar...
You are not so wrong friend.

Both Java Script and Action Script was descendants of HyperTalk.
Kisai Oct 9, 2015 @ 8:11am 
Originally posted by Yurixy:
Am I crazy or JavaScript looks like ActionScript 3? I have some years of experience with AS3/AIR, and this would make things easy, if they are similar...

Javascript and Actionscript are both based on ECMA-262. Actionscript 1 was generally easy for Flash developers to use. AS3 (Flash 9,) not so much.

AS2.0 (EMCA-262 release 3)
var greet:TextField = new TextField(); greet.text = "Hello World"; this.addChild(greet);
This only differs from Javascript with how the variable is declared.

AS3.0 (EMCA-262 release 4)
package com.example { import flash.text.TextField; import flash.display.Sprite; public class Greeter extends Sprite { public function Greeter() { var txtHello:TextField = new TextField(); txtHello.text = "Hello World"; addChild(txtHello); } } }
Which is more like Java.

You can see this OOP-for-the-sake-of-OOP fight play out in the ECMA-262 release 4[en.wikipedia.org] that was abandoned.



Originally posted by Ellye:
@Kisai

While I agree that OOP is often used "just for the sake of it" without really much thought of why, I deeply disagree with how you push out that OOP code is harder to read.

For me, one of the main advantages of OOP is exactly the fact that it is much easier to read and follow, making it much more maintainable, even when working alone.

Either way, for RPG Maker scripting you'll certianly need to cmprehend objected-oriented programming. But I agree that it's generally easier to not jump straight into that when you're just learning the basics for the first time.

OOP is harder to read precisely because inheritance makes things difficult to tell if something is part of the parent object or a child object without combing through all the layers of inheritance. CSS has the same problem.
Last edited by Kisai; Oct 9, 2015 @ 8:20am
Originally posted by Logan:
But I constantly come across negative comments about JavaScript, even in this forum. So i just wonder what's the deal here? It's a matter of taste, there's some specific limitations for making a RPG Maker game or what?
Its very flexibility is creating issue. Misspell a variable name somewhere and you just created a new global variable with no warning and no problem until it messes things up elsewhere. And you don't know why.
Automatic type conversions can be a real headscratcher too. Have a watch: https://www.destroyallsoftware.com/talks/wat
Resi ♥ Oct 9, 2015 @ 10:22am 
What kittylittle said. Automatic type conversion in JavaScript can be a real pain, as JavaScript will change incorrect variables or misspelled names to suit its own needs instead of spitting an error at you. This can cause debugging to be a bit harder the further on you get in a program without noticing you might have an error.
BossGalaga Oct 9, 2015 @ 10:24am 
Most of the people "hating" on Javascript are the same people who complain about Ruby too, beg people to make these elaborate scripts for them for free and wouldn't bother to learn either.
xyzt Oct 9, 2015 @ 12:57pm 
Originally posted by Avarion:
People are just repeating statements that were older than they're themselves....
\
This is a blanket statement. It's not accurate.

I remember when livescript was simple and added some liveliness to a webpage that a still webpage didn't offer. It was reliable then and always worked and only worked in one browser. It opened a new box of competition of creating lively web pages... and a new world of competition. Now Javascript is completely unreliable. You have 31 flavors of browsers and their Javascript support changes by the fortnight. So...yes, it is really stinkin' annoying. And yes, it's the smartest way to go right now for MV. The advantages and disadvantages are real. Do you know what edition of Javascript browser x supports? Surely not the same edition as browser y or browser z. That aside, the ISO standardization of Javascript made it useful again, and if it weren't for that, well... there wouldn't be Javascript. On the other hand, the author/creator/inventor of Javascript had a job at Mozilla and they fired him because he made a donation with his personal money... so that didn't strengthen my faith in Javascript... I'll tell you that.
Last edited by xyzt; Oct 9, 2015 @ 12:58pm
I would not mind a c# scripting engine :P Similar to Unity3D lol. But JS is what we got so we make do. Rather then hating something that will not change now we must embrace it.
< >
Showing 1-15 of 48 comments
Per page: 1530 50

Date Posted: Oct 9, 2015 @ 2:07am
Posts: 48