• 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.

RobotGuy

Members
  • Content count

    12
  • Joined

  • Last visited

Community Reputation

176 Neutral

About RobotGuy

  • Rank
    Member
  1. [quote name='6677' timestamp='1355859098' post='5012172'] Quick thread hijack here. Any recommendations on free online resources on the subject of writing compilers and interpreters while we're at it? I can write CPU/bytecode interpreters (although I have never looked at stack based, only register based) but nothing more. [/quote] The best I ever came across (and I did manager to write a compiler based on this) is the [url="http://compilers.iecc.com/crenshaw/"]Let's Build a Compiler[/url] series. It's complicated a bit by it being written in Pascal and generates executable code for 68000 processers, but it is relatively easy to follow and convert into C code and make it generate byte code.
  2. I must admit I'm beginning to run out of ideas, are you sure that mysql has networking enabled? As you said that the command line tool connected, try: mysql.exe --user=root --password= --host=localhost --protocol=TCP abelcorver_com This will try to connect via network sockets and if it fails when it worked without the host and protocol parameters then I'd have to be pretty sure that mysql isn't listening on the network. If so then you're going to have to alter your my.cnf to allow networking (check the mysql manual and make sure that skip-networking isn't included) or connect some other way. See if mysql is listening on a named pipe with: mysql.exe --user=root --password= --protocol=PIPE abelcorver_com If that works then either (and I have no experience with this as I use Unix) use "." instead of "localhost" in the call to mysql_real_connect or call mysql_options with MYSQL_OPT_NAMED_PIPE before the connect call. If none of this works then I'm afraid I'm out of ideas. Does XAMPP have a forum? They would probably have a better idea about the default configuration of mysql that is used.
  3. Shouldn't be a version mismatch as as far as I know both the server and client libraries are all backwardly compatible and I believe negotiate an appropriate protocol version between themselves. At least, I've never had to change the library I link against when changing the server version. I suppose if the versions where really far apart there could be a problem but you'd really have to work at it. As a suggestion, try changing the host parameter ("localhost") to your real IP address (i.e. not 127.0.0.1) and see if it works (or at least gives a different error message). If so then it is some issue with the library attempting to talk via the unix socket and it isn't working. Out of interest, can you connect with the mysql.exe program? cd C:/xampp/mysql/bin mysql.exe --user=root --password= abelcorver_com
  4. I can't guarantee that this is you issue because I haven't done a great deal of work with mysql on windows but under unix, mysql is really good at automatically assuming that if you are connecting to localhost then it should use the unix socket. If you really want to use TCP then you have to tell it before hand. Either check that you can connect via the unix type socket "C:/xampp/mysql/mysql.sock" or call mysql_options() with MYSQL_OPT_PROTOCOL and set the protocol to MYSQL_PROTOCOL_TCP before you call mysql_real_connect().
  5. Quote:Original post by Gage64 I meant you should generate a random number, use it as an argument to ifstream::seekg(), and then read one character at a time until you read a newline (that is, a '\n'). After this you know you're at the beginning of a line, and you can get the offset using tellg(). This will mostly work but there is a small issue in that, as written, the first line will never be picked and there is an issue when the random offset is in the last line. You must either search backwards for the newline (best done be reading a block of data, all at once, before the offset and scanning backwards through memory and repeating this if the newline or beginning of the file isn't found) or if you find the end of the file before a newline or the newline is the last character in the file wrap around to the beginning to get the first line. In addition, be aware that it will only give a equal chance to each line if the lines are of the same length. If all the lines except one are of length N and the remaining one is of length 2N, the line after this one will have twice the chance of being picked. This might be fine for your purposes but you should bear this in mind.
  6. Most speed ups for string searching depend on making some assumptions about either the needle string or the haystack string and you haven't indicated what shortcuts are acceptable (for example, can you limit the searches to whole or partial words or do you have to allow for search strings that cross word boundaries i.e. "ptions abo"). One speed up that will work in any case is the Boyer-Moore or Turbo Boyer-Moore algorithm which, for a small amount of set up per search, allows quicker searching through a string. There are lots of worked examples, source and pseudo-code available for these algorithms on the internet, but do be careful if you try to alter them. I made the mistake of attempting to change one set of source between using signed numbers for string indicies to unsigned numbers and found bugs for months.
  7. Have you looked at BRL-CAD (http://brlcad.org/)? I haven't actually used it yet but that is only because I haven't had time yet. It appears that it is a Constructive Solid Geometry system that allows you to build up a model by using one command line application that accepts a set of scripted commands then you can export the model into a number of different file formats with a different tool. Even if you don't like the actual scripted commands for the MGED tool, it would be a lot easier to create a python or lua package that would generate the MGED script from a set of commands than it would be to do CSG from scratch.
  8. As a quick guess, your init_GL is leaving the GL Matrix mode in the GL_TEXTURE mode rather than the GL_MODELVIEW mode which mean that any transformations will be applied to the texture not the quads that you draw. Try swapping the order of the glMatrixMode statements. As a suggestion you could be able to make your Sprite::display easier by removing the second glTranslatef call and making the quad vertices (-w/2, -h/2), (-w/2, +h/2), (+w/2, +h/2) and (+w/2, -h/2) which could be all precomputed and stored in a display list.
  9. Interesting problem, I was always interested in speech synthesis but it wasn't my area of research so this should be taken with a large pinch of salt but it might give you a starting point to start searching from. If I was having to do this I would take my corpus of speech (that's the that audio that we are trying to emulate) and first convert it to a formant based representation. This includes the the fundamental frequency, voice / unvoiced data, amplitude and the vocal tract filter (f1, f2, f3...) Next I'd search across the corpus for periods where the voice parameters are stationary for a period of time which would indicate pauses and vowel sounds (and fricatives if unvoiced). Run these though a classifier to break them into a limited symbol set (including a number of different pauses based on the length). Call these V1 - Vn Overlaying these onto the original corpus would give a give vowel symbols separated by non-vowel sounds. Then separate out the non-vowel sounds based on the vowel symbols that came before and after them (i.e. collect together all the non-vowel sounds that occurs between V1 and V2) and classify them the same way as the vowel sounds. Call these Vi-C1-Vj to Vi-Cn-Vj. The vowel symbols can be analysed to give a probability of one vowel symbol given the previous one (i.e. if we have 'V1' then it is followed by 'V4' 45% of the time, 'V3' 25% of the time, 'V9' 15% of the time and 'V7' 15% of the time). Start with a particular vowel symbol (for instance a long pause) then can pick a random next vowel symbol based on the probability of that vowel following the current one. Repeat as needed (perhaps based on length and final vowel symbol set) to generate a list of vowel symbols. This is called a Markov chain. You can improve in by using more that one previous previous symbol so you work out the probability of each vowel based on the two or more previous vowels but it depends on how big you corpus is. Then pick random non-vowel symbols to fit between then vowel symbols based on their probability of occurrence (i.e. if V1-C1-V2 occurs 50% of the time that V2 followed V1 then the probability of choosing it should be 50%). This gives you a full sentence of utterances which you need to turn back into an audio stream by concatenating sound fragments contains half a prefix vowel sound, an non-vowel sound and half a suffice vowel sound (i.e. half of Vi, Vi - Cj - Vk, half of Vk with the start and end at a zero crossing of the waveform) This can process can be done in one pass by picking the next vowel symbol then immediately picking the non-vowel symbol before picking the next vowel. It could also be mediated by the text by, for example, forcing pauses at intervals based on the length of the words. I'd probably create these fragments by computing the average vocal parameters for each vowel sound , finding each instance of Vi, Vi - Cj - Vk, Vk in the corpus, chopping of the first half of Vi and the last half of Vk and fixing the ends to the average vowel parameters. The instances would be averaged to make a representative fragment (or possibly two) based one the vocal parameters and then feed it back though a speech synthesis model to generate the audio. It might need the vocal parameters low pas filtering to muddy the sound up a bit otherwise it might be a bit too good but without listening to the results I can't tell. Depending on how intelligible the output audio is you might need to generate a list of prohibited sound sequences to stop you random burbles from randomly generating things that you don't want it to say such as obscenities. It's possible that this is a bit excessive for the application you want but hopefully, this will give you some ideas.
  10. Quote:Original post by ov3r_dr1v3 I do have one question though...whats the advantage of using const_iterators instead of iterators in this case? As Visitor said it's for const correctness. It's a good practice to get into always making sure that any pointers, references or methods that aren't meant to to used to change the target data are marked const. It makes sure that you can't accidentally change the data and sometimes it can allow the compiler to make some better optimisations.
  11. I think I can see what's going wrong. The iterator returned from the GetMessageHandler function is on the MessageMap that in contained within the AP_BASEWINDOW object however the other side of the comparison is an iterator on a copy of the MessageMap as getMessageMap returns a copy of the map rather than a reference. Try changing: MessageMap getMessageMap(){return message_map;}; to: MessageMap &getMessageMap(){return message_map;}; If this corrects the issue then a better ide may be to change the lines: typedef MessageMap::iterator MessageMapIterator; MessageMap getMessageMap(){return message_map;}; to: typedef MessageMap::const_iterator MessageMapIterator; const MessageMap &getMessageMap(){return message_map;}; and the GetMessageHandler function to: MessageMapIterator AP_BASEWINDOW::GetMessageHandler(long message) const { return message_map.find(message); }
  12. This is almost certainly not a problem with SDL and is quite likely not even a problem with your code but a fundamental limitation of your hardware. Keyboards can not reliably determine the state of every key in every possible state because of the way that the work internally. In general the keys are connected in a grid where every key, when pressed, connects a 'horizontal' wire with a 'vertical' wire. This means that for a 120ish key keyboard the microcontroller in it requires only 15 lines (7 * 8 > 120) rather than one for each key. When a key is pressed the microcontroller detects the short and tells your PC that a key has been pressed. With this arrangement it is possible to correctly identify when two keys are pressed but if a third key is pressed and it share a line with either of the two other keys then it can not be determined uniquely. The chances are that your 'jump', 'fire' and 'left' keys aren't in a problem configuration where as you 'jump', 'fire' and 'right' keys are. I would think that most keyboards have additional stuff to improve key detection for modifiers (shift, ctrl, alt, etc) so you might have more luck if you changed one of the functions ('fire' perhaps) to one of these.