Tag: inselkampf

Work in Progress – Web game

Work in Progress – Web game

Blazor AppI did some investigative work on this at the weekend, This is my Inselkampf type web game. Although I know C#, I’m fairly new to ASP.NET and Blazor. Now the first thing you’ll notice about most Blazor examples on the web is that many look like the screenshot. In particular, the purple gradient down the left hand side.

So my first job was find out where that’s defined and try changing it. In the project which is Blazor WebAssembly, there’s a shared folder and it contains two .css files. MainLayout.razor.css and NavMenu.razor.css. These are the files you need to alter.

Now its probably seven or eight years since I last touched CSS and it has come on quite a bit since then. I discovered css-grid which simplifies things enormously.  If you want to find out more about CSS, take a look on FreeCodeCamp.org. This site has lots of example layouts using CSS-Grid and I went for Redefining Grid Areas with Media Queries. 

This lets you specify a width so you can have a responsive website which adapts to mobile phones as well as desktop. I merged the css and HTML from the example into the project and although its an early stage, I’m quite pleased with it.

Game framework This is very early. The font, colours etc will all change but this has given me a web template with round corners, header, footer and two sidebars.

If I shrink the width of the browser the two sidebars move to positions above and below the main content like this below. It would have taken a lot more effort before css-grid to do this.

Narrow game framework

 

 

Thinking about my Inselkampf reimagination

Thinking about my Inselkampf reimagination

Database schema
Image by mcmurryjulie from Pixabay

In an earlier post on web games, I mentioned an old multi-player web game that I used to play and which was discontinued in 2014.  I have a rough design for this and am busy learning Blazor as I believe that would be the best technology to use. It lets you run C# programs in the browser, no JavaScript needed. This simplifies input with verification and also updating the web page without having to do lots of messy Ajax stuff.

But being a web game there is a web server involved and the big question is what sort of data architecture to use? The most obvious one is probably using a relational database behind the scenes. That way each game (with up to 1,000 players) is held in a single database in about 12 tables. I’ll probably use MariaDB.

I did consider doing everything in RAM but its a terrible abuse of a web server and rather restricts it to running one or two games. Pulling stuff out of a database is much less strain on the system than having a few hundred MB of RAM tied up per game. A web server can support multiple games which helps keep the costs down.

Also with a web game, it raises the possibility of caching certain static files on disk to improve throughput.  This blog uses WordPress but has a cache so when you view a page, it’s almost certainly been pre-generated rather than built on the fly.

An example of a web game that I admire is Torn.com.

I like web games

I like web games

IllyriadNot the Flash type games you get on sites like Kongregate but strategy games like Illyriad, (Pictured) Though you can waste an awful lot of time playing them. The web is an excellent platform for certain of multiplayer games. Heck you can even play games like Quake III which was a desktop game but redone using WebAssembly.

I used to play a strategy game Inselkampf (German for Island war) where you start off with one island and improve it then you can start building ships and invading other islands. I remember getting to the point where I was managing an empire of 80 islands and the only way I could do track all the details was with an Excel spreadsheet. But it was a big time hog, taking up over and hour and a half each day (just mad!) and I stopped playing.

It seems to have closed down a few years ago which is a shame as it was very popular in the mid 2000s. The UK website inselkampf.co.uk just has a start Game Over message on it! Searching about I even found a copy of the Inselkampf rules online.

Given my postal games background (I created three Play by Mail games back in the late 80s, two of which are still run today on kjcgames.com. ) I still have an inkling to create a big web or mobile playable game. I’m not saying I’ll make a £million like torn.com.  I’m not a great fan of web development (well the JavaScript part of it) but I’m currently studying a Udemy course on Blazor which is Microsoft’s take on C# and WebAssembly.  This lets you create websites in C# running in the browser. And C# I am most definitely a fan of.