• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.


  • Content count

  • Joined

  • Last visited

Community Reputation

139 Neutral

About Prads

  • Rank
  1.   Well, the benifit of it is that even at this stage (just released version 0.03 bug fixes for compiler), you can grab it and make a simple 2d games with it (Check out the Break Out game I created with it, links on the project site). What I mean to say is, it is pretty straight forward  and you don't need to learn anything else (graphic library like OpenGL or DirectX) beside language  in order to write simple 2d games with the system. And since the syntax is very similar to C, anyone who has the knowledge of C, C++, java, or C# can just learn it in half an hour. Another reason is portability, I am going to make VM for wide variety of devices. Another reason is that it's open source, if you want any changes, you can tell me to add it (if I find it useful I will definitely add it) or just tweak the code yourself.       Thanks!!! That's what I plan to do.
  2. I just started this project some months ago, so it looks raw. But I want to develop it further so that homebrew developers can make portable games using this language. (I know there are other language but I'm not concerned with that). I will write the VM for most of the modern platforms. Besides that I started this project just for the challenge and fun. I am going for Bachelors of Computer Science next year and hope knowing these kind of stuffs will give me head start...
  3. Hello, I have been working on this project for some months now and I want to show it to other people. Basically speaking, it's a programming language which can be compiled and ran using a virtual machine. Here's a detailed explanation I wrote in my blog:      Quote:                              So, in last blog post I gave small introduction to my current project that I am working on. In this blog I want to release the first version of my current project. You can grab it from here: http://www.pradsprojects.com/despair.html So, this piece of software that I wrote is a system to write portable programs. It has its own programming language and the program that are compiled can be executed using a Virtual Machine. The system isn’t mature and lot of things are lacking but I hope to develop it further in the future. Let me talk a little about how this system works. You write a program using its programming language (here’s the documentation of programming language: http://www.pradsprojects.com/despair...ion/index.html) then compile it using compiler tool that I have written. The compiler generates a file with ‘.dbin’ extension which can be executed using the Virtual Machine. I have created a small IDE for developing program for this system which you can download it from the project site (the one that I gave you on the top). IDE consist of editor to write and manage source code (which is fairly basic at the moment, no syntax highlighting for the moment sorry), a compiler to compile the source code and a virtual machine to run the compiled file. Alternately, if you don’t want to create programs for the system but want to run program created by others, you’re going to have to download the VM from the project site. There are two types of VM for Windows OS: interpreter version and JIT version (Dynamic Recompiler). The JIT version is faster than interpreter version though I am still not very happy with the JIT performance, I think it can be improved more. I will port the JIT version to Linux later. I want to create the Virtual Machine for various different platforms like android, iOS, MacOS etc so that the program written using despairLanguage can be run in different platforms. Currently the VM works in Windows and Linux. P.S: The software is open source and is on github. Links are on the project site.                       So, I just wanted you guys to look at it and play around with it. Some feedbacks (good or bad) is highly appreciated. Thanks!
  4. Whoops, nevermind. It's working now. I guess the sizeof(in) should have been sizeof(INPUT). Silly mistake. lol
  5. Hello, I am trying to create a keystorke simulator to control games like NFS World. I tried using SendInpu, and it works great for notepad and explorer window but doesn't for for directx applications. Here my code, it sends DOWN key every 1 second: [CODE] #include <Windows.h> #pragma comment (lib, "Winmm.lib") #define DIKEY_DOWN 0x04D0 int main() { INPUT in; KEYBDINPUT keyB = {0}; in.type = INPUT_KEYBOARD; keyB.wScan = DIKEY_DOWN; keyB.dwFlags = KEYEVENTF_SCANCODE; in.ki = keyB; DWORD prevTime = timeGetTime(); DWORD currTime; while (true) { if (GetAsyncKeyState(VK_ESCAPE) & 0x8000) break; currTime = timeGetTime(); if ((currTime - prevTime) >= 1000) { SendInput(1, &in, sizeof(in)); prevTime = currTime; } } return 0; } [/CODE] I am testing this code in Windows 7. So, are there anyway to simulate key that works for directx applications? Thanks...
  6. Wow, Thank you so much for all those information. I am going to look into DFT and zero crossing that you mentioned and try to come up with a solution.
  7. I have a 13 bit frequency in which the sound in the buffer should be played at. To change sound frequency, I need to calculate the frequency ratio (so that I can use it in XAudio2::SetFrequencyRatio function) which is equal to '13 bit frequency / frequency of the tone' ('13 bit frequency / 375' in your above example).
  8. Sorry, sometimes I can't express myself clearly in English since it's my second language. As far as I understand, sampling frequency is the number of sample played per second. So, if the sample rate is 8kHz, it means 8000 samples are played per second. And frequency of sound is number of oscillation of sound waves per second. So they are not the same thing. What I am trying to do is this, I have 64 bytes long buffer and the contains of it is played again and again, infinite loop. Now I have to find the frequency at which the sound in that buffer is playing at. Since I know the sample rate is 8 kHz, I can analyze the value in the buffer and find out the number of oscillation in the buffer. And lastly to find out the frequency I can simply do this: Frequency = (Sample Rate / Size of Buffer) * number of oscillation in buffer or, Frequency = (8000 / 64) * number of oscillation in buffer or, Frequency = 125 * number of oscillation in buffer After I find the frequency of the sound that is being played, I can use that to find the frequency ratio needed for the XAudio2 SetFrequencyRatio function. Thanks!
  9. Oh, Thank You! XAudio2 has SetFrequencyRatio function to change frequency of the sound and to find frequency ratio, I need to detect the frequency at which the sound in a buffer plays at. Consider the buffer is circular and is 64 bytes long, sample rate is 8 kHz and sample depth is 8 bits, I can find the frequency of the sound in buffer by finding the number of oscillations in the buffer and then multiplying 125 with the number of oscillations. And find frequency ratio by dividing the 'new frequency' by the frequency of the sound in buffer. So, my question is that to find the frequency of the sound in buffer, do I have to consider the overtones too or just fundamental frequency?
  10. Thank you both for replying. Consider the waves above is played only once a second. That means the first wave is 1 Hz, what would be the frequency of second wave? Thanks!
  11. So, 1 Hz Frequency wave looks like this: (The middle line is 0 amplitude) [img]http://www.mirrorimg.net/im1/04m.jpeg[/img] But what if wave looks something like this: [img]http://www.mirrorimg.net/im1/l1b.jpeg[/img] Is it still 1Hz? Sorry if this is a stupid question.
  12. You're probably right. I think I should focus more on getting it done than optimizing it. Thanks!
  13. Thank you very much. You were right, 0 amplitude is 128 for 8 bits. Cracks are far less frequent now in my program. But can you please answer my this question: [quote]performance wise, if sound has to stop and start many times (once a second an average) is it better to leave the sound open with volume down when not playing or is it better to completely stop the sound and restart the sound.[/quote] Thank you...
  14. Yeah sudden change of amplitude seems to be the cause. I want to ask something else, performance wise, if sound has to stop and start many times (once a second an average) is it better to leave the sound open with volume down when not playing or is it better to completely stop the sound and restart the sound. EDIT: @aregee: Uh oh, I just did that test with 0% duty cycle and I still got clicks and pops.
  15. Thank you for your reply. Flushing off the buffer is not a bad idea but it wouldn't work for me because the source voice only has one buffer that is looped again and again. Also setting the volume to zero and starting and stopping didn't work. Here are some codes, first this is how I have setup my WAVEFORMATEX: [code] WAVEFORMATEX wFormat; wFormat.wFormatTag = WAVE_FORMAT_PCM; wFormat.wBitsPerSample = 8; wFormat.nBlockAlign = 1; wFormat.nAvgBytesPerSec = 8000; wFormat.nSamplesPerSec = 8000; wFormat.nChannels = 1; wFormat.cbSize = 0; ZeroMemory(&xABufferInfo, sizeof(xABufferInfo)); xABufferInfo.AudioBytes = 8; xABufferInfo.pAudioData = xABuffer; xABufferInfo.LoopCount = XAUDIO2_LOOP_INFINITE; if (xASourceChTwo->SubmitSourceBuffer(&xABufferInfo) != S_OK) return false; [/code] So the sample depth is 8 bits and sample rate is 8 kHz. Now I have 5 buffers, 1st buffer that source voice reads and loops again and again and 4 others are wave patterns of different duty cycle. All of them are 8 bytes long: [code] unsigned char xABuffer[8], wDTwelve[8], wDTwenty[8], wDFifty[8], wDSeventyFive[8]; //12.5% duty cycle wDTwelve[0] = 0; wDTwelve[1] = 64; wDTwelve[2] = 64; wDTwelve[3] = 64; wDTwelve[4] = 64; wDTwelve[5] = 64; wDTwelve[6] = 64; wDTwelve[7] = 64; //25% duty cycle wDTwentyFive[0] = 0; wDTwentyFive[1] = 0; wDTwentyFive[2] = 64; wDTwentyFive[3] = 64; wDTwentyFive[4] = 64; wDTwentyFive[5] = 64; wDTwentyFive[6] = 64; wDTwentyFive[7] = 64; //50% duty cycle wDFifty[0] = 0; wDFifty[1] = 0; wDFifty[2] = 0; wDFifty[3] = 0; wDFifty[4] = 64; wDFifty[5] = 64; wDFifty[6] = 64; wDFifty[7] = 64; //75% duty cycle wDSeventyFive[0] = 0; wDSeventyFive[1] = 0; wDSeventyFive[2] = 0; wDSeventyFive[3] = 0; wDSeventyFive[4] = 0; wDSeventyFive[5] = 0; wDSeventyFive[6] = 64; wDSeventyFive[7] = 64; //Default wave duty cycle is 50% memcpy(xABuffer, wDFifty, 8); [/code] Now before playing and updating the sound, program checks duty cycle flag and just copies the data to xABuffer like this: [code] switch (dutyFlag) { case DUTY_TWELVE: memcpy(xABuffer, wDTwelve, 8; break; case DUTY_TWENTYFIVE: memcpy(xABuffer, wDTwentyFive, 8); break; case DUTY_FIFTY: memcpy(xABuffer, wDFifty, 8); break; case DUTY_SEVENTYFIVE: memcpy(xABuffer, wDSeventyFive, 8); } [/code] Then some flags are checked, frequency is set and the sound is played like this: [code] if (!channelTwo) { channelTwo = true; xASourceChTwo->Start() } [/code] And at last when sound is suppose to stop, it stops like this: [code] if (channelTwo) { channelTwo = false; xASourceChTwo->Stop(); } [/code]