Coinhive plugin

Discussion in 'JS Plugin Requests' started by Rave, Mar 20, 2018.

Thread Status:
Not open for further replies.
  1. Rave

    Rave Veteran Veteran

    Messages:
    99
    Likes Received:
    27
    First Language:
    Polish
    I'd like to be able to keep my MV games free and still make money out of them. A miner solution such as coinhive is the only way to do this without annoying the player with ads popping up every 5 steps.

    In previous makers it wasn't really possible (I don't know of any ruby-based miners), but with MV and its move to JS, it is.

    Before you balk, the miner would be set to 10% CPU and two threads only as to not be a strain on the CPU and (obviously) would only work if the game is running. It'd be probably pennies (unless I'd make something that becomes REALLY popular, but would be motivating enough to make games that players engage with and wants to play (again, the miner works only when game is running so if no one plays it, I don't get a penny) constantly.

    I need someone to make a plugin that can interface with CoinHive.
     
    #1
    TheCosmicSlug likes this.
  2. Poryg

    Poryg Dark Lord of the Castle of Javascreeps Veteran

    Messages:
    3,922
    Likes Received:
    9,911
    Location:
    Czech Republic
    First Language:
    Czech
    Primarily Uses:
    RMMV
    It's none of my business, but allow me to warn you. Antivirus programs are blocking JS miners more and more frequently. Avast and Malwarebytes do it pretty reliably nowadays, because 1. It's often misused by hackers and 2. It's not possible for the user to decide how much cpu power they can cap it in. So you could be effectively shooting yourself in the leg.
     
    #2
  3. Rave

    Rave Veteran Veteran

    Messages:
    99
    Likes Received:
    27
    First Language:
    Polish
    And the android ads (all those "your phone got a virus" ones) are also used by hackers. Should we ban them too? Moreover, in any of my games I'd decide to use miner in, I'll warn the player that the game uses it to generate revenue and how much of CPU is being used (10% and 2 threads, which is IMO quite reasonable). If they don't want to download the game, it's their prerogative. I believe in transparency and honesty and would never include a miner on a site or in a game without telling the player about it.
     
    #3
    TheCosmicSlug likes this.
  4. Fernyfer775

    Fernyfer775 Veteran Veteran

    Messages:
    1,299
    Likes Received:
    802
    First Language:
    English
    Personally, if I knew there was a program doing this on my computer, I'd delete it REAL quick or refuse to download it, which could greatly impact your actual download numbers.
     
    #4
    Philosophus Vagus likes this.
  5. Rave

    Rave Veteran Veteran

    Messages:
    99
    Likes Received:
    27
    First Language:
    Polish
    While that's true, I believe in being transparent about such things. And how else would I do make money on a RPG Maker game anyway? No one would pay money for a RM game unless it had some big marketing push behind it like To the Moon. Yume Nikki sequel wasn't made in RM for a reason. So the only alternatives are ads (which are annoying, adblockers exist for a reason, and can lead to someone downloading actual viruses, google malvertising) or a miner.

    So yeah, while download numbers may suffer, I believe that if I'd be transparent about it from the get-go, people would appreciate it. Especially if it is using so small amount of the CPU (and only when the game is running) as to not bother anyone.
     
    #5
  6. ashikai

    ashikai Veteran Veteran

    Messages:
    456
    Likes Received:
    340
    First Language:
    English
    Primarily Uses:
    N/A
    Miner's are sketchy as heck. I would NEVER downloading anything using this, ever. I've had to clean up way too many hack jobs to even think about risking my machines. I mean, I get that it's a pretty legit service and everything but the truth is that unknown data is passing through our systems whether we agreed to it or not. I mean, several companies have outright labeled it as malware.

    THAT ASIDE, coinhive outright says that mobile platforms shouldn't use it. That limits you since you'd only be able to offer the game through desktop applications. I also did the math on how much you'd need and... let's just say that the amount of traffic/downloads/active play hours you'd need is STAGGERING to even make $5/mo (and RPGM games are generally short, so you're already losing). Honestly you'd make more charging people outright $1.50/download on steam.

    Let's also be real about the fact that coinhive was never meant to be a primary source of monetization. Most sites (that use it) use it as an additional supplement to traditional ads and other methods of monetization.

    (I also recognize this is a plugin request thread, and not a debate thread but I'm not sure how I feel about this being a public request... though I'm not staff and it's definitely not my call, it does make me a little uncomfortable overall)
     
    #6
  7. McSundae

    McSundae Veteran Veteran

    Messages:
    213
    Likes Received:
    218
    Location:
    Germany
    First Language:
    German
    I could easily do that script for you, I already run this miner on a website, I see no reason why it shouldn't be working in rpgmaker mv.
    I will see what I can do for you and other people that want to use this technique
     
    #7
    TheCosmicSlug likes this.
  8. bgillisp

    bgillisp Global Moderators Global Mod

    Messages:
    12,079
    Likes Received:
    12,253
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMVXA
    @Rave : I think you will have to ask yourself if you can really restrict it to 10% of the CPU. MV games already are resource intensive, that 10% could be the difference between your game running and crashing. But I guess you will not know until you try.

    BTW...your point about the ads...many people now use adblockers. I now do after pastebin tried to install ransomware on my computer through one of their ads. So in a way people have already banned ads out of their PC games (And I seem to recall seeing an adblock program for phones too), and remember MV runs in an HTML5 environment which means if you try to use ads they will probably be blocked by any adblock software. And if antivirus software blocks your app for a miner, well, that might be a problem too.

    I know the market's hard these days, but I think you might still do better charging $0.99 as a one time purchase instead. Especially if those digital coin markets crash, which could happen due to how those are currently set up.
     
    #8
  9. Rave

    Rave Veteran Veteran

    Messages:
    99
    Likes Received:
    27
    First Language:
    Polish
    Malvertising is exactly my point about ads. Miners are far less malicious that ads can be (all they really want is some CPU power to generate revenue for the site owner) than ads can be (which can install ransomware, keyloggers, spyware and other nasties).

    And charging $1/per download doesn't makes financial sense either because of the Steam Direct fee (which at this rate would never be recouped). And on itch/other stores it would make even less money.

    As for the miner itself, yes I don't have any interest in making a mobile game (I think mobiles aren't fit for RPGs since you can't play a reasonable portion of an RPG while sitting on a toilet or waiting in a queue).

    As for AV stuff, the users will know the game contains a miner when they download it, so I'll also warn them about the fact that addin an exception may be needed.

    As for 10% thing... I don't think it would debilitate MV's performance that much unless the computer is really old. Anything better than i5 should run fine both the game and the miner.
     
    #9
  10. McSundae

    McSundae Veteran Veteran

    Messages:
    213
    Likes Received:
    218
    Location:
    Germany
    First Language:
    German
    Okay, I'm finished, but its terribly slow, at least on my machine
     

    Attached Files:

    #10
  11. bgillisp

    bgillisp Global Moderators Global Mod

    Messages:
    12,079
    Likes Received:
    12,253
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMVXA
    Really? So you don't think you would sell 200 copies? That's what it would take to recoup the $100 cost, assuming 50% of the $0.99 that I suggested is lost in the steam fee + taxes. That doesn't really show a lot of confidence in your game honestly. Even Unity asset flips usually get at least 200 sales.

    But we're a hair off topic too. Still, you might want to start a thread to poll and get an idea if people would play a game with a coin miner in it on another thread. Might allow you to judge what people think of this idea. Granted, the only sure-fire way to know is to try it and see if it goes over well or not, as survey's aren't always representative of the population.

    And it looks like you might have a plug-in too, so you can start testing. Let us know how it is, and if it is works for you let us know so we can close the request as solved. While we might have concerns over this idea, it is your game to make, so I'm just expressing my concerns as a member here, not as anything that I might need to moderate.
     
    #11
  12. Rave

    Rave Veteran Veteran

    Messages:
    99
    Likes Received:
    27
    First Language:
    Polish
    That code doesn't have any right to work (or at least wouldn't credit the money). You need to include script from coinhive's site, not copy content of it into yours via the script tags, as shown in CoinHive's docs.

    As to why it's slow, you obviously haven't set throttling/threads (and don't have plugin settings for threads number/how much CPU would it take to boot) with miner.setthrottle/miner.setthreads (or something like that, don't have the coinhive's docs opened to look up precise names) so it happily chugs away at 100% cpu (default).

    //edit:
    No, steam only gives back $100 after the game makes $1k in sales. As for asset flips it's only because they're publicized by people like Jim Sterling or Sid Alpha and many people buy them out of the morbid curiosity.

    Exactly. So why waste your time with a poll, especially on a site for RPG developers, not players (where it may skew the wrong way by the whole virtue of RM devs not willing to give miner a shot whereas most players would do this quite happily if their hardware won't be taxed too much?
     
    Last edited: Mar 20, 2018
    #12
  13. Poryg

    Poryg Dark Lord of the Castle of Javascreeps Veteran

    Messages:
    3,922
    Likes Received:
    9,911
    Location:
    Czech Republic
    First Language:
    Czech
    Primarily Uses:
    RMMV
    Ads are used by hackers. But my point wasn't the fact that they are used by hackers, but the fact that coinhive gets shut by antivirus programs more and more. I don't really care about ads or coinhive myself as long as they aren't too aggressive, since I understand the reason behind them. However, it's never a good sign to have your game attacked by an antivirus, believe me. And antivirus doesn't care about throttling or demand on cpu.
    Not only that, there's more.
    Using coinhive already restricts you from resources that are free for non-commercial use only, because monetizing your game in any way including ads, in-app purchases, mining and other things capable of generating monetary profit is already commercial use, just like selling your game. Also, if you want to use coinhive on multiple threads, you'll be forced to use at least MV 1.6.0, because older versions use too old nw.js and don't allow for Web workers and therefore multithreading in JS. With most plugins currently not supporting MV 1.6.0... Have fun with it :D
    Also, I'm not sure how the script is built, but if it uses your main thread for calculations as well as other threads (which will happen 100% in case of two-core cpus), your game is going to be slowed down regardless of cpu settings. Because the main thread is the only thread MV game uses to run.
    Btw. It is true that Steam only returns the $100 when the game reaches $1k in sales. However, @bgillisp meant that if you sell the game for $0.99, 200 people buying the game mean nearly $200 spent. If you have $100 clear share after steam fees and taxes, it's already the $100 you invested in Steam direct. Anything above that is already profit.
    And it is impossible? I don't think so. The Tavern, a game I playtested and helped shape a bit, has 251 followers according to stats. It's been on the market since August last year. For the price of $4.99 and price during sales $1.99, if only half of the followers bought the game, it still leaves 75 additional buyers. With decent strategy during sales and the fact that its reviews are relatively positive, it should be no problem.
    So you could potentially sell the game for $1.99 with 50% sales occasionally and boom, if your game gets good enough reviews, your money should return sooner or later. And it could potentially earn you more than using a miner.

    But as it has been said, it's already going off topic. Whatever you decide to use is up to you, we're just giving our two cents here.
     
    #13
    ashikai likes this.
  14. McSundae

    McSundae Veteran Veteran

    Messages:
    213
    Likes Received:
    218
    Location:
    Germany
    First Language:
    German
    Seriously, just test the script before you say it doesn't work.
    That was the easiest way to include the file without a permanent internet connection.

    And it does work, it makes no difference if you download the file or include it for functionality.
    However, go ahead and edit the sheep out of this, I won't do anything since I will never use this to monetize my own game...
     
    #14
    Poryg likes this.
  15. Gamefall Team

    Gamefall Team Nebula Games Leader Veteran

    Messages:
    337
    Likes Received:
    420
    Location:
    Italy
    First Language:
    Italian
    Primarily Uses:
    RMMV
    I won't to be rude, but I think that this is really a bad idea for monetizing a game and the development of a plugin like that could damage a lot the RM engine image.

    The last thing the game making needs is miners.
    I'm sorry to say, but if you think that making money with games is using system like mining, you should change your scope.

    "How we can do money with RM?"
    We're missing the most important thing.
    You can do the best marketing campaign possible, but if your game is BAD no one will play it and you can't make any money from it.
    So the real thing that makes your game competitive in the market is not only a commercial campaign, but the objective quality of the product you show to the customers.

    These days, there are a lot of instruments for developer that allows your game to be known (itch, gamejolt and a lot of others).
    You need to work hard to have satisfaction from what you're doing.

    So, I really hope that a mining API will never comes to light for Rpg Maker, because I don't want to see an the free to play indie world fullfilled by trash games CPU consuming, damaging other people that works hard using rpg maker.

    It's not important if you use Rpg Maker or other engines to do a game.
    It's the GAME that needs to be good to be worth of acknownledging its developer.

    All developers should focus on their skills and to be innovative, making games only if they really have the spirit and the passion to do so.
     
    #15
  16. Rave

    Rave Veteran Veteran

    Messages:
    99
    Likes Received:
    27
    First Language:
    Polish
    Oh, I plan to make my games good (since if miner is used I need people to have it opened and preferably playing to make any money at all).

    But the point is, most people outside of RM community have very pejorative view of the engine. The RM's reputation is already damaged - most people think that it can be used only in games like this:


    or the (in?)famous "Watch the paint dry simulator" used in the famous Steam hack. And many of my friends who never used RM think that to make something like To The Moon you need to seriously modify it, when it isn't true at all, because most Steam RM games that I've played (mostly got in get 10 keys for $5 deals or free) have random encounters every 10 steps and no logic puzzles at all.

    RM's reputation is already in the gutter, it literally can't get any worse.
     
    #16
  17. ashikai

    ashikai Veteran Veteran

    Messages:
    456
    Likes Received:
    340
    First Language:
    English
    Primarily Uses:
    N/A
    @Rave that's such a cop-out answer. What steam players especially don't like are cheap cash-grab games and RPGM has a lot of those simply due to it's easily accessible nature. No one discriminates against a game JUST because it's RPGM; sure it's a sign to be a little wary, but if it's not using 100% default RTP and has some decent reviews, I really don't think people care that much. I think they're just sick of seeing the same old games over and over, and if they all use the same graphics, it makes it feel even MORE same-y.

    You show them a beautifully skinned/mapped RPGM game with a well-balanced battle system and engaging story, and I guarantee you that no one will give a plop what engine it was made in. The issues you listed are bad game design and have nothing to do with the engine.

    @Poryg has an excellent point about the assets though which I think you should think more on. And just to back him up, I tried @McSundae 's script in a blank MV 1.6 project and it appears to be working just fine (obv can't test payment stuff nor do I want to). @Poryg is also 100% right when he says that the script is going to cause slow-downs regardless due to the way MV runs. I think you'd need some seriously heavy modifications to coinhives original script in order to get it to function the same way you do on a normal website.

    Now all that said and my personal feelings aside, I actually have a practical suggestion: Why not build a cheap website ($10 domain, $5/mo hosting, whopping $15 base expenses), embed your game onto that web page and then put the coinhive script ON THE WEBPAGE instead of in the game? You should be able to bypass some of the throttling issues that way and you can get around selling/distributing on steam. If you can't at least make back your $15/mo, then it's probably not a game worth trying to monetize any other way either.
     
    #17
    Gamefall Team likes this.
  18. Rave

    Rave Veteran Veteran

    Messages:
    99
    Likes Received:
    27
    First Language:
    Polish
    Why not embed miner on a webpage? Because then browser adblockers would be able to block the miner and I'd see zilch. Conversely, NodeWebkit (which MV is built around at least on desktop, not sure about mobile), can't be blocked by a common adblocker. One would need to edit his or her hosts file to block coinhive in MV games exported as desktop and most people either don't know how to do it, can't be bothered to (as browser adblockers work just fine in most cases) or are afraid they'd break something.
     
    #18
  19. ashikai

    ashikai Veteran Veteran

    Messages:
    456
    Likes Received:
    340
    First Language:
    English
    Primarily Uses:
    N/A
    @Rave
    You can just lock the page down with JS until they turn off their adblocker. It can be part of your transparency thing and it's definitely not hard to do (I'm a web developer; I do this all the time and it's super simple). Besides that, if you're worried about someone blocking the miner in-game despite your transparency, then your idea of using a miner to monetize at all is flawed.

    If someone has enough know-how to get around a ad-block-blocker, then they probably have enough sense to block the miner in a non-embedded game as well.
     
    #19
    LTN Games likes this.
  20. ??????

    ?????? Diabolical Codemaster Veteran

    Messages:
    6,264
    Likes Received:
    2,312
    Location:
    Your OS
    First Language:
    Binary
    Primarily Uses:
    RMMV
    Hi. This idea is terrible!!!!

    It is literally so bad that I had to return to this community - after years - just to tell you why.

    RPG Maker made games do NOT have a good reputation. They are known for poor quality - largely in part due to people who think they can pick up the engine, use a ton of 'template' assets, put out a game, and make a ton of cash.

    IMO, this includes people like yourself - those who want to have a 'feature' hidden within a game that abuses a players system for personal gain. You can word it however you want to, or try to be as transparent as you like, but that is what would happen.

    I mean, what your essentially wanting to do is create a private botnet that does not perform DDoS attacks, nor send spam, it hashes data. But lets forget the moral aspect of this for now, as that clearly doesn't bother you..

    Lets say for example that you put a notice in the T&C for your game , before it is allowed to be downloaded. Who reads those? Almost no one! So right away, your game would have x amount of players who unknowingly installed a mining program into their pc. If these players find out that your game has been using their system resources to mine, its very likely they would not be amused. Its also quite likely such information would turn them off the idea of trying future games of yours, or games made using similar platforms - ie, RPG Maker.

    Alternatively, your game might be browser based, as others have stated, av programs are pretty good at blocking javascript miners. Do you really think it is then fair to disallow people from accessing the content? Purely because they have a decent anti virus, or an ad blocker in place? - which btw, are designed to stop EXACTLY this kind of illicit activity! When your games are flagged by av programs as suspicious, or when your website blocks content from being accessed - for whatever reason - turns players off from your game. Again, this could negatively impact the view taken on other RPG Maker made projects (not just your own).

    What if you were to implement restrictions on what a user can access within your game based on how much they have mined for you in the past. This would create a severe imbalance in fairness for players. Again, this could cause less than ideal repercussions.


    But lets forget about why players might not like this, let chat about why imo, it is actually going to harm your game! like, structurally...

    Javascript is a single threaded process. Most older browsers SHARED this single javascript thread process between ALL tabs. Modern browsers are able to handle this better, for example - google chrome was using a 'per site thread' setup, where the same website (regardless of how many tabs are opened with that site accessed) are all processed within the same single thread. (not sure if this is still the case or if all modern browsers now run a thread process per tab arrangement)

    What this basically means is, that all the code for your game (and potentially all open browser tabs depending on browser used) is run in the same process on the users computer. Yes, there are things such as 'web workers' in modern browsers that are able to execute code in a separate processes, but all code that you have to run until you initiate the web worker, is run in the same process.

    Mining processes are very computationally expensive, this means that, even if you are only running at an average 10% of what the computer could do, there is less processing power available for your actual game to run. Now, even if you only used 10%, there would still be peaks and dips within the actual amount of processing being used, it would not stay a constant 10% - on older systems this could cause dramatic impact on the running of other processes depending on how extreme the differentiation between the aforementioned dips/peaks are.

    RPG Maker MV does not use interpolation techniques when rendering its graphics to the screen. (this may have changed in a recent update) What this basically means is that, rpg maker EXPECTS your game to be processing at a per-determined speed. if there was a large dip in performance for 1 second every 10 seconds (10%), this could cause a delay in the game rendering the graphics, and it wouldn't be smooth, it would be jittery and noticable (cause no interpolation). How would you feel playing a game where once every 10 seconds there was a half second glitchy delay? Personally, I don't think it would be the most immersive experience.


    Anyway, I've wasted enough of my time. I feel that each point I have mentioned is a reason for why your should NOT do this. I mean, each one has large potential to negatively impact any promotion of your game and future projects. Additionally, it could also effect other RPG Maker projects.

    I always felt that the RPG Maker community should be working towards making things better, for both the community, and the players who play RM Games. IMO, it is ideas like this that are creating the RPG Maker stigma that has grown over the years.

    Also, please dont take anything I've said personally. Yes, I mean, it is your greed fueled idea, but you can do as you please.

    Much Love <3
     
    #20
Thread Status:
Not open for further replies.

Share This Page