Hot answers tagged

36

First of all, are you sure you really need that? Have you calculated the memory footprint? A small back-of-the-envelope calculation: A single mob and its state should fit into 100 byte of data. Let's give it a whole kByte, in case you are doing something extraordinary. When a cell has 1000 such entities, it requires a MByte. If your world is 100x100 cells, ...


14

One way you could solve this problem is not actually storing state on disk, but just setting up your generation code to use a seed for the random number generator, so it generates the same thing for a given area every time the area is generated, deterministically. Then you just keep the 1000 or so most recently visited areas in memory. When areas are ...


4

Save it to the hard drive instead. Saving large quantities of data in a non-volatile fashion is literally why hard drives were invented. If a player isn't interacting with it anymore, you won't need to rapidly access it, so why keep it in the RAM? Just save it to the your server's hard drive in a text file or something.


2

I assume that col1 is also declared elsewhere in the code, otherwise I don't understand how this would've compiled. Notice this line: BoxCollider2D col1 = new GameObject().AddComponent<BoxCollider2D>(); You're re-declaring col1 within a limited scope, and so you're not setting the external col1, which is used when the touch phases ends. Use col1 = ...


2

TL;DR Use metrics to find what's a performance problem, don't just guess what it is. TL As you're accessing it via a web interface, the datastore at the back end is irrelevant. The performance considerations for you concern the transport of the data to your client and then the parsing of the data into workable data structures (i.e. C# classes). If you ...


2

After trying several things it seems that it is a problem with version 3.7.1 of Monogame. I switched to Version 3.6 and the padding is gone. I will update this answer/question if I find the reason why 3.6 behaves differently then 3.7.1


2

The editor grays them out to remind you the code doesn't work in the current build platform you chose. For example if in the editor you have chosen Android as the current build platform, it will gray out code that is on other platforms to remind you that this code only works on Android build. Sometimes you'll write code for debug and testing, so you'll put ...


2

They do mess with some time and calculate everything from it. The question is which time do they use? Some games do use system time, and on their case, if you change your time locally, you can fool them to earn rewards. Other games use server time, so when the game starts, it attempts to connect to a server to get that time and make all the calculations. ...


2

They do actually use the clock the way you think they do, but they'll sometimes make network requests to get the time from a more reliable source. Try disabling the internet, closing the game and then setting the clock. They should either completely refuse to load or have the wrong values.


2

You don’t. This would need to be simply a single-step achievement.


1

Only allow saving on quit and delete the save on load. A somewhat common approach to this sort of problem is to quit the game when you save. So for your case, when they player try to save the game they could be presented with two options: Save and quit Cancel Then when the player returns to the game to load their save you can pop up a warning to the ...


1

I don't think it's possible to open 'permissions' page directly from the app. However you can open settings page with Toast like, "click permissions and allow X permission to proceed", to guide the user.


1

I would love if unity permission has call backs but unfortunately there is not. So i found a way around it. When i ask for permission using: Permission.HasUserAuthorizedPermission("android.permission.WRITE_EXTERNAL_STORAGE"); Then android native popup come up which is asking for permission at that time unity application is out of focus. and when user ...


1

From my experience in game developing, when making a game for multiple platforms, its easier to organise everything in such a way that works for most of them. In this case, using a SurfaceView is like telling to android "Give me a rectangular area on the screen, where I will draw custom graphics". This is very similar to how game development is being done ...


1

Well after leaving the app alone for an hour I launched it up again to check the Iap screen. Somehow, without pressing anything, the purchase that was somewhere pending ended up resolving, and I saw my popup indicating that the purchase completed. The purchase finally finished. So one of my latest actions probably triggered this, which are: Adding a ...


1

If you want to rotate the video sphere counter to the head's rotation (to make it look like the head is rotating within a stationary sphere), then you want something like this on the sphere: // Track the sphere's starting orientation in your scene. Quaternion _startingOrientation; void Start() { _startingOrientation = transform.rotation; } // Re-...


1

Yes, it's totally OK to use Google Play Games in both free and premium apps. You just have to accept the Google Play Games Services Terms of Service and Google APIs Terms of Service. You agree to accept these terms when you use the API.


1

I used native share since Unity doesn't really provide this feature. Saving the csv was also very straightforward: public string save() { string fileName = Application.persistentDataPath + "/saveDefault.csv"; using (StreamWriter w = new StreamWriter(fileName, false)) { foreach (TrafficRecord tr in data) { string ...


1

Forcing the keyboard to stay open may not be the best method as on some mobiles the keys will take up a good portion of the available screen space. If a user cannot un-focus the board it could lead to a bad experience for them. With that suggestion out of the way you do not have to write a custom plugin to achieve the behavior you want. You can set up a ...


1

If anyone has the same problem, here's how I fixed it: At first, I didn't know what to do or if I was doing the right thing but I decided to try a bunch of different things: I had to update the JDK and SDK used by android studio, and set the path on unity instead of using the default that was installed by unity hub. Through the SDK manager, I installed SDK ...


1

In your project open the Plugins folder and open the Android folder. Open up the android manifest and remove any lines written in the manifest that you are not using such as facebook sdk or another plugin you no longer use ect.. Save it / Rebuild and it should open up fine after that. -edited to improve answer - if the apk builds fine with no 'logcat ...


1

That error message you have looks like one I saw last week, but I was not using the ARCore Instant Preview. But maybe this is still relevant? It sounds like your situation is that the Azure Spatial Anchors NuGet package did not install into the Visual Studio solution like it was supposed to. It's possible this bug occurred because your Azure Spatial Anchor ...


1

According to another tutorial, based on the same git repo's sample, after the creation of the resource, there also needs to be an Azure Cosmos DB resource to create the base sharing URL. For anyone reading this that got stuck this is where you get the three values you need for demo config: Under your azure portal, locate the spatial anchors resource from ...


1

Google’s requirement is only for ARM64 support. You don’t need x86. You do not normally split aab files. The aab has all of the architectures in it, and it is split into the correct apk by the Play Store, based on what device is downloading it. You can use bundletool to generate an apk to test with, or you can upload it to the Play Store and set it to alpha/...


1

Here's an official answer. Any assets inside the Resources folder (including Sprites and Atlases regardless of being packed) will always be exported. This is by design. So when we make a SpriteAtlas with some textures, and put in it the Resources folder, it's a total mess. I did it initially cause I wanted to unload assets and load them dynamically.


1

You can take a look at globalstats.io (https://globalstats.io). It is a hobby project I am running for some time now that offers free leaderbords for your exact use case.


1

Well, I was wrong, the maximum depth precision is 24 bits, and setting it this way completely eliminated the problem. Before, on Android, my EGL configurations were setEGLConfigChooser(8, 8, 8, 0, 16, 0). With setEGLConfigChooser(8, 8, 8, 0, 24, 0) everything works great.


1

I got it. VR was enabled, Oculus was listed in the dropdown. I needed to unload Oculus and reload it, now it works! Thanks.


1

While I'm sure your looking for details it doesn't appear that there are many details about how exactly devs are paid (and it might even be obscure the the devs working on the projects) I can give you some speculation. 1) Time Based As you guessed it possible that amazon is paying apps based on how successful they are in time. Although this seems somewhat ...


Only top voted, non community-wiki answers of a minimum length are eligible