Giter Site home page Giter Site logo

Comments (3)

squeek502 avatar squeek502 commented on May 18, 2024

Sounds reasonable, you're probably right. I'll look into it more; there might be something in the PlugY source that is useful as well.

from d2itemreader.

squeek502 avatar squeek502 commented on May 18, 2024

So I think this 3/4-bit variance is actually vanilla D2 behavior that depends on the gridY value in Inventory.txt.

  • PlugY injects its modified stash size here by modifying the compiled Inventory.txt values directly, but doesn't change anything else related to the Y coordinate of saved items.
  • If you change Inventory.txt to use a gridY of 10 and use -direct -txt, Diablo II will start saving Y values using the 4th bit. Very strange behavior to vary the bit width depending on the max value if you're just going to use a padding bit when writing the 3-bit value anyway, but that seems to be what's going on AFAICT

So, in order to be compatible with mods like this we'll need to know the contents of Inventory.txt while reading items, and then when reading PlugY stash items we just need to tell the reader that gridY is actually 10 so we read the Y pos as a 4-bit value.

Very good catch, thank you for creating the issue!

Some more stuff:

from d2itemreader.

squeek502 avatar squeek502 commented on May 18, 2024

Actually, I overthought it. The fix is as simple as unconditionally reading the 4-bit value, since the bit ordering means that 1 would be 1000, and 9 would be 1001 (i.e. the 'unknown' bit is only set if the actual value is large enough to warrant it, which explains why it was labeled 'unknown' by people only looking at vanilla D2 saves since it would never be non-zero without Inventory.txt changes).

Will fix the library and docs.

from d2itemreader.

Related Issues (9)

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.