Jump to content

  • Log In with Google      Sign In   
  • Create Account


Unity Caching in Web Player, without WWW


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 Dan Violet Sagmiller   Members   -  Reputation: 896

Like
0Likes
Like

Posted 19 March 2013 - 01:08 PM

I have a game in unity+C# running on the web browser.  Map data resides on the server so that each player can get to it from any machine.

Map Data for some players is almost 50 megs (I'm aware of the 50 meg free caching cap) and each time the player logs in, it has to download all that content again.

 

I would like to use caching, but it looks like it only works through WWW, and only for Asset Bundles.  The server builds the map information for each player live, and is not a Unity machine, but just an MVC4 service coupled with a website to download binary map data.

 

I would like to simple execute code similar to this

 

byte[] contents = [binary map data];

save("player1.mapdata", contents);

 

As well as the ability to load from file name, and also check if the file exists locally.

 

 

does unity web player have a way to do this?

 

(I also have this question on the unity forums)


Moltar - "Do you even know how to use that?"

Space Ghost - “Moltar, I have a giant brain that is able to reduce any complex machine into a simple yes or no answer."

Dan - "Best Description of AI ever."

My Game(s), Warp Wars is in early development and can be found here: http://blog.WarpWars.Net.


Sponsor:

#2 hplus0603   Moderators   -  Reputation: 5069

Like
2Likes
Like

Posted 19 March 2013 - 01:27 PM

I believe this is one of the ways that Unity starts making money from "real" uses of their web player. Last I checked into this (which was two years ago) there was no good way of loading game-like assets from non-Unity data; you had to convert to asset bundles on the server side, and you had to go through their caching layer, where you have to pay for more than 50 MB of local caching.
There is a WWW interface that allows you to issue a "GET" or "POST" but it's not quite to the level that you can trust a "streaming game experience" to it.

Again, this was about two years ago, so things may have changed since then. We ended up developing our platform on HTML5 + WebGL instead.
enum Bool { True, False, FileNotFound };

#3 Kylotan   Moderators   -  Reputation: 3333

Like
1Likes
Like

Posted 19 March 2013 - 04:42 PM

Have you tried manually caching the data yourself, writing it to Application.temporaryCachePath?

 

If that's not good enough, consider whether you can reconstruct maps on-demand based on sending instructions, instead of sending the whole set of map data. If most of the building blocks are already on the player's machine (perhaps at all times), along with the code to assemble a map out of those blocks, then the data to describe a map can be very small.



#4 Dan Violet Sagmiller   Members   -  Reputation: 896

Like
0Likes
Like

Posted 21 March 2013 - 08:19 AM

Have you tried manually caching the data yourself, writing it to Application.temporaryCachePath?

I have not,  I started to look into it, but your second idea works better for me.

you can reconstruct maps on-demand based on sending instructions, instead of sending the whole set of map data

After some reflection, I've found that this will be the most suitable for my game.  I'll focus on keeping the generation methods lightweight and split into areas of 32x32 or possibly smaller.  I don't think I'll have any buildings bigger than that, at least not as one model.

As long as the generation is lightweight, transferring the data will probably take longer than just generating it on the fly.  

http://blog.warpwarscity.com/2013/03/changing-mapping-plan-again.html


Moltar - "Do you even know how to use that?"

Space Ghost - “Moltar, I have a giant brain that is able to reduce any complex machine into a simple yes or no answer."

Dan - "Best Description of AI ever."

My Game(s), Warp Wars is in early development and can be found here: http://blog.WarpWars.Net.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS