Neuer Wochenbericht (16.05.14) - Challenge and saga of Zombie Pathfinding

  • Neuer Wochenbericht (16.05.14)
    Challenge and saga of Zombie Pathfinding


    This devblog will be focused on describing the progress with one of our biggest issues: Zombie Pathfinding.


    Development Priorities and Pace


    Our major focus has been on establishing the architecture, both in the team and in the game, in order to deliver best in the future. This involved us drastically increasing the size of the team working on the game. This had a severe short-term impact on our progress as our existing team had to devote time and resources to training and planning. The new zombie pathfinding is a good example of this approach beginning to produce results.


    Some examples of future major changes coming as a result of this new focus:



      [li]Entirely new rendering system (allowing potential upgrades to DX10 or DX11, ports as well).[/li]
      [li]True multithreading / multicore for servers and possibly clients.[/li]
      [li]Completely new animal AI that mirrors an actual animals behaviors.[/li]
      [li]Redeveloped “action” system, replacing the mouse-wheel scroll action system.[/li]
      [li]Complete refactoring of the inventory system. While not a big change for users, possibly allows some more advanced systems to be implemented and better performance and less bugs.[/li]


    Background


    Zombies have proven to be one of the most difficult to develop components of the game. When we were developing the game we realized that in the time we had, we would need to work within the parameters of the AI already in the engine. In the engine, AI is calculated on a “per agent” basis, with some caching for things like targets (shared target info, etc…). In the mod, this was dropped in favor of calculating visibility and target info on a “per player” approach. This meant that zombies in the mod were simply pawns, activated by players moving around.


    In addition to behavior problems we also experienced problems with pathfinding and collision for the AI. We were getting the engine to do things that it was never designed to do, especially regarding interiors of buildings. We attempted to refactor these solutions to accommodate our changes but, as can be seen by playing the current build, they fell short of our expectations. In the end we decided it would be easier to develop a new approach from scratch.


    The Challenge


    There are many exciting solutions available for pathfinding, it’s fairly standard fare in the video gaming industry. Our problem was not unique, but our situation was: our world is very big yet it requires the same precision as a small one.


    The team devoted to solving this decided to use navigation meshes. The serious problem it presented, though, was how to generate these meshes, with nearly 2 million objects on the map doing it by hand would not be an option. So a method was devised to split the world up into grids, and then raycast at a precise interval and generate chunks of navmesh. This is all done during the packing process and “baked” out into data that can be read by the server and client. This uses the wonderful approaches outlined in the open source navmesh project Recast and Detour.


    The Results


    I spoke to Martin Slavkov, programmer behind the solution, to help me outline the result with some screenshots.


    [img width=700 height=425]http://i.imgur.com/dmGCZ1y.png[/img]


    More Pics: http://imgur.com/a/dHsSZ


    A small program was developed to read through the world, load all the objects, and then work its way through tracing billions of lines to calculate the ability to move. This then works out not only where outside you can walk, but inside as well. It gives great precision while still working for a very large scale world both indoor and outdoor. Having a unified solution for pathfinding makes implementation much easier.


    Use in-game All Pics: http://imgur.com/a/4QV8K


    The engine is then able to load the chunks in as it needs. It does use some memory (around 600mb extra, maximum), but it only loads the chunks it needs. However as we are moving to 64-bit on the server side, this reduces any potential issues with memory.


    [img width=500 height=296]http://media.tumblr.com/5328f1…ine_n5o6snNeSi1rq1exu.png[/img]


    Performance optimizations can be very significant. Currently the team are working on parallelizing the AI pathfinding function so it can operate on a separate core. With all new functionality we are developing in this way, unfortunately that means that it can take longer for us to develop but the results for performance can be massive.


    Previously two different systems were used for navigating AI. The exterior one handled navigation around static and dynamic objects, and an internal “path” system was used for building interiors. This involved artists defining paths that AI could follow. We had to drop this interior method because of the massive performance issues with large numbers of agents.


    [img width=500 height=299]http://media.tumblr.com/9626e2…ine_n5o9qdDV8z1rq1exu.png[/img]


    In the screenshot above, you can see a path between two red points. Because the system is now unified it means that more efficient (and more natural) pathfinding solutions are available to the AI, at a fraction of the performance cost as before.


    [img width=700 height=355]http://i.imgur.com/1LDFAdm.jpg[/img]


    I’m happy to report on the loads of content which will soon hit experimental servers. Recently the Prague and Bratislava studios had our first meet and greet so I was able to get a first hand look at all of the ongoing work by the artists and animators on our new animals. We have a basic implementation of prototype animals that will be swapped out by our Bratislava artist’s work which is looking incredible!


    [img width=700 height=437]http://i.imgur.com/rEKQkXQ.jpg[/img]


    Improvised fishing tackle and a carp were created, which players will be able to catch in ponds. We have also created some filet models which you will eventually be able to cook. This will all add up to be a literal game-changer. Speaking of animals - we also met Big - the office pet tortoise in Bratislava. Hm, that gives me an idea…


    [img width=669 height=1908]http://i.imgur.com/RkKyCB6.jpg[/img]


    Our character artist is further expanding with the addition of a new large-capacity police vest to go along with our ОMON-inspired Орёл uniform. We have also started working on EMT, Firefighter, and finalizing the Gorka uniforms.


    Fireplaces, Hunting, And being a lumberjack!


    We pulled fireplaces and hunting from the previous update in their state at the time, we felt they would hinder gameplay not enhance it. The extra time has been spent improving gameplay aspects and also identifying how we can better support it.


    The build to experimental will show the basic structure of how this will work. Chopping wood from trees now gives logs, and after a certain time, the trees will be “expended” and fall over. Tree cutting is done by holding an axe in your hands, and using the mouse-wheel action menu. This is a prime example of why we want to remove the mouse-wheel action system. Instead of this, we envision you simply hitting the tree with the axe and being rewarded with wood - but that is for the future.


    Fireplaces can be upgraded with stones, which are recovered from the ground around rocky areas or by hitting rocks with a pick-axe. Fireplaces can be crafted by making a “fireplace kit” out of items such as rags and kindling. Kindling is recovered by searching the forest floor for sticks. All these scavenging aspects need more refinement as part of a new action system, but they’re exciting changes that will pave the way for more complex systems such as horticulture.


    Bratislava Team Visit. All Pics: http://imgur.com/a/P3ZzK


    [img width=700 height=525]http://i.imgur.com/zRJpnCK.jpg[/img]


    The next update


    Our current targets have us putting out builds to stable once a month, a huge inspiration for approach we aspire to is Prison Architect who do this very well. We have no set timeframe for experimental releases, these are done to assist us with preparing for stable releases.


    Above all else, it’s vital that people appreciate several things:


      [li]Different tasks take different amounts of time[/li]
      [li]Priorities for tasks are built around what is needed based on dependencies, not what is most needed to satisfy the game design[/li]
      [li]Scheduled builds are targets, not absolutes. We will delay and postpone builds where we are not confident in their status.[/li]
      [li]Devblogs are no longer scheduled weekly, and are done as often as we can to provide background for our progress.[/li]


    The Final Word


    This is an extremely exciting time for us all as we come out of two months of very aggressive growth. We’ve expanded the team a great deal, taking a huge risk in doing so. That risk is paying off, and we’re excited to see the massive impact that the pathfinding and collision changes will have on the DayZ experience.


    Quelle: dayzdev.tumblr.com

    Die, Bart, Die

    Einmal editiert, zuletzt von Urs ()

  • Vielen Dank an unserem Partner DayZWorld.de für die deutsche Übersetzung:[img width=500 height=100]http://dayzworld.de/news/logo_bright.png[/img]


    Die Herausforderung der Zombie-Wegfindung


    Dieser Eintrag beschreibt den Prozess eines der aktuell größten Probleme: Die Wegfindung der Zombies.


    Das Entwicklungstempo und dessen Prioritäten


    Diesen Monat haben wir uns darauf konzentriert eine bessere Struktur im Team und im Spiel zu schaffen, um in Zukunft gute Arbeit liefern zu können. Das zwang uns dazu die Größe des Teams nochmals zu vergrößern. Im Verlauf dessen musste ein neuer Plan aufgestellt und unser neues Personal eingearbeitet werden, was uns einiges an Zeit kostete. Die neue Zombie-Wegfindung dient dabei als gutes Beispiel um zu zeigen wie dadurch schnellere Resultate erzielt werden können.


    Einige Beispiele zukünftiger Änderungen:


      [li]neues Berechnungssystem (ermöglicht die Nutzung von DirectX10 und 11)[/li]
      [li]echtes "Multithreading/Multicore" für Server und möglicherweise auch für Benutzer[/li]
      [li]eine komplett neue KI (künstliche Intelligenz) welche das Verhalten der Tiere besser widerspiegeln soll[/li]
      [li]Neuentwicklung des "mouse-whell action system" (der Möglichkeit verschiedene Interaktionen mit dem Mausrad auszuüben)[/li]
      [li]Neuentwicklung des Inventarsystems (nicht visuell)[/li]


    Der Hintergrund


    Zombies haben sich als eine der schwersten Komponenten des Spieles im Bezug auf die Entwicklung des Spiels herausgestellt. In der Engine wird die KI auf "per agent" (serverseitig) Basis berechnet, wobei Ziele bzw. Zielinformationen zwischengespeichert werden. In der Mod hingegen wurden die Sichtbarkeit und Zielinformation mit einer "per player" (clientseitig) berechnet. Somit waren Zombies einfache Schachfiguren die von den herumlaufenden Spielern "aktiviert" wurden.


    Als wir erkannten, dass wir die Engine haben Dinge machen lassen wofür sie eigentlich gar nicht geeignet war (speziell hinsichtlich von Innenräumen), haben wir versucht die Lösungen dafür zu überarbeiten. Wie man jedoch an der aktuellen Version sehen kann, haben wir dies leider nicht geschafft. Schlussendlich haben wir beschlossen nochmal von Grund auf neu anzufangen.


    Die Herausforderung


    In der Videospiele-Industrie ist die Programmierung der Wegfindung ein Standardprozess. Unser Problem war nicht einzigartig, aber unsere Situation war es: Unsere Welt ist sehr groß, braucht jedoch die gleiche Exaktheit wie eine kleine.


    Das Team hat abgestimmt und entschieden, dass die "navigation meshes" (Navigationsnetze) eingesetzt werden sollen. Das Problem war: Wie sollte man Navigationsnetze auf über 2 Millionen Gegenstände legen? Uns war klar, dass wir das nicht per Hand machen konnten. Also haben wir uns überlegt ein Raster über die Welt zu legen und diese somit in kleinere Bereiche zu teilen. Im Anschluss wurden Einheiten (chunks) in präzisen Intervallen berechnet und generiert.


    Das Ergebnis


    Ich sprach mit Martin Slavkov, einem Programmierer, um das Ergebnis mit Screenshots etwas klarer darstellen zu können.
    Bildergalerie


    [img width=700 height=425]http://i.imgur.com/XbiroAE.png[/img]


    Ein kleines Programm wurde entwickelt um die Welt zu lesen, die Gegenstände zu laden und die möglichen Bewegungen zu berechnen. Dieser Prozess funktioniert außerhalb sowie innerhalb von Gebäuden.
    Bildergalerie


    Die Engine ist in der Lage die Bereiche (Chunks) zu laden wenn sie gebraucht bzw. benutzt werden. Das verbraucht in etwa 600MB RAM extra, was durch die 64-Bit Server jedoch kein Problem darstellen wird.


    [img width=500 height=296]http://media.tumblr.com/5328f1…ine_n5o6snNeSi1rq1exu.png[/img]


    Aktuell arbeitet das Team daran, die Berechnung der Wegfindung auf einen eigenen Prozessorkern zu verlagern um die Performance zu optimieren. Mit den neuen Funktionalitäten, mit denen wir die Wegfindung entwickeln kann es leider zu Verzögerungen kommen, welche die Performance jedoch positiv beeinflussen werden.


    [img width=500 height=299]http://media.tumblr.com/9626e2…ine_n5o9qdDV8z1rq1exu.png[/img]


    Vom Abteilungsleiter des Bereichs Design, Chris Torchia
    Bildergalerie


    Kürzlich hatten das Studio in Prag und das in Bratislava ihr erstes "meet and greet". Dadurch hatten wir die Möglichkeit uns persönlich von den Entwicklungen dort zu überzeugen. Wir haben einen einfachen Tier-Prototyp welcher jetzt schon großartig aussieht.


    [img width=700 height=437]http://i.imgur.com/rEKQkXQ.jpg[/img]


    Improvisierte Fischerausrüstung, mit welcher sich ein Karpfen in diversen Teichen fangen lässt, existiert auch bereits. Wir haben ebenfalls ein Filet-Model erstellt, welches man eventuell kochen können wird.


    [img width=500 height=391]http://media.tumblr.com/4cedbf…ine_n5obamMACn1rq1exu.jpg[/img]


    Unser Charakter-Designer hat ebenfalls eine neue Weste designed, welche mehr Plätze hat als die bisherigen. Zusätzlich haben wir bereits damit angefangen Kleidung für Rettungsassistenten, Feuerwehrmänner und GORKA zu erstellen.


    Feuerstellen, Jagen und der Holzfäller


    Da wir bedenken bezüglich der Feuerstellen und dem Jagen hatten, haben wir beides nicht in das letzte Update mit eingebunden. Die zusätzliche Zeit haben wir jedoch genutzt um uns Gedanken drüber zu machen wie wir das Spielgefühl in diesem Bereich verbessern können.


    Das Update für die experimental Server wird eine erste Übersicht über diese Features geben. Durch das hacken von Bäumen kann der Spieler Feuerholz bekommen. Und nach einer bestimmten Zeit kann der Baum auch umfallen. Um einen Baum zu fällen muss man eine Axt in die Hand nehmen und mit dem Mausrad die richtige Aktion auswählen. Zukünftig möchten wir dies jedoch anders lösen und dem Spieler ermöglichen durch einfaches drauf hauen den Baum zu fällen. Damit würde die Option mit dem Mausrad wegfallen.


    Feuerstellen können mit Steinen, welche in der Nähe von Felsen oder durch die Nutzung der Spitzhacke gefunden werden können, erweitert werden. Feuerstellen können erstellt werden indem man ein "Feuerstellen Kit" crafted, welches aus Lumpen (Rags) und Zündholz gemacht werden kann.
    All diese Neuerungen brauchen als Teil des neuen "action systems" noch gewisse Verfeinerungen.


    Der Besuch in Bratislava
    Bildergalerie


    [img width=500 height=375]http://media.tumblr.com/c11289…ine_n5oauglkkD1rq1exu.jpg[/img]


    Updates


    Die Veröffentlichungen von Updates für die experimental Version helfen uns bei den Vorbereitungen für die stable Version.
    Grundsätzlich solltet ihr jedoch folgendes bedenken:



      [li]Verschiedene Aufgaben, brauchen unterschiedlich viel Zeit[/li]
      [li]Die Priorität von Aufgaben wird nach ihrer Abhängigkeit und nicht nach Design Kriterien verteilt[/li]
      [li]Wenn wir mit dem Zustand eines Features nicht zufrieden sind, werden wir die Veröffentlichung verschieben oder verzögern[/li]
      [li]DevBlogs kommen nicht mehr wöchentlich[/li]


    Quelle: http://dayzworld.de

    Die, Bart, Die

    Einmal editiert, zuletzt von Urs ()

  • Die interessantesten Bilder hier nochmal gezeigt:


    [img width=700 height=437]http://i.imgur.com/dhm8niA.jpg[/img]


    [img width=700 height=437]http://i.imgur.com/I4KN98k.jpg[/img]


    [img width=700 height=437]http://i.imgur.com/noxiEgD.jpg[/img]


    [img width=700 height=437]http://i.imgur.com/TxS0P8Y.jpg[/img]


    [img width=700 height=437]http://i.imgur.com/XxPbbJ4.jpg[/img]


    [img width=700 height=384]http://i.imgur.com/IAxgtHj.jpg[/img]


    [img width=700 height=467]http://i.imgur.com/HS5NeBW.jpg[/img]


    [img width=700 height=437]http://i.imgur.com/bWD53z7.jpg[/img]


    [img width=700 height=437]http://i.imgur.com/vvkYMT0.jpg[/img]


    [img width=700 height=437]http://i.imgur.com/ES8GdLD.jpg[/img]


    [img width=700 height=437]http://i.imgur.com/PQYbOQ0.jpg[/img]


    [img width=700 height=437]http://i.imgur.com/cn5UESE.jpg[/img]


    Pathfinding exterior
    [img width=700 height=415]http://i.imgur.com/psScWD9.jpg[/img]
    The red dots indicate the start and end points of the path solution. Note that the generated navmesh correctly navigates around all world objects (such as fences).


    Pathfinding over multiple levels
    [img width=700 height=417]http://i.imgur.com/Zux7OsV.jpg[/img]
    Note the red pathfinding line that indicates a path has correctly been discovered to the next level.


    Pathfinding exterior
    [img width=700 height=420]http://i.imgur.com/4z1tTdT.jpg[/img]
    The navmesh covers all types of terrain and all objects


    Pathfinding for interiors
    [img width=700 height=416]http://i.imgur.com/iEzSZ53.jpg[/img]
    Note that navigation mesh is included for interiors. In this screenshot, the proxy objects (furniture) has not been included in the nav mesh check, but this is planned for the future.


    High precision over large distances
    [img width=700 height=418]http://i.imgur.com/1d4WjOg.jpg[/img]
    Note there is some "Z-fighting" in this screenshot, but it shows how a chunk of the navmesh looks when lined up with a small village.


    Pathfinding into buildings
    [img width=700 height=420]http://i.imgur.com/Pqu6oX4.jpg[/img]
    The red line indicates the chosen path.


    Complex navmesh
    [img width=700 height=414]http://i.imgur.com/igGpDPT.jpg[/img]
    Even very complex objects have their navmesh generated


    [img width=700 height=525]http://i.imgur.com/6VIi7gP.jpg[/img]