Showing posts with label JavaScript. Show all posts
Showing posts with label JavaScript. Show all posts

Day clock page

Following on from yesterday's Dementia Day Clock, I decided to create a new Day Clock with a little more information - for instance - accurate time.

Day clock on my Lumia 950. Click the image to load the new Day Clock.

I managed to export the data from the Perpetual Calendar for the BBC microcomputer using BeebEm and then wrote a script to convert the data from a BBC text file into a JSON file. The data contains the dates of various interesting anniversaries, and so I thought it would be a nice touch to show these on the new day clock, including a calculation of how long ago the event took place.  For example today is the 41 year anniversary of the UK Sex Discrimination Act 1975.

BeebEm has some really useful tools, most notably the 'export' function which allows you to export one or more files from a BBC disk image to a PC format. This means that I can code a file on the BBC microcomputer, but still access or edit it on my Windows 10 machine. Yay!

I then added in 'red-letter' days, or other recurring events including holidays and Pagan festivals (from Pagan Calendar). I cannot be absolutely sure I haven't made any errors here, but I'll keep checking that this works and then add some more date/time information as and when.

The final touch was to put the current time into the new page tab so you can check the time in your list of browser tabs without navigating back to the page.

Well that's it for now. In the future I may add some other features, perhaps a background image that changes with each passing month. Maybe I shall put a Google search box in, or other widgets such as weather. Maybe I'll just sack it off and build something else.


Come back soon for more nerdy stuff.

If you liked this post, then you might also like to watch some bouncing balls, or just play a game of Have Spell Will Travel.

New updates to my chatbot

I have spent most of Sunday having very daft conversations with my chatbot, Mac, and I am pleased to say that I am happy with progress so far. His dictionary files have increased in size and he is becoming a much better conversationalist.


If you want to have a pointless conversation with Mac, then you can find him waiting for you here. Try asking him who he thinks will win the race for the White House, or what his opinions are on current affairs. I'm not actually claiming that he will make any sense, but it will be fun finding out. Enjoy!

Introducing Weekend Warriors

This August I have been working on a new game: Weekend Warriors.

Weekend Warriors is a strategy text game of spell-casting and problem-solving. You play the part of a wizard protecting your kingdom from the endless hoards of computer generated enemy horror.

You have at your disposal over sixty unique spells from which you must choose those that will defend your kingdom. Some spells will summon creatures to do your bidding, whilst others represent magical objects, places and enchantments that will aid you in your quest.

At each turn you must defeat the hoards of your enemy by matching symbols on your enemy cards with powers generated by your own creatures.

Facing your first enemy: The Baby Giant Slug, adept at killing noob wizards, this monster requires 2 points of combat power and 1 point of defence power in order to be defeated, however there is a short cut - just one point of fire power will toast this slug to death.
Spells are cast by spending either gold (generated by defeating enemies) or mana points (one point is generated each turn).  The more powerful spells cost more to play, and sometimes they are delayed one or more turns, so you need to think about what you will need in advance.

Unlike many games of this genre, you have access to every spell in the game, which you can access at any point in the game by opening your spell book.  There are currently over sixty unique spells to choose from, with more coming soon.  It is recommended that you study each spell carefully and weigh-up their costs against what you require to win. Some spells reward you for having already cast other spells, for example, the spell Bloodlust gives you combat points equal to the number of warriors you have in your battlefield, so it would be a good strategy to spend precious resources building up your army of warriors.

The spell book showing some of the available spells.


Weekend Warriors allows you to play the game however you want, and you are rewarded for knowing the spell book inside out.

Each turn consists of two phases.  In the first phase you may look through your spell book and choose spells to cast. You may wish to examine the creatures and objects already on your battlefield for activated abilities or to 'rest' creatures you do not need.  In the second phase your creatures spend their 'stamina' points generating powers for you to use in defeating the computer-controlled enemies.  In this phase it is too late to rest your creatures, although you may still cast new spells and organise your armies.

Viewing an item in your battlefield.  Here is the battle axe, which is just waiting to be equipped to a suitable dwarf.

Weekend Warriors is ready to play in public beta form.  There are probably a few bugs still to iron- out, and undoubtedly the game-balance will need tweaking based on feedback.

All constructive feedback is welcome.

Further updates in the future are planned, with more spells and enemies to keep you going.  What is even more exciting is that there is planned original artwork for each spell and enemy in the game coming soon from the talented artist Pob, who worked with me on Spellunker. You can check out Pob's artwork for Spellunker here.

One of the creatures in the spell-book view, showing (from left to right) name; 'summoning' button; spell class and types; description; placeholder for artwork (coming soon); flavour text; casting costs; stamina; abilities; links to other spells that work well with this one.
To get you started with Weekend Warriors, I've created a short tutorial.  Just press the 'Help' button in-game and choose a help topic.

Weekend Warriors tutorial running on my Lumia 950.


If you have enjoyed this post, then you may like this post from last year's game Have Spell Will Travel.




Some improvements to my chatbot

Today I made some improvements to 'Mac' my chatbot engine. It is still too early to release yet, but here are the new features:

The chat history is in reverse order. The latest response is at the top.

1. Mac can now remember the values of variables stored within the user's input. In the above example, it can match the variable <<name>> from the user's input "Some call me Tim" and "My name is Bob".

2. Mac has can have two different responses to user input depending on whether a condition evaluates as true.  Conditions are expressed in the format ( [conditon] AND [condtion] ... ) OR ([condition] AND [condition ] ... ) .... So, for example if you tell him your name is something different to what he thinks, you get a different response.

Well, that's it for now, but stay tuned for more chatbot developments - and a live version plus code for you to play with - coming soon!

It's alive!

I have been working on Mac, my JavaScript chatbot for a couple of days.  I won't post it online just yet as it is still in development.

The interface with no CSS.  The previous conversation is stacked up in reverse order.

The JSON file for one input pattern.
The bot works as follows:

The user types some text into the edit box and the system tries to match this with a script object stored in the JSON file.  For each script, if the current conversation subject matches one for the script, it will check whether the user's input matches one of the regular expressions in the 'pattern' array.  If there is a match it will check whether the condition has been met.  If the condition is true it will respond with the data in "whenTrue", otherwise if the condition is false, or if there is no condition, the "whenFalse" block will execute.  In both cases, a random response from the "match" field will be returned.  The system will silently set variables in the 'think' list and set the special conversation variable to the new conversation topic in "setSubject".

The result of the script above is that Mac will respond to some standard greetings "Hi", "Hello", "Hullo", etc.  Should the user type "Hi" again, Mac will have a different response "Hello again".

That's all for now because I have to go, but I'll keep on working and publish the code shortly.

A new update to Have Spell Will Travel #HaveSpell

I released a new update to my adventure game "Have Spell Will Travel" today.


What's new?
  • Three new character classes - the Paladin, Mystic and Ninja.
  • One new quest (can you find the awesome thing from Lake Mulbz).
  • Loads of new items and creatures that will try and stop you from getting those items.
  • I've tweaked the experience system so that it is not possible to gain loads of experience all at once.

Do please check it out.



Label

World Karma Game