Posts Tagged ‘jeu video’

First patch upcoming and a new gameplay video in the meanwhile.

Thanks to our first players for joining!

It’s a real pleasure to see you fight for the domination of the very first planet of Win That War! and to read your comments. They are already helping us improve the game.

Everything is not perfect yet, we know that, but the team is working on fixing the issues that has been reporting to us and the first patch will be out this Friday. This should fix the major problematic crashes, among other things.

If you haven’t joined the Galmactic Conquest yet, today is the last day to enjoy the -25% discount. Quick, grab your copy.

In the meanwhile, you can watch our new online campaign gameplay video, with the new GUI this time!

The conquest system in the MMO campaign

The MMO campaign in Win That War! consists in acquiring new planets on behalf of your mega-corporation. How does it work?

A planet is divided into several hundreds of territories, all randomly generated. Each of these territories can host up to 9 players – 3 from each mega-corporation – simultaneously.

GUI-ONLINE3

At the start of the game, the planet is entirely virgin, since it has just been discovered. The domination is made territory after territory.

The conquest of a territory is based on the score of the established mega-corporations. This score is calculated, among other things, according to the value of the buildings in the bases of its players. To claim a territory, a mega-corporation must achieve a minimum score. Thanks to a system of relay antennas, which limits the expansion of a player’s bases, it is very difficult to acquire a territory alone, so cooperation between players is highly recommended.

GUI-ONLINE3sans-epingle

When a territory is dominated by a mega-corporation, it takes its color in the planetary view. But it is still “contestable”.

When a territory dominated by a mega-corporation is entirely surrounded by other territories dominated by the same mega-corporation, it becomes a “locked” territory, and only the players belonging to that mega-corporation can access it. To collect resources, for example.

GUI-ONLINE3A

Finally, newly discovered planets will be exploitable for a limited time only. At the end of the allocated time, the Galactic Board, the highest body in Win That War!, will announce the victory of the mega-corporation owning the most territories on the planet.

Dynamical sound-design: the Artillery

For Win That War! we chose to work with the Wwise audio engine, which offers a greater autonomy to the sound designer.

Freed from technical constraints thanks to a tool such as Wwise, which brings a real flexibility of use and very intuitive tools for sound integration, all that remains is to be creative: recover the events of the game to play the sounds of the objects, of the atmosphere, the feedback, the music… and work the sound in its entirety to create a cohesion between all these sounds.

For this first article about Sound Design, we chose to talk about one unit in particular: the Artillery.
This is the 2nd part of the article about the Artillery animation, you can read it here.

artillery win that war

The Artillery is a vehicle which, in the game, plays several animations. To achieve the sound of the vehicle and stick to its animations, we divided it into five parts:

  1. Movement
  2. Artillery landing
  3. Cannon deployment
  4. Artillery shooting
  5. Artillery “take off”

 

Movement :

 

An engine sound is played when the vehicle is moving, two events allow the sound to start and stop.

These events are common to all of the vehicles of the game, they are linked to a switch in which the sounds of vehicles are located.

  • StartEngine
  • StopEngine

Wwise events

startenginemarque

The “StartEngine” event plays the “EngineSounds” switch. The “EngineSounds” Switch contains all the sounds of all the vehicles. These sounds are named exactly the same both in the switch and in the code of the game, playing the sound corresponding to the right vehicle.

stopenginemarque

The “StopEngine” event mutes the sound of the vehicle played in the “EngineSounds” switch. The selected line (dark gray) corresponds to the action performed by Wwise on the selected object.

Wwise sequence

artilleryloop-sequencewwisemarque

The “EngineSounds” switch on the main tab (and not the event tab) contains the vehicle movement sounds. By selecting the sequence of the Artillery, we enter the settings window.

 

Artillery landing:

At the very moment the vehicle sets into position on the ground, a sequence of sounds is played, triggered by a “code” event, which plays the sounds in Wwise.

This sequence consists in several sounds which are played one after the other, or overlap one another.

  • ArtilleryLand
  • ArtlleryLandRotation
  • ArtilleryDeploymentTurret

Wwise event

artillerylandmarque

The « ArtilleryLand » event plays the Artillery landing sequence.

Wwise sequence

artilleryland-sequencewwisemarque

This “Container sequence” contains the different sounds constituting the landing action of the vehicle. The playlist, at the bottom right, allows you to decide in which order the sounds of the sequence are played

 

 

Cannon deployment: 

 

Following the landing of the Artillery, the cannon deploys. This sequence is launched by an event:

  • AtilleryDeploymentCanon

Wwise event

artillerydeploymentmarque

The “ArtilleryDeployement” event plays the sound of the cannon deployment. When the order of deployment of the gun is launched, an order to stop the landing sequence “ArtlleryLand” is sent from the same event, at the same time.

Wwise sequence

artillerydeployment-sequencewwisemarque

 

 

Artillery shooting:

 

Then, the time has come to fire…

 

Always driven by an event, a sequence mixes the shooting sound with a “metallic” recoil sound, and another for ammo reloading.

  • ArtilleryShoot
  • ArtilleryShootCanon
  • ArtilleryRecharge

Wwise event

artilleryshootmarque

Wwise sequence

artilleryshoot-sequencewwisemarque

 

Artillery “Take Off”:

 

Once the target has been destroyed, or by order of the player, the vehicle must be moved. A sound is played when it leaves its state of siege.

  • ArtilleryTakeOff

Wwise event

artillerytakeoffmarque

Wwise sequence

artillerytakeoff-sequencewwisemarque

 

Each sound is created ahead, with an “audio sequencer” software, in which an animation video of the vehicle enables to tune the sounds to the image and to proceed to the editing of the recorded or collected sounds, as well as the processing. This creates a harmonious and credible mix (eq, filters, pitch, compression, reverb…)

Everythin is made as one piece, then cut to create several sounds. Then, these sounds are exported to Wwise and played in sequences as explained above.

In game, the different parts that make the final sound of the Artillery are played accordingly to the actions of the unit.

And this is how it looks and sounds in game, when you are playing:

 

Win That War! is on Steam Greenlight.

The Greenlight is now officially launched, and is only waiting for your votes!

We’re counting on you, not only to show your interest by offering us some green thumbs, but also to spread  the word of the Greenlight on your Steam community. Having Win That War! available on Steam is up to you now.

Unit balancing methodology

Game Designer saying: “when someone tells you that there is a problem in your design, 90% of the time he’s right. When he points out what you need to change to fix it, 90% of the time he’s wrong.”

In this first blog post about Game Design, we have chosen to focus on units balancing, a fundamental condition in real-time strategy game viability.
Balancing requires to identify with precision the cause and solution to a problem detected during a test session. Keep in mind that neither the cause nor the solution to a given problem are obvious, and the important thing is to always keep an overall view of the balance of the game when making an adjustment.

In order not to bring a disaster and make the game unplayable for a time, it’s important to keep some essential points in mind. Of course, since the following examples are directly taken from Win That War!, you’ll have to make some adjustments.

logo win that war

Balancing rules

  1. Always read the specs (specifications) of the units that are directly or indirectly related to a change. Remember the role of this unit in the strategic and economic balance of the game.
  2. There is always two sides to a deficiency or an excess in a stat (a parameter). Either the stats of this unit is too high, or the stat (of this unit or its opposite) which counterbalances it is too low. It’s essential to consider which side of the issue needs to be improved, all the while preserving the original intent of the gameplay dynamic and, above all, minimizing the imbalance caused on the game economy. Most of the time, this means picking the solution that would have the least possible impact on the rest of the system.
  3. Preserving the rewarding aspect of the use of an unit: its specificity, its imbalance in some particular situations (regulated and counterbalanced by other local imbalances in the other units’ stats and mechanics), its role in the economy and the possible strategy of a player, or rather the possible strategies.
  4. Finally, keeping an eye on the possible upcoming upgrades that would affect this unit: don’t nullify or OP-ify (Over-Power-ify. Don’t make it too strong) an upgrade when you affect a stat that might be subject to possible improvements for one of the factions. Some units are bound to be much more useful in a build of a particular faction. This is normal and advisable.

 

Case study – Units balancing in a RTS

Example: We find out that Bombers are way too weak compared to the AirKnocker, which devalues the use of surprise air-ground tactics and late game air-rush.

 

The question is: how to make this unit less efficient in this specific case, without going against the concept of use of this very unit, or any other one?

Here are some of the possible choices, as well as their impact on the game:

  • Changes such as improving the attack stats of the Bomber against the armor of the AirKnocker, making the Bomber harder to target or increasing the range of its bombs seem to be the best options at first sight, but would have a destabilizing impact on all air-ground fighting situations. These three options are then excluded.
  • Nerfing (reducing) the armor of the AirKnocker makes it more vulnerable to all ground units, which would be very frustrating since this unit is quite expensive and takes time to be produced. Moreover, this change would only take effect when the attacking player has a compo allowing him to reach AirKnockers through more powerful lines of units, which is the usual function of this unit. This means that the effective impact on the problem will be lower than the imbalance felt by the player as he watches his units get destroyed in one shot. That’s not a good idea, so this option is also excluded.
  • Increasing the price of the AirKnocker (as well as its required production time) to justify its power by its cost would make it a powerful and high-value unit to the player, which counterbalances its light armor and its visual appearance. Moreover, being the only anti-air specialized unit, it needs to be accessible, as beginner players would otherwise feel helpless when faced with air tactics. Well, we’ll exclude this one too.
  • Reducing the range or the fighting stats of the AirKnocker could be the solution, while keeping in mind the preservation of its specific role, its tactical viability and its difference compared with the use of anti-air turrets. A small change in several stats can subtly remove the problem by giving the unit a slightly awkward feeling. A medium or low cost unit shouldn’t have an “ace”, capable of anything kind of feeling, and making it less reactive while preserving its specialty is a very good option.

screenshot001

In most cases, (after a number of iterations), the existing balance of the stats of a given unit is correct and matches its role, and simultaneously scaling several stats by a small factor is enough to fix a defect or an excess of power.
As a general tip: Do not cancel what makes the unit special and fun, but rather work on related factors that reinforce its strengths and weaknesses while remaining consistent. Eg. making it easier or harder to use a feature.

In the case of the AirKnocker, the range, the acceleration and the tracking speed were the three main factors we had to tweak to solve its relation problem with the Bomber, while maintaining the overall balance.

Since we don’t want you to get bored with Game Design, we’ll keep the topic of economic balance for another blog post.

Switching Win That War! to the Entity-Component-System Pattern

This post describes the switch of our gameplay codebase from a class hierarchy to an architecture based on the Entity-Component-System pattern (ECS). It will first explain why we undertook this refactoring and then present the new ECS framework with which we are currently developing Win That War!. The description is accompanied by some code samples as this post is voluntarily geared towards readers who are curious about the technical details of such an implementation.

The old ways

The Win That War! team is growing and the scope of the game has evolved towards a richer design than originally planned. Concretely, this means that we now need to support new game mechanics as well as new units with some unanticipated characteristics.

Some months ago, at the core of Win That War!‘s code was your typical class hierarchy. A base GameObject implemented all the shared behavior. Additional sub-classing then progressively added new functionalities to create specialized types (Fig. 1). This was all fine and dandy, until our game designer got loose and imagined fancy units such as the Command Unit. Here is an excerpt from its specifications:

The command unit is both a building and a unit that materializes the player’s presence on the game map. The player’s buildings can only operate within the range of a Command Unit and its destruction triggers the player’s defeat.

In other words, this unit must be able to anchor itself on the ground, like a building, but also to take off in order to establish new bases on any other point of the map. Behold the first flaw of the class tree, the dreaded diamond: due to the tree-like nature of our architecture, we got to a point where it was impossible to share antagonist behaviors such as being both a static building and a mobile unit.

ecs-tree

Fig. 1 — Simplified representation of the initial architecture. The new Command Unit does not fit in this hierarchy.

At this point, we had two options. Option 1 was to go deeper into the rabbit hole and create a new subclass of GameObject (imagine a StaticButSometimesMobile class alongside Mobile and Static). Option 2 was to think ahead and switch to a more flexible architecture. Given the loads of other units and mechanics that are planned, it became obvious that we really needed to look at alternatives. After some consideration, we chose the Entity-Component-System pattern.

In the meantime, we settled for a quick hack: two versions of the Command Unit were coded, a mobile one and a static one, and we swapped them when landing/taking off. Let’s just say that we were only moderately satisfied with this approach. Some code had to be duplicated and having this very specific swapping logic for a single  type of unit did not sit well with us.

Composition over inheritance

The Entity-Component-System pattern is an alternative to the canonical class hierarchy. The three ingredient of the ECS recipe are:

  • Entities: the concrete instances of our game objects. For example, units, buildings, decor elements and cameras can all be entities. Conceptually, an entity can be seen as a bag of components.
  • Components: the pieces of data that represent specific aspects of the entity that they belong to. For example, position, physics parameters, 3D models and health could all be components. It is the aggregation of components that defines the nature of an entity. We call this set of components the entity’s composition. A strong characteristic of the ECS pattern is that components should only contain data and no logic.
  • Systems: the modules that govern the logic of specific parts of the game by manipulating related components (Fig. 2). For example, a Drawing system could examine the Position and Model components of entities in order to render them. A Physics system could examine Velocity components to mutate Position components. Another strong characteristic of the ECS pattern is that all the game logic should reside in systems and that systems are responsible for the interaction between components.
ecs-data-logic

Fig. 2 — Entities (Top) can be seen as “bags of components”. Systems (Bottom) update them. There is a clean separation between data and logic.

ECS is a component-based pattern with a strict separation of data and logic. The Unity game engine often comes into the discussion when speaking of components. However, the vanilla Unity approach is looser in its definition: a component (MonoBehaviour) contains both the data and the logic. Some libraries do provide an ECS layer for Unity, such as Entitas.

Here are the benefits that we expect from ECS:

  • Flexibility: it will be trivial to dynamically alter the nature of our entities. Want to temporarily buff a unit? Simply change the data in the appropriate component or swap it with another component altogether. Similarly, systems can be enabled/disabled at runtime, which is extremely useful to un-complexify the game for testing/debugging or to reproduce Minimal Working Examples.
  • Data-driven: because ECS is so strict about the separation of data and logic, we should naturally end up with a more data-oriented application. Hence, it will be more straightforward to deserialize our on-disk game data (authored by the game designer) into game entities. Similarly, it will be easier to sync this data over the network without resorting to an intermediary form.
While it was not the reason for this refactoring, ECS is also known to be performance-friendly because the underlying data structures are often layout in a way that corresponds to their processing. That is, same-type components that are processed sequentially by logic systems are contiguous in memory. Thus, the CPU cache is happy.

Practicalities

The new architecture had to mesh well with most of the code that was already in place. To this end, we designed the central data store for entities and components (the Entity Manager) to expose them in different forms to the “legacy” code and to the “new” code (which will reside in Systems).

The gist of it is that the legacy code uses stand-alone Entities with a similar API as the old stand-alone GameObjects. However, the new ECS systems leverage a more sophisticated approach in which they process views on entities that match certain compositions (each system has it own criteria).

Fig. 3 gives an overview of this architecture. Each part will be discussed in the following sections.

Fig 3 -- TODO

Fig 3 — Our ECS architecture. The game data is exposed to the “new” code and to the “legacy” code in different forms.

Components

We use an interface to mark a class as being a component. Notice that there is no internal references to the entity that owns the component. This is a voluntary design choice: not exposing the owner forbids indelicate programmers to access unrelated data (eg. myTransform.Owner.AnUnrelatedComponent). Even more importantly, not exposing the owner prevents to add any logic to the components that could mutate them from the inside, since their context of execution (the “neighbor components”) is unknown. The way in which logic systems do access this context in order to make components interact will be discussed in a further section.

EntityManager

The entity manager contains the meat of our implementation. It has the following roles:

  1. Managing the entities lifetime. Users have control over the creation and destruction of entities. On creation, an entity is given a unique ID by the manager. Under the hood, entities are stored in a map in which they are indexed by this ID.
  2. Composing entities. Users can create, destroy, and query components. Components are stored in a matrix-like structure where rows correspond to the various types of components, and columns correspond to entities. Querying component X of entity Y is a matter of looking at element (X, Y) in this map. Tab. 1 illustrates the kind of data that can be found inside the matrix if you were to inspect its content (this article provides a nice illustration of this layout).
  3. Categorizing entities with respect to their composition. The last job of the manager is to keep track of which entities match a set of user-defined compositions. In this way, logic systems can process only a subset of the existing entities and only consider components that are consistent with their work. This mechanics is detailed in the Logic Systems section.
Tab. 1 — The game data is stored in a matrix-like structure that associates component types and entity IDs. Rows correspond to component types. Columns correspond to individual entities. Changing the composition of an entity simply consists in filling its slots with other components.
ENTITIES
#1
(tank)
#2
(resource)
#3
(decor element)
#4
(factory)
COMPONENTS Transform
  • x: 0
  • y: 5
  • z: 1
  • x: 0
  • y: 0
  • z: 3
  • x: 0
  • y: 0
  • z: 5
  • x: 3
  • y: 10
  • z: 10
RigidBody
  • type: dynamic,
  • mass: 1000
  • type: static
  • type: static
Model
  • name: "tank"
  • name: "crystal"
  •  name: "tiny_rock"
  • name: "factory"
Weapon
  • effect: "laser"
  • dmg: "5"

This structure is a good illustration of the flexibility provided by ECS. It really favors experimentation and quick iteration because, once all our components are defined, we can design entities with novel behaviors in a pinch. For instance, it’s trivial to weaponize a factory (give a Weapon component to #4) or to make some decor elements interactive (switch the RigidBody of #2 from static to dynamic) so that players can play with them.

Entity

An IEntity instance exposes methods for mutating and inspecting a specific game entity. In practice, this interface is mostly used by legacy code that has not been converted to ECS. Because its usage closely resembles that of the previous architecture (a stand-alone GameObject held all the data of a single unit/building/game thingy), we kept a similar API, which significantly reduced the amount of code rewrite.

Manipulating entities is straightforward:

The concrete Entity class that we use acts as a facade for the EntityManager. It also adds a layer of cache in order to reduce queries for the most used components, plus game-related metadata that we had to keep for legacy reasons.

Logic Systems

The last part of the architecture deals with the logic systems that update the entities’ components and run the game simulation. Let’s start by looking at the type of code that we wanted to avoid writing:

We did not want to iterate blindly through all entities (there could be thousands), filtering them away with some predicate, only to process a fraction of them. Instead, we needed a way for each system to express which types of entities it is interested in ahead of time, so that it would only process those.

This mechanics is made possible by the formulation of compositions. A composition is a user-defined class with a number of fields of type IComponent, as well as a reference to an entity that possesses said components.

A composition instance, or node, can be seen as a view on an entity, exposing only components of interest. Their creation is handled by the entity manager who is already responsible for mutating the entities and thus provides the best place to also inspect them when a change in composition happens. Basically, for each existing composition type TComposition,  the manager has an internal collection CompositionNodes<TComposition> containing one node for each entity that matches TComposition (see code sample below).

The logic systems can access those node collections via the EntityManager.GetNodes<TComposition>() method that was seen previously. They can also subscribe to two events: OnNodeCreated(node) and OnNodeDestroyed(node). The collection raises OnNodeCreated when an entity matches the composition and it raises OnNodeRemoved when an entity does not match it anymore. In this way, systems do not need to consider an entity during its whole lifetime, but only when the entity’s composition is relevant to its work.

Here is an example of a physics system written with this strategy.

In this example, the system reacts to new entities having both a Transform and a RigidBody, and it manipulates nodes exposing only those two components. A benefit of this approach is that a programmer does not need to know the inner workings of our ECS implementation by heart to write new systems. The entity manager does all the bookkeeping by tracking which entities match which compositions, and systems just have to listen to the events that it raises.

This notion of expressing subsets of entities to work on can be found in other forms in established ECS libraries. For instance, Artemis-odb lets users formulate aspects and the Ash framework lets users define nodes in a way similar to ours.

Results

After spending several months coding gameplay within this new architecture based on ECS, some conclusions can be drawn.

  • Unavoidably, refactoring a sizable codebase such as Win That War!‘s was several week’s work. Switching to this new “philosophy” also required a bit of getting used to from everyone in the team. So, all in all, the move to ECS took a bite in our schedule. However, the promise of ECS is to make up for this lost time with greater speed and flexibility during the rest of the development. It seems that ECS is already paying dividends as we now iterate more quickly on new features.
  • We had to make some compromises during the switch to ECS and chose to convert specific parts of the codebase in priority. Some aspects of the game logic still adhere to the old ways of doing things and will probably not be updated due to lack of time. And this is fine, because these parts interface well with the Entity facade that we described. In any case, the code that has been converted — as well as new code — feels cleaner. It’s just simpler to write clear, explicit code, and a lot of complex use cases just seem to sort themselves out naturally.
  • Finally, the ECS favors isolation, which is precious for testing/debugging purposes. For instance, we obviously don’t want to pull all of the game rules in our unit tests and some game mechanics that would be constraining in this context (eg. the need to be close a relay for a unit to be active) can be trivially disabled by turning off the systems that handle them.
Screenshot of Win That War! with the components of several in-game entities

Fig. 4 — Some components actually used in Win That War! for different units.

To conclude, switching Win That War! to the Entity-Component-System pattern required a significative amount of work but we are already reaping some benefits. The gameplay code is more modular since various aspects of the game are now neatly decoupled from each other. Most importantly the game code feels clearer and gives us a better sense of control. For the curious, Fig. 4 shows a screenshot of Win That War! with some of the components that are actually used under the hood.

About this Command Unit trick that we had to resort to (the building version sneakily swapped for the mobile version): now we just give our unit a Building component when it lands. When the unit takes off, we replace the Building with a Motion component and all is well in the ECS world!

References

I love splines!

 

A curve

In Mathematics, a Spline is a numeric Function that is Piecewise-defined by Polynomial function, and which possesses a high degree of smoothness at the places where the polynomial pieces connect (which are known as knots)“. Thank you dear Wikipedia, I couldn’t have said it better myself.

“But, what link can there possibly be between Splines and Polygons?” you may ask yourself. And that’s a legitimate question, since I usually write about polygons and cake (made from polygons too).

Well, you have to know you can actually create 3D models by using these famous splines. That’s right!

A basic spline

As you may know, I mainly use 3DS Max to model my vehicles, buildings, etc. 3DS  taught me to use the word “spline” to define a 3D Bezier curve when it comes to design.

Actually, It’s a commonly used technique in automotive design. Seeing as I mostly model vehicles, it makes perfect sense for me to be working with curves.

However, I apologize in advance, because somehow, I have the feeling this post will feel like a tutorial.

The 3DS Max “Lathe” tool works just like an actual shaping tool and allows to easily sculpt an object  with a very smooth shape.
So, as an example, I’ve made a pretty bowl for you:

The process to use Lathe modifier.

I’ve got another little trick for you : You also can do what is called a “Sweep”. This is actually a  standard shape that you’ll select and with which you’ll “sweep” the previously drawn curve.  The shape is then multiplied to create the desired object.
Here is another example for you, and be prepared, I went a bit crazy and I’m now modeling…a mug!

The process to use Sweep modifier.

Anyway, now that you see how it works, let’s get serious and I’ll show you how you can apply it to your 3D modeling.

Once, in my student days, I was looking for a tool to model by using Splines, and I finally found a tool called SURFACE. At the beginning, Surface was a third party plugin, then Kinetix eventually bought the licence and included the tool in 3DS Max 3.0. I don’t know who this third-party is, but I owe him a big “thanks”.

Digging through my archives, I found the following model. That’s what it looked like the first time I tried to use this tool, based on three pieces of circles intersecting with each other.

The use of a Surface modifier

How did the software turn this into that? I don’t have a clue. Voodoo magic?
Well, and so… how do you put this technique into practice? Among other things, you can  use these tricks to model a vehicle. An airplane, for example.

Use of spline in modeling

It can also be used for specific organic creations.
Like for this wonderful purple…marshmallow.
I could probably have made something sexier, but you get the idea.

Chantilly

In short, I love modeling using Splines . The tool “Surface modifier ” is probably my favorite, it’s part of the workflow for all my vehicles .

I also think it’s a good starting point to model an object with a lot of rounded surfaces .

However , be aware that Splines, alone, are difficult to comprehend in 3D for our poor humanoid eyes that can’t decide whether a form is curved or hollow. So we will have to get used to the tool and rotate around your model, regularly move the camera angle to visualize the form , and then use the Surface modifier.

If you’re not using this technique already, I can only recommend you try it asap!

Cheers

Philemon

New year, new team, new trailer

Ok, I admit this title is not the most original I could find.
But, you know, the video is speaking for itself:

 

 

Putting aside logos and the lost territories map made from hexagons, everything you see in this video was captured in-game. As you may have noticed, there is a lot of changes concerning the Sound Design. Hey, we told you there was a reason for Jpeg hurting his car.

Next week, the post will be proposed by Philemon, so you can guess it will be a bit artistic one!

Utopiales and Art to Play: November fairs

Putting aside our recent penchant for recruitment and furnitures assembly, we are still (yes, we do!) collecting all your feedbacks to improve the game. And game fairs, show, conventions are the best for us. Really, it’s amazing to meet you all, watch your reactions while you’re playing WinThatWar! and talk about it with you. And, in November, we were kinda lucky since we were present at the Utopiales and Art to Play, both of these fairs taking place in Nantes.

Just like last year, the Utopiales public was really… young. Anyway, he also was very enthusiastic, and from the beginning of the afternoon, the kids were just there, staying at our stand, helping out and teaching the new comers how to play WinThatWar! That was really great for us to see the youngers able to understand the game and how to play it. Sometimes, at the expense of the elders! Hold on, don’t get mad, “elders”, we know most of you will become some really badass strategists as soon as the game will offer more features and options.

Utopiales Insane Unity

We neither regret the Art to Play weekend. At the contrary! You were so many to stop by our stand, 14yo young women to 60yo grown men, testing the game and tormenting us with your countless and unusual questions (Actually we love that, it makes us look deeper into the game mechanics, so please don’t stop!), and also encouraging us. Well, we won’t lie, this weekend was exhausting (like really, it killed us. 5 days later we’re sleeping on the tables at the studio. I barely exaggerate, promise) but still, it was really rewarding. We wrote a lot of your feedbacks and ideas on our notepads. Plus, that was a good opportunity to see if you’d like the tokens/strategy icons, as it was a brand new feature in the game. Unless I’m mistaken, i think you liked it, and the map general view have seduced many (mini-map “are so 2014” anyway.).

In short, if we should summarize those 2 weekends:

  • The younger are the players, the rougher they play. They just spend their time building turrets.
  • We can easily welcome 13 players at the same time on our stand, even if it’s only 2 computers.
  • Trying to give some explanations about our game when Matthieu Sommet (SLG – a french famous youtuber) or Ganglion (J-rock band) are standing on the stage, about 10 meters far from you, can be a quite difficult excercise. That’s why we just gave up our vocal cords there.

Art to Play Insane Unity

Again, thank you to every single player who came to these conventions.

Procedural generation & P2P

Network, network aaaand network… yeah, I’m working on multi over Internet mod for some months now. But here it is, today I decided to take a rest and write a post about the backstage, for you!


p2p

RTS & Lock-stepping

In a multiplayer game, we use the network to synchronize the world’s state on all the computers. Every player has then the same representation of the map than the others. Following the example of all known RTS,  WinThatWar! network layer is based on an algorithm called lock-stepping.

The classical approach (in FPS for instance), is to synchronize the internal representation of every items of the game by relaying, via the network, the changes bring to the other players. In a RTS, we can get to hundreds, even thousands of items to synchronize at the same time. So, you would probably understand that’s not possible to send, 5 time a second, the exact location of every unit of the map to every player in the game. However, even the most frenzied korean Starcrafter doesn’t exceed more than 5 commands by second, so that’s 300 APM (actions per minute)… Ok that’s not so bad.

To simplify, the lock-stepping will “cut” the game in 200ms turns. During that turn, we’ll record all the controls of the player: selection, moving orders, attack orders… At the end of the turn, theses controls will be send to all the other players while you’re waiting for their own. After a period of time, all the players finally get the list of  all the controls for this turn. This list is delivered to the game-logic (AI, Gfx, etc.) that will execute them (the controls). Then, the next turn begins. If the game-logic is determinist, which means it will always get to the same result for a given list of controls, the World state is exactly the same for every player. It’s called “Synchronous simulations”.

In facts, that’s a bit more complicated: we mask the network latency by simulating a n -1 turn, so we give time to the next turn controls to arrive before the end of the current turn simulation. Are you still following me? Anyway, in the case of games over Internet, we just make sure that these turns length of time vary depending on the players’ computers and network capacities.

This paper, wrote by Age of Empires creators, describe this principle very well.

At the end, the network part is quite simple. The true difficulty resides in the game-logic determinism. For a given list of controls, all the computers have to end in the exact same result.

Procedural generator & GPU

In the case of WTW, we chose to use procedural generation to produce our maps. We’ve actually got a tool that allows us to define varied maps styles, then our generator is able to create an infinity of variants of them. Well, we have to confess that’s still a bit experimental now, but we’re working on it!

For the sake of performance, the maps relief (heightmap) is generated by the graphics card with the help of Pixel Shader, at the very beginning of the match. That’s quick, and efficient.

Problem is there’s still some negligible differences between what results of two graphics cards made by a different constructor or so. Usually, it really is a tiny variation, in the range of 10e -5 or 10e -6 maybe (0,00.001 and 0,000.001 if you prefer). But here it is, that causes troubles in the synchronous simulations. For example, at Player 1’s, a tank could perfectly shoot the target, but at Player 2’s, the tank seems a bit upper on the map, and it can’t shoot. In short, that’s not synchronous anymore. And we do not like it this way.

P2P transfer & ECC

I the way to fix this problem, in LAN mode, the host was sending his own heightmap to all the player. This way, we ensured there was no display difference. But we can’t use this method  concerning the multiplayer over Internet mode. Our largest maps heightmaps is around 400Ko heavy. In the case of a 8 players game, the host would have to transfer 7x400Ko of data, knowing our Network technology is P2P based, and if, like me, you didn’t have choice and subscribed to an ADSL which don’t allow you to upload more than 100ko/s… it would take you 28 seconds just to transfer the map. And we all now, here, how these seconds can seem lengthy when you wait a game to be launch.

So, this is roughly how it works at Insane Unity: If 8 players join the game, the map is “cut” in 8 parts, and every player send his own eighth to the 7 others. So one player will upload only 350Ko (7x50Ko), which means 3.5s sending time.

Actually, the map is “cut” to be as efficient as possible for the processor cache, but in any case, it doesn’t change anything of the 8 parts things, since every player will send more or less the same volume of data.

Engine

The heightmap in Yellow, the cutting in Red.

But wait for it… that’s not the best!

I think that ECC (Error Correction Codes) are one of the most magical thing of informatics. The principle is to use an abstruse mathematical process: For one data bloc, a “parity” bloc is reckoned. The whole (data + parity) is relayed, then through a second abstruse process, we can firstly check that none of the data are damaged, and then fix the potential errors. Reed-Solomon codes (RS) might be the most used: CD, DVD, Blu-Ray… it even works when it’s scratched. And, if as mine, your ADSL is a 2,5km long interferences antenna, I think you might be happy that your residential gateway or router fix some of the errors.

reed_solomon_code_word

RS bloc coding, n = total weight, k = playload (useful data), and 2t = parity. Through a 2t parity, you can fix up to t errors.

Well, let’s get back to our map. The heightmaps are almost the same for all the players. So, I’m using the RS to calculate a parity bloc, and that’s what players are exchanging through the Network. Then everyone can apply the error correction, and that’s how all the players will finally can have a perfectly identical map. Oh yeah, I almost forgot, parity bloc is obviously smaller than data bloc but you probably noticed that already. In our case, it’s RS(223,255), being 32 octets parity and 223 octets of data. Let me do the calculation for you: Now, the players just have to upload  50Ko each thanks to this method, which means an half a second transfer.  And that’s what we like!

So, that’s my daily life at Insane Unity. Hope you enjoyed this post.

Doom

Return top