Hi. I am working on a game with JME, and I would like to know what you can recommend to use to create items that the player can buy with real money. That is, how do I manage the player’s purchases? Is it possible that my game works with PayPal for example? How do I detect the payment and then enable the item in the game? Thank you for your time.
I think it would mostly depend on how you plan to distribute your game. Are you using Steam or any other vendors or app stores for distribution? Or do you plan to distribute your game independently?
Steam has this documentation Steam Inventory Item Store (Steamworks Documentation) and makes the process pretty simple for any steam partners to add “In-App Purchases.”
I also used to run a minecraft server that allowed players to make in-game purchases. Players would be redirected to a web page where they choose what they want to purchase, then check out with pay pal. And then once the paypal payment is verified, it would send a message to my minecraft server and the server would run a script to award the player with their items. So I connected a web page for collecting paypal payments with a game server that had to be running 24/7. But that was for a minecraft server, so there were lots of limitations preventing me from creating an in-game shop interface, which would have made things much easier.
Thank you very much for your answer. The origiinal idea is distribute the game independently, but I must to think to use Steam or another app store. Thanks.
It’s very easy to setup a secure payment gateway on your website.
I think its pretty easy to display html in your game.
The fun part will be calculating the appropriate sales taxes by individual and tracking all of that.
The payment processor, whomever it may be, will provide you with an api and documentation. The search keywords you are looking for are merchant account.
These comes to my mind.
1- Assign to your player account a wallet which can be charged by voucher code. You can have voucher codes price 5$ 10$, … and sell them in digital markets like https://www.sendowl.com
2- You can add in app purchase mechanism
for example see
As others has pointed out: The technologic aspect isn’t the problem, but the law/taxes are.
For instance I’ve read that everyone use “coins” (Rockstar Points, Rainbow Six Credits, …) so that you buy those coins and not “Weapon X”.
That way you don’t seem to have to handle RMAs for the Weapon or problems when you remove that Weapon/Skin out of the game for whatever reason, you’ve only sold the POINTS. But look at the EULAs of those games and you see hwo complex such things become.
Is your game Single Player? If so, you’ll have a hard time protecting those items. Is it a PC Game or rather an App (there you’d have the IAP (In App Purchases))?
Buying points/coins has a lot of benefits. If you want a gun that’s 600 coins but you can only buy 500 or 1000, you spend more than you need - great for forcing them to spend more. You can even make them pay more per coin if they buy less. For example 1 dollar for a hundred or 3 dollars for 500… punishment for spending less / reward for buying more, however you look at it. It saves setting up payments per item too. It’s a very simplified structure in that way. You only ever buy coins. It’s a very solid way of solving a lot of headaches programmatically (asynchronous calls and waits for every item. Sometimes it’s a 4 stage process. Ugh.) and increasing profits.
Ahem what? Hold on a second then, why do we even have GUI libraries?
i have my own GUI lub based on XML(pseudo html like nifty have)
but this is connected to engine to synchronize actions with update loop / etc.
also work fast and can put 3d items into gui layer.
imo you can use some HTML java engine, but it will be hard use it for elements ingame like HUD/etc. (will throw exceptions if not synchronized well - also you will be unable use nice features from 3d gui elements)
but im not sure, i think thats the case - work fast, have 3d features and be update loop dependent
About the topic, i think best solution are codes or third party like steam integrations. It solve much.
Yeah I suppose that’s all good and true. Although it doesn’t really make that much sense to use it for things like the HUD which has few changing elements. I usually just use jme Pictures or quads for those.
It’s when you’re making complex menus, scroll lists and such where html really shines and where most existing jme gui libraries kind of struggle. It would be amazing to have a library that literally compiles and shows html+css but that would be more like implementing an entire web browser api I guess, and out of scope of everyone’s dreams.
For what it’s worth, without knowing more detail my guess would be this is a case of “Lemur can you lay these out for me… but oh by the way, I don’t like your values so can you make it half the size?” or something.
It could just be a different development style but I never hit this particular issue.
That being said, I’m on the other end of the scale where I find HTML nice for making pretty charts but abysmal for wiring up GUIs as hooking anything up to a model is generally very painful (or you are left with antiquated form processing that always reminds me of when http was hooked directly to shell scripts.)
I was a Swing developer since 1997 or so… so I automatically think in “GUI layouts”. I admit that Lemur may be tougher to layout if one comes at it top down versus bottom up.
Anyway, sorry to derail the conversation.
I will restate that the real issue you will have is tracking sales tax. This is why things like Steam are so popular because they will already calculate and collect the sales tax for you… or VAT tax in Europe, etc…
The choice of ‘how to collect the payment’ is only about 1% of the total problem. It’s the stupid-easy part.
Idk, i use mine even for HUD. Its just Pictures / Quads really like you say. And Text ofc.
I dont use lemur / nifty or other. I used Nifty, but it was hard to implement some functionalities and MIX my mouse actions with Nifty ones and much more odd issues hard to solve.
Anyway its nice to have HTML like state/screen to load and easy code one-line or class based for more complex control elements. So i made my own solution that use strict JME functionality for controls / update and others.
but still, this is just Pictures / Quads / Text and related 3d models inside GUI.
anyway for payment option, it should connect to other webpages so it require HTML browser library.
One easy way to display HTML from a JME app is simply to open a new window using
That’s how I do it in Maud.
According to my findings that doesn’t work for Linux though, see the SDK Code:
Easy … Use JavaFX / CSS for complex things, and Lemur for non complex things. I even have a Lemur container that can contain a JavaFX complex components and you can do things like this.
Amazing answer. Thanks for your time.