🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

DevBlog #36

posted in Zemlaynin
Published December 29, 2019
Advertisement

Hello readers of our diary! Happy new Year to all!

It's been a long time since I wrote a diary, for good reason. Let me remind you that my working season ends in late October / early November and I had to return to the project at this time.

But there was another reason why I didn't start the project until early December. After my long internal resistance, I still took up the study of Unreal Engine 4. In turn, the study of UE4 pushed me to the lack of progress on the design document of our game designer. After two months of picking at UE4, I realized that IT was a great tool for creating games... But still it is not for strategies, or rather not for strategies with such huge maps as we have.

From using Blueprints I got only pleasure, especially when you can see firsthand and look at the whole scheme:



In the summer, while the working season was going on, there was almost no time to deal with the project. But then I bought myself a new thing for the computer-a video card RTX 2080 and decided to test the project on it. The project was launched but did not work correctly, after a long search for the cause, I realized that the problem is in the Shader:





On the forums nobody could help me, it was a lot of advice but all were misses. As a result, after studying the OpenGL documentation, I came to the conclusion that my error was in the special behavior of OpenGL 4.5, or rather the error was in Non-uniform flow control
https://www.khronos.org/opengl/wiki/Sample(GLSL)#Non-uniform_flow_control

After her correction, everything worked. Still, after forum correspondence, the guys gave me a good idea and I optimized the Shader a little, for which they are very grateful.

The next step was to rework the algorithm for finding starting places for players, I still do not like it, but it works better than the previous one, time for squeaking takes a lot. This is the second time-consuming problem, after the normal calculation problem. It even happens that the search for starting places takes longer than the calculation of normals...





We'll have to rewrite it again.

After I finished working with UE4, I was planning to take up writing a design document. I thought about what direction I should go and where to start, re-read the previously written concept document. On one of these days, under such reflections, I remembered how I was haunted by the written algorithm for generating mountains. Let me remind you how the mountains looked earlier:





It was a fleeting thought, but it caught me, and I spent the day with it in my head.
The next day I decided to program this moment:





The mountains were not bad, but not much better than they were. But I made them using a completely different approach, which left room for maneuver. Two days I experimented and in the course of such experiments I realized that it prevents me to get the desired forms, but this will have to change a little the way of generating the transition of one type of surface to another, i.e. the transition of water to land and land to mountains. It took me half a day to write the code, but by the evening I had an interesting result:





It didn't seem too bad.

And then I realized that a similar approach can be applied to rivers. The design document was relegated to the background. In a couple of days I have rewritten the rivers, their curves now look more natural:





And now, in addition to the fact that the rivers were built more efficiently, in the process of writing the generation algorithm, I have repeatedly looked at the algorithm that built the mapping of rivers in 3D space. In a strange way, I displayed them, and in just a few hours I copied everything to an algorithm based on the construction of Bezier curves. By the way, in the screenshot above, the rivers are built on Bezier curves.

The new approach to generating both rivers and mountains allowed me to work with them more freely, and a couple of other ideas came to mind. I had a plan and even knew how to implement it. But, then fell into a stupor and a whole week could not formulate and implement the plan in the code. I walked around the office in circles, literally banging my head against the wall and cursing myself for not being able to do such a simple thing. A week passed in agony, I can't tell you how empty my mind was. And four days before the new year I finally gave birth to my thought:





Rivers can cut through mountains (is it realistic?).

Now rivers can come out of the mountains.





And the coolest thing - now the rivers have different widths! There are navigable rivers and non-navigable ones. At the confluence of one river with another, the latter changes its width. The width of the river in turn now depends on the length. The width of the river increases gradually, from the source to the mouth.

It remains to program a beautiful source and mouth and rivers will be ready.

At last I was released, that fleeting thought is embodied in life, it is possible to write the design document further.

Now diaries will come out more often. See you again!

https://vk.com/thegreattribes

https://discord.gg/ZhTzDB


Previous Entry DevBlog, No. 35
Next Entry DevBlog # 37
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement