• Hey, guest user. Hope you're enjoying NeoGAF! Have you considered registering for an account? Come join us and add your take to the daily discourse.

Indie Game Development Discussion Thread | Of Being Professionally Poor

Status
Not open for further replies.
Am just curious how
short the buffers can be made, i.e. how fast the XAudio2 systems respond such
that an uninterrupted play can be assured, since this determines the latency
of the sounds being played. Sure I want to have the new sound being played the
millisecond it happens. Yet I've read somewhere that XAudio2's thread wakes up
every 10ms (XBox360 about ~5ms) processing and feeding data to the hardware.
So the buffers can be changed 100 times per second at best. Am going to
tinker around with it and will later build everything again with WASAPI after
having read more about it.

it's likely the minimum buffer size for smooth playback is going to depend somewhat on the computer you're running this on as well as the API. best bet would be to do some investigation by setting up a streaming source with a large buffer (say 1024 samples) and then stepping down in size until the sound starts to exhibit popping/glitching artefacts. if all you actually want though is a sine tone that changes pitch you can create a sample that is a single period of the wave, enable looping and then adjust the pitch during playback. of course, that's less fun ;)

Thanks for all the votes, guys!

B and C pretty much tied, so I finished up both of them and included some alternate facial expressions so you can see how the character(s) will change in each style.

http://i1.minus.com/ibfXYQRrSdM1kd.png[/IMG

[IMG]http://i1.minus.com/ibeRr1XICA7uKV.png[/IMG

Tell me which you prefer! I hope it doesn't end up in a tie again, I don't want to have to choose...

I'm a little sad D only got a bare handful of votes, since that one was my favorite. But that always seems to be the case! No one likes my favorites.[/QUOTE]

I'm voting B (A is actually my fave). Something about the mouth on C doesn't sit right with me.
 

missile

Member
it's likely the minimum buffer size for smooth playback is going to depend somewhat on the computer you're running this on as well as the API. best bet would be to do some investigation by setting up a streaming source with a large buffer (say 1024 samples) and then stepping down in size until the sound starts to exhibit popping/glitching artefacts. if all you actually want though is a sine tone that changes pitch you can create a sample that is a single period of the wave, enable looping and then adjust the pitch during playback. of course, that's less fun ;) ...
Less fun, indeed. I already did that. ;) You are right about the other points
about the speed and the API, no question about it, yet I assume my computer to
be fast enough for generating a sample for the purpose at hand. This is how I
look at it; the driver grabs the ready flag from the sound hardware and routes
it into the upper tiers until we see it as an OnBufferEnd within XAudio2
introducing sort of an overhead which might be ok. But if the XAudio2's thread
awakes for every 10ms, then this will ultimate require a minimum buffer of 441
samples (assuming 44100Hz) to be buffered ahead of time for continuous play,
which is usually not a problem if one plays a common wav file. So if my
assumption (well, I've read it on a Microsoft page) about the XAudio's 10ms
is true (XBox360 ~5ms) the sound should start to crack at a buffer size <=
440 samples. If this will be he case, XAudio2 won't be a solution for me.
Anyhow, stepping down will give the lower limit, as you wrote.
 

OatmealMu

Member
Cool, thanks for this! Any idea how I get the option to upgrade to pop up? Can't seem to figure it out.

You need to be in the beta channel for the upgrade option to show. If you've already installed the free edition license, open up the notification area and right-click the GameMaker icon. You can switch to the beta channel from here. Everything after that is self explanatory.
 
You need to be in the beta channel for the upgrade option to show. If you've already installed the free edition license, open up the notification area and right-click the GameMaker icon. You can switch to the beta channel from here. Everything after that is self explanatory.

Thanks! Very simple.
 

Popstar

Member
So if my assumption (well, I've read it on a Microsoft page) about the XAudio's 10ms is true (XBox360 ~5ms) the sound should start to crack at a buffer size <= 440 samples. If this will be he case, XAudio2 won't be a solution for me. Anyhow, stepping down will give the lower limit, as you wrote.
If you want 1ms latency the only way you're going to get it is with ASIO which requires specific hardware/driver support which most people won't have. WASAPI latency will be maybe a third at best of XAudio2.
 

Sajjaja

Member
I don't know anything about Game Maker Studio, so what does it mean by Unlimted Resources when compared to the free version?
 

Lissar

Reluctant Member
I don't know anything about Game Maker Studio, so what does it mean by Unlimted Resources when compared to the free version?

Yes I'm pretty sure that's the case. (Otherwise it wouldn't be much different from the free version).

Though I can't really recommend GMS because it's SO buggy. Every project I've worked on has ended up set back because of various bugs in the system.

edit: *looks at post below* Man I misread that. Sorry!
 

Raonak

Banned
I don't know anything about Game Maker Studio, so what does it mean by Unlimted Resources when compared to the free version?

The free version had resoruces limited to 20 of each kind. So you could only have 20 objects, or sounds, or spirtes, etc. Which is basically crippling to any game.
 

missile

Member
If you want 1ms latency the only way you're going to get it is with ASIO which requires specific hardware/driver support which most people won't have. WASAPI latency will be maybe a third at best of XAudio2.
Thx for the hint ... will have a look at it!
 
I installed GameMaker Studio, it tells me it installed successfully but when I run it from the start menu nothing happens. There is no tray icon or a running process in Task Manager. I tried uninstalling and re-installing, same thing :/

Running Windows 7, 64-Bit

Edit: Got it to work. Right-click, Run As Administrator.
 
This looks great and reminds me of the days when a video game was a video game and not a movie, full of wacky things instead of tears.

Man I miss that. We need more Earthworm Jims and stuff. I mean hell, even Mario's just full on insane. You're a fat Italian plumber who rides a dinosaur and fights a giant spiky turtle to save a princess who rules over a kingdom of mushrooms. I mean...what?
 

missile

Member
FUCK!!

XAudio2 runs as fast as it could, no 10ms wake-up whatsoever. So there seems
to be no default latency, it runs as fast the the computer has MHz to spend!
I'm able to update a sample buffer consisting of just 1 sample continuously at
a rate of 44100Hz! 8) Sure, I don't do much with XAudio2, overhead will
increase using more voices, mixing whatsoever, but at least in this simple
case it runs the way I want it. OnBufferEnd gets called 44100 times per
second. And I literally bump just a raw sine value into the buffer, i.e. a
32-bit floating-point value (hence, no PCM) at a different phase each call.
What's cool; instead of computing pitch sliding, i.e. portamento, i.e.
interpolating the current pitch to the new one, into a buffer > 1 , which I
have done before and which always lags behind depending on the buffered length
necessary, now it is inclusive and the reaction is instant. I've mapped the
pitch to the mouse. Pitch is increased depending on the distance to the center
of the window. Moving the mouse changes the pitch instantly without any
cracks. And moving the mouse rapidly at random makes R2D2 talk to me! HA!
I like! xD


Update:
Am able to increase the sampling rate to about 133000Hz until the sound starts
to crack. CPU load: 100%.
 
Oh, also, since my job involves C#, I'm thinking of porting that game I started over from Java. Anyone know a good graphics libraries? Or just general libraries or frameworks for C# game stuff?
 

Popstar

Member
Oh, also, since my job involves C#, I'm thinking of porting that game I started over from Java. Anyone know a good graphics libraries? Or just general libraries or frameworks for C# game stuff?
MonoGame seems to be the standard. Unity also uses the Mono runtime if you want to go there.

Really? I thought even WASAPI had a latency of around ~3ms. I suspect most of the API latency figures I've seen must be for people round-tripping audio and are input latencies.
 

GulAtiCa

Member
I'm literally so close to being done! I'm literally almost to the point where I am running out of stuff to do with the game before release. Which is really a good thing. Just a few clean ups, make sure game is balanced, and do the manual/title logo icon(thing that appear on Wii U menu/etc)
 

missile

Member
... Really? I thought even WASAPI had a latency of around ~3ms. I suspect most of the API latency figures I've seen must be for people round-tripping audio and are input latencies.

Could be true.
It virtually seems like a pass-through. I timed the callback and it is indeed
called that many times. I've heard that XAudio2 converts every stream into a
PCM no matter what the input source, yet I do believe XAudio2 even
converts PCM into 32-bit IEEE_FLOAT internally, which is plausible given that
most sound algorithms work on floating-point numbers. And floating-point is
also supported natively (SSE). Comparing with 16-bit PCM (integer) and all the
swizzling required converting into float back and forth would make it pretty
cumbersome. So part of the latency may come from converting PCM into floats.
It might be possible that WAVE_FORMAT_IEEE_FLOAT may indeed not suffer from
all of this.
 
Our main character, Rolan.

rolan_s.png
 

friken

Member
After a week of the flu dropping us all on our rears, we are back at it... bit low capacity, but working. Here is the next alien backdrop. Next up, the animations for dialog sequences (idle/talk/annoy/etc).

Voolgard-1.jpg
 
ss1124_mbs.png


This is an example of how I'm telling stories in my game. These are two security officers who take to the streets to investigate the president's disappearance when the police are sidelined by the greedy mayor.
 
Hi guys, i am starting to Get the hang of unity now. Finally got my ships moving now. Just reusing the same ship until i get some more models.

space.gif
 

nicoga3000

Saint Nic
Glad they did the free Game Maker Studio Standard. Hopefully that will entice folks to try the software and realize it's potential!
 
I love how standard edition is free for limited time?, right after I bought it few months earlier :x guess ill redownload it on my active account.
 
That's looking cool, makes sense to stick to one ship for prototyping. I used one player character and one enemy forever.

Yeh definetely, the final things like moving turrets e.t.c will be last :)

What you see here is the "Base" or mothership which doesnt move and is the basic "target" of the enemy team.

Some of the units i am planning

- A carrier/transport ship that can move units on the board to new locations
- A mining ship to collect resources
- Numerous attach ships with varying stengths
- Bombers and other support units

Movement is restricted to a 2d plane and most of the strategy will be where to mine (mined tiles cannot be moved to , as well as what ship to move/attack and where.
 

missile

Member
Keyboard, Scancode and Friends

Question:
Is there a Win32 API function to get the - full - scancode of each single key
pressed/released (make/break) from a keyboard?

Description:
A keyboard sends a scancode to the keyboard controller on the motherboard. The
actual value of the scancode depends on the mode of operation of the keyboard
and on how the keyboard controller translates this code. Usually, PC/AT
keyboards work in mode 2 and some in mode 3 with the controller translating
the code back to mode 1, usually. It's a little bit involved, lots of bug in
this procedure. Anyhow. What's important to know here is that a scancode isn't
just a byte, it can and usually does consist of multiple bytes depending on
the key and its state. And it is this sequence of bytes I want to obtain from
within Windows.

Problem:
Am sort of writing a PC backend for a couple of things and I want to have my
own virtual keyboard mapping from raw scancodes. Given the Windows API,
pressing a key sends a message, i.e. WM_KEYDOWN, to a program. This message
contains the given Windows virtual key, which is fine and is used most often
by any given program. The message also contains a scancode of the key but not
the full one. Some keys have prefix/extended bytes which are used to
differentiate the state of the key and the keys itself against each other, and
also to classify all the special keys. And these extra bytes aren't included
in the massage sent. Hence, differentiating some keys is impossible using this
method. For example, pressing the UP_ARROW gives the same scancode like
the key 8 on the numpad given NumLock is activated, yet both keys are
(physically) different. While their (Windows) virtual key codes are different,
their (Windows) scancodes aren't. As another example, the full mode 1 scancode
for Pause is 0xe11d45, yet Windows just delivers 0x45. So having a Windows
function delivering the scanned bytes into a buffer would solve the problem.
 

Mikado

Member
Is there a Win32 API function to get the - full - scancode of each single key
pressed/released (make/break) from a keyboard?

Yes.

See the MSDN info here

Using the (deprecated) Direct Input calls is your best option. Obtain a Keyboard device, use SetDataFormat to prepare it for data retrieval, then call its
GetDeviceState method. This fills in the instantaneous state of all keys on the keyboard, indexed by scan codes, not virtual key codes. The number of simultaneous keys detected is dependent on your keyboard hardware.

Note that using this function makes many antivirus programs flip out, since this is the easiest way to implement a keylogger.
 

Popstar

Member
I'm going to disagree with Mikado. Noone should be using DirectInput in 2013. It's been deprecated for about a decade.

Raw Input is the best way to go.

Every Windows API for getting keyboard input is broken in it's own special unique way however, so expect some frustration.
 

Blizzard

Banned
As crazy as you are, missile, you might as well write a virtual keyboard driver and/or a filter driver for added fun. :p I wrote a filter driver to take gamepad input in certain cases and generate keypresses from the virtual keyboard, for example.

But doing that sort of thing always makes me scared that I'm going to get VAC banned or something because the same technology could almost certainly be used to cheat/keylog/do all kinds of stuff.
 

razu

Member
ss1124_mbs.png


This is an example of how I'm telling stories in my game. These are two security officers who take to the streets to investigate the president's disappearance when the police are sidelined by the greedy mayor.

Love it :D



Hi guys, i am starting to Get the hang of unity now. Finally got my ships moving now. Just reusing the same ship until i get some more models.

space.gif

I also love this!! :D

End of message ;D
 
Status
Not open for further replies.
Top Bottom