Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loadout support #66

Merged
merged 28 commits into from
Nov 21, 2019
Merged

Loadout support #66

merged 28 commits into from
Nov 21, 2019

Conversation

Longi94
Copy link
Contributor

@Longi94 Longi94 commented Oct 19, 2019

Loads car models from rocket-loadout.com
Also fixes #45

@todo
Copy link

todo bot commented Oct 19, 2019

use the default wheel for now, there aren't a lot of wheels in rocket-loadout yet, and not yet fully supported

// TODO use the default wheel for now, there aren't a lot of wheels in rocket-loadout yet, and not yet fully supported
wheels = new WheelsModel(Wheel.DEFAULT, paintConfig, manager.config)
await wheels.load()
body = await bodyTask
}


This comment was generated by todo based on a TODO comment in 7d2cf9c in #66. cc @SaltieRL.

@Longi94 Longi94 changed the title Loadout support WIP Loadout support Oct 19, 2019
@todo
Copy link

todo bot commented Oct 20, 2019

use the default wheel for now, there aren't a lot of wheels in rocket-loadout yet, and not yet fully supported

// TODO use the default wheel for now, there aren't a lot of wheels in rocket-loadout yet, and not yet fully supported
wheels = new WheelsModel(Wheel.DEFAULT, paintConfig, manager.config)
await wheels.load()
body = await bodyTask
}


This comment was generated by todo based on a TODO comment in 6b0163d in #66. cc @SaltieRL.

@Longi94 Longi94 changed the title WIP Loadout support Loadout support Oct 20, 2019
@Sciguymjm Sciguymjm requested a review from Abbondanzo October 23, 2019 00:54
Copy link
Member

@Abbondanzo Abbondanzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good but I wouldn't scrap the default model loaders. For the future, we're going to add quality scales and mobile users will be defaulted to load really basic models (I'm talking a few steps removed from a box) so that we don't blow our their CPUs.

const paintConfig = createPaintConfig(player.isOrange)
body = new BodyModel(Body.DEFAULT, Decal.NONE, paintConfig, manager.config)
wheels = new WheelsModel(Wheel.DEFAULT, paintConfig, manager.config)
await Promise.all([body.load(), wheels.load()])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does your library handle caching the body and wheel loads?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The lib itself doesn't handle caching, but I've enabled three's internal cache here:

Cache.enabled = true

Although since this only caches the raw downloaded assets, they do still need to be processed. If you want to speed up processing, there are also smaller textures available that have 4x less pixels.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Three's cache is fine for handling preexisting assets being added to a scene, but this might still make the request to download these models N times over assuming the browser isn't smart about cache. On a mobile connection, another 30Mb is another 30 seconds.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Three's FileLoader is smart enough to not load duplicate assets https://github.com/mrdoob/three.js/blob/master/src/loaders/FileLoader.js#L48

E.g. if you enable default loadouts and check the requests in the dev console, there is only one request for the octane, while normally the browser would show multiple requests but indicate that the subsequent ones are fetched from cache.

@Longi94 Longi94 changed the title Loadout support WIP Loadout support Oct 24, 2019
@Longi94
Copy link
Contributor Author

Longi94 commented Oct 24, 2019

I am considering making some big changes to the model files. Setting this to WIP

# Conflicts:
#	package-lock.json
#	package.json
#	src/loaders/scenes/GameFieldAssets.ts
@todo
Copy link

todo bot commented Nov 21, 2019

use the default wheel for now, there aren't a lot of wheels in rocket-loadout yet, and not yet fully supported

// TODO use the default wheel for now, there aren't a lot of wheels in rocket-loadout yet, and not yet fully supported
wheels = new WheelsModel(Wheel.DEFAULT, paintConfig, manager.config)
await wheels.load()
body = await bodyTask
}


This comment was generated by todo based on a TODO comment in 43e326e in #66. cc @SaltieRL.

@Longi94 Longi94 changed the title WIP Loadout support Loadout support Nov 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Car models are slightly larger than in-game models
3 participants