Calendar Rolling Dates – Update

It’s been a while since I have posted. This is due in part to not being able to get enough time on Sojour and also due to the size of the current task in-hand. That said, progress has been made!

I guess the first question for me to answer is ‘What are rolling dates?’

I feel that the easiest way of answering this question is to firstly explain what non-rolling dates are.

Calendars that have non-rolling dates are characterised by each month starting on the same day of the week:

A Gloranthan Calendar – with Non-Rolling Dates! (click for larger image)

The above example shows two different seasons from the Runequest Gloranthan calendar. Each season starts on a very specific day – Freezeday. This would still apply even if I was to go to a different year: Sea Season’s first day will always be Freezeday.

It’s this lack of relative motion between the days and their months that make this Gloranthan calendar a non-rolling calendar (otherwise known as a fixed calendar).

It turns out that many role playing game systems use non-rolling calendars as they are the simplest to use in terms of gameplay. Examples of games using non-rolling calendars are Runequest, Dungeons & Dragons and Traveller.

In direct contrast, the Gregorian calendar, as used in the West on Earth has months that do not start on the same day. This is the case even when looking at the same month over many years.

For example, April 2023 starts on Saturday, whilst April 2024 starts on a Monday.

These variations in the start day occur because the day of the week, Sunday to Saturday, roll independently of the month that they are in. They always form a full seven day week even when crossing monthly boundaries.

It’s this that makes the Gregorian calendar a rolling calendar.

Now, it might come as a shock to most people, but Sojour has never natively supported rolling calendars!

Some of you will be reading the above paragraph in disbelief and will be pointing to Sojour’s built in Gregorian calendar as evidence to the contrary.

However, Sojour’s Gregorian calendar is a special case. Sojour does not use its calendar system’s time-units to model the Gregorian calendar. Instead, it uses the default Gregorian calendar provided by the operating system. It then seamlessly integrates that calendar with Sojour’s user interfaces to provide the illusion of rolling date support.

The big give away is that unlike other calendars, you cannot edit it:

The Gregorian Calendar is a special case – it’s why you can’t edit it!

Much of the recent work has been centred around getting Sojour’s time-unit based system to be able to model rolling calendars like the Gregorian calendar. Enabling this will allow users to literally invent any calendar that they can imagine!

Today is a special day in that I finally cracked it! :

A Gregorian Calendar, but not as you know it! This time it is constructed and modelled with Sojour’s time-units! (Click for a bigger image!)

The above screenshot doesn’t look too significant, however it represents a huge step-up in Sojour’s calendar modelling capability. That’s because it has managed to model a rolling calendar – the Gregorian Calendar – using its own built-in editor and time-units!

The system even takes leap years into account:

A leap year!
A non leap year!

As an aside, Sojour can model leap days, weeks, months or whatever else you can imagine. For example you could easily invent a calendar that has 4 leap days that occur every 6 years 🙂

Coding the month view to support rolling calendar dates was a right royal pain. The first issue is that the 1st can occur on any day! So the 1st will invariably not start in the first cell of the month view and will tend to move around.

In addition, some months will have more, or less rows (weeks) than other months and all of this has to be calculated:

For example April has six rows of days, whereas most other months will tend to have five. The code has to be able to account for this!

Sojour’s rolling dates are really powerful. In the above Gregorian calendar it only has one set of rolling entities to drive those dates and that is a rolling entity group called ‘Days of the week’. However, I could quite easily go on to add many more rolling entity groups and map those to different time-unit levels.

In fact, you can even assign multiple rolling entities to the same level! For example, with the Gregorian calendar I could create another set of rolling entities called ‘Moon Phases’ and then assign those to the day level. The moon phases will then roll around independently of anything else as the days go by!

Sojour even allows you to associate images with your rolling entities and these will end up being visible on the calendar’s month view. In the above example we would see the different phases of the moon on each day.

The Gregorian calendar I created here is simply a proof of concept. I figured that if Sojour’s time-units could model the Gregorian calendar successfully, then in theory a user could create any calendar that they can imagine!

Whilst I have made a lot of progress, there is still a huge amount of work left and I suspect I will be on this feature for quite a while yet.

Hang on in there and have patience! Once released, Sojour will have one of the most powerful and flexible calendar systems ever released in a VTT!

Have Fun!

RobP

Back in the Saddle!

The replacement laptop has arrived as have the ordered upgrade parts. Most people don’t take apart their brand new laptops, but I do 🙂

Adding a much bigger SSD amongst other things!

With the laptop put back together and the development environment installed, we are now all green to start coding again!

The new laptop being taken through its paces!

The first coding task is to add rolling entity groups to calendars:

Rolling entity groups! (Click for bigger image)

What are these?

They are groups of any entity type that you can think of. They can be days of a week, or perhaps phases of the moon as shown above. Or anything else that you can imagine!

These groups are then attached to calendar time-unit levels. The idea being that each time-unit on that level will cycle to the next rolling entity in the rolling entity group. If the calendar is already on the last rolling entity, it will roll around back around to the first entity.

This mechanism will allow users to create custom calendars with rolling dates. It will also allow users to attach as many rolling entity groups to each level of time units as required.

For example you could set the lowest level time units to show the day of the week and the moon-phases together! Both sets of rolling entities will independently roll and display on the calendar!

I know this all sounds confusing, but it will be a very powerful feature.

Once it is done, I’ll update the custom calendars video on You-Tube to include a demonstration of this new feature. It’s much easier to demonstrate than it is to explain – honest!

That’s it for this week!

Have Fun!

RobP

Sojour – A slight hiccup!

I have started working on the improved calendar modelling as alluded to in the previous post.

However, this all came to a grinding halt when my trusty development machine of 8 years finally gave up the ghost. It was a first generation Surface Book Pro:

Here it is in better days when developing Ancient Armies – another one of my projects. (Click for larger image!)

I loved everything about this machine. It had a touch screen that could be detached and used as a tablet – complete with stylus.

It also had one of the best screens and keyboards I have ever had the pleasure of working with. The uncommon 3:2 aspect ratio was perfect for coding too – wide enough to see everything, but also deep enough to see many lines of code at once.

One of the best things about this laptop is that it kept my coding honest. It housed an old Intel dual core I5-6300U processor, 8gb of RAM and it had a very poor GPU – an Nvidia 940M. These low specs forced me to think about Sojour’s performance – something that can be neglected when working on a super-machine!

What went wrong with it?

The battery….

Looks like the battery is trying to escape through the underside! (Click for larger image)

A few weeks back I noticed the laptop couldn’t sit flat on the table top anymore. It was a noticeable issue, but I couldn’t see anything physically wrong with the Surface Book, so I carried on using it.

It’s only in recent days that the expanded battery’s size has started to create a large bulge in the base of the laptop. This bulge has got to the point where it has forced the base away from its mounting points, hence the crack shown above.

The general consensus on the internet is to stop using it right away! It now represents a fire hazard and a fume risk if the battery blows.

Further research also indicated that battery bulge problems are a fairly common issue with Surface Books.

There is no need to worry about Sojour’s source code, it is perfectly safe and sound!

A new laptop has just been ordered from Lenovo as the Surface Book’s replacement.

Once I receive it, the new laptop will need a little TLC to integrate it with my development environment, but once that is done, I’ll be good to go again!

In the meantime, farewell Surface Book! – You have been a sturdy and reliable companion for over 8 years! You will be missed!

Have Fun!

RobP

Sojour v1.2.39.0 has been released!

This release addresses some issues with Sojour’s User settings.

In the past they never carried over between installs.

In v1.2.34.0 they were always carried over, but Sojour would tend to overwrite current user settings with the previous ones due to a misunderstanding with how Microsoft’s upgrade mechanism works.

In this version, I have versioned the user settings. They should now only get upgraded if Sojour detects that the current running version is later than the version number assigned to the settings.

This should enable such things as user data directories to be better remembered, both from previous Sojour versions and from any new changes.

In addition work has now started on Sojour’s Calendar System V2. The intent is to add a concept of rolling entities to it. This will allow users to assign entities that naturally roll. Good examples are day names and moon phases!

I know this probably doesn’t make much sense right now, but it will when I release a tutorial video on completion.

In the meantime, if there is anything you want to see in Sojour’s calendars, now is the time to ask 🙂

Have Fun!

RobP

Sojour v1.2.34.0 has been released!

This is a minor release that I thought I’d get out of the door as the new drag and drop code makes for a much smoother user experience.

Changes for this release:

  • RPG-365 Enhancements to all drag and drop code. In the past, a drag would be initiated the moment the left mouse button went down on an object. This caused the UI to be a little squirrelly – especially in the treeview. One example where this this would manifest itself was when double clicking a treeview node only to have a partial drag and drop start – this was always a little disconcerting. In addition, Sojour used to need safety code to limit dragging actions on the map. This code had the occasional unwelcome side effect of making map tokens undraggable on the very first click – this issue was plain annoying. All of this has now gone away! The drag and drop code now follows Microsoft’s recommendations and all drag and drops should now perform smoothly, with no missed or unwanted drags!
  • RPG-366 Sojour’s user settings and preferences, which also include the directory you are using to play your games are now migrated across upgraded versions of Sojour. This should reduce the kerfuffle during upgrades!

That’s it for this one!

Have Fun!

RobP

Sojour v1.2.32.0 has been released!

This is a very minor enhancement release for the new filing system brought in during the last release.

Firstly, the initial dialog window that is displayed when Sojour is first run now includes a third option: ‘Cancel’:

This gives users the option of backing out completely and just closing Sojour.

Another enhancement is that the Manual and EULA pdfs are now installed under the Program Files directory rather than the Documents directory.

The manual is a large file. Moving it to Program Files means it no longer needs to be copied when moving Sojour around your system. Plus, only a single manual is required, rather than multiple copies, one per Sojour instance.

This change makes everything more efficient and removes a corner case where the manual button would sometimes fail after moving Sojour around.

The map toolbar buttons also have their statuses updated correctly after performing a file operation.

That’s it for this minor update!

Have Fun!

RobP

Sojour v1.2.28.0 has now been released – featuring a new File Manager!

Before I start with this post proper, I’ll just go over the results of a question I asked in my previous blog post:

“Would you prefer a slower release cycle – say once a month – to allow for more testing? Or do you prefer the current weekly cadence with an increased risk of bugs being introduced?”

Thank you all for your responses – it’s been much appreciated.

The result was that an overwhelming majority of you – 84% – wanted me to stay with the current release cycle.

To quote from one of the respondents:

“I like the current “Elon Musk like” fail forward releases. Your hard work is very much appreciated.”

This fills me with some relief, as one of the issues of being a lone software developer is the perpetual dread of dropping ‘that’ release that breaks everything.

Whilst the perpetual dread is probably a good thing, it’s good to know that my customers are allowing me some slack to occasionally drop the ball in the name of progress.

I know the results aren’t going to make everyone happy, but on the plus side, you could just skip a few releases. Sojour’s built in updaters are designed to automatically work from any prior version, so skipping releases will not present an issue – you will not miss out on anything!

Now back to the release!

v1.2.28.0 saw Sojour’s filing system getting a massive upgrade thanks to feedback from many customers.

In the past, you were stuck with having your data saved under Documents/PollySoft/Sojour.

Not any more! 🙂

Click for larger image!

If you closely examine the above screenshot you will notice that the status bar now shows where Sojour is accessing its data from! In this case I’m using some folders on my D:\ drive.

Sojour’s data can now be stored practically anywhere. Sojour will perform the relevant checks to see if it can access your chosen folder and if it can, that folder is in!

When you first start Sojour you will be presented with this screen (if it can’t find any data):

Most users will click ‘Yes‘ and have Sojour store its data in the usual place of Documents/Pollysoft/Sojour.

However, if this is not a suitable location, you can click ‘No‘ whereupon you are presented with this dialog window:

From here you can pick or create a folder for Sojour to use anywhere that your system can access!

But that’s not all….

Sojour now has a new File Manager:

Click to view a larger version!

This file manager lets you do many things! You can move your current data somewhere else, you can back up and restore data and you can even point Sojour to a different set of data files!

The latter would allow power users to have several sets of Sojour data and allow them to switch between them at will!

Alas, this was no easy feature to code, it took a lot of effort to implement:

22 code commits over 29 hours of coding! (each day is 8 hours)

The reason it took so long was in part, due to some poor initial design choices from my previous self! (As an aside, my previous self has a lot to answer for and if I could go back in time, I would be having some serious words with him! :p )

With the original design, I had encapsulated the ability for each object within Sojour to know where its data was stored. This was a good thing. However, I had coded this system to use rooted paths rather than relative paths. This was a really bad design choice as one cannot move data around with rooted paths!

Undoing the above and designing a new system that would work with both the old and new filing systems really pushed my brain into overdrive! But it’s now done and I think Sojour is all the better for it.

The new functionality is really flexible, so to that end I have produced a You-Tube video that will take you folks through some of the things the new filing system can do!

The full list of changes in this release is:

  • RPG-354 New enhanced file system, which adds a whole bunch of new features and additional flexibility to Sojour.
  • RPG-358 Tokens no longer show their health bars when dragged from or to a map that has them disabled.
  • RPG-363 A tentative code alteration that may alleviate occasional crashes when using the screenshot tool.

Have Fun!

RobP

Sojour just went Electrum! :)

Today is a major milestone for Sojour. It just earned DriveThruRPG’s Electrum badge for 251 sales.

I’d like to take this opportunity to thank each and every one of my customers for taking the plunge and joining Sojour on its onward journey!

Have Fun!

RobP

Sojour v1.2.15.0 has now been released!

This is a bug fix release and as usual is free to all customers.

The following issues were addressed in this release:

  • RPG-337 The treeview will now better remember its last state. It will now also focus on the last selected campaign and/or ruleset prior to shutdown. This should ensure that when you restart Sojour, you will always start in your last played ruleset/campaign.
  • RPG-348 Fixed a number of issues with regard to tokens from the token palette. Looks like these issues got introduced when the new drag and drop system was put in place two or three releases back. Issues fixed are: 1) Tokens that use dice expressions for their characteristics are now back to rolling their dice only once that token has been dropped onto the map. In addition, Sojour won’t re-roll them when Sojour has been restarted. 2) Tokens that have been rotated, now correctly show their rotation when dragged off map. 3) Dragged token health bars are now back to showing the actual health of the token (this never affected the token itself – just its dragged representation).
  • RPG-356 Fixed a PDF issue and upgraded the WebView2 component to the latest version. Sojour always tries to restore opened PDFs when you start it. However, minimized or maximized documents prior to shutdown could confuse Sojour when it tries to re-open these documents. This has now been fixed and Sojour now respects whether documents were maximized or minimized prior to shutdown and will now leave those documents in the appropriate state when restarted.

I have been putting my thinking cap on with regard to these bug fixes and have forwarded all my customers a question:

“Would you prefer a slower release cycle – say once a month – to allow for more testing? Or do you prefer the current weekly cadence with an increased risk of bugs being introduced?”

It’s a pretty important question as the answer will affect the way I work and how often you folks get new releases. I’ll go with whatever the consensus is and post the result here!

That said, I am expecting a new release this Sunday that will provide much more flexibility with regard to where Sojour saves its data. This should be the next release, unless any critical bugs are detected between now and then.

In the meantime…

Have Fun!

RobP

Sojour v1.2.12.0 Critical Hotfix has been released!

This is a hotfix that fixes the Map Scaling Wizard that got broken in v1.2.11.0. All users are urged to upgrade to this version.

In addition, the following story got addressed:

  • RPG-333 Vertex buffers, Index buffers and Textures are no longer initialised unless the map holding these models is loaded. This should speed up overall loading times and vastly reduce resource usage on startup.

(I discovered the map scaling wizard issue whilst working on the above story)

Apologies for the breakage.

Have Fun

RobP