Grid Sage Forums

Grid Sage Forums

  • May 19, 2024, 08:53:14 PM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

News:

LINKS: Website | Steam | Wiki

Author Topic: Problem with importing xp file when having more than one layer  (Read 3162 times)

dagondev

  • Derelict
  • **
  • Posts: 31
  • https://www.reddit.com/r/piraterogue/
    • View Profile
    • My project - Pirate Rogue

Sorry for lack of visual examples, currently at work. Will deliver those later.
While this maybe more of a RexReader problem, it looks like something is changed in structure of a file when xp have more than one layer. I checked code for RexReader with your specification and everything looks okay, but when xp have more than 1 layer, colors and chars get messed up. As I was fiddling with RexReader itself I get it somehow working by switching order or reading colors and char.
RexReader: https://github.com/BaconSoap/RexReader/blob/master/RexReader/RexReader.cs#L202
Manual: http://www.gridsagegames.com/rexpaint/manual.txt
Logged

Kyzrati

  • Administrator
  • True Cogmind
  • *****
  • Posts: 4324
    • View Profile
    • Cogmind
Re: Problem with importing xp file when having more than one layer
« Reply #1 on: March 14, 2016, 08:58:21 AM »

Hm, that's odd. To my knowledge there are numerous RexReader users and none have reported it causing any trouble. Maybe bring it up with BaconSoap himself?

Nothing has changed in the specification.

When there's more than one layer, the only thing to remember is that it's necessary to read in the layer dimensions separately for each one, even though the value won't change from layer to layer.
Logged
Josh Ge, Developer - Dev Blog | @GridSageGames | Patreon

gumix

  • Cyborg
  • ***
  • Posts: 134
    • View Profile
Re: Problem with importing xp file when having more than one layer
« Reply #2 on: March 14, 2016, 01:23:28 PM »

I made a quick look into their code, Seams they don't read width and height of every layer. (they all are identical but must be parsed out from file).
Logged

Kyzrati

  • Administrator
  • True Cogmind
  • *****
  • Posts: 4324
    • View Profile
    • Cogmind
Re: Problem with importing xp file when having more than one layer
« Reply #3 on: March 14, 2016, 08:55:03 PM »

I figured that would be the problem. I guess others haven't run into issues since not a lot of people use multiple layers. Haven't seen BaconSoap around so I'll let another dev who's updated the repo before know--he's written a roguelike library that uses it and is pretty active.
Logged
Josh Ge, Developer - Dev Blog | @GridSageGames | Patreon

Thraka

  • Unaware
  • *
  • Posts: 7
  • SadConsole - .NET Roguelike/Console game engine
    • View Profile
Re: Problem with importing xp file when having more than one layer
« Reply #4 on: March 15, 2016, 10:58:43 AM »

Hey guys, I can fix his bug but I'm not totally sure where it is. I tried investigating it a couple of months ago but couldn't figure it out. I would fix one thing then suddenly some other oddity would show up. So I just wrote my own reader from scratch following the spec. I'll get you all some code later tonight after work.

Thraka

  • Unaware
  • *
  • Posts: 7
  • SadConsole - .NET Roguelike/Console game engine
    • View Profile
Re: Problem with importing xp file when having more than one layer
« Reply #5 on: March 15, 2016, 08:41:03 PM »

Here you guys go: https://github.com/Thraka/SadRex/releases

I didn't test it though because I'm pressed for time. Let me know if there are problems. You can also fork and fix. The code is much more straight forward than RexReader (no offense Bacon Soap :) ).

Also, I made it as a PCL so it should run everywhere with no problems.
« Last Edit: March 15, 2016, 08:46:47 PM by Thraka »
Logged

Kyzrati

  • Administrator
  • True Cogmind
  • *****
  • Posts: 4324
    • View Profile
    • Cogmind
Re: Problem with importing xp file when having more than one layer
« Reply #6 on: March 15, 2016, 09:39:55 PM »

Thanks for the C# solution, I've added it to the site!
Logged
Josh Ge, Developer - Dev Blog | @GridSageGames | Patreon

dagondev

  • Derelict
  • **
  • Posts: 31
  • https://www.reddit.com/r/piraterogue/
    • View Profile
    • My project - Pirate Rogue
Re: Problem with importing xp file when having more than one layer
« Reply #7 on: March 16, 2016, 08:18:26 AM »

Wow, thanks guys!
Logged