Hello Everyone. I am sharing with you all what I am doing so far with my very first JME full game project: Dominoes. You may have seen it in the monthly screenshots. I wanted to create a topic to post my updates as the project goes
I was planning of making another type of game but since I was changing from Unity to JME and I wanted to learn more about the API and the strengths of this engine I decided to start with this one instead.
In reality, because it’s one of the easiest board games to play once you know the rules. and to translate a board game to a videogame is to me one of the best ways to start learning about a game engine API as well using the strengths of the programming language and get experience with JME in the process.
The game is still in development as I start optimizing and refactoring code to something more reusable.
User Inputs to play with the tiles, not just camera.
Different levels of AI instead of just putting the first available tile at hand.
It has been really interesting the use of the interpolations for the tiles as they move from a stack to the hand, arranging the hand and placing the tile on game. Also I am learning where Controls or AppStates are more suited, using a separate thread for AI (basic for now), among other stuff that JME can do to help me make this project.
since I am aiming to go from double 6 to possibly double 18 dominoes sets, I made a simple solution of modeling just one tile in blender that will contain two main materials:
the material for the whole tile
The material for the numbers of each side of the tile
Then for each number I prepared the 19 textures from 0 to 18 withe a normal map (needs work I know) and texture for the tile itself. So that in code I could replace the textures according to the tile I am creating and complete the set. My first test worked but something worried me:
With double 12 I was getting a performance hit, and the problem was easy to find: I was changing the texture of each material for each tile. The solution was simple too: create a map of the common materials and load them once, then for each tile I assign these materials to the tiles making them faster to load and it improved the performance quite a bit
After playing and fighting with Nifty I managed to dynamically have a list of players with scores and end numbers that change values only when an event from the game occurs. Started adding localization as well that later on I will add other languages.
Also player inputs with mouse have been implemented.
Right mouse button and drag moves the camera with your titles at hand.
Single/Double click (by setup) on a tile of your hand to set it to play automatically.
If on automatic play you have two or more different destinations, a GUI will appear asking for the destination number. The buttons are created dynamically so it can be reused for cross dominoes and mexican train. It was a good learning experience with Nifty
Sorry guys. Being an employee takes a lot of time for me to keep on the project in a steady pace but I do have some updates.
The AI has been improved but I decided to release the game with two difficulty levels with more to come in the future:
the “Lucky” difficulty is just as the name implies. The computer looks for the tiles it can play in its turn and chooses one at random. This one is easy to beat but it can be a good challenge for beginners as they get strategies to win or to lose with the least points possible.
The normal difficulty has some strategy that never knows which tiles the other players own but has these basic concepts:
Get rid of doubles as soon as the opportunity arises.
Count the played pips(numbers) of the tiles on the table, the more that are played the more valuable they are to play.
Look for ways to close the ends to its favor and make other player take tiles from the boneyard or pass.
Another difficulty will be added with other strategies, but the code needs to be improved to that it becomes quite the challenge, but it can be quite good against amateur players.
Use the multiples in the ai calculations for Normal.
Ideas for cross platform multiplayer that is low cost
Sound effects were added, recorded with my headset =P and audacity.
Music is free with creative license, so I had to show the proper license when each song plays.
Note that spider monkey would be fine for this though you will run into scalability issues at some point if you ever want to support hundreds of thousands of simultaneous players.
If it were me, this is the route I might use (and I basically wrote Spider Monkey).
Me, I’d probably do some kind of RESTful web service. Done properly then you could even support disjointed games where people didn’t all even have to be online at the same time to play. (Kind of like ‘words with friends’ and stuff.) You get that essentially for free with a bit of design consideration. It’s also really easy to plop such services up on AWS nodes or similar cloud services should you decide to scale this up.
Steam offers leaderboards, achievement management, interacting with others, but not synchronising data between two players. So even if you implement steams features, you will need a server to synch your players.
You can also use Microsoft Bizspark, which gives you quite some VM power for 3 years for free if I remember correctly. After the three years you have to start paying for the VM @ Microsoft or rent a VM elsewhere. Anyhow, you get 3 years or free servers.
AFAIK, AWS is IaaS, App Engine and Heroku are PaaS.
SaaS in another thing.
In heroku you deploy your app and you’re not aware what it’s running on, you need to choose the amount of “web dynos” by moving a slider, if you choose only one it’s free. (Pricing | Heroku)
I don’t know if it has any kind of auto-scaling.