Code Monkey home page Code Monkey logo

epfviewer's Introduction

EPFViewer

NexusTK EPF Viewer for viewing and exporting EPF/TBL/PAL/MAP files.

Table of Contents

Quickstart

This script will take a while to initially load up, give it some time.

Dependencies:

  • Python 3 (PyQt5)
  • Python pip3 dependencies:
    • pyqt5
    • pillow
    • struct

Running the script:

python3 epf_viewer.py

FileReader Module

This module contains readers for the following files:

  • TBL
  • PAL
  • EPF
  • MAP

File Structures

Tile{A,B,C} TBL File Structure

int tile_count                     (4 bytes)
int palette_count                  (4 bytes)
byte[3] unknown                    (3 bytes)
short[tile_count] palette_indicies (2 * tile_count bytes)

Note: TileX.tbl will refer to various TileX[0-(palette_count-1)].pal files.

SObj TBL File Structure

int obj_count               (4 bytes)
short unknown               (2 bytes)
obj[obj_count]              (? bytes)

typedef struct {
  byte movement_directions  (1 byte)  Map Editor:
                                        0x00 (Empty)
                                        0x01 (Bottom)
                                        0x02 (Top)
                                        0x04 (Left)
                                        0x08 (Right)
                                        0x0F (All Sides)
  byte tile_count           (1 byte)
                                      MAX of 0x0A
  short[tile_count]   (2 * tile_count bytes)
} obj

Note: Movement Directions appears to have 6 states:

  • 0x00 (Empty)
  • 0x01 (Bottom)
  • 0x02 (Top)
  • 0x04 (Left)
  • 0x08 (Right)
  • 0x0F (Full)

PAL File Structure

byte[32] header    (32 bytes)
color[256] palette (1024 bytes)

typedef struct {
  byte blue        (1 byte)
  byte green       (1 byte)
  byte red         (1 byte)
  byte padding     (1 byte)
} color            (4 bytes)

EPF File Structure

short tile_count                    (2 bytes)
short width                         (2 bytes)
short height                        (2 bytes)
short unknown                       (2 bytes)
int pixel_data_length               (4 bytes)
byte[pixel_data_length] pixel_data  (pixel_data_length bytes)
tile_entry[tile_count] tile_entries (tile_count * 16 bytes)

typedef struct {
  int unknown                       (4 bytes)
  short width                       (2 bytes)
  short height                      (2 bytes)
  int pixel_data_offset             (4 bytes)
  int unknown_offset                (4 bytes)
} table_entry                       (16 bytes)

MAP File Structure

short width              (2 bytes)
short height             (2 bytes)
tile[width*height] tiles (width * height * 4 bytes)

typedef struct {
  short tile_id          (2 bytes)
  short unknown          (2 bytes)
} tile                   (4 bytes)

EPFViewer GUI (PyQt5)

A GUI using the FileReader module to perform some functions.

Features:

The EPFViewer attempts to mimic parts of the NexusTK Map Editor.

The Data directory (from NexusTK Map Editor) is required. This contains the following files:

SObj.tbl    // Not yet implemented
TileA0.pal
TileA1.pal
TileA2.pal
TileA3.pal
TileA4.pal
TileA5.pal
TileA6.pal
TileA7.pal
TileA.epf
TileA.tbl
TileB0.pal
TileB1.pal
TileB2.pal
TileB3.pal
TileB4.pal
TileB.epf
TileB.tbl
TileC0.pal
TileC1.pal
TileC2.pal
TileC3.pal
TileC4.pal
TileC5.pal
TileC6.pal
TileC7.pal
TileC8.pal
TileC9.pal
TileC10.pal
TileC.epf
TileC.tbl

This editor and its Data directory contents are intentionally NOT INCLUDED here. These files are binary files and certainly do not belong in this repository.

These Data files are required Since this exports NexusTK EPF/PAL/TBL files, the EPFViewer is coded to reference TileA, TileB, TileC format - this can be modified for custom projects.

  • Export A Tiles to Bitmaps
  • Export B Tiles to Bitmaps
  • Export C Tiles to Bitmaps
  • Export All Tile Groups (A, B, C)
  • Export individual Tiles to Bitmap (Right-Click)

epfviewer's People

Contributors

dizzythermal avatar

Watchers

James Cloos avatar

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.