Subscribe to GameFromScratch on YouTube Support GameFromScratch on Patreon
6. November 2011



The Gamefromscratch PlayN installer is fairly straight forward in execution but has a few tricky points.  Also, I can’t be sure it will work 100% and you can refer to this process to see if your installation worked properly.



On occasion an environmental or Maven problem can occur during installation, or you weren’t fast enough installing the Android SDK.  If that happens, simply close the dos prompt then run the installer again.



First things first, download the GFSPlayNInstaller.  Extract this file anywhere on your computer, it will contain two files, a .CMD and at .PS1 file.  The PS1 file does all the work, but needs to be launched using the .CMD to have the proper permissions.  Do not run from within the zip, this will not work.  Throughout the install you might get a Windows firewall prompt regarding Java, this is part of the Google PlayN install process and should be granted permission.



Double click Install.cmd



A command prompt will open and you will receive a prompt to determine if your system is 32 or 64 bit; hopefully the detection is correct and you can simply click YES.






Now you will be prompted if you have a Java JDK installed ( the JRE is not enough! ).






If you do not have a JDK installed or you do not know, click No.  This will cause the JDK to be downloaded and installed automatically.  If you already have a JDK installed click Yes, and the following dialog will appear:






Simply navigate to the JDK directory and click OK.  Do NOT click cancel, I am not completely sure what will happen, but I doubt it’s good. Winking smile  If you clicked No earlier, you will not get this dialog.  If you clicked YES and the dialog didn’t appear, alt-tab around to see if it is there somewhere, it doesn’t always get focus.



Now you will be presented with this dialog:






This dialog is determining where PlayN is going to be installed.  If you simply click OK, it will be created in C:\.  Where ever you select a new folder PlayN will be created, so you do not need to create a folder just for it.  Again, don’t click Cancel…  Now the installer is going to go off and do its magic for a while….






Behind the scenes it is doing a number of things, downloading a zip program, grabbing Git and the Android SDK.  Even if you don’t want to develop for Android, you need the SDK installed for PlayN to work properly.  That is the next step and it is very important you do this part correctly as it was the only bit I could not automate!  You need to configure the Android SDK and you need to do it fairly quickly as the install will continue while the Android SDK install happens and eventually the install is going to depend on the SDK being installed.  Worst case scenario, run the installer again and simply close the Android SDK window when it opens.




As I said, this part is important, so I made a rather cryptic message box to inform you of just that!







Once you click OK, the race is on!  The Android SDK installer will be loaded and it should look like this:






It will take a minute or two to configure all of the various options… don’t be distracted by the installer going on in the background, keep your attention focused here!  First things first, once it’s done fetching info, click the “Deselect All” button to clear all selections.  Then you want to select Android 3 ( API11 )->SDK Platform, like this:







If everything was done correctly, the button will show “Install 1 package…”.  If you want more features, you can run the Android SDK Manager later… when you aren’t under type restraints! Winking smile


After you click the Install 1 package… button, you will see:





Simply click Install.



Alright, stressful bits are over, now just a matter of sitting back and letting the installer do it’s thing..







That was a screenshot of the installer doing it’s thing.  Frankly it isnt very exciting and yes, it’s a rather long process.  While that process is happening, the Android SDK Manager is chugging along and will eventually say:





Say whatever you want, it doesn’t really matter so you might as well go with Yes.  Eventually assuming success with the Maven process ( actually it runs even if there is a failure… if you see a whole bunch of failures, try running the installer again ), you will get the following prompt:







This is just another simple GFS provide script that builds your new game Maven script for you.  If you want to create a game of your own, click Yes.  If you click Yes…





The new game wizard will appear!  Simply fill in the values you want to make your game, like I have above and click Make Game!  Once you click “Make Game” a MakeGame.bat file will be created then run.  This process creates an actual game within your PlayN folder.  Unfortunately I couldn’t completely automated it and it will prompt you to continue.  When prompted ( in the dos prompt ) type Y then [Enter].  Voila, your new game is created!  If you chose C:\ for your PlayN folder, your game will be located at [C:\PlayN\PlayN\YourGame]



Finally, you will get one last prompt:





I hear there are all kinds of interesting things at that website, you should click Yes and check it out! Winking smile  If you click Yes, it will open your webbrowser ( or a new tab if already open ) and send you to




Voila, all done!  Enjoy PlayN!



If you want to create a new game at a later date, the New Game Wizard can be run again, it is located at Playn\Playn\NewGame.cmd.



If you encounter any problems, please let me know and I will do what I can.  Either use comments here, send me an email ( not preferred, because other people having the sample problem will not benefit from the results ) or I will piggyback the PlayN teams support process and request you post to StackOverflow with the PlayN tag and I will keep an eye on posts there.


2. November 2011




If you have left a comment recently and it appears to be gone, or if you get notification of a comment that when you check it doesn’t appear to exist, don’t worry you are not alone!   Something screwy is going on and sadly it is outside of my control as comments are handled offsite by disqus.  For some reason it isn’t consistently showing new comments, although old comments appear to be working fine.  Hopefully it will be resolved soon.


In the meanwhile, rest assured I can see all of the comments are in fact intact on, so hopefully this is just a brief interruption.  If you want to contact me and comments remain down, you can email mike [@] gamefromscratch [dot] com.   Can you tell I’m sick of spambots? Winking smile


Hopefully this is a very short blip.


EDIT:  They appear to be back…. for now.


EDIT2: 11/6/2011, it's happening again.  Pay no attention to the comment totals at the top of a post, click into the post to see if there are comments.  IF you made a comment and it disappeared, do not worry, it's still there... somewhere.  I think I have erased two comments total since starting GFS, one was a racist diatribe and the other was a spam bot, so don't worry, I didn't erase it.

Totally Off Topic

27. October 2011



So after running through my earlier Getting Started with PlayN tutorial, I never actually tried running the HTML5 target and today I tried it.



First task, as a non Java developer was figuring out just how the hell to actually run it.  All of the Google examples seem to use ANT so I went that route.  Unfortunately I didn’t have Ant installed on my machine, which isn’t quite as simple as double clicking an installer EXE.



First head on over to Ant’s webpage and download the zip.



Extract the zip file to some folder, I put it in my C route so the path was C:\apache-ant-1.8.2\



Now you need to add a few environment variables. ( Right click Computer->Properties->Advanced System Settings->Environment Variables )



First you need to add the ant bin directory ( c:\apache-ant-1.8.2\bin  in my case ) to your already existing PATH variable.  Just add a semicolon to the end append your ant path.


Next you need to make sure JAVA_HOME is defined and points to your java SDK root folder.


Finally you need to add ANT_HOME, which points to your ant directory ( C:\apache-ant-1.8.2 ) with no trailing slash.



Now open a new command prompt ( not an existing one, as the settings wont take ) and type ant.  If you are configured correctly you will get an error like:





If you get that error, you are off to the races!  Anything else and you probably have a problem somewhere in your install.


Now in the command prompt go to the directory you created your game to.  In my case its c:\users\Mike\workspace\MyGame\.  Once there type ant run-html, and if you are anything like me, you are about to get an error message :

Unable to resolve artifact: Missing:



So why did this error occur?  Because Eclipse mucked up the Maven install earlier.  Fortunately now that you have ant installed, the fix is quite easy.  In a command prompt, change to the folder you installed Playn to, in my case it was C:\Playn\.  Once there type ant install.  After doing its thing, your maven repository should now be properly configured.  Now go back to your game install folder and type ant run-html again.  Now with everything properly configured, ant will start up a local web server and host your game.  When done, it should look something like this:






At this point, open up your web browser and go to http://localhost:8080/YourGameName



And voila, your game running in a browser:






Easy eh? Winking smile



Now, dropping to the command line every time you want to run your application is annoying, very annoying.  So how exactly do we run our HTML ( and other ) builds within Eclipse?


Open up Eclipse, select the Window menu –> Show View –> Ant


The Ant window will now be visible like this:




Click the +Ant icon ( far left ).  A window will pop up like this:



Select your game ( not the sub projects ) in my case “MyGame”, expand it and select Build.XML and then click OK.


Now your game will show up in the Ant view.  Expand it and you will be able to see your various Ant targets:




Right click run-html, select Run As->Ant Build.  Now just like before, open a web browser and navigate to http://localhost:8080/YourGameName/


Voila, your game run from inside Eclipse.


27. October 2011


Yeah, I really took my sweet time on this one, but things are better the longer you wait, no? Smile



In this chapter we get the ball rolling, literally.  Additionally we add collision detection and realistic rebounds.  On the C++ front, we introduce and discuss the various types of casts in C++.


For those of you that haven’t read it yet, the Pang C++ Tutorial table of contents is right here.


For those that have been following along, Pang Part 7 is here.  As always, full project source is included at the end.



And here Pang, the worlds most over-engineered pong clone in action!




19. October 2011



It took a while, but Blender 2.6 is finally here.  I have to admit I am a bit disappointed as I recall from a earlier roadmap that 2.6 was going to be the branch where the BMesh project ( ngons ) were going to be added to Blender, but sadly that didn’t happen.  Apparently the Blender 2.6.x series of releases are going to be all about merging in the various trunks.


Anyways, as to todays release, it adds a number of new features like 3D audio/video support, vertex weight groups, improved Collada support and a number of animation improvements.  Perhaps most important to non-English users, they added support for internationalization.


For game developers, the new vertex weight tools will probably be of the most interest.





I haven’t tested yet to see if it works with Unity, will do so shortly.


So go get it now!

GFS On YouTube

See More Tutorials on!

Month List