Skip to content

Vercix/godot-grand-strategy-map

Repository files navigation

Godot Grand Strategy Map

Visual description of concept

This is a project for the Godot game engine.

General Concept

Visual description of concept

The program starts by reading the 'province image', located at /Assets/states.bmp, and turing it into a PackedByteArray, this is a format that the engine can pass to the compute shader. As well, a 'look up' texture is created. This is essentially converting a 1D index value to a 2D index value. Using the ID provided in /Assets/states_cache.json. Each id needs to be a unique unsigned integer. i.e. the top image in step 2 in the image above.

Compute Shader

The compute shader takes in the data and converts it to an image where each pixel is the uv coordinate for the color look up image. i.e. bottom image in step 2 in the image above.

GdShader

The results of the compute shader are used as uniforms in a godot shader. Which results in step 3 in the above image.

How to use

You can open the project in the Godot editor and just press play. Hover over the different states of Denmark and Germany and you should see a unique id in the label below.

Note that a limitation right now is that the image dimension is hardcoded. You can easily change that by editing the project. See comment on line 147 of Root.gd

References

A great resource used was this post on Intel.com by Bartosz Boczula, Daniel Eriksson

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published