Giter VIP home page Giter VIP logo

godot-eqloader's Introduction

godot-eqloader

A Rust-based Godot 4 extension, using the gdextension crate, for loading EverQuest assets at runtime from the original data files. It depends heavily on the libeq crate, and is really a thin wrapper around it with a translation layer into Godot's objects and conventions.

Example Project

The example project in this repository attempts to show, in the most concise way possible, how to build Godot assets with this plugin. For a more advanced example, I will be setting up a separate repository. To run the example project, you must provide .s3d files yourself, and either put them in the eq_data folder, or create an environment variable called EQDATA that points to a folder containing .s3d files.

To run the example, first build the GDExtension: cargo build Then you can either open the example project in the Editor, or run it in the command line: godot4 --path ./example/EQLoaderExample

There are some command line options. The default action is to load a random zone and character file.

Load a specific zone, including its characters: godot4 --path ./example/EQLoaderExample -- --zone misty

Load a character file only: godot4 --path ./example/EQLoaderExample -- --chr global_chr

Building

First, make sure to follow the setup instructions for the gdextension crate. At the time of this writing, that includes setting the GODOT4_BIN environment variable to point to your Godot4 binary. Then...

cargo build

Or for a release build:

cargo build --release

Installation

After building, copy godot_eqloader.dll (or .dylib or .so) from ./target/release/ into your project directory somewhere.

Create a file called EQLoader.gdextension next to it that looks something like this:

[configuration]
entry_symbol = "gdext_rust_init"

[libraries]
linux.64 = "res://./godot_eqloader.so"
macos.64 = "res://./godot_eqloader.dylib"
windows.64 = "res://./godot_eqloader.dll"

Current State

The following features are currently implemented:

WLD fragment access

  • S3DWld - Provides methods for getting all the fragments described below
  • S3DMesh - A wrapper around DMSPRITEDEF and DMSPRITEDEF2, which represent all meshes
  • S3DMaterial - A wrapper around MATERIALDEF and its SIMPLESPRITEDEF and BMINFO references, which represent materials and their texture properties
  • S3DActorDef - A wrapper around ACTORDEF, which represents actors in the world such as placeable objects and characters
  • S3DActorInstance - A wrapper around ACTOR, which represents instances of ACTORDEFS in a zone
  • S3DHierSprite - A wrapper around DMHIERARCHICALSPRITE, which represents skeleton-based objects such as characters, and their animations (TRACK and TRACKDEF fragments)
  • S3DUnknownFragment - A wrapper around unsupported fragments, for analysis. To actually look at the fragment data, see the "Extra Features" section below.

Archive access

  • Loading .wld files as S3DWld objects (described above)
  • Loading .bmp files as Godot Images and ImageTextures
  • Loading .wav file as Godot AudioStreamWAV

The following features may be supported in the future, and any help is welcome:

  • Regions (For the sole purpose of detecting whether the player is in a particular special region such as water, zoneline, etc)
  • Lights
  • Blitsprites

Extra Features

This library can be compiled with a serde feature, which adds a new method to all fragments: as_dict. This returns a serde-serialized representation of the underlying raw fragment data as a Godot Dictionary, for analysis. For fragments that do not have a wrapper, you can get them and look at their data with wld.at(fragment_index).as_dict().

godot-eqloader's People

Contributors

bryab avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

godot-eqloader's Issues

Add support for WorldTree

It should be possible to get WorldTree data, including Region data needed to know the type of region the player is in.

I think it would be useful to have a function like region_at_pos(x,y) that returns the Region where the player is by traversing the BSP tree.

Add support for Legacy Meshes

It would be my preference to have the S3DMesh GodotClass wrap around both the old DMSPRITE and the newer DMSPRITE2.

Add support for 2D sprites

Get whatever data is important about 2D sprites in the game, which includes things like particle sprites (fire, smoke, etc) and UI elements

Add support for Lights

Add support for getting the basic data needed to create lights and to setup ambient lighting. Vertex colors are already supported.

Can this work for Godot 4+ games with multiplayer and open world chunks?

Test chunks link: WithinAmnesia/ARPG#15

I'm trying to find a way to seamless load and unload chunks for a 2D multiplayer game project to make an open world with a working server using Godot 4.2.1.NET.

How can this work for multiplayer and what is needed for this to potentially work? What options can be used for chunk loading and unloading seamlessly in Godot 4.2.1.NET? Please give feedback.

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.