Category Archives: Cluster-1

Building Out Cluster Web Parts

Schema fun

I’ve been through the basic pieces (many, small and fiddly) of the SQL schema for this game a couple of times now. Each time I get a certain distance down the road and run out of steam putting together the various details needed.

First web bits

I’m going to start in on the process of laying down the game logic and support structure at this point. Initially I’m not planning to lay in any significant security. I’ll likely skip password storage and focus on the first two big steps in getting a game setup.

  • Login and signup screen
    This gets me user creation and walks me through session management for players in the game.
  • Game creation screen
    I expect a logged in user to create a game and then perhaps invite other players (up to three more) into the game. Initially, I’ll probably make the invitation process very simple…you invite the others to the game at game creation time and when you login you see your active games and open invitations (where you can accept or decline).
  • Game administration screen
    Ideally useful to help with debugging of things. Getting a look at digested versions of the game tables in a helpful format should make it easier to see what is going on and when things are messing up.

Steps to follow

Once these pieces are in place (and perhaps backed by some RESTful API bits) I’ll want to set up the VR viewer to access the stored star information for a selected game.

I expect that user permission information will be pre-stored on a given computer/account separately and the VR lobby will simply provide a list of games to the user to select from.

Once a game has been selected, the full game VR will be displayed and the player may begin setting up a new turn (if the previous turn has completed).

A Weekend of Database and CertificateS

Spent some time over the weekend doing some more work on the MySQL database layout for the cluster game and working on getting self-signed certificates prepared for my various development machines.

PHP and MySQL

The database work went smoothly. Still largely on the whiteboard at the moment. I’ve also been going through a PHP re-familiarization as I’ll need to code this stuff in PHP for my hosting and I haven’t worked in that environment in some time. I did grab an evaluation license for PHPStorm a few weeks back, but I fear that was premature as I haven’t reached the point where I need such tools on this sandbox project yet.

Certificates

I finally took the time to create SSH certificates to permit direct logins to my linux machines from my windows systems. That part I’ve done many times before and it went flawlessly.

I created and installed self-signed certificates for various local systems and set up TLS on their Apache servers. The creation and installation went smoothly, but the end-result was not what I was hoping for.

After installing the certificates in several different ways on the systems/browsers involved, I still did not see the secure icon in the address bar. I’m not sure whether this is caused by the certificates being self-signed (shouldn’t be as I installed the keys directly from files into the trust stores) of something else I’m not doing properly. I’ll need to keep looking at that one.

I do want to verify that the connections are using TLS. If they’re encrypted but not ‘safe’ because they’re not signed by a major cert vendor then I’m probably ok with that. If the TLS handshake failed because they don’t have the right certs then there’s a bigger problem.

Sunday evening I started down the road to building a local CA to sign all of my certificates with. I’m wondering if setting this up and loading its public key as a trusted root may give better results. The process is a bit more involved but may be worth it if it gets closer to the results I’d get with a commercial certificate.

I still haven’t found a way to load a FreeTLS certificate on my GoDaddy hosting. One of these days I’ll spend the time to get on the phone with their support folks and see if this can be worked out.

I may try setting up a FreeTLS cert on my dynamic DNS connection that targets a port on my home firewall. That would provide more flexibility, but be less robust and scalable.

Samba SMB Shares

Toward the end of the evening I ran through samba installs on several systems. I had been pushing files around between my windows and Linux machines all weekend and wanted to make things closer to seamless.

I had no real luck on that front. I could get things to the point where windows recognized share names from the Linux machines. I could never get things to the point where my windows systems could connect to a share and see files inside. Not sure what I’m missing and the samba logs were not at all helpful.

I’ll probably re-visit this again sometime soon, but for now the convenience of having it working isn’t worth the effort involved in finding out why it isn’t.

Getting Back to PHP Work for Cluster

Since vacation I’ve been pretty busy working on photo post processing and around the yard.

At this point I’m going to be trying to get back to building a back-end for the unity based cluster game that runs in PHP on my web hosting (initial work on local sandbox PHP instances of course).

I think I’m going to try using Visual Studio Code with PHP Extensions to get this started. I’ve done a little PHP coding in the past, but this looks likely to be far more involved than any of that.

I’d like to get a TLS cert on my site before going live with this, but it appears that my hosting may not support free TLS or similar cert installs and I’m not happy adding the annual renewal cost for a cert to my site at this point so stay tuned. I’ll probably try hitting GoDaddy support some evening soon to see what they can tell me.

First steps will be getting a simple RESTful interface defined and then laying out some simple SQL schema to provide the back-end. If I can get that working, I’ll look at extensions necessary to provide the full back-end to the game as a whole. Not looking for commercial quality here, just something sufficient to allow multi-player turn based gaming.

CLuster Game Web Back Ends

Just reinstalled clean and up to date copies of XAMPP, MariaDB and MongoDB on one of my home machines. 

I need to write some RESTful PHP code that can run on my web hosting as the back-end for a VR game I’m playing with. This gives me a platform for building that code in a safe place.

I do need to stick to PHP 5.x features as my GoDaddy shared hosting does not support PHP 7.

I’ve got to get the basics stitched together, add an appropriate .htaccess to keep passwords out of inappropriate hands and then start working out a SQL schema that works for the persistent game data I need to store.

Spending a big chunk of this long weekend post processing pictures from our recent vacation (see them on the blog side of ninecrows if you’re interested). Watched the whole last season of Game of Thrones and saw Aladdin. Lots to still get done, but progress is progress 🙂

Unity Investigations…

I’ve been splitting my experiments with Unity between this blog and pandamallet.com (where I put ‘creative’ things.

More graphical content and thoughts on game design possibilities have lived on the creative side while more technical, C# coding and Unity script coding bits have lived here.

I’m going to move to keeping everything in one place for convenience and accessibility. From here on, I’m going to put all of the game programming related content on the creative side and keep my career blog for more directly coding related items and similar things.

As pandamallet.com does not share with linked-in at this time, this will mean that anyone who was watching these goings-on through linked-in notifications will need to pop over to pandamallet to see what’s up going forward. I will look at making sure that all of my sites (pandamallet, my main blog and my career blog) are publishing to my twitter feed when something new is added to make this (perhaps) a bit easier.

Unity and Multiple Platforms

I tried to get a single Unity project to build for multiple platforms over the weekend. The code I’m writing is probably best suited to a flat screen with mouse and keyboard quite honestly. That said, I’m interested in working with VR systems and thus intend it to run on the platforms that I have available. This gives me:

  • Flat screen with keyboard and mouse.
  • Google Daydream VR with Daydream controller.
  • HTC Vive with two Vive controllers
  • Possible Google cardboard with no controller (perhaps a game controller as a stretch?).

Multiple Platforms from One Project

Sam had run across a couple of projects that claimed to work across platforms last week and sent me a link. Over the weekend I pulled the projects down and ran them on the Daydream without problems. They were a bit awkward to use as neither of them used the daydream controller effectively (one seemed to be built as a cardboard app, using the sight axis for selection).

I took the project that had been targeted on the Daydream and re-targeted it to the PC with a Vive headset attached. I got errors (don’t have the exact form) that suggested that I needed to load the Steam VR SDK in order to make things work. In the end I loaded the SDK from the asset store. This did allow the Vive headset to connect but did not display the information panels that the project was designed to show. At that point I shelved the project…I’ll probably return at some point to look deeper into the implementation, but for now I’ve had enough.

Switching Platforms in a Project (the hard way)

Later in the weekend I tried simply creating a project with a few simple assets and adding in the two SDKs. I was able to get the Daydream up and running (tried that first) by making the usual additions to the scene for that SDK and setting up the platform. To get the Vive running I had to delete all of the Daydream items from the scene and add in the usual Vive content. That too worked as expected.

The surprise came when I switched back to Daydream again. I continued to get errors indicating that the Vive input mapper json file was missing. It appears that something Vive related was still attached to the project and looking for Vive specific assets. This is another area where I may dig deeper at some point. For the moment I’m moving on.

Modular and Layered

I did dig through a good bit of content over the weekend (both video and online blogs/documentation) that suggested Unity supports external code assemblies linked in. This leads me down the road to a more modular approach.

  • Provide multiple .NET core assemblies that aren’t Unity specific code to implement the ‘business logic’ of the game. This keeps the complex code (game rules, world generation and storage) and other such items in a place where they can be unit tested and managed as pure code assemblies.
  • Manage all Unity assets that aren’t target specific in free-standing packages that get bolted into a target specific frame at the last moment.
  • Build the SDK specific parts of the game as thin wrappers over these other assets. These will be asset packages and projects that contain only target specific items and user facing elements.

I’m going to head down this road next and try structuring a new version of my Cluster game to support this approach. I started coding up the game generation part on Sunday and will likely try bolting a version of that into a VR frame as soon as it is complete enough to be usable.

Unity Event SYstem Looks Like the Next Stop

A quick perusal of the documentation suggests that I’m going to need a better grasp of the unity event system to get my handling of VR controller raycasting working as I’d like.

My stars (and anything else that wants to be responsive) will need to handle input events and thus detect when a ray touches the construct (and stops touching it). This should allow me to do the sort of ‘hover text’ I want. I’ll likely try to work this up tonight and get my inflating stars code working with the DayDream (and perhaps the Vive as well).

I’m still wishing for a decent solution to modularity that would let me keep the common assets between the three platforms I’m interested in separate enough to make sharing them easy.

I’m currently maintaining three divergent versions of the code and assets with each configured for a different system. As the game rules implementation develops, this is going to become hard to support.

Unity flat screen mouse pointing is working

I just pushed an update to github that detects mouse over of stars in the game screen and temporarily bumps the size of the star up by a factor of eight (to show you pointed at it). I’ve also got some other minor bits working such as finding a script on an object given the GameObject .

I need to add code to read in the star names file. I also want to make the DayDream pointer do this same thing to stars you point at. In the longer run, I expect to add a UI panel that displays additional information about the star when you point at it and may very well magnify the size of the star and any associated information at the same time.

Now on to seeing what I can see with DayDream…

Got the Static Assets in Place…

Now I’m stitching in some game logic and properties related to game play. Still need to get the systems loaded from the static stuff I’ve added and start building some game play but it feels like things are moving at a decent clip.

I’m also going to be looking at keeping some of the game logic in external, non-game assemblies. Being able to pull in external code that can be unit tested and perhaps even deployed in other areas is useful.

Hoping to get the basics wired in and then get back to interface work. I need to get the VR controls started. A user should be able to switch perspectives between several fixed camera spots with the controller. They need to be able to get a basic view of the state of the board from a distance and be able to view full details of a given star by pointing their controller at it.

  • View basic star information available to a given player from a distance.
  • Assemble a fleet (if fleet markers are available) from ships present at a star.
  • Task an existing fleet with going to another system.
  • Allocate this turn’s production to construction or research.
  • Side effect of the above, move population from a planet surface to colony transports.
  • Check transit time from one star system to another.
  • See beacon area of effect for your existing beacons.

Looking to store static data strings in a unity asset

I’m now looking to store static text (potential names to be selected randomly, object configurations, etc.) in an accessible unity resource/asset. I want the game to access and load this information and the information to be packaged as part of the game after a build (i.e. in the DayDream *.apk file that gets deployed to the device).

Got it…text asset in a resources folder. My list of star names is now in place. Now I need to shuffle them and associate them with stars and (hopefully) display the names near each star. Ideally I want the name tags to always be positioned so that the normal of the tag passes through the camera and the vertical axis of the label tag passes through the associated star with a fixed distance maintained between the bottom edge of the name plate and the center of the star. Ideally the top of the name plate would be ‘up’ to the viewer as well. I’ll have to look into enforcing these constraints once I’ve gotten any sort of name tags working 🙂