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.


3

so I fixed the problem. I had to go into C:\Program Files\Epic Games\UE_4.21\Engine\Build\Android\Java and edit the aar-imports file. After adding all missing dependencies and updating the others (as many were super outdated) the problem was fixed. (also make sure the dependencies are the same as those in your plugins build.gradle files.


2

In addition to remove the ads from you app it looks like to you need to update your ad settings in the Google Play Console. This can be found (as of 2018) by selecting the App you want to modify and then selecting Store presence -> Pricing & distribution and setting Contains ads to no.


2

One way to prevent this is by tracking user's purchases on back-end/server and saving the game state when the user purchased the item along with the Order Id and pacakge name for every purchase, then if the user restores the purchase within 48 hours (which you can check using Void Purchases API) then just restore the game state to the saved one and if the ...


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

While the NullReferenceException is technically a bug that Unity should protect against and present something nicer to the user, your manifest is not complete. The main thing it’s complaining about is that it doesn’t have an <application> tag wrapping the activity. You should base your manifest on the one provided by Unity. To see it, remove your copy, ...


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 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.


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

In your GPU there's a thing called fragment shader which gets executed for each pixel. Fragment shader does some calculation to determine the colour for a pixel. The complexity of this shader varies based on what you are trying to achieve. Generally It has to consider the lighting in the scene and everything that affects the look of the pixel. so if you ...


1

Having used A* path finding algorithms previously, my advice would be to take your Terrain, and break it down into smaller rectangles. Run a check to see if any of these rectangles co-inside with collidable entities. If they do, mark them as solid. From there, ensure each rectangle has a node, and continue as you would for calculating with 2D A*. When it ...


1

You can use the Android Manifest device compatibility properties to specify required device features like minimum screen size/density, memory/graphics specs, network/touchscreen/accelerator capabilities, etc. Google Play uses those properties to determine whether to show/hide your app for any given device. However you should consider whether these are hard-...


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

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 ...


1

restarting unity fixed the problem for me


1

Uninstalling Unity/Visual Studio and installing them again fixed the problem for me.


1

It's hard to answer that without any logs. You can use LogCat for that. If you don't have Android Studio installed, go ahead and install it. Once that is done head over to C:\Users\YOUR_NAME\AppData\Local\Android\Sdk\tools and start the monitor.bat as an administrator. Allow debug mode on your phone and plug it into your PC via USB. Your device should be ...


1

I cannot give "the best practice" because it really depends on your situation. But I can give two real world examples from games I worked on. In Love & Hip Hop, we checked the RAM of the device. At the time, 2GB devices could definitely render a lot more than 1GB devices. So we tried to target the lowest 2GB devices with high-resolution assets, and ...


1

MonoDevelop was phased out in version 2018.1. You now need to use something different, like Visual Studio.


1

What's Happening Now By providing your own Manifest file in Assets/Plugins/Android, you are declaring that your Manifest should be considered the main one, and Unity will try to inject any extras into that one. As the main Manifest, your file would have to provide all the basic requirements and have the correct well-formed structure, according to the ...


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