Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Your map format #6

Open
siredmar opened this issue Aug 8, 2022 · 9 comments
Open

Your map format #6

siredmar opened this issue Aug 8, 2022 · 9 comments
Labels
discussion Let's discuss.

Comments

@siredmar
Copy link
Contributor

siredmar commented Aug 8, 2022

Hi!

Would you mind explaining a little bit about your map format? Did you fully specify it yet? If so, it might be easily possible to write a converter that reads the original ISLAND5 chunks and creates your format.

Thanks for your efforts so far! Looks pretty amazing!

@stwe
Copy link
Owner

stwe commented Aug 8, 2022

The map format so far represents only a single island with a width and a height. Two layers with the tiles follow. I will explain the details here later. Of course it is not finished yet. I think there will be some changes in the next few weeks. The ticket remains open. Questions about the map format will be discussed here then.

For the beginning, I think it would be a good idea if we could convert the SCP files. Then we could very easily choose from different islands to build on.

@siredmar
Copy link
Contributor Author

siredmar commented Aug 8, 2022

Sounds like a plan. Just for the record, i'd covert everything leaving only standard and custom types, e. g. map files to your custom Format, textures to PNG,...

@stwe
Copy link
Owner

stwe commented Aug 9, 2022

....can you please explain this in more detail

@siredmar
Copy link
Contributor Author

siredmar commented Aug 9, 2022

Sure. I don't see the requirement of a real drop in replacement. I'd make a hard cut with the original files. I propose converting everything to something we can handle better. Looking at the horrifying COD format, the first big step was taken towards that goal by converting it to JSON.
The SCP format with that silly chunks is the next example of how to not do things right.
Same with .ZEI and .BSH formats. Let's simply put them into PNGs or whatever is more easily handled instead of a custom bitmap format they invented.

There could be a converter tool, that puts everything in the right place before running the actual MDCII. This way it would be possible to just convert old savegames into the new game and live happily ever after. :)

@stwe stwe added the discussion Let's discuss. label Aug 12, 2022
@stwe
Copy link
Owner

stwe commented Aug 13, 2022

I packed everything in Benno4j into a few TileAtlas files (a PNG has many images). The TileAtlas can then be loaded directly into the GPU. What doesn't work is that everything is packed into PNGs and distributed with this repo. The TileAtlas files can be created/cached once at the beginning. That's how I did it with the haeuser.cod too. There is a haeuser.json created at startup, if not already there. Unfortunately the initial chaching of the resources takes some time. The copyright must be respected and pointed out here at every place - that is important to me.

@siredmar
Copy link
Contributor Author

I'd not ship the PNGs with this repo. Our understanding is quite the same. Generate everything out of the freaky original file formats to something more usable on first startup and cache it somewhere.

@stwe
Copy link
Owner

stwe commented Jan 2, 2023

The current map format version 0.2-dev:

{
    "version": "0.1-DEV",
    "world": {
        "width":
        "height":
    },
    "islands": [
        {
            "width":
            "height":
            "x":                               // x position in the world
            "y":                               // y position in the world
            "climate": "SOUTH",   // NORTH or SOUTH
            "layers": [
                {
                    "coast": [              // only (water) tiles with height of 0
                        {
                            "id":              // building ID
                            "rotation":     // building rotation
                            "x":               // building x
                            "y":               // building y
                        },
                        {
                            // next tile
                        }
                    ]
                } ,
                {
                    "terrain": []            // terrain tiles only with height of 20, including embankment
                },
                {
                    "buildings": []       // additional buildings with a height of 20
                },
                {
                    "figures": [
                        {
                            "id":              // figure ID
                            "rotation":     // figure rotation
                            "animation" : // nr of animation
                        },
                        {
                            // next figure tile
                        }
                     ]
                }
            ]
        },
        {
            // next island
        }
    ]
}

@siredmar
Copy link
Contributor Author

siredmar commented Jan 3, 2023

Great! But, i'd introduce an additional version field on top level of the JSON.

example

{
    "version": "v1alpha1",
    "world": {
        "width":  50
        "height": 50
    }
}

stwe pushed a commit that referenced this issue Jan 5, 2023
@stwe stwe pinned this issue Jan 20, 2023
@stwe
Copy link
Owner

stwe commented Jan 21, 2023

New: The file extension .sav is used for savegames and .map for worlds without additional buildings. The reason is that things like the number of resources (wood, stones ...) have to be saved later in a savegame. The map files should only be used to start a new game.

@stwe stwe unpinned this issue Feb 12, 2024
@stwe stwe pinned this issue Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Let's discuss.
Projects
None yet
Development

No branches or pull requests

2 participants