raylib – a simple and easy-to-use library to enjoy videogames programming.

The last 12 months have been very difficult. My Dad passed away suddenly from cancer which meant I had to find a new home for my Mum who relied on him for her day to day care, sell their house and deal with some serious health issues of my own. This was in addition to everything else we have to deal with day to day and a busy job.

I am finally starting to play around with some CRPG game ideas and possible platforms.

I came across raylib recently and I have to say I’m very impressed with it so far. This is a simple and easy to use library for game programming. It’s cross platform and was originally designed to work as a library with standard C code which remains my language of choice, though I am still not very proficient with it. It’s apparently been around 10 years so it appears to be well established and have a strong following though I had not come across it before.

Raylib feels like a good match for my game development needs which remain very much inspired by the 8 and 16bit era of adventure and CRPG gaming. There are lots of examples on the official website and many, many tutorials online and on YouTube. It’s free to use though donations are welcomed.

You can find raylib at: https://www.raylib.com/

Alternate Reality X – Release 0.75 – Changes

With the public release of Alternate Reality X 0.75 looming for the end of September 2016 I thought I would talk a little bit about what you can expect to see, what I didn’t manage to add and my general approach to have the completed 1.0 release in your hands before the end of the year.

I had planned for this release to complete ALL the elements of the City and the Dungeon that I see as combat and encounter related. I didn’t achieve that for a number of good reasons but I did make some very significant steps that put the project in a much stronger position than it was in before. One of the big changes was to add all the remaining Dungeon monsters as to date only the Well Lit Area and Fixed Encounters had been added and to animate them all.

One major change which I had not committed myself to making was using the original 8bit Dungeon monster data directly from the binary files. I was previously using simple text files which whilst easy to update had numerous errors, lacked a lot of information from the real data and were prone to spoiling of the game / opportunity for cheating from players. In addition to this I had built up similar text files for weapons in the game – an amalgamation of weapons the player could buy, monster weapons and unique items you could stumble across (e.g. the Sword of the Adept).

One of the great features of Alternate Reality (the Dungeon at least) was that it had a very flexible system for customising monsters and items in the game. Many games at the time would have had fixed object sizes with no opportunity to modify those objects in game. The Dungeon in contrast allowed very rich items and monsters which contained a mixture of attribute data (name, bonus to hit, sharp damage) with effects (curses, give off light) and directly included 6502 (the processor used by the Atari 800, Commodore 64 and others) code. In game objects could also be dynamically created in game (clothing in the City) or modified through player actions (weapons having enchantments added at the Weapon Enchantress).

So after a lot of thought I made the decision to use the original binary data. Using some great information provided by Brian Herlihy a few years back, I replaced the original monster loader and also added in support for loading in all their weapons and attacks. These are stored as part of the monster data. This was a lot of work for me but once I had these changes working I felt it made an immediate improvement to the feel of the game as well as adding all those additional Dungeon monsters – about 50 in total. Thanks to Brian for this information without which these changes wouldn’t have been possible.

Another major change in this release was the introduction of properly timed / processor speed independent encounter animation. I had information on encounter animation from old emails from Jim Norris – thanks Jim! – so I used these to hopefully produce a fairly accurate recreation of the Dungeon encounter animations. As part of this work I totally rewrote the main encounter loop and the way that monster and player “turns” are taken during combat and how multiple opponents are dealt with. Monster attacks now use the proper attack descriptions (whomps, slashes, chokes etc), can hit multiple player body parts and can also knock the player to the ground.

Behind the scenes I re-organised some of the game code, introducing more source files to try and better segment and compartmentalise different code areas (e.g the actor source files refer to encounters, load in the binary data, create their weapons and attacks etc). All these changes meant a lot of knock on changes – some foreseen, others not. These took time to sort out. I’ve probably not caught all of these issues yet.

With the introduction of all the new Dungeon monsters and only limited new encounter art I took the decision to temporarily disable the new media options – these will be back in a future version. I also disabled the W command to force an encounter as it seemed to be a source of problems and encounter frequency checking has been re-written in this release to check regularly for new encounters. I had to tone this down a bit as encounters seemed to be happening back to back!

The other feature missing from this release is the ability to pick up monster weapons after combat. There was a very practical reason for this, namely that all monster weapons are now stored in a new format and location whilst the player inventory / object buffer in the game uses a totally different system. In order to allow for the custom weapons of the Dwarven Smithy and enchanted weapons from the Enchantress this system will need to be updated and this in turn will impact on all the existing shops where weapons, armour and clothing can be bought. This work will be the focus of the next release with addition of adding in the original item binary data from the Dungeon to introduce all those special objects into Alternate Reality X such as Trump Cards, Eyes, Wands and Horns. Trying to add these into release 0.75 would have added a lot longer to the development time and I was keen to have a release out before then.

In order to have the 1.0 release ready for the end of the year I have had to focus tightly on what needs to be finished and priority on the gaps that need the most work and will add the most to the game. This may mean that some of the extras will go on the back burner for the time being but I think it will be well worth it to have a complete, integrated City and Dungeon Alternate Reality world to explore! Hopefully these decisions make sense but as always I’d love to hear your thoughts. Watch out for release 0.75 coming very soon. Thanks.

CRPG DEV – The 2016 Update and future plans

January 2016 has passed but I hope you had a good Christmas / New Year or holiday.

I’m sorry for not posting anything for such a long time. I’ve found it difficult to focus and use my time well to make the significant updates to Alternate Reality X which I’ve wanted to despite putting in some serious hours. I started some major structural changes as well as trying to make the code fully object oriented. Looking back I tried to change too many things at the same time and my experience of full object oriented coding isn’t really good enough. I should have stuck with the style I’m familiar with rather than what I thought I should be doing.

The SFML media library I use also underwent some other changes which broke my 3D view code as it relied on some no longer supported OpenGL functions. I’ve considered going back to a previous version of the SFML library, though I’d prefer I was using the current version.

I’ve given it a lot of thought and planned out some more realistic short term changes to ARX. I’ll stick with my procedural style and concentrate my efforts on the areas that really need attention to allow progress to be made with the game. With the New Year I’ve given a lot of thought to what I want to achieve this year – professionally and personally – and making significant progress with ARX (and CRPG Dev) is high on my list.

I’m now working on a simple 0.72 release (as my past official release was 0.71). Once I’ve fixed the 3D view I’ll make this available – the purpose of this will be to update ARX to the latest version of SFML and also make use of the new Visual Studio 2013 build. I’m no longer using Code::Blocks as my development environment as I’m trying to improve my coding and many of the tutorials and books I’ve been studying use Visual Studio.

I’ve lots of plans but I’ll not say anything more about those just now until I’ve proven that ARX is still ongoing with a couple of new releases. So hang in there! 

Thank you for your past support and interest in what I’ve been doing – it’s really meant a lot to me. So with that I’d like to wish you (a belated) all the best for 2016.

Alternate Reality X – Back to Basics

As I’d said previously I wanted to review what I’d achieved with Alternate Reality X (ARX) and what I needed to do to take it a step closer to completion. I’ve given the project a lot of thought and wanted to post an update.

I found some of my early AR images on the internet dated 12th June 2004. Eleven years ago! These are very old when I was using Mike Robert’s excellent TADS 3 Interactive Fiction system to read the AR binary map files and display an overhead view. Thanks to Mike for answering my often off topic questions when I should have been using TADS 3 to write more adventure games 🙂 Here are the images:
My early Alternate Reality port using TADS 3!

Another screenshot but with a different font and a very simplistic 3D view
My next move after moving away from using TADS 3 was to post a little SDL based demo of some randomised Dungeon combat with various Dungeon denizens things have changed a lot. My original demo looked very authentic and just worked. I liked that version 🙂

My original goals for my Alternate Reality remake were to:
  • Produce an easy to use version of AR that would run on modern systems
  • Allow players to move seamlessly between the City and Dungeon scenarios

It was not my original intention to improve the graphics and sound or to try and complete the other scenarios. The display and audio options as well as multiple screen resolutions have all added to the development time for me. Not ideal when this is really my first proper programming project 🙂
Since then a lot of time has passed and over the years the project has started and paused a number of times due to other commitments and changing ideas about direction. My conclusion now is that the best direction for now is to return to my original goals for the project and try to bring it to a sensible conclusion, or at the very least bring this stage to completion so that there is a solid foundation for myself or others to build on (e.g. adding a new scenario).
The original Alternate Reality:The City
The other conclusion I’ve come to from the emails and messages I’ve received over the years is that the vast majority of people are really looking for a fairly faithful port of the original games – including the original 8bit graphics and sound. I really need to pair back the project to its core so that I can rewrite some of the dubious code in the background. This is turn would provide a solid platform for possible future scenarios to be added – once the City and Dungeon are 100% implemented.
There are a couple of other things I’ve considered. SFML’s use of OpenGL causes a lot of issues foe people who don’t have fully compliant OpenGL video drivers on their Windows PCs. This is a big concern for me with Windows 10 now on release.  A switch to the SDL media library which I believe doesn’t use OpenGL would probably help a lot with this. I’ve also decided that for ARX any ports to Mac OS X or Linux would probably have to be carried out by someone else. Unity 3D I’ll use for new projects rather than ARX.
So where does that leave the project? 
Here’s my current plan and thoughts for Alternate Reality X development:
  • Microsoft Windows only
  • Staying with C++ and a media library (SFML or SDL)
  • Review each section of code, rewriting where necessary
  • Concentrate on adding the remaining functionality
  • Stick to the original 8bit look and feel for now

Future CRPG Developments

Thanks to those of you who were kind enough to send me documents, resources and even your own 3D models for Unity 3D. I’ve not had the chance to go through everything yet but they look really useful and have given me a real flavour of the possibilities of development in Unity. I’ve decided that I will be moving my development projects over to Unity 3D from now on; the benefits far outweigh the negatives in my opinion.

I believe I must have spent hundreds of hours working on my Alternate Reality port development and if I’m honest it’s not as complete as I expected it to be. If I’d known when I first started looking into it and poking around with the maps that I’d still be working on it in 2013 I think I would have run a mile! It’s become very hard work at times as the project has reached a significant size. I’ve learnt a lot from working on the project and I’m still learning all the time as well as improving my skills but a lot of my time has been spent “recreating the wheel”. At this point with some significant code changes needed in ARX to properly handle objects I don’t feel it would make sense for me to continue using my current home brew system.



Trying out a free model in a Unity scene

Unity 3D has the advantage that it’s an all in one development system so I can do a search on creating a mini map, an inventory system or rain effects for example and I will get dozens of links and videos suggesting how to produce the effects or functionality I’m looking for. It’s all provided in one, nice integrated package. You only need to do a quick search on YouTube to see there are hundreds of tutorials and examples of Unity and how to use it. Compare that to my current development where I need to read up on issues relating to C++, OpenGL (for 3D), SFML for my media library and Visual Studio or Code Blocks for my development environment. That’s a long list! SFMLs use of OpenGL has also nagged me a bit as many Windows players don’t have the correct OpenGL drivers installed. I’ll be doing some tests on older kit with Unity to see how well it runs.

Once you have a working Unity game you can publish it to Mac, Linux, Web and mobile platforms relatively easily (ok I’ll need to buy into optional upgrades of Unity for Apple IOS and Android versions but it’s there ready to tap into when the time is right).



Web Player, PC or Mac?

Now I’m not naive enough to believe that Unity is going to write my game for me but I do think it is likely to make me more productive and so far I’m having fun using it which is why I started doing this in the first place. I’ll still have to write lots of code (in javascipt, C# or Boo) but there are thousands of examples online and it all appears to be well documented and a lot of the core game functionality can be handled through game objects or properties. So far it’s been a pleasant environment to work in. So far I’ve had an on screen graphical inventory up, a menu system and and my own mountains and wilderness to explore created in very little time. I think once I’ve got a better grip on the basics I believe I’ll be able to make much more rapid progress.

When it comes to creating additional scenarios or environments the other problem we’re already running into is limited art assets. Unity has an extensive asset store with a mixture of free and payable assets, many of a high quality. It also supports a variety of 3D model types. It took me minutes to find and download some reasonable free models and import them into my Unity scene.

From the messages I’ve received most people seem to think that Unity is a good move forward. I think it will provide some security for the project as Unity seems to have a large community and in the event that I stopped working on it, others would be able to pick it up and continue work. A more polished engine and game are likely to get more players interested in the game who will in turn improve the chances of the complete series being developed.

Hopefully you’ll agree that this is the right way forward and still feel supportive towards the project. One chapter may be coming to a close but I think an exciting one is about to begin.

Exploring Unity 3D

I’ve just got home after being away for over a week so I’ve not done any further work on Alternate Reality X during that time. However I spent a few hours today familiaring myself with the basics of the free version of the Unity game development system and I’m pleased with the results so far. On first use it seems like a very powerful system to use.

Exploring the Wilderness in my first Unity 3D effort?

I’ve tried out Unity before but have never really sat down with a clear objective in mind and tried to learn some of the basics. I’m reading Beginning 3D Game Development with Unity by Sue Blackman and so far I’ve managed to put together a few scenes and have my character move around in a full 3D environment. After creating some simple terrain using the built in tools and then adding mountains, hills and clearings I was able to add my character and walk around the landscape I’d just created. I have to say I enjoyed the moment where I climbed to the top of a clearing and a series of mountains loomed into my view.

My map from above and players view in the game window

I also played around a bit with creating the user interface and found some nice free assets on the Unity web site for creating menus, text and buttons. I’ve also been researching how Unity would work for more traditional 3D Dungeons and walls such as those in but without the limitations or visual restrictions that my current system has. From my research and the contents of the book it seems that people have used Unity to create all sorts of games from role playing games, first person shooters to 2D point and click adventures.

The next thing I’m keen to try is converting one of the City or Dungeon maps into a Unity scene with a few nice extras which I would have struggled to implement. I’m excited by the possibilities but I won’t rush into making any decisions just yet.

Let me know what you think.

Alternate Reality X – Release 0.61 Status

Release 0.61 of ARX will be released as soon as I fix a bug when entering guilds
which leads to a crash.

The main change in this release is that at
least on a temporary basis I’ve switched to the CodeBlocks development
environment using the MinGW C++ compiler. There were 2 main reasons for this –
firstly compile times increased significantly with Visual Studio 2010 from a few
seconds for a change to about a minute which was really making small changes
very tedious, and secondly CodeBlocks is available on Linux and Mac making
native versions of ARX much easier to produce as the same environment can be
used across all platforms. The switch of environment has raised a few new compile
bugs though which I need to deal with before releasing 0.61.

From a
player perspective the other major change I’ve made is that I’ve almost 100%
dropped the use of “RenderTextures” in the SFML media library. My use of these
created lots of problems for players with Intel onboard graphics and a few
issues on newer machines I had access to. My code was also messier and harder to
debug when I had these in. My new 0.61 version works much better on old harder
which I’m much happier with. I don’t see why a player shouldn’t be able to use
an old laptop to play something based on a 25 year old game series just because
it has intel graphics.

I’ve also added code to better handle monster
vulnerabilities and invulnerabilies to various damage types. Bit more work to do
there though to make it complete.

There are a few new encounter images
which I’ve been sent as well which are included for players playing ARX in a
full window. These will hopefully gradually replace the handful of placeholder
MM6 images I’ve used currently.

Hopefully I can have this release wrapped
up fairly soon.

All the best,
Acrin1

Visual C++ 2010 Express and SFML 2

Based on some issues that players of Alternate Reality X reported, I was keen to try out one of the more recent versions of SFML 2.  Hopefully this would resolve problems relating to the use of RenderTextures on machines using integrated Intel graphics. Using a very helpful tutorial by SFMLcoder over at http://sfmlcoder.wordpress.com/2011/06/15/building-sfml-2-nmake/ I was able to build my own SFML 2 binaries and libraries successfully for the first time.

I also used this as an opportunity to switch from Visual Studio C++ 2008 Express to the 2010 edition. It looks like there are a few changes between 2008 and 2010 but no major issues just now.

One thing to remember if that players will need to install the Visual Studio 2010 runtime for the next ARX or SOTC release.