Tag Info

Hot answers tagged

52

Well now - what a simple but interesting question to tackle. When reloading a level there are so many factors that need to be taken into account that the answer can go many ways. If your level state contains a large list of assets it can be more practical to start from a clean slate when reloading a level back to a save/mission state as this maintains the ...


12

To clarify the existing answers against your question about consoles: they don't have enough memory to store both the starting state and current state for larger complex games. A game could store the level and initial state separately so that just the state could be restreamed in, and this is very likely what many games do. Even streaming just that is ...


11

There is no such directory; %APPDATA% is Windows-specific. You'll have to abstract it yourself: create your own GetSaveGameDirectory function that returns an appropriate path on whatever operating system you're running on. You can typically make this determination at compile time with preprocessor checks against the appropriate macros in C (and it's ilk). ...


7

I disagree with much of Blue's answer, I do not believe there is a technical case for not resetting levels - I certainly never encountered one. Level loading is almost always slower than level resetting, in fact I find it difficult to conceive of an occasion when it wouldn't be. In most cases games could offer effectively instant level loading if the devs ...


7

You're over-engineering this =) Windows games have two different storage areas: The first is for static data with the installed program and these files are almost always referenced relative to the application itself, or defined in a file (XML usually) that the program loads when it starts up so there are no hard-coded references. Using the Windows ...


4

I'm using this code on my game right now: System.getProperty("user.home"); Simple and efficient. It's a user dependent directory, which is perfectly fine for storing save files. I'm using it to download and store assets, though.


3

PlayerPrefs provides a key-value store implemented in a platform appropriate manner.


2

With Sean and Blue's excellent answers regarding physical platform limitations and pro-con decisions, I'm going to expand a comment into a different approach: Why You Should Probably Just Completely Reload The Level So you've got your loadLevel() call working perfectly, yay! You stream in a level file information, and step through building the world based ...


2

To allow for large levels or seamless level game play, even with limited memory (memory is always too small, the question is if you hit the limit in RAM first, or on the graphics card) there is another strategy: Only have the part of the level in memory, that the player needs currently or will need in a few seconds. Models, textures, sound samples, ... ...


1

You can certainly do all of this by simply storing the move list for a game in a text file. That would be the simplest way to store the data, but at the expense of forcing you to build all of the query mechanisms yourself. Something more structured like an XML or JSON file will probably make querying slightly easier (since you are on iOS, you may want to ...


1

I finally understand about Preferences. Here's the example and observe the comments. Take note that this is sample from my previous projects. public class Temporary_Database { //TODO __________[ Field data ]__________ public Preferences pref_1; public Preferences pref_2; public String male_name; public String female_name; //TODO ...


1

On Linux, the only standardized path would be the XDG_DATA_HOME and XDG_CONFIG_HOME directories. Use the environmental variables with those names if they exist, otherwise default to $HOME/.local/share/<appname>/ for user-data (saves, progress, player profile) and $HOME/.config/<appname>/ for configuration. Deleting the latter directory should in ...


1

Windows: %UserProfile%\Documents\Saved Games\GAMENAME\ Linux: ~/Saved Games/GAMENAME/ OSX: ~/Documents/Saved Games/GAMENAME/ As Josh mentioned, don't hardcode paths - use the OS API to use the correct path:-)


1

The .love files are actually renamed .zip files. These zip files contain directory structures, so if your code refers to, say, "foo/bar.dat", your zip file has to have a "foo" directory with the "bar.dat" contained within. See http://love2d.org/wiki/Game_Distribution for details.


1

I think that the most elegant form is to abstract the filesystem and to do it operating system independent. This abstraction is responsible of determine the operating system that is running the game and get the real path of the game executable. Then all your code that accesses to resource paths are always relative to the directory that you want. For ...



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