Unity 3d Support?

Per this article, Unity 3D now compiles to Web Assembly, Wasm

This could mean that you could make a full 3D video game world in Unity 3d, building it for WebGL, and then deploy it on the Internet Computer. Has anyone tried this? I do not have my internet ID, or dev. environment set up yet, but it seems like a tool chain is here.

Thanks
Shakespeare1212

7 Likes

Yap,

https://dqnbo-kiaaa-aaaad-qak2a-cai.raw.ic0.app/

Unity → WASM

Basically you can use this: Unity - Manual: WebGL: Interacting with browser scripting and setup interop between Unity and agent-js. You need to most likely create a library to handle the transformation between an agent-js object and a simplified js object to pass back to the C#, but that should be simple.

3 Likes

This seems a lot more interesting if you can separate the game logic from the rendering pipe line. I wouldn’t imagine that rendering would be very efficient on the IC?

This looks like it could be just a little bit awesome, but it just switches to “Unready?” in red, and then nothing happens. Does anyone want to join me?

James.

James you can just open a second browser in Incognito mode. Play against yourself :-p.

1 Like

Does anyone have some example of a Unity WASM file implemented (w/ motoko?). Or could me push into the right direction.

I use three.js instead of Unity for building 3d worlds
it has worked well so far

1 Like

Hello,
I am just new to IC and want to make unity webgl game on ICP.
here, I have some questions related to my project.
Can I call canister smart contract inside the unity game?
or should I call canister smart contract in js file and import it to unity script?
Please tell me if anyone have an idea.
Thank you.

1 Like

Are there any examples of 3D games that are require moderate processing? Something like a high-end mobile game?

I have been developing a 3D game that I would like to be optionally multiplayer but don’t want to re-write it to be a multiplayer game in the traditional sense (interpolation etc). Running the whole thing on-chain would be a great compromise if the IC can handle it.

Searching through the samples page I found this: GitHub - yosun/dfacecam No idea if this is what you’re looking for, but seems interesting

Wow, that’s pretty good, thanks. I’ll trawl through the samples page.

Can I ask how did it go ?

Severin - we have a sizeable Unity webgl project that runs in localhost and looking to build deploy to ICP mainnet.

Any serious new links to any resources for such a move ? - thanks in advance.

I have already deployed a few canisters - simnple ones and a FT token … I have the 0.24.1 v of dfx all setup and plenty of cycles

Any way to resolve server 500 backend timeouts ?? I’m on #110… trying to deploy a 400MB unity codebase Assets…

gave up after 110 time outs… and im on 30mbps down and 20mbps upload speeds.

I don’t know what currently happens with large files. @NathanosDev do you have any insight?

Thanks Severin,

Its a approx 400MB Unity webgl sized build

back-end server 500 exceptions ceased today - deployed ok now

Fetching properties for all assets in the canister.
Done fetching properties for all assets in the canister. Took 448.594242ms
Starting batch.
Staging contents of new and changed assets in batch 115:
/webgl-logo.png (2947 bytes) sha b30c3af2a4538c6edf5f2411953760641dfa257f2a4cc5b88d671aa243b1f12f is already installed
/favicon.ico (2305 bytes) sha 9c13beb90ee8f70580d52a21d5233970d1c89e71e4a34a462c22610941c3c77f is already installed
/unity-logo-dark.png (3042 bytes) sha c1b72d26c096487dabc948b54bc203f8dac7ed4e3f5733918798e858acb4b159 is already installed
/progress-bar-full-dark.png (74 bytes) sha 3306a6244dcb3926fca38a28e3ced589df8ff1beed955eb17c0bbf01c918bc62 is already installed
/unity-logo-light.png (3077 bytes) sha 002990aea0d946833cadc1519d5b7e50a4570bd537a0517dd79a59d3eec84da7 is already installed
/fullscreen-button.png (175 bytes) sha 21221581673a54b8139d408d4a3f8d2b879e86827d4b6fc53b995ff7a99ee3e9 is already installed
/webmemd-icon.png (1670 bytes) sha c56f5494640cedda273aad38d58e6ab9da625d5b3f4d875c0ff92c6192a569c2 is already installed
/jdametaversetestrunwebgl.data.gz (412290386 bytes) sha fdcb8767adbc7cb88da8a71898872d956f8ebcb9f9537ad84ed9071c3c7a03fb is already installed
/Video_1.mp4 (6705375 bytes) sha 3c4ceee8c69d607ef703be707bde63ea6a208396783480288bcbbab681421bc1 is already installed
/jdametaversetestrunwebgl.framework.js.gz (82102 bytes) sha 9dd7bcf974b8fcc8ca4f95f6e9c71b07a1077777db5de92a1969a4f4a36f55b1 is already installed
/MemoryProfiler.png (665 bytes) sha 0ce87be20d0c24ab6cb73b57de2004da261cc2a641e69319c6ae3fe11fc85483 is already installed
/Video_3.mp4 (11730361 bytes) sha 47511c20f2d0137321389ac1bdc558c6504dd9d48e57b45d8df8e066abe2709c is already installed
/jdametaversetestrunwebgl.loader.js (20642 bytes) sha 86ea62283e54262ba471d7fccfd1af877ef7a09ec4d047afbd9ddbb6d315d169 is already installed
/jdametaversetestrunwebgl.loader.js (gzip) (7357 bytes) sha db3bc0e33a8ad6cc17a8a3ac260ca01548d5e0c1fcd015500d5f83f34b46b525 is already installed
/progress-bar-empty-dark.png (96 bytes) sha bbee7131afe8a3365906240d89184dc86234c119467f390bc4bc6802328fdb4d is already installed
/jdametaversetestrunwebgl.wasm.gz (8521255 bytes) sha 508a1caf4e84d41406f41918fb8ef3167a7e0bbfd5646bec205e6f46ebfb6556 is already installed
/progress-bar-full-light.png (84 bytes) sha 12395ea785480c5cdf12fade6e6cbf49666d5bb1cef7240c113dbcba6bdc5c87 is already installed
/Video_2.mp4 (9761643 bytes) sha 59cb9a38da6b8ec14b7d1774a8e77eb250f9a6f38f226f108851e1f6ae485080 is already installed
/style.css (1428 bytes) sha 53080c2b597e94c25ffccbb95dd6de27f71159e18623cc33b375c203233f5a20 is already installed
/style.css (gzip) (467 bytes) sha 47aa8eaf3f78fb70aca1fb9f072b053f248098423648444b2365c692f5d554de is already installed
/progress-bar-empty-light.png (109 bytes) sha 143696c060ad43d6c30f19ff5f49000927a139a2a1e4c9f45fafaa2b90d7d2be is already installed
Committing batch.
Deployed canisters.
URLs:
Frontend canister via browser
unity_webgl_template_assets:
admin@Admins-MacBook-Pro-2 jdametaversetestrunwebgl % dfx canister status edx4q-jaaaa-aaaap-akqha-cai --network ic

Please enter the passphrase for your identity: [hidden]
Decryption complete.
Canister status call result for edx4q-jaaaa-aaaap-akqha-cai.
Status: Running
Controllers: tzjak-ovwyg-2726s-j6nnf-jegj7-4edtg-h2kuu-3gon4-ssk4i-kynmu-uae ymkjf-naaaa-aaaap-accia-cai
Memory allocation: 0
Compute allocation: 0
Freezing threshold: 2_592_000
Memory Size: Nat(1700082864)
Balance: 2_365_352_455_538 Cycles
Reserved: 0 Cycles
Reserved cycles limit: 5_000_000_000_000 Cycles
Wasm memory limit: 3_221_225_472 Bytes
Module hash: 0x2c9e30df9be951a6884c702a97bbb8c0b438f33d4208fa612b1de6fb1752db76
Number of queries: 0
Instructions spent in queries: 0
Total query request payload size (bytes): 0
Total query response payload size (bytes): 0
Log visibility: controllers
admin@Admins-MacBook-Pro-2 jdametaversetestrunwebgl %

fixed … yes coolio!

admin@Admins-MacBook-Pro-2 jdametaversetestrunwebgl % dfx canister status edx4q-jaaaa-aaaap-akqha-cai --network ic

Please enter the passphrase for your identity: [hidden]
Decryption complete.
Canister status call result for edx4q-jaaaa-aaaap-akqha-cai.
Status: Running
Controllers: tzjak-ovwyg-2726s-j6nnf-jegj7-4edtg-h2kuu-3gon4-ssk4i-kynmu-uae ymkjf-naaaa-aaaap-accia-cai
Memory allocation: 0
Compute allocation: 0
Freezing threshold: 2_592_000
Memory Size: Nat(1700082864)
Balance: 2_365_352_455_538 Cycles
Reserved: 0 Cycles
Reserved cycles limit: 5_000_000_000_000 Cycles
Wasm memory limit: 3_221_225_472 Bytes
Module hash: 0x2c9e30df9be951a6884c702a97bbb8c0b438f33d4208fa612b1de6fb1752db76
Number of queries: 0
Instructions spent in queries: 0
Total query request payload size (bytes): 0
Total query response payload size (bytes): 0
Log visibility: controllers
admin@Admins-MacBook-Pro-2 jdametaversetestrunwebgl %

solved ! … well it resolved itself

I got it to deploy… could have been upload mbps

now I have a browser /js or html code issue - due to it being a canister on the boxes