I know that generating a sky is very resource-intensive. Every time I change the "time of day" so to say, the game stutters for like 1/4 of a second. Can I make the sky be generated in a separate thread so it doesn't lock up the main one?
Also, is there a way to change the framerate of the animation player so it doesn't generate a sky so frequently?
Related
I have objects with 3 different colors:
black, dark green, and bright blue.
When I take pictures of them, I do not yet know the real color of the object, thus my image can only be so bright that the bright blue object does not blow out to white. If I make the bright blue as bright as I can, then the dark green and the black are still very dark. Almost too much.
Is there anything that can be done beside brightening up the images afterward?
the camera is a Genie Nano.
If there is enough time, you could take multiple images with different exposure times. There is even a ready method in Halcon to merge light and dark images "create_high_dynamic_range_image.hdev".
If your application is time critical and camera manufacturer provides events for the language you're working in you can do the following:
Put the camera in asynchronous acquisition (reduces time)
Start acquisition with the lowest desired exposure time
On each image event increase the exposure time for some step N times
Since the camera is in asynchronous acquisition each exposure time comes after M frames (usually 5)
First M images should be ignored, and after that you will have N-M images with gradually increased exposure time
I'm pretty new to Inform and it seems like this shouldn't be too hard to do but I haven't yet found a way. I want to change a room's description based on where the player came from. Something along the lines of:
The Town Square is a room. "As you enter the small town square, [if yourself came from West]
the rising sun makes silhouettes of the roofs and spires to the East.[otherwise]your long
shadow strides before you as the Sun rises behind.[end if]"
What's the best way to go about this?
I found a reasonable solution:
The last location is a room that varies.
Orientation is a direction that varies.
Before going to anywhere, now the last location is the location of the player.
After going to anywhere:
now orientation is the best route from the last location to the location, using even locked doors;
continue the action.
The Town Square is a room. "As you enter the small town square, [if orientation is east]
the rising Sun makes silhouettes of the roofs and spires to the East.[otherwise if orientation is west]
your long shadow strides before you as the Sun rises behind.[end if]"
The "using even locked doors" modifier ensures this will work even if a door closes and locks behind the player. The solution does assume that the player has come via a reversible route, which may not always be the case e.g. if the player has teleported.
I am making a 2D (top-down) horror game in game maker. Each player has a flash light which drains overtime. The flashlight uses surfaces to draw light and the cone gets smaller overtime.I would like for the flashlight to act like a real flashlight instead of going through walls. Is there anyway to do this?Picture of what I want it to look like
how are you currently drawing your flashlight?
I would recommend not drawing a flashlight sprite and instead filling a surface with black (to act as darkness) and cutting your lights out of that.
Then You can use the collision_line function to sweep in an arc from your player and get either where it hits an object or whether the line extends past your flashlight range. Then store all those vertices and draw a primitive with blending to act as flashlight.
Hope that makes sense, otherwise I swear I've seen some posts on the gamemaker forums on this, good luck!
I am a final year student making a project in which I take a image from camera placed at car and my objective is through image processing on Matlab. I have to take image of different colour ball until my desired image (which is red) comes and the car stop through micro controller. How can I continuously take a image of ball with millisecond time delay?
The For-A VFC-1000SB High Speed -- only about $12k :-)
However, on the "cheap" end there is the Exilim line (e.g. EX-F1). One of the features is a movie mode up to 1200fps. Note that as the fps goes up the resolution goes down. I know nothing more about this other than the adverting. YMMV.
Now, even if the camera can take frames at this speed, getting it to the host and processed "somewhat timely" is unlikely without additional specialty hardware (and I doubt it is doable at all with the Exilim).
I have experimented with a sigmoid and logarithmic fade out for volume over a period of about half a second to cushion pause and stop and prevent popping noises in my music applications.
However neither of these sound "natural". And by this I mean, they sound botched. Like an amateur engineer was in charge of the sound decks.
I know the ear is logarithmic when it comes to volumes, or at least, twice as much power does not mean twice as loud. Is there a magic formula for volume fading? Thanks.
I spent many of my younger years mixing music recordings, live concerts and being a DJ for my school's radio station and the one thing I can tell you is that where you fade is also important.
Fading in on an intro or out during the end of a song sounds pretty natural as long as there are no vocals, but some of these computerized radio stations will fade ANYWHERE in a song to make the next commercial break ... I don't think there's a way to make that sound good.
In any case, I'll also answer the question you asked ... the logarithmic attenuation used for adjusting audio levels is generally referred to as "audio taper". Here's an excellent article that describes the physiology of human hearing in relation to the electronics we now use for our entertainment. See: http://tangentsoft.net/audio/atten.html.
You'll want to make sure that the end of the fade out is at a "zero crossing" in the waveform.
Half a second is pretty fast. You might just want to extend the amount of time, unless it must be that fast. Generally 2 or 3 seconds is more natural.
More on timing, it should really be with the beat rate of the music, and end at a natural point in the rhythm. Try getting the BPM of the song (this can be calculated roughly), and fading out over an interval equal to a whole or half note in that timing.
You might also try slowing down the playback speed while you're fading out. This will give a more natural vinyl record or magnetic tape sounding stop/pause. Linearly reduce playback speed while logarithmically reducing volume over the period of 1 second.
If you're just looking to get a clean sound sound when pausing or stopping playback then there's no need to fade at all - just find a zero-crossing point and stop there (or more realistically just fill the rest of that final buffer with silence). Fading out when the user expects the sound to stop immediately will sound unnatural, as you've noticed, because the result is decoupled from the action.
The reason for stopping at a zero-crossing point is that zero is the steady state value while the audio is stopped, so the transition between the two states is seamless. If you stop playback when the last sample's amplitude is large then you are effectively introducing transients into the audio from the point of view of the audio hardware when it reconstructs the analogue signal, which will be audible as pops and/or clicks.
Another approach is to fade to zero very fast (~< 10mS), which effectively achieves the same thing as the zero-crossing technique.