GithubHelp home page GithubHelp logo

Comments (14)

rnyoakum avatar rnyoakum commented on May 30, 2024 1

I've gone through RIS and eliminated the reliance on the .but and .img files that were hanging around (merged via commit 49a85a5). Those have been replaced with pngs that had been extracted previously by the RIS team or that I extracted. I haven't deleted the original files yet.

from raceintospace.

willglynn avatar willglynn commented on May 30, 2024

We've made a bunch of progress on this. Random data files have been replaced with PNGs one piece at a time, and #100 gives us a way to manipulate the graphics system independent of these crazy formats.

from raceintospace.

hweimer avatar hweimer commented on May 30, 2024

With serialization via cereal being included, it is possible to make progress on this. In many cases, the game uses files containing a big binary array of some internal data structure. For example, the file mission.dat is one big array of struct mStr. So if you want to get the mission with code 42, the game will seek() to 42*sizeof(struct mStr) and read the next bytes into the proper struct. There are several possibilities how we can proceed to convert these files into human-readable JSON files:

  1. Load all data files into memory when the game starts. Will significantly increase memory usage, but it's not 1992 anymore.
  2. Perform live deserialization of the required data file. Might be too slow for some of the bigger files, although rapidjson is pretty fast.
  3. Split the file into many small pieces, each containing one element of the array (e.g., mission_42.json). More cumbersome to work with these files.
  4. Keep the existing data formats, but automatically generate the datafiles from the corresponding JSON files during compile-time.

Opinions?

from raceintospace.

peyre avatar peyre commented on May 30, 2024

It would be exciting to finally ditch some of this hex file nonsense. I'm not a big fan of 3 or 4: replacing the hexadecimal files with easy-to-edit plaintext would be better, I think, and I'm not enthusiastic about splitting them into umpteen text files. I'm not sure I quite understand 2, but 1 sounds like it might be our best option.

from raceintospace.

hweimer avatar hweimer commented on May 30, 2024

Well, in 4 you also have an easy-to-edit JSON file in the source directory. It just gets translated to a binary file during the compilation of the game. Will probably require some CMake trickery (which is not exactly my area of expertise), but should be doable.

from raceintospace.

peyre avatar peyre commented on May 30, 2024

Well, however best you can do it, it would be a good thing - the main thing is to make the files easily moddable.

from raceintospace.

hweimer avatar hweimer commented on May 30, 2024

These suggestions could be helpful.

from raceintospace.

hweimer avatar hweimer commented on May 30, 2024

In #749, I went for option 2. Please report any issues with noticeable delays when flying a mission.

from raceintospace.

peyre avatar peyre commented on May 30, 2024

That's fantastic, that you've made some progress on converting a few of our binary files to plaintext. I'd love to see some of our really early Issues resolved - in addition to the whole "ease of modification" aspect.

from raceintospace.

hweimer avatar hweimer commented on May 30, 2024

Luckily, replacing fails.cdr by a JSON version turned out to be much easier than replacing the sequence files.

from raceintospace.

peyre avatar peyre commented on May 30, 2024

Great to hear.

from raceintospace.

peyre avatar peyre commented on May 30, 2024

I've just played most of a game. The change does seem to cause slight delays following missions, but no big deal.

However, when I was getting close to launching the Moon landing, the game crashed:

WARNING /home/leon/raceintospace/src/game/fs.cpp:279:try_find_file	can't find file `PPIX_08.ogg' in audio dir(s)
unhandled exception: vector::_M_range_check: __n (which is 2954) >= this->size() (which is 2954)
Aborted (core dumped)

ppix_08.ogg does exist in raceintospace/data/video/mission/, so I'm not sure what's going on.

from raceintospace.

hweimer avatar hweimer commented on May 30, 2024

The warning is about a missing audio file during countdown and is unrelated to the crash. 2954 is the length of the vector holding the failure sequences, so it looks like that some sequence code couldn't be found and the index variable increased beyond the bounds of the vector. I will put in some additional checks that the game doesn't crash in such a situation.

from raceintospace.

hweimer avatar hweimer commented on May 30, 2024

In #774, I'm now going from Option 2 for deserialization (see #3 (comment)) to Option 1 as the delays from deserialization are quite significant in AI-vs-AI simulations.

from raceintospace.

Related Issues (20)

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.