HUD redesign – work in progress

So I’ve been working on the Knights Province HUD redesign lately. It is a two-fold endeavor – design and programming. Here’s how it goes:

Some terminology first – typically, HUD is a short for the Heads-Up Display – GUI elements that pop up over the “world” view, showing some general information and/or the selected objects info. Here and below I will be specifically referring to the in-game object’s HUD that appears when an object gets selected (a house, a unit, a tree, etc).

So basically I’m quite content with the current blocky HUD. It was always planned to be a temp solution. Something that can be slapped together and work. Grey at first, recently it got nicer with colored background textures and subtle shadows, but still – it is a temporary solution. It serves its purpose of being a “sketch/prototype” very well. I’m glad to have it functional and would like to keep it that way. However changes are due.

What was the push for the change? Fences and sheep!

Looking at other games (specifically Age of Empires) I always liked the idea of being able to select every major object and trees to see its info. Now with fences it is doubly important to be able to select them and view their details (e.g. player ownership).

HUD design and coding is one part of the endeavor. Object picking in-game is another one. Suffice to say – it took some noticeable amount of time and effort, but now it seems object picking is working rather well and is future-proof (with improvements already queued).

Back to the HUD topic though. Being able to select more kinds of objects meant that the HUD needed to be updated to show the new objects in a pleasant way, or, even better – redesigned! Being so used to the existing design I would not be able to radically change it without taking a long break from the game development and coding, so I have had to hire a freelance artist to help. Just_bu stepped in. Below are just some of the sketches (ideas) she has made:

You may notice they have an odd style and gamma – this is intentional. On this stage we were generating UX/UI layout sketches. Seeing what needs to go together and what can be moved. Checking out the balance between form and size.

Unfortunately, Just_bu had to move on to a higher priority project some days ago. Now I’m posting the vacancy description once again, hoping to get a new pair of hands on the case. Important to say – Patreon donations helped to cover the costs. Big thank you, patrons!

After running some research and seeing different UI ideas, I saw that Knights Province UI tended to gravitate towards certain structural layouts. Being reasonably sure about that, now I’m starting to update the game engine too. Refactoring old “rigid” forms into more flexible “modular” design. Here are some modules I have isolated as example in the old UI:

And after some extensive research I was able to create the following table, that covers most of the in-game entities and the HUDs they need (a fragment):

It contains the entities (rows) and modules they need (columns). Pretty straight-forward. With just minor complications arising from allied/enemy states and cross-module dependencies. No road-blocks though – just a lot to code and refactor! xD

One of the bigger and nicer HUD elements I wanted to cover in more detail is an object’s avatar. It is going to be a central piece of the new HUD. I’ve chosen to reuse the in-game 3D model for it (instead of hand-drawn graphics), to speed up and ease up the development. The model gets rendered into its own texture and post-processed with a nice glow effect.

Avatar being rendered into its own texture with glow and antialiasing is somewhat performance costly, but I’m hoping to optimize that later on, when it becomes accepted (cos who knows, maybe new UX artists will bring in superior HUD ideas that do not involve avatars).

Here’s another wip example – Store HUD getting “modular” overhaul – wares module is now common between it and the Camp, Fort and Barracks (all houses with “a lot of wares” stored inside):

Objects HUD redesign is a “soft-ball” of sorts. If it goes well I plan to redesign other in-game GUI elements (minimap, build menu, etc.) later on (maybe in Alpha 13). Main menu redesign is lower priority (think Alpha 14 or later).

Once the big HUD overhaul/refactoring is stabilized I will be able to release new Alpha 12 wip build (with beta sheep and better fences and waterfalls and other nice features). So, armed with that, work goes on!

P.S. And as always, I’m happy to read your comments and discuss on Discord 🙂

Posted in Live progress | 15 Comments

Short 2020 overview

2020 is nearing its end. Thank you everyone for following the project!

What about code?

2020 in commits

What about gameplay?

2020 in highscores

Happy New 2021 Year! Let’s hope it will be a much better one! 🙂

Posted in News | 3 Comments

Alpha 11.3 update

Here’s a third minor update with a bunch of bugfixes and small improvements:

  • Fixed a crash when ordering to attack an already demolished house under FOW
  • Minor naming changes (lance > pike, pike > halberd, house > building)
  • Smooth scrolling for lists
  • Fixed a bug when a keypress would leak from reassignment of a hotkey into a players name editbox in Options menu
  • Fixed crash on loading a savegame with fences being built or attacked
  • Fixed small memory leak on hotkeys resave
  • Fixed harmless junk text getting written into settings on hotkeys resave
  • Fixed crash on reopening Highscores after GFX reinit

Knights Province Alpha 11.3 (installer)

Knights Province Alpha 11.3 (7z package)
Posted in Downloads | 16 Comments

Alpha 11.2 update

Here’s a second minor update with lots of bugfixes and small improvements:

  • Fixed stone stockpile placement after house get demolished
  • Fixed error on loading a savegame with a dead group assigned onto a quickselect (Ctrl+0..9)
  • Fixed a couple of minor memory leaks
  • Changed “erase” to “remove” in various MapEd menus
  • Don’t list the horses in the map maker when selecting the resource for wagons #283
  • Messages with buttons should allow for no glyphs #282
  • Fixed mines placement locations visible behind the FOW #270
  • Fixed a bug when Save/Load of the mission unlocks every profession in the school #267
  • Added script action UnitUnlock, like the HouseUnlock #279
  • Fixed a bug when Stonecutter was unable to mine the stone from map corners #281
  • Possibly fixed error on game start when GetDocumentsPath was returning extra slash on the end
  • Calls to Action.(House/Group/Unit)OwnerChange if the new owner is the same as old one will be logged and ignored
  • Fixed stockpiles “auto (collect)” behavior (it was reversed) #266
  • Fixed error in saving a mission from MapEd with default human hand preceded by empty hands
  • Lasso selection should expand a bit when made close to map edge #278
  • MapEd places units under rotated camp wrongly (when applying skirmish) #272
  • Fixed ability to queue the last (5th) unit in the School #280
  • Updated list of patrons in Credits
  • Allowed for grain on snowground25% terrain [#284]
  • Added some snowground25% terrain to Winter Stand to equal out the starting locations
  • Improved KT panel layout a bit
  • Fixed dust puffs locations offset after canceling a house plan (also responsible for crash if they were to be spawned outside of the map bounds)
  • Fixed crash on unchecking Skirmish setup options in MapEd
  • Adding faulty savegame into the crashreport in case a crash occurs
  • Fixed crash on scanning or loading a map with empty script file
  • Fixed CRC calculation being 1-off
  • Implemented undo history depth in MapEd (default 512) [#286]
  • Slightly improved GUI of Records\Global layout
  • Added points assigned for each place into highscores (will be filled once KT is updated)
  • Renamed “Rank” into “Place” in highscores
Knights Province Alpha 11.2 (installer)

Knights Province Alpha 11.2 (7z package)
Posted in Downloads, News | 6 Comments

New maps

Alpha 11.1 was released just recently, yet it already has 4 new maps for download (https://discord.gg/3fsaFAj) and a mapmaking tutorial by Wychor:

Posted in News, Video | 7 Comments

Alpha 11.1 update

Following initial release, here’s a minor update with several fixes and improvements:

  • Fixed bug with hotkeys assignment when Ctrl key was pressed and released before assigning a key with another Ctrl key
  • Ported the rest of FXAA 3.11 implementation (better AA)
  • Reordered render init and error messages
  • Wrapped log creation error into a human-readable message
  • Removed unnecessary settings resave on game init
  • Made hotkey UI buttons wider to fit Russian captions
  • Improved pathfinding efficiency by ~35%
  • Changed unit-house damage formula from “AverageDamage/2” to “AverageDamage/1.5*Morale” (Militia will hit weaker, Knights will hit stronger)
  • Reduced time it takes to make a savegame by ~30%
  • Fixed black shadows in Store house construction site
  • Tweaked and minorily improved some house models
Knights Province Alpha 11.1 (installer)

Knights Province Alpha 11.1 (7z package)
Posted in Downloads, News, Uncategorized | 4 Comments

Alpha 11 is here!

It is the most worked-on version of the Knights Province yet (except for Alpha 1, of course). Last release was 7255 and this one is 9043. Almost 1750 bits of changes and improvements went into it.

Main features of the new version are:

  • Manned towers. Now each tower can be manned with 1-3 warriors who will pick up bows inside and shoot from atop at the enemy. Warriors will request food to be brought in by Serf when hungry, otherwise they will stop “working” and walk out, just like citizens do. It is yet unclear how warriors specialization will affect his performance in the tower, or if warriors inside could take a fraction of damage from enemy archers. At the moment, all warriors shoot with the same strength, distance and frequency and stay 100% protected inside.
  • Buildable fences. Now you can build and destroy your own fences (and enemy fences too, of course). Fences cost wood to build and block passage for citizens. Warriors can break fences on their way with several blows. So far it is quite a weak obstacle, but with more playtesting that can change. In the future fences are also planned to be used for cattle.
  • Real Fog of War. From now you can see only what you have surveyed. This is how fog behaves in the majority of the games. Implementation was quite tricky, but the end result is well worth it.
  • Early stages of multiplayer accounts. Registration and mission highscores allow you to compete with other single-player players. More on that is covered in the previous article.
  • New and updated campaign missions. Campaign scripting and persistent script storage between missions, customizable icons and maps. Now allows for more varied custom campaigns. Check updated tutorial, Intro and Hostages missions.
  • Added Russian localization as a test of a text translation engine. More localizations can be made later on.
  • Configurable shortcuts/hotkeys are finally here as well. Almost everything is configurable and Ctrl+Alt+Shift are supported as well.
  • Restyled fish count calculation and display in water bodies. Now it is smooth and informative.

Smaller features are:

  • Return of the fraction of building materials on house destruction. Nice bonus or last chance at building a Stonecutter’s – you decide.
  • Revised and improved several house models and textures.
  • Finally added some leather background to in-game forms. It’s still a work in progress though.
  • Added cinematics and speech bubbles support in missions.
  • Allowed to make terrain highlights (invoked from script).
  • Decal and Objects palettes for the MapEd. As well a couple of new objects.
  • Added support for Buttons in dynamic script messages. Your choice can now directly affect mission flow.
  • Changed how coalmaker’s house works, now the coalpiles need to be set outside.
  • Made AI to attack animal dens.
  • A lot of effort went into refactoring alliances. Neutral hands. Players instantiation and mission setup.
  • Reiterated and improved AI in Skirmish (GDP +17%, Starvation -30%).
  • A whole lot of bugfixes and improvements.
  • New music by Juan (Dark Banners, Harvest, Over the Hills).
  • Campaign Builder tool is included with the game now.
Knights Province Alpha 11 (installer) Knights Province Alpha 11 (7z package)

Join the Discord server for discussions and feedback – https://discord.gg/ZGrgC6G

Thanks to everyone who helped and supported the development with feedback, testing, ideas and suggestions, critics, mapmaking and everything else!

Posted in Downloads, News | 1 Comment

Substance Designer purchase

Thanks to monthly support from my patrons on Patreon I was able to purchase Substance Designer!

SD is a tool for procedural texture generation. Those nice shingles, wooden beams, plaster and whitewashed walls, grass and lava. Guess what, instead of painting by hand, all those textures can be generated from noise and simple functions!

So I was looking for shingles textures online again. Shingled roofs are so common in the game and they make the most screen area after terrain. Finding suitable textures (free or not) to use in the game is not easy. Every time it’s either a different scale, too low-res, watermarked, has unclear copyright, etc. So when I found another bunch of neat textures I noticed they were not hand-painted, but procedurally generated. That made me think, if those nice textures are a product of an algorithm, surely I can tweak and repeat that algorithm to get the exact result I’m looking for.

Procedural texture generation is not uncommon to me. In my 3D editing app (Lightwave 3D) there’s a procedural texture generation subsystem. It is rather clunky though, for its main goal is to produce 3D volume materials and affect the render pipeline rather than create flat surfaces. Still it’s the same idea in its core – take small pieces and interconnect them into a more complex system (just like you take houses and build towns in Knights Province).

Procedural texture generation captured my mind a long time ago, but until recently I have not met a good working example. Earlier this year I tried another texture generator – Material Maker. It’s free and open-source, it has a great variety of elements and nodes, but trying to create anything more complex than a simple brick wall texture with mortar has put its performance to its knees. It took seconds to refresh even 256×256 nodes ..

So here comes the SD. I first tried it on trial and made myself a deal – if I can create 2 decent textures in it with reasonable effort – I’m buying it, cos that’s gonna be break even with ordering the same textures from freelancers or painting them myself. After two days of tests I was convinced – albeit textures creation is a tricky and complicated job, SD as a tool offers a very good interface and instruments of doing it. I was able to get acquaintanced with SD UI and toolset in a day and after exploring some examples (included with SD and available online) to craft a decent shingles texture for the Fisherman’s house. Soon followed by wood planks texture. The purchase was made.

Having such control over textures allows me to bring my vision into the game much better.

So far the plan seems to be:
 – generate most common and prominent textures (roofs, walls, wooden beams)
 – roughly UV map them to the existing 3D models
– later on, improve the models and do the proper mapping

Posted in Artwork, How things work, Screenshots, Tools | 4 Comments

Player scores

Knights Province has got one more neat feature provided by the Knights Tavern – Player Scores!
Now you can compare your single-player skills with other players.

Scores are calculated by the following formula:

  • Each mission has a ranking mode (min time, max time, best score)
  • Each mission also has a scoring multiplier (some missions give out only 50% of the points and some 200%. Percentage is configurable in KT depending on the missions difficulty)
  • Some missions are excluded from the scoring (e.g. “Alpha 1”, since it is a development mission, not a real one. “Town Tutorial” is also excluded, since it’s very easy to “win”)
  • For each mission a player has played his place is identified
  • Points awarding system is then applied. It is made after Formula 1, but with a bias towards first 3 places. Places get the following number of points: 10, 10, 10, 8, 6, 5, 4, 3, 2, 1. 

The system is not final, but for now it produces rather good results.

The system is not final, but for now it produces rather good results. As usual, test version (r9018) can be downloaded and tried out from Discord (https://discord.gg/cEwJFSY). With that change I’m hoping Alpha 11 is ready to be released in a week or so.

Posted in Sidenotes | 2 Comments

Players list

Alpha 11 release is coming soon and I’m not adding any big changes to the game to not cause any new bugs. I’m getting less and less crashreports, which is a good sign of version becoming stable.

To keep myself busy and get some distraction from bugfixes, I’m also working on smaller side-features (those that don’t affect the game at large). One of such features is a Players List:

Player list is important to have for many upcoming features of the KnightsTavern. E.g. when the game allows for private messaging or sending MP room invites, and many more.

Posted in Live progress, Sidenotes | 4 Comments