Hot answers tagged

43 votes
Accepted

For a custom game engines, what should I do if my core data is malformed or missing?

Log an error and gracefully exit. Ideally, display a human readable error on screen as well. There should be a core pipeline of hard coded functionality that operates without these data files. It's ...
House's user avatar
  • 73.1k
34 votes
Accepted

Couldn't all games avoid post-start loading?

The answer is yes, this could be done, in most cases, at least to some extent. The reasons it isn't done are many: It requires time and money to do it right. The amount of bugs that pass testing ...
Peter's user avatar
  • 9,965
32 votes
Accepted

How can I efficiently load huge volumes of star systems?

The trick Elite likely uses is that they don't pre-generate the whole galaxy and store it in a database. They likely generate most of the galaxy at runtime when it is needed. I would do this using a ...
Philipp's user avatar
  • 118k
26 votes
Accepted

How can I speed up slow loading of big levels?

First of all, you should measure where exactly the bottleneck is so you don't waste time improving things which are already good enough. The bottleneck could be any of these: Reading the XML file ...
Philipp's user avatar
  • 118k
22 votes
Accepted

Smooth loading screen between scenes

When you load an scene with SceneManager.LoadSceneAsync() there are actually two things happening: The gameObjects of the scene are loaded into memory. Then the ...
Leo's user avatar
  • 1,565
12 votes

For a custom game engines, what should I do if my core data is malformed or missing?

Byte56 mentioned one option. There is at least one other: Assume default values and display a Warning. Depending on the nature of your data, it might be perfectly acceptable to assume some default ...
Octopus's user avatar
  • 279
11 votes

My game crashed... Access Violation (0xc0000005)

I see you solved your own problem. However, I would like to explain what are you looking at, and what to look for in an error log like the one you received, in case you get a similar error in the ...
Panda Pajama's user avatar
  • 13.3k
10 votes
Accepted

Can I run my own loading script during the Unity splash screen?

I just did some tests, and I found that the constructor for objects in the first scene actually gets called while the splash screen is still displayed. Here are some timings I measured with a static ...
DMGregory's user avatar
  • 130k
10 votes

Couldn't all games avoid post-start loading?

If your menus have a ton of assets, those assets take time to load. You also have no idea what order people will navigate your menu. They could click options -> back -> credits, or credits -> back -> ...
Almo's user avatar
  • 6,678
7 votes

How can I speed up slow loading of big levels?

Despite it being used for virtually everything, and despite it being used even in high-volume, low-latency applications, XML is an abysmal format for almost everything, but in particular for ...
Damon's user avatar
  • 1,374
6 votes

For a custom game engines, what should I do if my core data is malformed or missing?

It depends on whether this happens during development or release. During development, you will have all kinds missing things, errors, and mess-ups, constantly, all the time, and you may even want to &...
Damon's user avatar
  • 1,374
5 votes

Couldn't all games avoid post-start loading?

A big factor in the feasibility of such a solution is the predictability of what needs loading. If the player loads entirely new levels with no way of anticipating what they will choose, a completely ...
Jibb Smart's user avatar
  • 2,450
5 votes

How can I speed up slow loading of big levels?

There are a number of factors to approaching this problem, although you are on the right track. Single Load The first approach, as you've already tried, is to load it all at once. This puts all your ...
Stephan's user avatar
  • 1,728
4 votes
Accepted

What is the Basic Game Screen/Scene Life Cycle?

The nomenclature here is definitely odd. I at first thought you were talking about something lower level (like the scenegraph or screen manager for organizing logic flow and/or rendering). I then ...
Matthew Sanders's user avatar
4 votes

How can I implement versioning into a save system?

You could add a version number to your savegame file format itself. The savegame loader loads the savegame file as plain data, checks the version number which it expects in a specific position and ...
Philipp's user avatar
  • 118k
4 votes

Is it better to load all of the scene at once or load small parts of it as the player moves?

When your game scene becomes so large that you run into performance and/or memory problems, then it can make sense to divide your world into separate scenes and only load those around the player. By ...
Philipp's user avatar
  • 118k
3 votes

Can I run my own loading script during the Unity splash screen?

Your best bet is to make your own loading screen and set that as the initial scene. Then, from that simple scene, use the Scene Manager to load the next scene in the background, asynchronously. I ...
Stephane Hockenhull's user avatar
3 votes

Couldn't all games avoid post-start loading?

Time. You need time to save time. Or you need money to make up for the lack of time. In any case, "No loading time!" is a feature that only those who have the luxury to afford it can offer. It takes ...
Vaillancourt's user avatar
  • 16.3k
3 votes

How to load and unload objects at a certain radius from the player?

Have two different kinds of star game-object: LoadedStar UnloadedStar While the UnloadedStar is nothing but the transform ...
Philipp's user avatar
  • 118k
3 votes

Add Existing Animation

Here is how I fixed the same issue: Open the animator window Click on the game object that has the animation In the animator window for that game object, the original animations you set should still ...
NiNjA Chronicles's user avatar
3 votes

Can a loading screen be implemented using one thread only? If so, how?

You basically have to break down the loaded data into smaller chunks, and intersperse UI updates in between those bits of processing. The finer the granularity of the chunks of data you synchronously ...
Engineer's user avatar
  • 29.3k
3 votes

How can I speed up slow loading of big levels?

Let's have a look at smart... what is smart exactly? You state that you use XML as a format to store your levels. XML is a hierarchical format that is stored into a file. Thus we have 2 main factors ...
dot_Sp0T's user avatar
  • 2,002
3 votes

Google street view racing game?

This is, in a way, available from Google via their Google Maps Platform. The data provided by this platform is a combination of aerial, satellite and street view data. I'm not sure how far down the ...
House's user avatar
  • 73.1k
2 votes

How do I make a progress bar with letters that get "filled in"?

If your ui system uses a layering concept you can do this: Have an image with the letters having alpha of 0 (front layer). Have a quad which is the "unloaded" colour, scaled to the same dimensions as ...
Ian Young's user avatar
  • 2,609
2 votes
Accepted

In Unity, how can I register a custom file type that is always opened with my game?

This isn't explicitly a problem of Unity. This is something an installer could do for your programm. Summed up: it is a registry setting Hope this link helps: where-in-the-registry-does-windows-...
monty's user avatar
  • 374
2 votes

How to load sprite from JSON?

Expanded post on comment:"JSON is just a means of storing text information right? Why not just hold a path to the sprite in the JSON file? Then whenever you obtain the information in the JSON file, ...
Savlon's user avatar
  • 1,092
2 votes

Quickly Converting RenderTexture to Texture2D in Unity3D

You can't do anything to prevent the freeze. The Texture2D.Apply() method is expensive. The larger the texture dimensions, the longer the freeze. You can't ...
Ruslan L.'s user avatar
  • 121
2 votes

Couldn't all games avoid post-start loading?

One reason dynamic loading isn't always the ideal solution that other answers haven't really considered I think is also pop-in and other graphical artifacts. The prediction of what to load and what ...
Waddles's user avatar
  • 201
2 votes
Accepted

Loading settings files better?

risk of crashing if someone edits the file incorrectly If the configuration is invalid, then it should not work. You should verify if the data on the file is valid (e.g., It has all the fields, it ...
Theraot's user avatar
  • 24.4k

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