Giter Site home page Giter Site logo

ataulien / zenlib Goto Github PK

View Code? Open in Web Editor NEW
54.0 54.0 26.0 19.29 MB

Loading of proprietary formats used by the engine used by the games "Gothic" and "Gothic II"

License: MIT License

CMake 1.39% C++ 88.91% Python 0.45% D 8.29% Shell 0.94% C 0.02%

zenlib's Introduction

Hi there ๐Ÿ‘‹

zenlib's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zenlib's Issues

Daedalus VM got `ShiftRight` wrong

        case EParOp_ShiftLeft:
            pushInt(popDataValue() << popDataValue());
            break;
        case EParOp_ShiftRight:
            pushInt(popDataValue() << popDataValue());
            break;

Shift Right does not Shift Right.

Using PhysicsFS as FS interface

I was wondering if it wouldn't be better to add the capability to load VDF files to PhysicsFS instead of using a homebrew solution like it is being done now in ZenLib. This would also make it easier for people to make mods and the like, since standard archive types could be used, together with real directories.

Let me now if this would make sense, so that I could start adding the support to PhysFS.

MdsParser design proposal

Hi, I have an idea how to make Mds parser better.

Problem

In current design we have ModelScriptBinParser/ModelScriptTextParser with base class ModelScriptParser.
Every time someone want's to add support for new chunk-type, code has to be written twice: once for Bin, once for Txt.

Possible solution

Move more logic into ModelScriptParser base class. It can be done, by introducing a new group of virtual functions, like:

      virtual std::string readStr()=0;
      virtual std::string readKeyword()=0;
      virtual uint32_t    readDWord()=0;
      virtual int32_t     readI32()=0;
      virtual float       readFloat()=0;
      ... 

Prototype

Here is a prototype, I have in my fork:
https://github.com/Try/ZenLib/blob/master/zenload/modelScriptParser.cpp
Testing: run locally Gothic2Notr, Gothic2, Gothic1, Gothic reloaded.
Test suite: https://github.com/Try/ZenLib/blob/master/tests/test_mds.cpp
(sorry, but no test-data in repo - I've had to use dumps from game assets)

Benefits

  • Less code
  • Feature-consistency over gothic1-2
  • Write once - debug everywhere king of code

Cons

  • Debug everywhere king of code, because one line can change behavior for both formats.
  • CHUNK_MESH_AND_TREE doesn't match between txt and bin formats - implemented as virtual function.
  • Prototype contains unrelated changes(more chunks + removal of get-function in favor of public access)
  • CHUNK_ERROR handling not implemented in prototype - text parser is always relaxed.

Andre, welcome back by the way :)

Daedalus compiler

Hello. I've written a Daedalus parser not long ago, and I wonder if there's any interest into merging it into this project.

I've uploaded the code to Hedede/Daedalus. The state it was left in, as far as I can remember:

  • Fully functioning parser (tested on GMDK scripts).
  • Symbol table and type checking started, but not finished.
  • Debug tools: AST dumper, .dat dumper (prints symbol table and bytecode as pseudoassembly)
  • Unfinished codegen (prints pseudoassembly), uncommited
  • Unfinished compiler driver (which takes an .src file as input and manages compilation process), also uncommited

Some G2 worlds can not be parsed.

Some Gothic 2 worlds (see below) can not be parsed. The following std::runtime_error is thrown:
Value name does not match expected name. Value:VISUALANIMODE Expected: CDSTATIC

The worlds that cannot be parsed are:

  • FIRETREE_LAMP.ZEN
  • FIRETREE_LAMP1.ZEN
  • FIRETREE_MEDIUM.ZEN
  • ITLSTORCHBURNING.ZEN

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.