Advertisement Jump to content
  • Advertisement

Leaderboard


Popular Content

Showing content with the highest reputation on 01/05/19 in all areas

  1. 4 points
    Or it can be running in a different thread. The audio often has multiple tiles to this audio buffer, and you fill one or several as they become free, perhaps in a callback. If you don't fill them on time you might get audio glitches as the audio plays tiles that contain old data. The size and number of tiles can affect the audio latency (the gap between playing a sound and hearing it). With a small buffer you can get small latency but you need to ensure it is filled 'on time'. With a larger buffer there is less need to keep it filled in a timely fashion. If the audio is running on a different thread, the effect of frame rate may be rather to affect the 'granularity' of sound effects playing in the game, unless the audio wrapper and system specifically compensates for this. Typically a game might issue a command like PlaySound(GUNSHOT) .. if it is running at 1fps, a bunch of these may be issued at the same time rather than spread out over the second. More likely to be the other way around if anything. If you can query your audio how far through it is, you know how far to advance your game. However with an accurate general timer this is less likely to be an issue, as most games are designed to be frame rate independent, i.e. they use their general timer to know how far to advance the game. The longer the audio the more the possibility of drift between general purpose timer and audio player rate, and afaik different sample players are not exact. This is more likely to be an issue in audio / music apps than in games though. Also note that you could in theory change the rate that audio plays, but this normally gives a change in pitch, which might be noticeable, especially with a varying frame rate. You can also do time stretching on audio, to shift the play rate without changing pitch, but that would probably be a very messy solution to this particular problem.
  2. 2 points
    Have you thought about therapy?
  3. 2 points
    This is completely wrong. In Java, only the native types (boolean, int, and float like types, written all lower case) have enough internal storage to store their value. Everything else, including boxed types like Integer are objects. Object variables do not contain object data, they are references to heap-allocated memory. In C++ you'd call them pointers. Every 'new' creates a new object of the given type. In other words, each "new Monster();" makes a new fresh object. Java has automatic garbage collection. it removes objects that cannot be longer accessed. You can access an object if there exists a variable that references the object. after "monster = new Monster();" the "monster" variable references the Monster object, so it will not be removed. Variables also exist in objects, This system thus extends to object variables in objects as well. If you have a "Room room" variable in your Monster (the room it currently is), then that room will not be removed, since the Monster object refers to it, and the Monster object is not removable too (since "monster" refers to it.) So what you want is somewhat already possible. If you write "monster = new Monster()", the 'monster' variable now refers to the new Monster object. It does no refer to the previous Monster oibject any more. If no other variable in your program refers to the old Monster object with that assignment (ie "monster" was the last variable refering to the old Monster), the old Monster object will be removed from the program. You cannot forcibly de-allocate an object in Java. Imagine what would happen: // 1 object Monster, and 2 variables both refering to the same object. Monster monster = new Monster(); Monster monster2 = monster; deallocate monster; // Say we could de-allocate // The Monster object is now gone, what would monster2 refer to now? // Garbage? Note that you can also remove the Monster object reference from the monster variable by a simple "monster = null;" assignment. "null" points to no object at all, and thus also not to the Monster object. This is not often needed though. Normally, you either assign a new object, or you drop the variable from the scope (ie you cannot access the variable itself any more), for example by leaving the function that had the (local) monster variable in it. I agree with others that garbage collection is a non-issue in a text-based game, so just don't worry about it at all. If you want to re-use the Monster object, you "new" it once at the start of the program, and then for each next monster, you re-initialize the object, like "monster,restart();". Note that in this way the game always has a monster object, so if the player can kill it, you need some sort of inactive or 'dead' state for the monster for the time between the kill and the respawn.
  4. 2 points
    Audio has its own frame rate of usually around up to around 48000 FPS If your game is running at 60Hz, that means that there's about 800 "audio frames" per "visual frame". To deal with this, your audio library will create a buffer to pre-compute at least 800 "audio frames" ahead of time, to make sure it's always got data ready to stream out to the speakers/etc... To be safe, it might buffer a lot more than this - maybe even buffering up to 5000 "audio frames" ahead of time just to make sure that the speakers always have data ready to go without any gaps in playback. If your game runs at a slower framerate, your "audio buffer" just needs to be longer. As above, if audio is at 48kHz and the game at 60Hz, then the buffer needs to be at least 800 audio samples in length. If the game is running at 30Hz, the audio buffer needs to be at least 1600 audio samples in length. In practice, most game audio products will just use some conservative buffer length like 5000 samples by default to be safe.
  5. 2 points
    Part of it may be the file size. When you upload these the server starts background processing those files (stripping EXIF, managing compression, creating thumbnails and other scaled sizes, etc.). When it happened yesterday I noticed a lot of processing causing the 502, but I didn't know the cause until putting it together that large gifs/videos were being uploaded. So yeah, looks like there's a bottleneck in the system there that needs to be worked out.
  6. 1 point
    Maybe also read a book or two and watch some docos. There are probably cultural preservation organisations with people you could talk to. Alternatively make her native american without bringing it up overtly at all. MMA fighter seems safest... ironically.
  7. 1 point
  8. 1 point
    @a light breeze That was just a picture I snipped off my desktop. Here's the finished product Thanks for informing me that it's hard to look at... I bdly wanted orange because it's supposed to be an emergency tent, but that won't work with my background will it?
  9. 1 point
    How big is the lake, do you keep the whole thing loaded at once? Is the edge represented as a mesh or a texture? Do you need to accurately follow triangles in the mesh, or could you use bilinear control points to define the edge? Do you want to reflect, bounce or collide n slide, or something more complicated like get some air or crash? How much do you like maths?
  10. -5 points
    Hi, folks! As you know, I have a huge personal problem with Russians. So it is obvious, I want to exclude Russians from getting The Spell of Mastery and my other programs. A political statement if you will. But what is the best way to achieve it? Guess stating openly "sorry, we don't serve Russians" will not work, because many countries have some commie anti-discrimination laws. But will saying "Unfortunately this software doesn't currently work in Russian Federation. We work hard to fix the issue." do the trick? Then we also have problem with Russians, who downloaded software illegally. My idea is to include harmful code into program, which, when detects Russian locale or Internet address, starts sneakily damaging files under user's home directory (or maybe even download child pron there and call cops?). That should scare Russians enough to stop downloading it illegally, even if pirates promised to break the protection, because pirates can never guarantee that all protection checks were removed - they don't analyze whole hay stack, just look for the known needles. Now if these Russians start complaining about lost data, I can just shift blame to software pirates or viruses, and claim that it were crackers who included harmful code (many of them do it anyway). And because license doesn't allow disassembling the executable, there is no legal way to prove that is my work. What do you think?
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!