Giter Site home page Giter Site logo

njibhu / t3d Goto Github PK

View Code? Open in Web Editor NEW
19.0 3.0 3.0 39.27 MB

Set of tools to explore guildwars2 from your browser

License: GNU General Public License v3.0

TypeScript 27.02% JavaScript 68.85% HTML 0.18% C 0.57% CMake 0.03% C++ 3.15% SWIG 0.16% CSS 0.05%
guildwars2 tyria3d t3d javascript

t3d's Introduction

T3D

This is the new home of the Tyria3D project.

Come and try it here:

What is T3D ? Wasn't there a Tyria3DLibrary ?

T3D is a new mono-repository to combine the work of the few small projects using the library. The point of using a mono-repo is allowing faster iterations on different parts of the project. It also greatly decreases the burden of maintaining the project.

The library contains the core logic for parsing and transforming the data coming from the .dat archive.

The projects built on it are:

- Tyria3DApp (now abandonned)

Tyria3DApp was the legacy map viewer publicly available. Due to recent changes to the archive, it is no longer compatible with the current game files. Because of the increasing differences and incertainty about the ownership of the project it is now abandonned.

- T3D Explorer (new!)

The explorer is a newly built version of the Tyria3DApp built on top of the current version of the library. The developement of the explorer will now focus on this version instead of the legacy Tyria3DApp.

- T3D Browser (previously Tyria2D)

An archive browser with an integrated chunk parser for the file archive. Coming from the original release of the Tyria3DLibrary.

- SimpleModelViewer (Part of the examples)

A simple 3D model viewer for the file archive. Coming from the original release of the Tyria3DLibrary.

Extra modules

- t3dtools.js

This project contains the wasm port of the t3dtools originally written by Ahom.

- utils

This module contains a lot of utilities including the generators for the declaration and definition files for the new parser.


Current goals and status

This repository contains experimental and non-working code. Some of it is imported while other is work in progress.

The current main focus is:

  • Finishing the new parser written in TypeScript and integrate it with the library. This will allow for much easier maintenance as the game continues to be updated.

Contributors

Here are a few people which contributions have been critical to the existance of this project:

  • Ahom
  • RequestTimeout408

License

All the code is under GPL 3 license with the exception of assets from ArenaNet's Guild Wars 2 Asset Kit. A COPYRIGHT file in the same folder of these assets contains the necessary copyright notice.

t3d's People

Contributors

dependabot[bot] avatar njibhu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

t3d's Issues

List + loading

Several LW1 return maps are not listed as is not the new map Gyala Delve.

As for the Gyala Delve, it does not load. The loading does not even start. What could cause this is unknown yet, however it is a first map with ID starting with number "3", therefore it may be possible the viewer does not recognize IDs "3+" as maps. Fixing this is severely crucial, as it would mean no future map could be loaded.

Some props are not being renderer by the PropertiesRenderer

How to replicate:

  1. Open explorer
  2. Load Lion's Arch
  3. Mosts of buildings and bridges are missing.

Extra information:

Few thoughts about where the bug might come from:

  • The chunk definitions haven't been updated since forever (mainly because of focused work on the new parser), these props might be using a new version. Seems unlikely though because it should raise errors in the console and from what I checked, neither geom or prp2 have been updated.
  • Textures are missing. Maybe the prop is renderered but fully transparent.
  • The LOD implementation is not very sound, might be a bug in there.

Confirmed to not be related to:

  • backculling. (Checked, this is not the source of the bug)

To help with debugging, in claw island some of the props for the wall around the fort have the same issue. This map is quite fast to load in comparison to LA.

[Explorer] Console error on page load

Uncaught TypeError: can't access property "domElement", mapRenderer.renderer is null
    [1]< index.js:391

Quick fix needs to be registered only after the renderer is setup.

[Parser] Chunk names changes every version

In chunk definitions regeneration:

When chunk names contain their offset it solves the duplication issue but creates a new issue at the same time.
Every update will create a huge PR with new files for every chunks and imports need to be updated.

Solution:
Maintain a mapping list between the root name of the first version of a chunk and the short name we will use in the definitions.
When a chunk doesn't have its mapping, the generation should fail and the mapping should be updated by the maintainer.

[Library/PropertiesRenderer] THREE.DirectGeometry.fromGeometry(): Undefined vertexUv

Reproduce:

  • Map rendering on Cragstead with props enabled

For Cragstead the models responsible for this error are:

  • "78877"
  • "76653"
  • "74595"

After quick investigation, this doesn't seem to produce much performance difference.

How to find out which models are causing it:

  • add a breakpoint on the log (in the threejs build)
  • check the vertices array.
  • Add logs looking for the same vertices in the vertex parsing code of the renderutils.

[Library] Skybox code is broken

  • Fallback code is broken, ids are wrong.
  • Fallback should also not use hosted files but from the archive.

Once fallback is fixed, investigate fixing the real skyboxes

Doesn't load almost every map anymore

Went to check this tool again after some years when I discovered it first but it seems to be stuck at loading, raising ram usage and then crash Chrome.
Only one of the maps (the dev test one) can be loaded.
I made sure to exclude all the power hungry options for faster loading too.
I wonder if this tool is even still usable or abandoned by now.

[Library] PropertiesRenderer mesh improvement

The properties renderer create a new THREE.Mesh for every mesh in the world.
We should use instanced meshes which would save a lot of memory.

Issue:

  • InstancedMeshes in threejs needs to know in advance how many instances will be used
  • Map only refers to 3d models, not meshes directly. Most of objects have many meshes.
  • Different objects can use the same mesh

Solution for now:
We can already improve the solution by having an instanceMesh for each meshes of a specific model. Getting instance mesh working cross object would need a big architectural change, and this would be welcome when getting the implementation fully async, but too big for now.

  • Predict amount of instances for a mesh by counting before how many times an object is used on the map.

  • Then while rendering the object itself
    -- Count how many instance of the same mesh we have on the object
    -- The THREE.MeshInstance amount is instanceOnSameMesh * objectOnMapAmount

  • We need to have a counter for knowing which instance each mesh needs to use and translate/scale/rotate.

3+ maps do not even start loading

Same issue as Gyala Delve happends with new SAB World 3 map. Those two have ID beginning with #3, by that we can clearly say the tool is unable to load 3+ maps.

Performance research

Merge meshes for modl pack

let materialArray = [
    new THREE.MeshBasicMaterial({color: 0xFF0000}),
    new THREE.MeshBasicMaterial({color: 0x00FF00}),
    new THREE.MeshBasicMaterial({color: 0x0000FF}),
];

const geomRoot = new THREE.Geometry();
geomRoot.merge(geom0.geometry, geom0.matrix, 0);
geomRoot.merge(geom1.geometry, geom1.matrix, 1);
geomRoot.merge(geom2.geometry, geom2.matrix, 2);

const mesh = new THREE.Mesh(geomRoot, materialArray);

https://threejs.org/docs/index.html#api/en/core/Geometry.merge

Memory leak in t3dworker.js

There's a memory leak in t3dworker.js
Now that assets are getting bigger and bigger this becomes quite a big issue.

The bug must come from the wrapper not correctly freeing memory after the inflate calls.

"Loading Terrain 99%" in perpetuity

A good number of maps seemingly stop loading at 99% and remain there infinitely (hours or more) until the page is refreshed. Is this a known issue?

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.