Since the Sunflower engine is starting to have to much information about it to keep it all in my personal blog, which is supposed to be about other things as well, I opened a wiki. All information about the engine will go there from now on, so if you’re interested in playing card games, creating card games, or teaching your computer to play card games – go right here.
First, initial release of the Sunflower engine (version 0.26) will come in a few days, so it’s about time to start giving information to anyone who might want to play and make games for it – starting with, how to make AI. Currently it has to be made in Java, but more languages might be supported in the future – especially if many people ask for it.
What you’ll need:
- The official Sunflower engine Jar file (which will be available for download within a few days).
- The AI interface of the game you want to make an AI player for. I still haven’t decided on the official AI interface format, so for now I’ll just write something down for the first game to be released for the engine (which will be Hearts).
- The ability to write and compile a Java class.
How to do it:
- Create a Java class that extends the class AIAgent, and place it in the package sunflower.ai.
- Create a constructor that accepts an AIAdapter and an int (which is the playerNum – identifier of the player in a multiplayer game).
- Override the getSupportedRulesets method, which returns an array of String, with the names of rulesets this AI can play on.
- Override the getName() method, to return whichever name you want to give your AI player.
- Override the play() method. For now, just put nothing but “return false” in it.
- Compile the class, and put the .class file in the resources/AI subfolder of the Sunflower folder.
By now, the player exists and is recognized by the engine. All that remains is to actually play against it.
- Open the resources/menus.xml file. Look for the “Start Game” button, and inside it look for the tag:
Change the value to the name of your own player (the one you returned in getName()).
- This is it – time to play with your new AI opponent!
Of course, it would be a little bit unimpressive to play against someone who doesn’t do anything. So in the next post we’ll see how to put some actual gameplay in the play() method. Stay tuned!
(Note – I was going to put code examples in this post, but my WordPress skills must be lacking, because I can’t get it to look good. So I’ll just put a link to a complete code example in the next post)
There it is – a first video look at the Sunflower game engine, playing a game of Hearts against three AI opponents:
The opponents are mindless AIs – they look at all their legal options, and randomly choose one. Smarter AI will hopefully come later. The video was created by an experimental new utility that will come with the engine – one that turns game replays to videos, ready to upload to YouTube. I strongly believe that video broadcasting has become and important part of gaming and rightly so, therefore I consider it to be a very important feature and hope that you’ll be seeing many more gameplay videos in the future.
Three things happened lately, leaving me with some thoughts about the future of multiplayer gaming:
- Last week, a Steam sale offered The Showdown Effect at discount price, also making it free to play for the weekend. I’ve had my eye on that game since it came out, as “platformer arena game” has long been on my “things to do someday unless someone else does them first” list. Unusually for me, I actually managed to find people to try it out with me – only to find out it fails. Still to this moment Paradox does not appear to give any sort of explanation what went wrong with their servers there, so I have no idea if it would ever have been fixed. Of course I did not buy the game to find out.
- If one game isn’t working, we can always go back to what’s known to work – a few days later, I came to play GTA 4. But oh, Rockstar Social Club was down. I tried for a while, so I’m quite sure it was down for about four days. At other times I was able to play, but occasionally it took me a few minutes until either Rockstar Social Club or Games for Windows got to work.
- Meanwhile I’m always looking for potential future games to get my friends into – so after seeing and liking the Spies Vs Mercs mode in the new Splinter Cell game, I decided to buy an old Splinter Cell game (Chaos Theory) to try it without spending too much. Tried it once and Steam failed to run it. Reinstalled it and it worked, then tried again after a few days and it failed again. Haven’t tried it since and don’t think I will.
So for a game like GTA, we have four servers where things can go wrong (Steam, Games for Windows, Rockstar, and actual game server). I remember being quite happy in the good old days when we needed exactly zero servers to play multiplayer, remember that? In case you’re too young to remember – to play Warcraft II multiplayer, you did not need any external servers. One player chose “host game”, the other chose “join game” and entered the host IP address. There are two main reasons this no longer exists – having a lobby to meet strangers to play with, and bypassing router blocks. All other benefits are for the company – they get to strengthen their DRM, they get statistics on how you use the game, they get personal information from you and they have your dependency on them.
For me, the ability to play with random strangers is not at all interesting, and certainly not worth the downsides of setting up servers. As for routers – the only issue is that you’ll need some minimal knowledge of computer networks to host a game. This means that direct P2P games can no longer exist in the commercial world, but for me – someone who makes games in order to play them and enjoy – I’m quite sure I’m never going to set up game servers. And in fact, the new experimental P2P multiplayer feature of the Sunflower engine will very soon be revealed, along with another fun feature I’ll talk about soon.
Getting ready for the release of the initial version of the Sunflower Virtual Gaming Table, here’s a little description of how the engine works. It’s built to be very modular and modifiable, and most importantly – to allow as much game creation and modding as possible be done without having to get into the actual project code. So here’s a basic description of the components of a game in the engine, with more detailed descriptions coming in the near future. All the terminology is currently based on card games, but the engine will also support other kinds of board games.
A Sunflower game requires the following – a ruleset, a table, a card set, (optionally) a deck, (optionally) a scenario, and an AI player.
The ruleset is the basic definition of a game in the engine. It fully defines the rules of the game, using a special-made markup language and scripting language. Since both are still under heavy construction, I’m not yet releasing an API, but it will come soon, and then you’ll be able to create all the games you want without having to mess with the engine code.
The table is the visual part, the appearence of the game on the computer screen. Each table is built to handle one or more rulesets, but is not necessarily bound to it – many tables can be used for a single ruleset, so artists are free to design tables that look however they want for any game. The tables are also defined with a custom-made markup language, so of course tables can be designed by artists, without any programming knowledge and without any need for messing with the internals of the project.
The card set is the pool of possible cards to use in a game. Each card has a set of properties, depending on the game – a classic card set will have properties “Suit” and “Value”, WTactics cards will have things like “Gold Cost” and “Attack Value”, and so on. Just like tables, card sets are made for one or more rulesets, so you can easily use a single ruleset to play with different cards.
A deck is a set of cards. Note that unlike a card set which defines possible cards, the deck has actual cards that can appear on the table – each card in the deck is an instance of the “prototype” card from the card set. Thus a deck is specific to both a ruleset and card set. Decks are expected to change with players in many games (such as WTactics), so a deck building mechanism will definitely come in the future.
A scenario is a snapshot of an ongoing game at a certain point. It allows creating games with several modes, identical in rules but different in starting conditions. This is the only basic element completely unimplemented yet.
An AI player is a piece of (compiled) code that knows how to play a certain game. They are loaded dynamically at runtime, so everyone can write new AI players without having to get into the engine code. This will probably be the first thing I’ll write an official API and tutorial for, so if you’re interested in AI, you might be interested in following it.
More is coming soon, stay tuned!
My excellent 2.5 weeks in Sweden are over, and the results will soon be announced – a new, single-player oriented card game engine, which will hopefully allow people to play a large selection of card games with AI opponents. Since WTactics is not finished yet you won’t be able to play that for now, but some other games will hopefully be implemented soon, each with its own AI opponent ready to challenge you. More details coming soon.
Those, of course, were my results – for the general WTactics project, see here.
It’s time to announce something I’ve been occupied with for a while now and haven’t mentioned yet – I’m going to land in Sweden this Friday to participate in the WTactics Summer of Cards.
Basically, WTactics is an open source collectible card game, or at least hopes to be so in the future. It has a very nice start so far with some beautiful cards and a promising set of rules, but it’s still not a working game. The Summer of Cards is a month-long game jam meant to push the project forward.
Now, what am I doing there? I’m going to work on a single-player card game engine the game will be able to use. The open source world has a few multiplayer card game engines, which allow players to meet online and play freely, taking care of the rules themselves. Single player support is much less common, and that’s where I come in – I think a single-player experience with an AI opponent is very important for new players to get into the game, and I’m going to work on it. The engine is already advancing nicely, and here’s what it currently looks like:
But there’s more. While I like WTactics’s potential, my open-source philosophy dictates making engines rather than games. I want my work here to be applicable to any future card game which will want it. So I’m going to start asking for any game designers out there, who have a set of rules ready – let’s see what we can do to make sure my engine will work for you as well. More on that in some upcoming posts.
My month in Lisbon really brought me some inspiration for my first commercial game, so stay tuned – gameplay is nearly complete, and an initial private demo will soon be released to the playtesters (in other words – random selection of my friends). So there is still hope that soon you’ll get to see the actual game happening. Just wait a little more.
I’ve been working on another game for the Experimental Gameplay Project this week. As you may notice, the month ends today, and unfortunately – it doesn’t look like I’m going to have something serious to show on time. I’ll try to make a quick development session today and have at least something to show for it, maybe also work on it a little bit in a personally-declared overtime. Meanwhile, I thought I’d share some of the philosophy behind my project.
There are many game genres out there. We have shooters, real-time strategy, turn-based strategy, turn-based tactics, brawlers, puzzlers, management, and many others, all of which are drastically different from each other.
But wait – the word “genre” can mean several different things. In all these genres, the game mechanics are indeed drastically different from each other. But what about the content? What are these games “about”? In that case, suddenly almost all creativity disappears. All the different, clever mechanics are used almost always in the context of fighting. Anything from one-on-one fighting in Street fighter, to huge multiplanetary wars in Total Annihilation. Almost every game currently available that I can see, involves killing something, or trying to. In some rare cases we get two other possible goals – earning money (mostly in management-style games) and getting out of somewhere (in puzzle games). Often these are combined with killing things, and anyway – they’re limited to their own genres. Most genres have only one thing – killing stuff. So why is that, and is that the only possible direction for the gaming world to go?
I admit – fighting is, despite its horrible uses, an interesting thing. It allows a wide variety of options and strategies, requires many different skills, is inherently symmetrical and is very dynamic. However, is that really the reason so many games go for that? I think it’s quite obviously not. It’s becoming more and more outstanding in the recent 10-15 years – as graphics become more and more realistic, we see the game industry’s order of priorities – huge resources are put into things that don’t affect the gameplay and don’t improve the graphics, but simply make things more violent.
So if the industry is doing it because people like violence and not because it’s the only option, could there be an additional option? Could we be missing an entire world of game worlds based on the same genres (in terms of game mechanics), but with different contexts than killing stuff? I think it’s possible. And the game I’ve been working on for the past week is kind of a test of that. As you might expect from a week’s work it’s hardly polished and might not actually be very fun, but I hope it will turn out to have some potential. What exactly is the context? It’s something I think can fill an entire world of games, no less rich than war, and can be applied to almost every genre where war is currently used. I’ll wait until it’s ready before announcing it, but you can have a little hint – the Experimental Gameplay Project theme for this month is “temperature”.
Just to clarify – I don’t (entirely) have a problem with violence in video games. I do have a problem with evil in video games as I’ve explained before, but games based on fighting are fine – the problem is when *every* game is based on fighting. My problem here is the lack of creativity.
 This is seriously a quote (or at least a paraphrase) I personally heard in a talk by someone from the Total War franchise, introducing their next game: “We made animations so much more realistic [...] the soldiers will now have facial expressions of sadness as their fellow soldiers die”.
 Almost needless to say how self-fulfilling that prophecy is – companies assume something about the target audience, make the games for them, they buy the games, companies check data about the people who buy their games, and find their assumptions were correct. How shocking.
 Hopefully, even something you’ll be able to explain to non-gamers without cringing. I think the multiplayer mode of Assassin’s Creed is really cool in its mechanics, for example, but can you imagine showing that to a non-gamer, who is presumably a normal person, and offering them to try playing it? “Here is where you violently slit the throat of a innocent civilian, it causes you a minor inconvenience because it wasn’t who you were supposed to kill. And here you can kick someone’s dead body, you get 50 points for that”.
Scouring the Internets thouroughly can occasionally bring up an interesting gem – as is the case with “Dancing Goblins”, a (relatively) new open-source rougelike rhythm game by Maurício da Silva. Due to the profound influence the game had on me, I thought a review might give it some much-deserved publicity.
Unsurprisingly considering the previous works of the creator (including, among others, an 4-person co-op Chess game and an RTS based on a jigsaw-puzzle mechanic), this is quite an unusual game. You can learn more from the link above, but basically – you go through a dungeon facing increasingly difficult monsters and traps, armed only with the power of song. The rhythm game mechanic provides the spell casting for the game, with different styles of music (from French chansons to Guaraní folk songs, and anything in between) conforming to different schools of magic. This all connects quite well into a game which, although not yet having reached version 0.1 (but it should happen any minute now, especially now that the world didn’t end), definitely seems quite promising.
Art: Certainly one of the game’s strong points, with artists Quimérico and PixelFalaz really bringing the dungeons to life with photo-realistic views, likeable characters and stunning animations. The choice of going with purely ASCII art (after many debates about weather full Unicode was necessary) turned out to be a wonderful success, as was also the choice of font size 18pt over the much more common 16pt.
Gameplay: Certainly gets points for creativity, and in the first few hours of playing it feels quite solid as well, but will it pass the test of time and become a full game genre? Only time will tell. The interface is well-planned, with some clever use of the “j” key (and a surprising role for the “scroll lock” key, which I believe was put in more as a cheap marketing ploy). The basic mechanic attempts to create a simultaneous strategical and musical challenge, but I believe the music ends up getting most of the attention, as the best strategy is generally to look for the best guitars (or, failing that, a zither or shakuhachi) and blast all enemies with the most powerful songs you can learn. Which brings us to the next issue:
Balance: Definitely needs more work. Some magic schools (like Basque folk songs) are ridiculously overpowered, while others (such as 1940s-style aboriginal chanting) seem to serve little purpose but to artificially inflate the game’s (indeed impressive) spell list. Hopefully this will get some more attention before the next version.
Story: The game comes with a charming plot, albeit simplistic. You take the role of Belisarius the untaxable, who roams the dungeons in search of a purpose for his life. I haven’t reached the end yet and don’t want to spoil anything, but you can expect an enjoyable set of texts to glance at while building your spellbook / chordbook. There is a certain inconsistent quality in them though, I felt that some of the characters (like the hydraulophone-playing half-centaur sorceress) were slightly poorly written and in need of review.
Soundtrack: Unfortunately, the game still doesn’t have one. They hope to get around to it in version 0.8 or 0.9.
There is definitely potential in this game for bringing back the long-awaited genre of rougelike rhythm games (I think we haven’t seen one since “Beeps and Fireballs” in 1978). We need to keep an eye on it – if the next decade of development will go as well as the previous one, we can expect an excellent version 0.2 someday.
As you’ve probably guessed by now, none of the games or people described in this post actually exist. It’s just the result of me having spent a day with a mild fever, after a week of practicing my Spanish by reading Jorge Luis Borges. I hope we’ll get some good real games soon (maybe even from me).