Hosting Unity game on Netlify

I have a unity game. when user opens the website, 250mb of game file load on their side and then the game starts.
the file can’t be sent in parts or hosted on cdn.
What is the best way of hosting this game?
Because hosting on netlify we will require unlimited bandwidth, but that option is not available in pricing.
Please help.

Hey there, @sc0rp10n.py :wave:

Thanks for reaching out. I recommend starting with this thread: Netlify function to trigger something in unity game engine as well as this search: Search results for 'unity' - Netlify Support Forums Let us know if this gets on the right track when it comes to technical work.

In terms of bandwidth, the best resource for you will be our Pricing Page. Our Pro Plan starts at 1TB /month, and then $55 per 100GB that follow.

Can you elaborate on why the file can’t be hosted on CDN?

@sc0rp10n.py, if you have very large files that rarely change, I wouldn’t even put the file itself on Netlify. You could still host the website here, just not the giant files.

To explain more, Netlify is not optimized for sending files over 10 MBs. You can host files that large here but over that size, the Standard Edge Network will never cache the file and the failure to cache will greatly impact performance (and when I say “impact” I don’t mean in a good way.)

What I would recommend is hosting the game file itself (the 250 MB file) on some other service designed for “large file hosting”. If you web search for that phrase, you’ll find no shortage of services.

One frequent workflow is a AWS S3 bucket where the large files are uploaded with Cloudfront then pointing to those files. Cloudfront is then providing geographically distributed caching and makes the download faster than using S3 directly.

With that workflow above, you then keep any very large files in S3 and reference them in your HTML using the Cloudfront URL. This also allows you to update the game file without needing to redeploy the site at Netlify. The Cloudfront URL won’t change even if the content it points to (the game file) does.

This “keeping the URL the same” is optional of course. You could use a unique URL for each version instead if you preferred but then that does required a new deploy at Netlify to update the website to change it.

This is just one solution. There are many difference services designed for large file hosting and so each solution will vary based on the service (or services) used.

Also, good luck on your game development endeavors. Some of my favorite games are built with Unity and I wish you the best.

1 Like

@luke
Hi luke, thanks for the S3 suggestion.
I created a S3 bucket, and uploaded my file their.
I got this URL for the file
https://martianverse.s3.ap-south-1.amazonaws.com/Build.data
but when i try to access it, it says access denied.
On my game frontend i get 403 forbidden.

I think i missed on some public setting, it would be really helpful if you could point me to the right direction.

@sc0rp10n.py Have you googled for AWS Documentation, this may help:

1 Like