Thanks britzl and Elpidoforos_Gkikas
You even remembered to add baltic states wich in not very common but sounds fun
i love games that look like this!!
Also will be there greece? and does player can use it? thanks
Yes. Greece is on the map and will be available in some scenarios.
I will add a scenario editor later. It will be possible to create any countries and customize them.
I plan to add a lot of maps and scenarios to the game
I copied the map of Europe from Civilization Path and added the sea.
There are a some of interesting points about working with the map, I will write about them later in this topic.
Hello, everyone! A month ago I promised to write about various interesting things with the map in my opinion. Well the time has come.
Provinces quality
I just have to say thank you to @Pkeod
My first idea to apply this method was: make NE that blurs the image and set material with contrast shader. Then I realized that writing an algorithm for blurring is not the most pleasant thing. I also realized that processing for each image at runtime is terrible for performance.
I forgot about it for a while, but I remembered it during the development of a new game.
Now I pre-blur the images with a third party editor and then apply shader:
shader code
varying mediump vec2 var_texcoord0;
uniform lowp sampler2D texture_sampler;
uniform lowp vec4 tint;
const float threshold = .01;
void main()
{
// Pre-multiply alpha since all runtime textures already are
lowp vec4 tint_pm = vec4(tint.xyz * tint.w, tint.w);
vec4 c = texture2D(texture_sampler, var_texcoord0.xy);
vec3 res = smoothstep(.5-threshold, .5+threshold, c.xyz);
gl_FragColor = vec4(res,c.w) * tint_pm;
}
The screenshots were made at different times, so they have a different scale. In the case of distance fields, it is even larger.
I think the difference is obvious
ImageTransparencyCalculator
The name is really incomprehensible, I guess I should have thought a little longer.
How did I handle the click?
I used collisions in Civilization Path. Creating collisions that repeat the contours of the provinces is a pain. It takes a lot of time, and no matter how hard you try, the result will not be perfect.
At first I started using Convex hull shapes that were automatically generated from the image by a third-party editor. The result was better, and most importantly - faster.
Later in the Russian Telegram, there was a talk about click tracking and the idea of tracking a click using a color change and a render script came up. I tried to implement this but no success. In general, I doubt that this is possible in Defold.
I got inspired by this method and wrote a native extension. How it works:
The native extension takes the image data as input and rebuilds the buffer, leaving only the transparency data in it.
The resulting monochrome image can be reduced in NE. In this case, the accuracy drops, but the size of the generated file also decreases. This is just in case someone doesn’t want perfect accuracy.
Further, the file data is compressed by zlib.
And already on the basis of this data, the lua module calculates whether the transparent area was clicked.
I’m glad now I can perfectly track the click, and everything is automated.
I will also be glad if this is also useful to someone and saves time. I know that @russelkgd changed it for GUI. That’s cool.
Various dynamic objects
They are created using game object factories. From flags to nuclear explosions.
Performance is very important. Therefore, some objects are not always shown. Objects outside the camera are disabled.
I still use msg.post("@render:", “draw_line”) for lines, although I know it’s not good. I will definitely experiment with this. Maybe even the distance fields will try again
It’s a sad that there is no slice 9 for sprites. I think this would be one of the solutions.
Fun thing that i used similar approach for continent selection, but with ellipses as my collision objects.
Anyway, thanks again for that extension. I will probably contribute gui version to your repository, but i need to change there something to allow more straightforward approach to it, because right now is adapted for my specific gui scene, which is not good. So maybe one day)
Thank you for another great post!
There’s an issue for it here: https://github.com/defold/defold/issues/4653
Hello!
Today the game is released in Google Play
I will be very happy if some of you download or even play multiplayer with me
The multiplayer is made by an internal purchase with server-side verification, so in order to play it, you need to use one of the promotional codes
Promo codes
2HX27GA54NBHMETZYALZPE6
01SW2T33LCFXXK7NMQQ3A0B
EGXTK5QSMPEDS71742GS502
ST7H0UL0VD72BJVWW6LYBU0
0DXRG938C6HBN5EZFVFJQQV
PMEP7RBF5D94TP40APH3UXW
J2WDH0HLY96YAVL0SKYXH7V
FDFF5W5Z52RGF76ZAT9Y30N
GRVNUMXW8JE4HLA9FBQZ00P
JQML4YV4W52WWYPYS3BAA9R
Link: https://play.google.com/store/apps/details?id=com.DenisMakhortov.ColdPath
Updated screenshots in the first post
Congrats @Denis_Makhortov !!! wish you the best . I could understand where i must put the promo, I press at join to connect direct at official 2 and show me chile but not sure if I was playing. thanks
Thanks!
if the map is loaded, then you are in game
If you want to play multiplayer, then feel free to write. I will set a map of Europe and the Modern World scenario, Greece is available there
how many can be inside? or will be you and me? thanks , also the box pop out and say what is new a bit stuck didnt know how close. thanks
Hello! I have developed a Map Editor for this game. This is very cool, now players can create their own maps and load them into the game!
I created it in January, and now I remembered that it would be cool to share some information about creating, because I believe that the code used in it for loading textures may be useful to someone.
All work with images is based on DrawPixels module, in which I added the code needed for the Map Editor.
About map creating
- User prepares some image
- User can modify map image. I only recommend doing this for small changes. Functionality of image editor is small and inconvenient
- When the user clicks on the “Autogenerate” button, the algorithm automatically colors the map so that each province has a unique color
- User clicks “Export”, editor creates map files
more about what happens when the export button is pressed
- The image is blurred. Blur is needed for the effect of distance fields
- The minimum possible texture size is selected for each province. The province image data is adjusted to the texture size and saved
- Data of each province is saved for click tracking using this module
- Information about each province is generated (size, position and information about whether it is water)
- Data is generated about which provinces are neighboring (so that player can move from one to another)
- A scenario is created for this map. It can be opened in the Scenario Editor to make cool scenario
About loading in game
- There is several atlases with prepared textures. The sizes of the images in them are different, because the game can have provinces of very different sizes
- When loading a map, this data is loaded: province texture, click tracking data, center offset (user can customize province center in map editor), province data
- How textures are set:
Loaded custom map in game:
The map editor is currently unfinished and not beautiful, but it is fully working.
I also added the ability to convert maps to in-game format. One fully working map has already been created in the map editor and moved to the game client.
Map Editor sources: https://github.com/JAlHund/cold-path-map-editor
Map Editor guide: https://denismakhortovdev.gitbook.io/cold-path/guides/map-editor
Hey can you tell me how to mine uranium
You need to upgrade your mine to level 5
227 / 5.000
Hi, I’m using google translator so sorry for any mistakes. I really love this game, I’ve been playing it since the middle of last year (2021) and so I would like to ask, have you ever thought about releasing it on a PC platform?
So I’m in America and the majority of people playing this game are russian. Could someone tell me a workaround so I can play with English players?
Currently there are no english servers. But now you can create your own.
Cold Path Server Sources are opened
Cold Path players can now create and set up a global server. The game server is highly customizable. There are already servers with modified gameplay (RP servers where wars for no reason are prohibited and you need to play the role of the ruler of your country by writing messages in the chat and Empire of 12 paths with new game features written using plugins)
The server is the core of the game. Here are all the main scripts for processing game actions and logic. Also there is networking here. The game server has been tested and online in the game is stable. Server is written in pure Lua.
I think this will be a useful example for other developers. License is MIT, you can use the source code to write your own project. I hope this helps you create your cool game.
Server sources: https://github.com/jalhund/cold-path-server
Guide: Global servers - Cold Path
Thanks for the help denis