Giter Club home page Giter Club logo

ostrivsdk's Introduction

Unofficial OstrivSDK

This repo contains two projects - OstrivSDK library and OstrivConverter binary.

OstrivSDK

Right now lacks in-code docs, but the API is pretty simple and self-explanatory. You can load data.data, .minimap and .level_save files, export them, import them and/or save them. This should make it possible to implement some basic level editor for example.

Minimap file

Contains 1024x1024 RGB pixels. The image saved here is used as a preview when picking a map in game menu. The actual minimap in game appears to be generated by game itself.
Supported formats for import/export are: .bmp, .gif, .jpeg, .png, .tiff

Data file

Is a package of game assets. It contains models, animations, textures and whatever else. There is a lot of files that have unknown extension like .tst, .tst2 or .floor, but textures and icons are in .png so these can be easily modified. Export/import works like packing/unpacking a zip file, just pick a folder.

LevelSave

This file is for maps and contains data on deposits, fishing spots and river flow vectors. Without deposits there is no lime/stone/iron, without fishing spots you cannot fish and without river flow vectors you can't use building that need water power to operate. Export/import is into .yaml file so it can be easily edited. Please read Notable info before any attempts to edit maps.

Map names are hardcoded in game so we cannot add a new map, we can only replace current maps for now. But I think that maybe if we showed interest, Yevhen would make the system more flexible.

Notable info

X, Y coordinates are horizontal, Z is vertical. Playable zone of each map is from X: -5000 Y: -5000 to X: 5000 Y: 5000 with X: 0 Y: 0 in the center. In case of _forestmap, _heightmap and _plantsmap, which are 1024x1024px, playable zone of each map is 512x512px around the image center:

Map coordinates of Map 1

IMPORTANT
Valid deposit names are:

building_finite_deposit_stone
building_infinite_deposit_stone

building_finite_deposit_limestone
building_infinite_deposit_limestone

building_infinite_deposit_iron_ore

variant property of each deposit corresponds to an ingame model. For building_finite_deposit_stone you can assign variant 0, 1, 2, 3. For anything else it needs to be 0 or the game crashes.

Right now we can use only deposits that are listed map menu(_infinite_ for Unlimited and _finite_ for Limited). Eg. for Map 1 you can only have building_infinite_deposit_limestone and building_finite_deposit_stone, for Map 2 you can only have building_infinite_deposit_iron_ore, building_finite_deposit_stone and building_finite_deposit_limestone. Any other combinations will crash the game. I am not sure if it's hardcoded in game yet, but it probably is. More research pending.

OstrivConverter

This is a CLI tool that uses SDK to do all above mentioned things without needing to code.

ostrivconverter --help

Examples:

ostrivconverter data --export -s data.data -d ostrivdata
to export data from data.data file into ostrivdata folder

ostrivconverter data --import -s ostrivdata -d data.data
to import data from ostrivdata folder to data.data file

ostrivconverter levelsave --export -s level01.level_save -d level01.yaml
to export data from level01.level_save file to level01.yaml file

ostrivconverter levelsave --import -s level01.yaml -d level01.level_save
to import data from level01.yaml file to level01.level_data file

ostrivconverter minimap --export -s level01.minimap -d level01.png
to export data from level01.minimap file to level01.png

ostrivconverter minimap --import -s level01.png -d level01.minimap
to import data from level01.png file to level01.minimap (bmp file has to be 1024x1024px)

Everything can be also shortened:
ostrivconverter minimap -e -s level01.minimap -d level01.png
ostrivconverter minimap -i -s level01.png -d level01.minimap
or
ostrivconverter minimap -es level01.minimap -d level01.png
ostrivconverter minimap -is level01.png -d level01.minimap

ostrivsdk's People

Contributors

bosek avatar

Stargazers

Vasyl Tsick avatar

Watchers

 avatar  avatar

ostrivsdk's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.