Jump to content
Site Stability Read more... ×
  • Advertisement

The Great Tribes Devblog #33




Hello dears! And happy new year's holidays!

It's been over a month since the last development diary. I have to say that I wanted to post a diary before, but faced with a intractable problem, which spent a lot of time. But all in order.

According to the development plan, the first contact with AI was implemented:


At the bottom of the screenshot you can see messages about crossing the army control zones with another army and the city. Now we had to develop an interface element that would display the event data:


This screenshot in the upper left corner shows the implementation of UILabel with the ability to transfer text by words. An important element of the interface that is useful in the future. In the lower right corner, above the end of the course is now visible various messages, hover the mouse over them POPs up a hint (also a new interface element), with a short description of the event. By pressing the right button, the event can be closed without making any decision, and the left button can open the message.
In this case, when you click on the event button will be the first diplomatic contact in the game:



It was further implemented the first maneuvers of AI. AI walks on the map and tries to determine the boundaries of its continent. In the video at Dukat https://youtu.be/69G51u_Mq3g?t=693 that is the moment where he runs over the enemy army, which pays no attention to him, because busy with study card :)

And somewhere in this place and at this time, I was faced with a problem, a performance problem. Our Modeler has a powerful modern computer of red Assembly. But it the game is terribly slow shipping a single core processor. The reason is simple-there are a lot of cores in new processors, but in fact they are less productive in single-threaded applications. And that moment I had a render in one stream. But in fact, the reason was not so much in this. And in the process of finding problems, I decided to count how many polygons we have in the scene:


On the middle map at the maximum distance and a large cluster of palm trees - it's just scary! 15 824 756 triangles! Almost 16 million!!!

After a bit of map generation, I found a place with 16.75 million. :)


Although here is a similar place with trees gave only 8.5 million triangles:


And in the middle stage consisted of about 4 million:


In General, I was glad that my render copes with such a huge number of triangles, but their number was excessive. It was necessary to optimize the number of polygons in the models.


40% decreased Poligona trees! Differences practically are not visible.

Next, we have altered palms - Poligona on the palms was reduced in 10 times. 600 - 700 against six thousand of polygons per pack.


While there was parallel work on the models I have been trying to simplify the geometry of terrain. Here's what it looked like before optimization:


And after the first steps:




But it was all done by a simple method — all smooth tiles were replaced by two triangles instead of 882.

But there were still flat places that could be optimized, and I began to build polygons from those triangles that had the same height:


Build on them convex-concave contour (Concave Hull). With Convex Hull ω was not a problem, I already used the Graham scan (Graham scan). But the construction of Concave Hull has a problem... Information on this topic on the Internet was quite difficult to find. I had to write the implementation of algorithms from scratch. I will not lie if I say that I read a dozen different dissertations on this topic. But all the proposed algorithms gave an approximate result with some error. After a week of torment and pain, I came up with the idea of my algorithm, maybe I'll describe it someday :)
As a result of two weeks of torment, I got the desired result and was able to build Concave Hull of almost any complexity, bypassing the set with holes, just dividing them into 2 halves of the hole. Received contour and triangulated it:



Getting the output of such a result:


The fog of war has also been simplified:

And in zones where was present only fog of war it turned out only about 300 polygons:

But in the end I was upset with the result and tell you that these two weeks I spent in the shuffle... The algorithm developed by me gave a significant increase in performance when rendering, as the number of polygons on average was reduced by 60 — 70%. But the generation of the map began to occur 10 times slower.... the algorithm was time-consuming and difficult.

3 days I lost in ATOM RPG removing stress:) Even at work did not go. Thank God we have at this time the thermometer went off scale at the border -44 - -46 degrees Celsius. And I gave my melancholy for an excuse not to start the car.

And before the new year holidays, enough to play, but the truth is not passed the game, I gave a new lightweight version of the algorithm, which was suitable only for my conditions of tiles. Data calculations for optimization were not noticeable against the background of map generation and the number of polygons decreased by an average of 40-50%.
But there are artifacts when rendering water, I had to rewrite all the algorithms associated with water.
Here is the result:


Anatoly meanwhile made unit of nomads:


While he lies resting :)

While working on optimization, I came up with the idea of how to change our mountains.


Mountains have become more embossed, it is noticeable without texture, as the texture is now not suitable for them:


On the grid, so in General the differences are obvious:


It remains the case for small — need a new texture of the mountains.

The next step was to rewrite the resource loader and map generator. Along the way, remaking the start menu for all these things:




Now loading of resources goes in parallel and then map generation begins.

I did a great job in dividing the render into 3 streams. The whole difficulty was in synchronization. Now we have one thread responsible only for drawing, the second thread for recalculation of the visible space when moving the camera and other interactions with the map space, and the third thread is responsible for animation and communication with the server part.

And Yes, we now have a server part responsible for all events in the game and for the AI. In turn, each AI player is a separate process.

Let's summarize the work done:
 - Graphics optimization from the software side.
 - Optimization of graphics models.
 - Server part.
 - Split render into 3 streams.
 - Preload resources (textures and models).
 - Rewrote the fog of war, water and terrane shaders.
 - Reduced RAM consumption by 20-30%
 - Implemented a number of UI elements
 - Redesigned start screen with the new UI.
 - Fixed errors in normal calculations.
 - Fixed the hills.
 - New mountain.
 - Introduced normalmap for terrain.
 - New selection of units.
 - New animation units.
 - Window of diplomacy.
 - Actions AI. Study the map.
 - Actions AI. Diplomatic contact.
 - Actions AI. The conclusion of peace, friendship, or a Declaration of war.
 - Actions AI. Action units in a collision.

 - In General, a lot of work has been done to optimize and not a lot of game mechanics. I hope this month to the CE goes to plan and I'm finally going to finish the city :)

Thank you for your attention!


Recommended Comments

Very cool stuff.  I like these sorts of games and I'm interested to know what the game plays like that's for sure.  I really like the turn icon in the lower right corner.  I like that it represents the four seasons and that it rotates.  Very nice.

Share this comment

Link to comment

Thanks for the comment. Soon will be implemented part of the gameplay

Thanks for the comment. Soon will be implemented part of the gameplay

Share this comment

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Advertisement
  • Blog Entries

  • Similar Content

    • By Shadowsane
      My project started in 2014 but recently ended due to no funds.  AltarisNine was a Minecraft project based on RPG. The concept was nine islands that you explore at a time to follow an in depth lore based on our own production team. This is where the 'Nine' comes in. With skepticism of future success we hope to make this tale into chapters. Such as the first one introducing Nine islands at time.
      It wasn't always the same though, my world did evolve over time and now I have a better idea of what it is better than ever. In the first island, Main Isle, is themed around jungles and wilderness. There's lore that stretches throughout the chapter which will engage the player. There would also be kinds of characters you can be such as any other RPG which could be talked about (because i'm still  about what I have lol)
      My former team was designing a world players would get into interact with in various ways. Boss battles would be minigames and the RPG lore would be engaged in and something indie platforms would enjoy and talk about beyond platforms.
      In the minecraft varient I was a builder, the leader, and the story director which everyone respected. I led my own team of builders and story writers. While I chose certain individuals to be the head department of development and art design.
      The reason I am here is to find a new team to help take this away from minecraft and hope we can be successful about it. I'll happily commute each and every person that volunteers and will be accommodated down the line with promotions, wages, and definitely praised for helping start my dream up.

      Here are some questions that were frequently asked and that I can thoroughly answer:
      What is the goal of the game? If you've ever heard of Wizard101. I got inspired by that game a little. I like the concept of making yourself in this world of mystery and impressing people with new mechanics and events that they enjoy. I'd like for the game to be successful and be mostly on PC but if this keeps up we could reach out to other consoles. But for now, PC, one platform at a time lol. My goal personally is to give people the entertainment and enjoyment I think they'll deserve. Something thats not cheesy, not cliche, something new to keep evolving the gaming community Is this in first-person or third-person? This will be a third person game. We can play around with the camera angles but I kind of want it from a aerial pov I saw RPG in the post so can I assume that the game will have generic RPG elements, e.g. quests, npcs, story-line, items? Yes this will have generic RPG elements. But with a few surprises that make the game different. Such as making boss fights some type of minigame. I don't know how the audience will like or even if it'll flow with game play. But I'd still like to take the idea on for now. Will there be combats, e.g. vs. monsters, vs. players(?) ? There will be tons of concepts. As i've said before the 'Nine' comes in the Nine isles of this world we haven't named yet lol. Each nine islands we come up with will not only give players plenty of content to play, but something we break up into story chapters. Each island will have its on set monsters tied to the story or even monsters that are just natural in their environment. There will also be a PvP aspect which can't be brought up too much because its difficult to try to come up with a player style culture that isn't too predictable or generic or even cliche. I was wondering if it should be an initiated fight or a head on duel like world of warcraft. Is this a single player game or a multiplayer one? Definitely multiplayer. Will the game look like Minecraft? like a voxel/blocks game? I imagined it not looking like minecraft but maybe that can be a concept of its own down the line (like an island concept). I was thinking along the lines of a 3D style and not like minecraft. What are the core mechanics to be included, e.g. player movement, enemy movement, enemy AI? This question is more technical but there will be interactive things in the world, things to collect, natural occurring crafting supplies to make new loot and weapons with. There will be NPC's and thats a broad topic enough lol. I'd even a imagine a pet, housing, and gardening system. But thats for accessories in coding and to give more content in the game for later polishing. Is there a storyline already made? There is an indirect storyline. We've made a script for voice actors (and just what to make the NPC's say in general) in A9 v1. Are there goals already planned out? There are many goals to set out. One each at a time for separate upcoming departments The first 8 pictures were of our hub, the other 9 was our factions world. The factions world doesn't retain to this project I wanted you to see how dedicated I was to making this project. I built everything in the hub myself except for the giant pagodas. The last two photos were all the ones I could find of the RPG world

    • By Octane_Test
      I want to render an ocean where players can change waves’ amplitude in real-time. Initially, I would render rolling waves (see picture). As the amplitude increases, I need to transition the rolling waves into breaking waves (see picture). For now, I am not going to show the shoreline onscreen so I don’t need to render breaking waves interacting with the shoreline; I only need breaking waves on the open ocean.

      I’ve tried three different approaches so far and I’ve only had success with rolling waves using approach 1. Breaking waves have been impossible so far with all three approaches.

      Approach 1: Mesh deformation

      a.     I can create smooth rolling waves using the Sine and Gerstner equations.

      b.     Since I can’t use these equations for breaking waves, I tried to implement them by using this free plugin whose output is similar to this paid mesh deformation plugin. But there are 2 problems with this plugin approach:

      ·      There is no smooth transition between rolling waves generated by approach 1a and the breaking waves generated by the Deform plugin

      ·      The output of the plugin does not look similar to real breaking ocean waves in three different ways:

                                                     i.     No smooth blending with the ocean surface

                                                    ii.     A large depression is created below the crest

                                                  iii.     The entire wave is the same height (rather than with more realistic variations)

      c.      I considered using vertex shaders but this approach seems similar to mesh deformation.

      Approach 2: Fluid dynamics + metaballs

      1.     To render an ocean I will need thousands of particles which will be too expensive in terms of performance (especially for mobile devices).

      Approach 3: Using mesh files

      1.     I can create breaking waves using some 3D software like in this post but then I can’t modify the ocean in real-time. It will be more like a pre-rendered simulation.

      To summarize, I am looking for an approach where I can vary ocean waves’ amplitude for a smooth transition between rolling waves and breaking waves. Please let me know if you have more questions.

    • By Cacks
      I'd like to get & set the OpenGL View Port Matrix but it doesn't work
      I'm using the "GL_VIEWPORT" parameter
      any ideas?
    • By a light breeze
      Is there a way to set up the projection matrix (in OpenGL) so that the vanishing point is not at the center of the screen?
      Let me explain what I mean in more detail.  Imagine that I am rendering a 3D scene with a standard perspective projection matrix to a 1000x1000 window.  There is no camera matrix, so planes of constant z are parallel to the screen, and objects move toward the center of the window as their z coordinate approaches infinity.  Now, I want to only render the bottom half of this window.  Planes of constant z are still parallel to the screen, but now objects move to a point at the top of the window as their z approaches infinity.
    • By bandages
      So, in real life, incoming dot normal at the silhouette is always 0.  With smooth shaded meshes, it never is, not naturally, not outside of contrived situations.  (Not with flat shaded meshes either, I guess.)
      And incoming dot normal is one of the bedrocks of CG.  Probably the equal of 4x4 matrix multiplication.  Problems with silhouette normals show up in Fresnel, in diffuse lighting, in environment mapping....  everywhere.  But I can't really find anybody talking about it.  (Maybe I'm not Googling the right terms.)
      Obviously, the problem decreases as poly count goes up, eventually reaching a point where it's dwarfed by other silhouette problems (like translucency or micro-occlusion) that CG doesn't handle well either.  But, if I'm reasoning correctly, normal maps don't improve the problem-- they're as likely to exacerbate it as improve it, and the exacerbations are, aesthetically speaking, probably worse than the improvements are better.
      I've tried playing with crude fixes-- basically, rotating normals toward incoming by a percentage, or of course clamping incoming dot normal (like we all have to do) to prevent it from bending behind the mesh.  Nothing I've tried looks good.  I suppose the best option might be to rotate normals to perpendicular to incoming at the silhouette and then interpolate to the nearest inflection point  of something like screen space depth to preserve curvature, but the math for how to do that is beyond me, and I'm not sure it would look any better.  Or maybe, instead, somehow, adjust the drawn silhouette to match the silhouette defined by incoming dot normal?  Not even sure how that would work, not if the normal was pointing away from incoming.
      I don't know-- is this a solvable problem?  Has anyone tried other stuff and given up, pursued anything that was promising but too expensive, anything like that?  Are there any papers I'm missing?  It's really surprising to me that I can't find anyone else talking about this.
      (Apologies if I chose the wrong subforum for this.  I considered art forums, but I felt that people frequenting the programming forums would have more to say on the subject.)
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!