the decal system part 2

You missed the part 1? Keep calm and click here.

Long distance decals

The problem with the artillery in the game is that you don’t have a clear idea of its possibilities. For example, you’d like to park it behind a mountain and target the enemy base, forcing him to bypass the relief and loose a precious time. However, since it is impossible to have the base and your artillery in the same screen, you cannot know how your artillery would react to such an order. In fact, if not at range, it will move right into the enemy base and be destroyed. The point is, when you start thinking strategically and not just a-clicking the enemy, you need critical information, such as the range of a unit.

Now technically, how should we do it ? We could make a decal from a texture, as we did with the selection circle, but that would be a really large area, mostly empty, so it may not be the best option. What we can do, is using the GPU to render vector art on the screen. I’ll explain it later, but if you want to know more about it you can check this chapter from GPU Gems 3 :

But, what is a vector art?

The most common way to consider an image on a computer is basically with a table of colours. When you create an image you have to define its size, which is the number of pixels it contains, and each one of these pixels will have a colour. So all you have to write in the file are the colours of the pixels in the right order, and the GPU will be able to print the image whenever you need it. However, this induces a small problem when it comes to scaling the image.

Picture yourself in a FPS, and in front of you is a brick wall. You are a few meters away from the wall, and can admire the beautiful brick texture the graphic designer created. However, as you get closer, this texture takes a bigger part of your screen, since it is larger, in pixels, than its original size. At this point the details of the texture are less accurate since the colour of a pixel is extended to 5 or 6 adjacent pixels. We could increase the size of the texture, but then the file would be two times bigger, and we want to avoid a heavy file that will take longer to load.


The classic way to overcome this difficulty is vector art, used in the svg format that we need for large decals, such as ranges. The idea is to save a description of the image that doesn’t depend on its size in pixels. To do that we rather consider the curves that form the image, as “paths”. Each path is a command, a set of points, plus a colour and various options about fill, or stroke, or whatever you need, defined in the svg standard. But it will be easier with an example.

Please, draw me a triangle

Let’s make a simple triangle : all we have to do is draw three lines, with each end being the beginning of the next one. For instance,

M 0 0 L 0 100 L 100 0 Z.

This is what a path looks like, a set of letters that are commands to indicate a certain shape to draw. The numbers after it are the coordinates that describe this shape. M means “Move” the current point to this position. It represents the start of the shape, as if it was the position of a virtual mouse. Here we position this cursor in (0,0). L is the command for “Lineto”, that draws a line from the current point to the arguments. At this point we drew a line from (0,0) to (0,100) then from (0,100) to (100,0). Z is the command that closes the shape, by drawing a line to the start point. In this example the line joins (100,0) and (0,0).


We now have a triangle between the points (0,0), (0,100) and (100,0). We can add options like “fill: black” if we want to fill the shape in black, but basically that is how svg files work.

This way, we can always adapt the shape to how large our image appears on the screen, and then avoid the problem of resolution, but of course complex images can induce a lot of paths, so it is better to save it for something schematic, with only simple shapes.

Other commands (Q, C, A) are used to draw the Bezier curves that we will need for the large decals, and are a little more complex, as you will see in the next part. Yes, there will be a part 3! Wait for it.

Mineral 1 – Sharp Crystal

I won’t write a novel on this blog today, I swear.
We just wanted to show you this new modeled version of the Sharp Crystal.
Mineral PatchUntil now, the Crystal you could have seen in game was kind of a “test” model, allowing you to play the game while waiting for this new one.
The Sharp Crystal is a common ore. It’s the basic element for construction.

It’s really simple. For now, in WinThatWar! you just have to take care of the level of two resources. The first one is the Energy, created through generators, and the second one is the Sharp Crystal you have to extract through… well, through an extractor.

We chose as reference a particular ore : Ilmenite. A titanium and iron oxyde mineral.

ilmenite ilmenite
The hexagonal shapes are used to represent strengh and solidity. We hope it works!
We tried to make it very raw/unrefined, as it’s mean to be the most basic resource of the game. But at the same time we wanted it a bit sharp.

When it came to color it, we thought it needed to be Surreal, so the purple was perfect.
We really want the player (a.k.a you) to desire to find and extract this kind of cake made of Crystal.

Top View
It’s not really a retro-future style element, as you may have noticed, but I think it contrasts nicely with the retro-futurism style of the buildings, as the extractor, for example:

Extractor plus Mineral Patch

Hope you could find some on a distant planet. I think you could find it useful.


The blueprints system

“So you want our beautiful vehicles? You want to build and deploy them on still unknown and unexplored planets? Thanks to our Blueprints, you will be able to do all this.”
Wilmuth Trueman, CEO of Robotron Industry during the IWC (Interstellar War Conference)

Well that’s a quick recap but that’s the idea (But, in his defense, he had to do quick and catchy given the stakes of this conference). Don’t worry, we are going to explain you every little details you have to know about these much talked about blueprints.

But what is this blueprint thing?

Basically, blueprints are just plans which allow your factories to build the units you will have to deploy on the battlefield. On this precious piece of paper is written everything your factories will need to know: what they have to put where and which resources they’ll need to build it (It’s ok, you don’t have to care about it, your factories will do it by themselves).


But I rather warn you right now, at Robotron Industry they’re not really charitable. You will have to pay for your Blueprints, and let me tell you it will be expansive! In addition, these big industrialists have found the perfect trick for these blueprints, and to keep going richer and richer: They limited the number of uses! But fortunately for you, you will be able to buy contract extension for your favourites blueprint. Aren’t they sweet?

How will it be helpful to you? Oh really, you still don’t understand what is happening here? Well, don’t expect Robotron Industry to sell you anything else than the “basic” form of their precious blueprints at the beginning. Yes this means that you won’t have definitives versions of the blueprint when you buy it. You’ll be able to upgrade your vehicles but sadly you will have to pay even more if you want to have the more powerful units in the game. Yes: PAY, again and again! Son of a…of a defective rusty robots! Wait. It’s ok, isn’t it? You already knew we wouldn’t provide you plans to build mass destruction arms at the same price as a scout plan anyhow.

Don’t worry, Robotron industry have well planned all of this, the price of the upgrades you’ll add to your units will be scaled to their strength. And you can’t say that they don’t have a conscientiousness because if they sold you fully upgraded blueprints you won’t be able to construct the corresponding units anyway, because you would probably be lacking of needed resources. See? Eventually big industrialists are nice to you, they care about you, and your base (and your wallet of course).

Well let’s talk more about this famous upgrade system. So your basic units will be upgradables by two different ways: you can choose to specialize them in their primary role, or you can choose to add this unit another role which it is usually not able to fulfil.

Let’s imagine your tanks: You’re probably using them every day but you are a bit sceptical about their destruction abilities? You can transform them into really bulky ones with better armour-plating and bigger cannon in order to inflict more damages!

Or if you are more an adept of precision strike and fast attack, you could choose to upgrade to a tank that will be faster than ever, with a better radar range and with which you’ll be able to plan recognition.

Don’t forget Michel


Ah, I almost forgot! If it can make you feel better, you need to know that the Cartels you are working for will nicely provide you your first blueprints… well, not exactly. Actually, they will lend you some money so you can buy them (the blueprints, not the Cartels!). Which means that you have to think deeply on what you’re going to spend their money. Because let’s confess it would be awesome to have a laaarge amount of fighting units, but if you’ve got no engineer to build the factories which will be used to build your units, you won’t be able to build this army and we agree that would be a shame. So, please, choose wisely. Will you do that for me ?

Well, well, well. I think you know everything you have to know about these magnificent blueprints supplied by the marvellous Robotron Industry and I hope you will buy lots of them so you could crush your enemies and bring peace (’cause of course, you’re the good guy) into the whole galaxy and fortune to your Cartels.

Ah! And for the few sceptical in the back: No I don’t earn any from the sells of blueprints.

Hæternal (trainee @ Insane Unity)

The decal system

A World without UI

Let’s imagine a RTS game where you’d play without an HUD, or even without a proper UI, just by clicking around with your mouse and learning by heart dozens of shortcuts. Pretty annoying, right ? You couldn’t tell how healthy is your army, assuming that you managed to create it, without a hint of which building is selected, and no construction menu. Think about all the stuffs you would miss.

That’s right, efficiently printing information on the screen is one of the main challenges in making a strategy game, and precisely the point I am actively working on. But let’s start with the beginning, before taking a look at what will come for you in the next releases. A lot of UI elements are already implemented in the game, like the tracking of the actions you programmed, by printing little circles on the floor, but how does it work ?

The decal system

Well those little indicators are called decals, and are wildly used in the large variety of games, from heraldry on a knight’s armor to a GPS arrow on the floor. The technique is inspired by real-life decalcomania, which is basically the art of printing a 2D image on a 3D surface, by pressing it and copying it on a support. What we want to do here is exactly the same, applying a texture on the terrain, but we have to do this in the most efficient way possible, since there can be a lot of decals, and they are refreshed every frame. (hint : we use the GPU for that).

Giving the example of the selection decal, let’s take a look at what we have to work with :

→ A texture of the pattern we want to print: cercle

→ The depth-map, giving the height of the terrain for every pixel on the screen: depthmap

→ The position where we want our decal to be, and the color we want it to have

Life is like a box of pixels

Now we are only a few steps away from the best UI ever.

First, we create a box around the given position, large enough to contain the full decal. To make this simple, we give it the maximum height of the terrain, and the size of our texture. This aims to reduce the number of pixels the shader will compute, since everything outside the box will simply get discarded.

Then, the challenge is to detect which part of the box is intersecting with the terrain, to know where to apply the texture. We do this by casting rays from the camera (in blue in the drawing) to every pixel of the box visible by the camera. There are three possible results:

  1. the ray enters and gets out of the box, intersecting the terrain after the box (top ray)
  2. the ray enters and doesn’t get out, intersecting the terrain (mid ray)
  3. the ray doesn’t even enter the box, intersecting the terrain before the box (bottom ray)


Thanks to the depth map, we get the surface we want by the rays in the second case, and we can get the corresponding texture coordinates by projection.

However, the technique is not perfect, and we still compute a lot of pixels for nothing. The box is almost always way too big since we take the maximum height of the terrain. Actually, we consider a box, independently of the shape of the decals, which brings us to draw a lot of useless pixels. In the case of the selection decal, only the circle is used, so 80 % of the texture is transparent. With small decals it is not a problem, since drawing a small number of superfluous points has no impact on the performance, but when it comes to very large shape, such as printing the range of an artillery for example, we have to think another way.

An other problem is that the decal is relying on an input texture that is static. But we could need something computed dynamically from the game state, like an influence zone drawn by the whole army.

So yes, there are a lot of complications ahead, but don’t worry, you will hear from all of this very soon, in a future article.


Space Needle

Space Needle

Hello, folks

Today, let me present the air factory to you.

Thanks to it,  you’ll soon be able to produce all the air units you always dreamed about… well at least the ones we designed for the game (sorry to all of you that were already imagining themselves flying the Millennium Falcon, it’s not planned on our Blueprints list).

But let’s get back to the factory itself : I was inspired by the Space Needle, a huge tower located in Seattle. But also by the Hesperia Tower, an hotel on the top of which we can see a beautiful retro-future dome. Have a look here: Click-me.

early concept of the air factorySecond concept of the retrofuture air factory

We wanted this building to look like an airport combined to a shed, that’s why it’s equipped with a control tower. Just in case the non-existing-tiny-little-planes-makers would like to call back a defective serial number…

Well, I warn you, this is still work in progress.

About tools: we use Marmoset Toolbag to preview the model and materials. So it’s not  very representative of the final in-game model. We will do our utmost to visually approach this rendering.Air Factory standby model


Lights on: working factoryAir Factory working mode


I’m still not sure about the dome…

We don’t have emissive effect (also called glow) in our engine yet but we will work on it. It’s an unavoidable feature anyway!

The next step will be to add some more details to the model: antenna, vents, and maybe a dynamic windsock using physics, too.

Don’t hesitate to tell me what do you think of it. What could be better in your opinion. I’m right here, keeping my ears open just for you.

Hope you enjoyed this post!


A new website appears


This week, we’ll just make do with a small announcement.
No big technology related blathering nor plenty of beautiful pictures today, but we promise to get back to that very soon.

Win That War! website grand opening!, we announce you that WinThatWar! website is now online. Universe, Roadmap, Team…some pages will need to be reworked later, so we could provide you more details about the game’s background little by little.

support devblog

Meanwhile, we hide a little surprise for you on the website. That’s not so much complicated to find, so you don’t need to train your 6th sense before visiting !

Have a nice weekend, under the sun or in front of your computer, as you prefer.

About RTS engine determinism

Hi everyone!

This week I’ll write about a topic which may seems a little bit austere, but truth is that it can easily become quite fun: testing

How to test a game?

When we talk about test, it may refer to several things. In the case of WinThatWar!, we distinguish three test levels:

  • unit test
  • integration test
  • test in real conditions

Test in real conditions

Let’s start with the last one, it’s the simplest: the best way to test a game is obviously to play it. It allows you (and me also) to find out unexpected issues, not only bugs, but problem of use as well (ergonomy, feeling, gameplay possibilities…)
When you’re coding a game, you can’t stop telling yourself that you really need to improve it and you forget to play it “seriously”. That’s why, at Insane Unity, we schedule regular test sessions of WTW, that we intensified when the release is about to come out.

The problem is, after a while, we know the game really well, we play the same way again and again by force of habit, and because of that we’re becoming unable to hit the broad side of a barn. That’s why we are constantly looking for new users. Newbies allow us to easily find out ergonomy issues and to make a game which will really be easy to play. Talented RTS gamers allow us to estimate how hard to master is the game, and they bring out balancing issues and the efficiency level of the interface.

Once again, I take this opportunity to thank you all, all the alpha-testers. If you weren’t there to help us improving the game, WinThatWar! would be of a much lower quality than it is today. That’s your game too!



Unit test

Unit test responds to a very simple problem: not to go round and round in circles everytime you’re coding something, undoing what was already working.

Before comitting any change in the code, the developer have to execute tests that will check if every module’s basic fonctionnalities work well. For example, some path-finding tests check that two groups of units can cross without striking each other, some others exist to check that our maths library’s convertion functions produce the expected result, etc.

Generally speaking, a unit test is written BEFORE coding the function it will satisfy. It’s called TDD.  This is one of the fundamental practices of agile development. Unit tests are very useful to “re-factorize” the code, in other words to deeply overhaul it without changing its functionality, in order to get it ready for the add of a new feature, or to make it simpler and less subject to bugs.

If a dev ever commit a change that “broke” one of these tests (called regression), he received an e-mail from our buddy Tim (that’s the name of our integration server) that gently insults him, and keeps doing so as long as the problem isn’t solved.


Integration test

Finally, the integration test takes place between the two other kind of tests I just wrote about. While unit test limits itself to test a module, integration test consists, as the name suggests, on making all the modules working together.

At Insane Unity, that means make 4 AI playing in 2vs.2 every night. Here again, Tim is in charge. Forward, we’ll check that we meet the expected balancing (for example, that AI lvl 5 always beat AI lvl3 in less that 10min.) But, for now, we’re using these tests for two things:

  • check there is no crash during the game
  • make sure our simulation is desterminist


RTS engine determinism

Determinism, WTH is that? Once again IT engineer gibberish…actullay a program is called determinist if it provides the same result every time it’s launch with the same starting conditions. It may sounds a bit “dumb”, but that’s not that simple. When you launch a program twice in a row on a modern computer, that’s never exactly the same starting state. So, if you ask your computer to do several things at the same time, it can choses, on its own, to launch the tasks in a different order every single time.

So what? Is that really a serious problem? Yes! When two players launch a RTS game, the world state isn’t sent by the network: it would take too long. Instead, we just send every player’s commands. Starting with exactly the same initial situation, and if we apply the exact same order, at the very same time, every players actions, we manage to keep exactly the same state, the same “reality” on every device.
But here it is, if one of the computer choses to execute the operations in a different order, the reality of every player will start to split, and that where the troubles start.

The first  versions of WinThatWar! were massively using parallelism to take part of the molticore modern processors. We quickly realised theses kinds of optimizations didn’t get on well with the network mode of the game. If you want to explore further, you can read this excellent article about Age Of Empire.

So, from now on, everytime we use multithreading, we have to make sure the operations order have no impact on the final result. And how to be really sure about that? Of course, we asking Tim for help! I told you that Tim plays WinThatWar! every night, at a rate of ten per night. That’s not all: it plays every game twice in a row, starting from the same seed and checking that every step of the world simulation is exactly in the same situation during both of the two games.

From now on, if you test a LAN pre-version of WinThatWar! with some of your mates, and if you suffer a crash, be curious and go get the log.txt file to watch it’s written on it. Now, you should know what that “Simulation out of sync!” message means. 😉


STUNFEST 2015, a little more indies?


Back from the Stunfest

We missed you on that blog. Have you missed us?

As we told you on our social media or Newsletter, we knew that during the two past weeks we would be a bit busy getting ready for the Stunfest.

bannière stunfest

If you don’t know what Stunfest is, it’s THE video game festival in Brittany. 11 years ago, it was just about some fighting games holic meeting in a garage to share their passion. Now, more than 10.000 gamers and visitors are coming from the four corners of the World, and hundreds of players challenge themselves during fighting games tournaments. In 11 years, the Stunfest open itself to new vistas: musical games, retrogaming, concerts, conferences, speedruns and, of course, indie games!

Win That War, Stunfest, Insane Unity, RTS, strategy, Michel, video games, test, festival

Insane Unity team, after setting up.

That were you’d find us. Before we left the studio, we checked that everything was ok, no-one and nothing was missed, we turned off the computers and we were ready to set the stand up on thursday night. There is even more space than last year especially booked for indie devs. 35  indies were expected this year: that was a good opportunity for us to meet some familiar faces and to discover new games and new devs.

3 days of WinThatWar!

Friday morning, 9h30, the gates would be opened 30 minutes later. That was the right time to check one last time that everything was working the way we were expecting. We brought 2 computers, so the gamers could challenge their mates in 1vs1 game. The hosts also lent us a third computer that we used as a demo screen. Ok, we were ready. “Release the gamers!”

And that’s an awesome start for us: the first players came to our stand and started to test WinThatWar!, and some others, that already knew the game, were here to see how it’s progressing.

Win That War, Stunfest, Insane Unity, RTS, strategy, Michel, video games, test, festival Win That War, Stunfest, Insane Unity, RTS, strategy, Michel, video games, test, festival
Win That War, Stunfest, Insane Unity, RTS, strategy, Michel, video games, test, festival Win That War, Stunfest, Insane Unity, RTS, strategy, Michel, video games, test, festival

The most timid ones were getting in the fight against our AI level 1,  we had time to explain them the basics so they could play on their own after that. Some others came by with their buddies to challenge them, and finally the most audacious ones faced our AI lvl 5 to gave it a good beating. 5 of them survived, the others were brave…until the end.

In addition of beautiful meetings with gamers and indie devs, we also had the chance to discuss about our game’s concept and its evolutions to come with some other professionals from the amazing world of video games : columnists, editors, streamers and even Llewellys, big boss of Millenium, who was kind enough to come to our stand to meet us after we king of “grabbed” him on twitter. Oops!

Win That War, Stunfest, Insane Unity, RTS, strategy, Michel, video games, test, festival, llewelys, millenium

Llewellys with Etham, Insane Unity CEO

We sincerly thank all of those who have been testing our game during these 3 amazing days of Stunfest, thank you for all your supports, thank you for all your feedbacks, your ideas which will help us to improve WinThatWar! again and again. Your advices mean a lot to us.

Win That War, Stunfest, Insane Unity, RTS, strategy, Michel, video games, test, festival Win That War, Stunfest, Insane Unity, RTS, strategy, Michel, video games, test, festival Win That War, Stunfest, Insane Unity, RTS, strategy, Michel, video games, test, festival

It is no secret that this weekend was exhausting, but we’re already impatient and hope to be a part of the next edition, or to meet you on some other fairs/conventions. See you soon?

More pictures on Facebook.

Insane Unity team, still a bit jet-lagged.

Alpha 0.3 is available

Less conversation today, let’s go to the essential!
As you might already know, because you read this blog every week or you’re following us on our social medias, Win That War! evolved during the last monthes.
Air-units, generator, a new network stack, the pathfinding optimization… You have been flooded by illustrations and technical terms during weeks.

But finally, here it is! Win That War! Alpha 0.3 is now freely downloadable on IndieDb.

If you’ve got any issue downloading by this website, just let us know. We are currently waiting for some other download platforms to validate our game. So, we will send you the download link as soon as it will be available.


If you played Alpha 0.2, here is a quick overview of what was modified/is new (You can read the full version of this release note on our IndieDB  game’s page)

  • Some events added : under attack & destroyed units, resources shortage
  • Use middle click to open radial menu and enqueue mode for mimic and attack-position
  • Air and aniti-air units place holders have been added you can now use them. So can the AI, so be careful.
  • By the way, you can now choose between 5 difficulty levels when you’re playing against AI.
  • Tank-traps and artillery have also been integrated.
  • And about network, we switched to our new stack.

If you have any questions or suggestions concerning the game, please feel free to send us a message or write a comment, we’ll respond to each demand.

Have a nice weekend!

PS: In the case you can’t find the hidden links in this post, here is the Download link : ALPHA 0.3


You wanted it, you dreamed of it.
Well, maybe you didn’t… Anyway we did dreamed that you could test WinThatWar! without being driven to despair, no matter if you are a RTS-holic or not.

That’s why we (most Kevin) concocted a little cheat sheet for you, so you could play Win That War! with total peace of mind.


Of course, some of these shortcuts may still undergo some changes in the coming months . But for now , you can refer to it to test the Alpha 0.3 which will be released in a few days .
Don’t hesitate to leave a comment to tell us what you think about these shortcuts. Is it ok for you? Or are some of them not suitable?

To be informed of future releases before anybody else, don’t forget to sign up here: Beta test program

Have a nice weekend.

Return top