Category: design

The joys of setting up a server

The joys of setting up a server

Virtualmin install script runningThis is for my MMO game. I need a backend server, so yesterday I signed up for a vps service. I picked Ubuntu 20.04 LTS which I’ve used before and received the login details. I use Putty to log in via SSH and WinSCP for browsing, copying files.  Installing Apache2 is actually very easy. Likewise PHP. I didn’t install MySQL which might have been a mistake, so I had a LAP system (Linux, Apache, PHP) rather than LAMP.

What I did do sensibly was pay for a backup snapshot service.  When I logged in first I did an sudo apt update then upgrade. Then I took a snapshot.

And I needed it. My exact configuration was Apache 2.4 with PHP 7.4. Apache worked when I tested it but PHP didn’t. Well from the command line the PHP command worked and I could see the version but it didn’t work with Apache.  I created a PHP script with phpinfo in it but instead when I browsed to it, it downloaded the script rather than ran it.

This is usually the case that httpd.conf needs some AddType statements only there isn’t an httpd.conf anymore in Apache 2.4. I did locate a mime.conf but adding AddType into that and restarting Apache made no difference. I eventually wasted about three hours on it yesterday. However in my searches I came across mention of Virtualmin and so today I restored to the snapshot and ran the Virtualmin open source script. Luckily Ubuntu 20.04 LTS was one of the supported distros and Virtualmin installed without a hitch. It’s very impressive. The screenshot is of virtualmin installing. Thankfully all the bars on the right were green…

Back about 12 years ago when I first started experimenting with Linux and websites, i came across Webmin and used it extensively. Virtualmin installed both WebMin and Usermin. It has changed substantially in the time since I last used it. It surprised me a little because for years Ubuntu and Webmin didn’t seem to get on and Ubuntu recommended not to install it.

Anyway I now have a server that runs PHP. The backend will be running .NET Core once installed, but it’s just as easy to use Apache and PHP for receiving order files (from mobile). PHP is just to simplify getting those files onto and off the server.

Godot and IO games

Godot and IO games

Agar.io homepageI occasionally answer (often in a somewhat ascerbic tone) questions on Quora.com, not just programming though that;’s the bulk of my answers.  Feel free to follow me there! One question today was asking whether it was better to deveIop IO games on Web or mobile first.

I’d never really looked at this category- what is an IO Game? Very loosely, its the replacement for Flash games, and unlike those, it can run on mobile or cross-platform. A typical development system for such games is Godot, an open source cross-platform development system. The main language is GDScript based loosely on Python but any programming languages that has GDNative bindings (so C++, C#, Rust, Nim, D and any others I don’t know about. ).

You get games like the multiplayer game agar.io which has an entry on Wikipedia and is cited as an example of an IO game.

 

Monetising a game

Monetising a game

bright city lightsThe celebrity game I’m building and I’ve been describing is free to play but servers cost money, so how does it make money?

First you have to understand there are two types of game currency. (Glitz dollars and Glitz Stars). Dollars are used in-game. It’s what your character needs to earn to survive, make rent etc.

Stars are worth about 10p or equivalent and can be bought and are spent on things like Chance Bags and character auctions. (See below)

So here are a few ways I’ve thought of.

  1. The mobile apps are free but will carry Ad-mob type adverts.
  2. Chance Bags. You can buy a set of cards that can be played to have Lady Luck affect you or mainly other players such as friends. These will be cost something like 10 Stars an provide 3-5 cards. The idea is to prevent players playing to win.
  3. Character Auctions. If a player has got a high-celebrity character then they can get something back by auctioning it in the in-game auction and they get 90% of the auction price. Celebrities drop a rank when they are sold by auction (they are advertised at the lower rank) and lose all accumulated properties (but the buyer does get some benefits).
  4. Sponsorship. Anyone can sponsor and this provides in-game gifts related to the sponsor and carrying their messages, logo and a link to a website. Plugging a new album? Gift it (in game ) to musicians by sponsoring. Also sponsors can sponsors major events, festivals etc in-game, Gifts can be given at film pre-launch parties to attendees etc.
  5. Watch a video and earn in-game Glitz dollars.
  6. Pay for advertising in-game. Players can do this. A phase two development is to allow celebs to buy in-game businesses such as Bands, film production, Bars, Hotels etc. That needs carefully thought though.
  7. Buy in-game gifts for other players.
  8. GlitzVille. This is the in-game magazine. This is produced by an editor who receives a tap  of news generated in-game and can pick and choose what to write about. It’s a modest cost per issue, only a few Glitz stars and the editor receives 75%.

As with all battle plans, this will change as the game grows and I may scrap some or come up with new ideas.

 

Trying to go schemaless

Trying to go schemaless

3.5" Floppy disks
Image by PublicDomainPictures from Pixabay

In my post SQL or NoSQL two days ago, I was dancing around the problem which is I am trying to avoid using a schema for the game’s database tables. NoSQL allows this, whereas a relational database of fixed schema tables (SQL) s more restrictive.

One reason for this is to make it easy to add new features without having to run an upgrade every time I want to add say a column in a table. I’m moving towards some key of key-value store.  This is not a real-time game but a more traditional data-processing engine which reads in a lot of data then process it and then writes out the altered data.

The data quantities are not really that big, a maximum of 10,000 players in one game using 10 KB each so maybe 100 MB of data so it could all be managed say by storing the data in JSON files rather than a database.

In the past I might have used a SQL database and I have used SQLite in a desktop application. It is fast, but if I can hold everything in RAM it will be faster still.  JSON does bulk up data a bit but nothing like as bad as XML which can be five-six times bigger.

Back when I programmed something comparable to this in 1989-1990, these (in the picture) were the standard media. Hard disks had not been around long and were quite expensive! These could hold a whopping 1.44 MB each.. CDs for data did n’t even exist then.