Re: Game Creation

2014-09-04 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: Game Creation

No. Most languages do not explain the basics in official documentation. They will tell you how to declare a variable, what the possible types are, etc. They will not spell out what variables and types are, why you might want them, etc. Some languages do provide tutorials for new programmers in the reference manuals, but this is rare and far between. Having someone get you started is way different: when the why or what does this term mean question inevitably comes up, they can tell you. Purebasic may have a basics for new programmers section, but that would put it in a minority. You usually have to go elsewhere for it and, even if the language offers it, its usually not the best. All you typically get is language specifics with an expectation that you know what all the words mean-its assumed youre already a programmer.

URL: http://forum.audiogames.net/viewtopic.php?pid=187878#p187878




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Game Creation

2014-09-04 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: Game Creation

Going to math class does not teach you what a variable is in the programming sense. Not unless were talking about some languages which are so far outside this discussion that we need the Hubble telescope to see them. Going to math class does not, in general, make you a better programmer. Programming makes you a better programmer, and there are no shortcuts.Going to math class does give you a wide variety of useful math things you can make use of and the highest levels of math wherein you make proofs for almost every homework question may promote the right mindset. But math is orthogonal to being able to write a program. These concepts either come from a programming class, a teacher or friend, or a programming tutorial aimed at one who has never programmed before. You can get some of it by osmosis as it were-watching the discussions of others online-but you cant just innately be a programmer as is being suggested here. Tha
 t doesnt happen; no matter how good you are, you got the basic concepts from somewhere else at some point.Second languages? No problem. Fifth languages? An hour with the reference manual. But the first one is a very big struggle, and you do need external help aimed at someone in your situation of one sort or another.

URL: http://forum.audiogames.net/viewtopic.php?pid=187904#p187904




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: creating a gui frontend to a cli application?

2014-09-04 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: creating a gui frontend to a cli application?

We need more information.In the simplest case, you build a GUI that builds a string, calls the terminal with that string, and then somehow communicates the result. But theres not much point, and it will always, always be hacky and easily broken. More complex cases assume that you have the source code and that it was written with this in mind-many programs are written as a library that you call and a 50-line command line frontend that calls it.Id suggest C# for this. C+++ GUI is difficult, in that QT is inaccessible and WX is hard to set up. Theres C++/CLI, but thats its own brand of special, especially if youre anywhere near new to programming. C# is the most similar to both of the languages you have mentioned. You can do it in C++, but I doubt BGT has the stuff you need. C++ GUI is difficult at the best of times. Now, if were just talking about a GUI for the blind-the normal techniques
  for game menus works for that, I suppose.But a GUI a in windows with actual buttons and checkboxes is going to overturn how youve probably programmed before. Its a callback model, not a push model. That is, the entire thing is done by waiting for things to happen and letting the GUI libraries call functions you provide when they do. This is as opposed to the traditional while loop and if statements, and is foreign the first time you see it.

URL: http://forum.audiogames.net/viewtopic.php?pid=187907#p187907




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: creating a gui frontend to a cli application?

2014-09-04 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: creating a gui frontend to a cli application?

The program being open source doesnt quite determine if youre able to add a frontend to it. Its about architecture. If the parts of the program that do work are pulled out properly, you can use it like a library and build your own. Otherwise, yeah, build shell commands. imho, its not worth it for most command line tools: the effort it takes to do this is grater than the effort to become proficient with the tool.But if its open source and in Python, then WXPython is maybe your best bet. C++ makes GUI programming somewhat painful, to say the least. The good frameworks are inaccessible, leaving only wx, as far as I know. I tried to get WX and C++ working at one point; it was basically impossible even though I did succeed in the end, and Im the one writing a very, very large library for game audio in C++. BGT doesnt have GUI at all.But as for where to start? Theres n
 o good answer to that, Im afraid. Only the stereotypical ones like read tutorials.

URL: http://forum.audiogames.net/viewtopic.php?pid=187922#p187922




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Game Creation

2014-09-02 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: Game Creation

The point at which trigonometry becomes an issue isnt much to do with programming skill. Its more to do with what youre doing and how youre doing it. Ive seen topics on here where people have started posting 100-line if statements and Ive come in and replaced it with two via trig formulas. So I dont know exactly when it gets hit, but I do know that it has a lot to do with the type of game being coded.As for computer science in general, you can do a lot with arrays. But the day does come when theyre too slow, and you need to at least know what a tree and a hash table are. This can be avoided for awhile, at least until you need to pull a 100x speed increase out of your hat in order to finish the project. Many projects never hit this issue, but be aware that it exists. You do not need to know how to implement these things, just how to use them; most languages have them built-in these days,
  and its usually just some library calls. There is no need to go jump on the Comp. Sci. bandwagon at this precise moment.@CAE_Jones:I dont know if you really want to try to explain it. Thats harder than it sounds. You can post the formulas, but the understanding is hard. The understanding also saves hours and hours later. Ive personally never had luck explaining it without a diagram, but maybe thats just me.And Im glad to see we have another indentation convert. Telling NVDA to only turn it on in your text editor can be done via config profiles, or you can just memorize nvda+n, p, f, i, space, enter. I dont know about other screen readers, save that jaws always had bugs involving indentation announcement and the bottom line of the window. Since its only announced when indentation changes (unless its the aforementioned Jaws bug, in which case you will drown in
  the high-pitched 4 spaces), its kind of like left brace and right brace--at least in my opinion. Also, having indentation on does make it announce with read line, which is also super helpful-especially when reading code by the sighted. I find it interesting that you use the arrow keys: Ive never heard of someone doing that and still thinking its a good idea. My C++ is, indeed, always indented.

URL: http://forum.audiogames.net/viewtopic.php?pid=187615#p187615




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Libaudioverse Preview 1

2014-09-02 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: Libaudioverse Preview 1

Its up on Github and has been from day 1. See here.The license is GPL. When 1.0 is ready, Im going to offer commercial licenses, probably through 3 Mouse Technology, a cooperative of which I am a member. I have been absurdly paranoid about copyright and no one but myself has contributed any code; to that end, I am still legally in the clear to do this.Building is a bit complicated and the readme is way, way out of date. Further documentation efforts are happening and are about 1/3rd done as of an hour ago. The readme is not the current state of development; the docs branch has a manual in asciidoc that includes build instructions. The TLDR version is this: install CMake, Python 2.7, Jinja2, enum34, pyyaml, pycparser, windows binaries for Libsndfile. Run cmake as usual.I have a binding generator that uses Jinja2 and Pycparser as well as a master Yaml file; 
 the net result is that I can probably do C++ classes on top of it. I just dont see the point at this time; I certainly wont be using them, not even for testing. Extensive C++ examples exist, as mentioned above.if anyone is both sufficiently adventurous and capable of attempting to build and cant get it to do so, either e-mail me or open issues on the Github repository. It should build on most windows systems, though there is at least one known issue with Libsndfile paths maybe not being quite right (see the docs branch, subdirectory documentation). Building is currently windows-only; Linux and Mac take some amount of work (probably 4 or 5 days all told, but really 2 weeks because of classes) and wont happen until I iron out the rest. iOS and Android are much more significant and are not on the table because of performance issues until after 1.0.

URL: http://forum.audiogames.net/viewtopic.php?pid=187657#p187657




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Game Creation

2014-09-01 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: Game Creation

Im not going to go into language preferences; my thoughts on this are very well recorded elsewhere.Cross-platform is hard. Many good programmers including myself struggle with it. Theres a lot of systems (including Python) that say theyre cross-platform, but then you end up in the if you dont use this feature, dont call that library, and dont make this other assumption about the system youre on land.Pick one platform, whichever one is your primary. Make a game for it. I would posit that Mac is potentially a good choice from a technical perspective because if we had Core Audio everywhere else Id not be doing Libaudioverse; Core Audio appears complex and not super well documented as far as I can tell. XCode itself highlights every accessibility issue with the Mac, at least last I looked at it (I was, for about 2 months, going to do IOS development with Objective-c.
  The slowness of getting things done with XCode stopped it). Ive heard rumors this might get better soon, but theyre only rumors and definitely not substantial.The other thing thats big here is math and basic computer science, no matter how much you want to avoid them. Anything remotely complex is going to require both. If you dont know much trigonometry, there are certain types of games that are basically not doable. Namely, Shades of Doom and any other FPS. If you arent comfortable implementing pathfinding, you need to find a system that already does it and stay well within its constraints (I am unfamiliar enough with BGTs implementation that I do not know what that specific one lets you do or not). The pathfinding algorithms can be done in under 100 lines, but the motivation behind why it works is not the simplest thing ever. The alternative is to give enemies fixed paths, but this wont let 
 them respond to changing environments like the player running away. 1d Side-scrollers are pretty easy and avoid all of this, but 2D side-scrollers like BK3 get a bit more complicated. If you want any sort of real AI, youre headed for some non-newbie areas. Top-down games (Shadow Rine) can be as simple or as complex as you want to make them. Id argue that a top-down might be easier than a side-scroller because you dont have to worry about gravity. But really, as long as its not an FPS, the difficulty is set by you and how much you want it to do, with the clarification that raising the bar above a certain point is like tripping on the edge of the deep end of your swimming pool while not knowing how to swim.I can barrage you with worthwhile terms to Google, but dont think that will help at this point. Googling is your best friend as a programmer, especially Googling for Stack Overflow answers. Really.

URL: http://forum.audiogames.net/viewtopic.php?pid=187540#p187540




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: What's the best platform for developing dynamic interactive fiction?

2014-08-30 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: What's the best platform for developing dynamic interactive fiction?

if I were to do this, Id use Inform 7. You get a ridiculous amount of stuff for free that Ive not seen elsewhere. If its an RPG, going and learning Inform 6 might be better--but this is more programming rather than describing, and is a c-like language as opposed to an essay-like language.The built-in I7 interpreter isnt accessible, but you can easily launch the games in other interpreters for testing; I dont remember how I did it, but I actually got the I7 IDE to launch Frotz TTS back in the day. The error reporting is fantastic, and, unless you know programming, its probably what you want.

URL: http://forum.audiogames.net/viewtopic.php?pid=187194#p187194




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Libaudioverse Preview 1

2014-08-28 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: Libaudioverse Preview 1

Okay. Let me try this again.You do have the coordinate system right.But the values are not panning ranges. The default distance model configuration is set up such that, when a source is more than 50 meters away from you, its silent. The 3 values are a position, not a panning value. If you have a monster at (5, 3) in a first-person game (assuming x is west/east and y is north/south), you translate it to (5, 0, -3). (40, 0, -40) will also produce silence, because (by the Pythagorean theorem) its more than 50 meters away. As the player moves, you update the listeners position through properties on the world object. Its literally as though youd suddenly put a real monster in the real room with you. Moving the listener simply represents you walking, and turning the listener represents you turning. If you wanted everything to be in millimeters, you can change the max distance to 5; if it&
 #039;s in kilometers, you can change the max distance to 0.05. If the environment is a massively padded room, you can lower them. If its an outdoor field, you can raise them. But the point is that this is coordinates taken directly from positions of objects in your game, not some sort of panning values youre supposed to calculate. There is no in-built maximums or minimums. If you put the object at (100, 0, -100) (100 units east, 100 units north) and then bump the listener to (80 0, -80), the sound becomes audible as though you teleported; if you move the listener slowly towards it, the sound becomes audible as though youre walking towards it in a big open field or something. Im not demonstrating this because I need to bring in 4 or 5 more dependencies to do it properly, all of which must be installed by someone writing the examples. Perhaps Ill add more commands to sim3d.py, but that doesnt do it justice a
 nd I was trying to keep things simple.Im not sure what placing a mono track with no blead in a location means. Im almost sure its possible anyway. The 3D simulation is built using other Libaudioverse components, all of which are publicly exposed and consequently usable by you. If you wanted to do something custom, you can feed it through an attenuator (so you can simulate distance) and a panner (so you can move it between the speakers), and then do whatever. This is exactly what the 3D simulation does behind the scenes, only Libaudioverse is providing the equations to control the attenuator and panner instead of you. You can use this at the same time as one or more 3d worlds by running all the outputs through a mixer. Im not sure what your goal is, however.As for the y values, its subtle and a bit tricky. If you try only coordinates like (0, 10, 0) you wont really hear it, and it doesnt w
 ork well with some sounds. I3d had to add the radar because of this but, in my experience, its working about as well as the real world. Part of the problem with this is that youre driving the simulation incorrectly and part of the problem is that its slight anyway. Run the HRTF example and try values like (30, 30), (30, -30), etc. Putting it right in front of you doesnt work so well when trying to demonstrate it. Also note that this part of the library isnt quite finished: if you sweep a sound from (30, 0) to (30, 90) in the HRTF example by anything less than 10-degree increments, itll jump up really noticeably.Two things to note about this: First, examples like this dont really demonstrate it properly, as theres a ton of queues missing due to the fact that its not being driven naturally. Whether or not something is behind you is actually partially determined by movement
 , so its a lot more obvious when things are moved around smoothy and youre actually in control of a virtual character. Second, most of the audio libraries worked with in this community have been intentionally watered down either because the authors didnt know enough math to do it properly or because the creators did not feel the need or desire to explain it to you (I place BGT in this latter category, because he obviously knows the math to have done better). Other libraries (Pygame) are simple because you, as the game designer, are supposed to write a higher level framework. Im not sure why this isnt provided in Pygame, but always found it mildly stupid that they didnt.

URL: http://forum.audiogames.net/viewtopic.php?pid=186879#p186879




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Libaudioverse Preview 1

2014-08-28 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: Libaudioverse Preview 1

You are indeed correct.The equations for facing are a bit complicated and need a full tutorial, but I can quickly sketch out the basics of how that works in general. I can never recall the specific equation off the top of my head, and dont want to spout off something thats wrong. You can actually turn to any arbitrary angle and, if youre not, its perhaps better to use some other features directly. If you cant hit the angles in between with aiming/turning controls, you will lose a lot and things will sound...a bit odd. The specific values for north/south/east/west are as follows:north: (0, 0, -1, 0, 1, 0) which is the default.East: (1, 0, 0, 0, 1, 0)south: (0, 0, 1, 0, 1, 0)west: (-1, 0, 0, 0, 1, 0)Set them on the orientation property of the world.So, a qualitative explanation of why Im using 6 numbers.The orientation of any object anywhere at all can be defined uniquely by 4
  things. You must define the top of the object, the front of the object, the direction a rod sticking out of the top of the object would be pointing, and the direction a rod stuck out of the front of an object would be pointing. We usually specify these two values as the forward and up vectors, and specify that the front of the viewer is towards the monitor and the top of the viewer is towards the top of the monitor. These rods must be kept perpendicular at all times or the equations that make them work fail hard.To put it more simply, pretend youve got a rod glued to your back that runs up to just above your head and another one thats poking straight out of your nose. Libaudioverse (and every other library for graphics and sound) makes this assumption and does not let you configure it. The first 3 numbers in the 6-tuple specify where the one pointing out of your nose is pointing, and the last 3 numbers specify where the one running up
  your back and out the top of your head is pointing.Now, the at and up properties could be separate, but suppose that the following sequence happens: you set at (which makes it temporarily not perpendicular to up), Libaudioverse does a block of mixing in the background, you set up, and another block of mixing happens. Weve got one block where theyre wrong, and everything randomly decides to sound very strange. To that end, we make them into a list of 6 numbers rather than two separate properties on a world, which forces your game to update it either completely or not at all (this actually ties into our threading discussion and is an example of something called atomicity. We say that orientation updates must be atomic).Notice that, for 2D games, the second set is always 0, 1, 0. This is because youre not doing tricks with looking up and down. Audiogames need the functionality very rarely, but it is there and can 
 make some interesting effects like falling over happen. This is not intuitive, so I suggest actually fiddling with a physical object you can rotate to understand it better.And to give what I *think* the equation is (I cant test it at the moment): (sin(theta), 0, -cos(theta), 0, 1, 0). theta may be in radians or degrees, depending on your programming language and the configuration of your math libraries (Python is radians). Positive angles turn clockwise, so 90 is east and 180 is south. The conversion formula for degrees to radians is as follows: radians=(degrees/180.0)*pi. I believe Python provides a function for this, but mathematicians and similar all just use radians directly anyway. There is a version of this formula that allows for phi, the angle between the ground and the direction you want to look in, but I have to re derive it before I can post it and I suspect you dont need or even want it at this point anyway.

URL: http://forum.audiogames.net/viewtopic.php?pid=186916#p186916




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Libaudioverse Preview 1

2014-08-27 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: Libaudioverse Preview 1

Is this with the build-in example? If so, which one? It could be a bug, but I need more information to determine one way or another.if youre not using headphones, given that those are outputting HRTF, its not going to sound right.In the case of not using headphones, you need to use an amplitude panner. I have one built-in, but no Python example for it. Its identical to the HRTF panner, save that you dont have to pass it an HRTF file and it can be configured to work on more than 2 speakers (warning: doesnt actually work on more than 2 speakers, Ive got to change the algorithm to use dot products and get surround sound maps working, the latter of which is going to take something like 1000 lines or a godsend). Anyhow, replacing the HRTF panner with an amplitude panner in the HRTF example will work fine; the class name is libaudioverse.AmplitudePannerObject. The case of sim3d.py is a bit more complex a
 nd needs some internal work.The behind sound is done with a technique called convolution, using some data from MIT. Increasing the behind sound with a number is not something easily done in HRTF configurations, but other panning strategies (which I will implement for imbedded devices, eventually) do allow for such. The point here is realism, and alternative strategies lose that and the ability to pan vertically, at all. Anything that isnt headphones cant provide this configuration either: either youre using stereo speakers and I cant do anything, or youre using a surround sound setup and the behind sound is whether or not I play through the speakers positioned behind you. Im not going to make guarantees either way, but the best headphone strategy available is HRTF and anything I do with it beyond the traditional stuff is basically original and publishable research (I.e. I dont know, because no one ha
 s come before besides trade secret companies and people who arent talking). A good deal of this is also sound design: the techniques I am using work on sounds with what is called a wide frequency spectrum, so something like a piece of flute music is going to have a lot less differentiation of when its behind you than, say, a footstep.Now, on to your problem. If you mean that the sound isnt moving at all, then this is a bug and we need to talk. But I think this is a misunderstanding of what the numbers are and that youre saying its only either coming directly out the left or the right speaker. The sim3d example is demonstrating how one makes a 3D world, and youre not supposed to use it like you are. Those are coordinates in 3d space, not panning values. Pretend theyre in meters, though really this is configurable. A value like (-0.5, 0, 0) means half a meter to the left of your head; (0.5, 0, 0)
  is half a meter to the right. While traditional audiogame programmers are going to kill me for this, y is vertical and z is forward/behind (Im not going to break conventions of every single math and science book as well as OpenGL, OpenAL, and properly configured DirectX without a better reason). The effect youre aiming for is more simply achieved by panning an HRTF or amplitude panner from -90 to 90. To see sounds move in front of you, try z values of -10, i.e. (2, 0, -10). yes, everyone who isnt in this community uses negative Z to mean in front, and the reasons seem to do with compass directions and trigonometry (and to really screw your brain, its sometimes easiest or even almost necessary to make the positive X axis point north). This will also eventually be configurable, but actually configuring it requires knowledge of 3D transformation matrices (so I might publish a table of if you want this then use tha
 t values). Nevertheless, when using Libaudioverse worlds you work in world coordinates; you feed it object positions directly from wherever they are in your game, set up configuration values for whether or not its feet or meters or millimeters or inches or whatever, and let it go. In addition, you can move and turn the listener around; you dont move the sources when the player walks, you move the player and Libaudioverse does what it has to. Im going to make tutorials for all of this. It is much easier than it looks from this short post and also kills huge chunks of code that everyone making a first-person game writes.For games like side-scrollers, the world/source interface is cumbersome and unnecessary. This is why the amplitude panner and hrtf panners exist. An amplitude panner ignores verticall elevation (we cant do anything with it and its only provided so you can use the same code with both) and pans
  evenly for azimuths specified as a clockwise angle from straight in front of you. I.e 90 is out the right speaker, -90 is out the left speaker, and values above this range specify things behind you (it does nothing special for stereo). If you go from 90 to 180 with stereo, itll center itself again; with surround sound, when I code that, itll play out the rear speakers.Hope 

Re: is coding in python easy? just interested

2014-08-25 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: is coding in python easy? just interested

Youre overcomplicating things tremendously. I think someone else needs to try to explain why threads are going to screw you in the end, but youre taking the molehill of ticks and turning it into a mountain. You can feel free to disbelieve me about threads, but Id bet literally anything that youll be back in two months with a failed project and the exact same conversation were having now. Possibly word-for-word, or at least post-for-post. Im having trouble finding an article that is at your level. I suspect this is because programmers at your level do not usually jump hard on the thread bandwagon and usually not just by going hey, look at the threading module-i.e. the tutorial or whatever has a chance to tell you about the problems. Ill try to be explicit about it at the end of this post.The delta is simply the time since the main loop of your game called tick last. It *can* be use
 d to make the game catch up. Or you can flat-out ignore it, pretend that it is always 1/20 or 1/30 or 1/60 or whatever, and write the whole game that way. As I said, nothing is wrong with the latter, especially in this case.Audiogame_engine screens are exactly like opening another window. Except that you dont re-import anything, you dont load a second Python interpreter, etc. Audiogame__engine just sends all input to the topmost screen on the ScreenStack, and thats it. Theres basically no performance hit for doing so, and the code that actually handles it is simpler than what youre posting. Larger, but simpler conceptually. Just subclass screen, override tick, and make use of self.keyboard_handler and self.mouse_handler to set up functions to be called when youve got input ready.A few things. First, never ever use AttributeError for initialization. __init__ is where youre supp
 osed to set everything to default values. Second, the delta is not the framerate: it is the time from the beginning of a tick call to the beginning of the next tick call. If your tick is taking more time than the framerate, your delta becomes larger than the framerate. Third, you do not wait framerate seconds, you wait framerate-last_tick_time seconds, Where you get last_tick_time as follows:start_time = time.time()
tick()
end_time = time.time()
tick_time = end_time-start_time
wait_time = framerate-tick_time
if wait_time  0:
time.sleep(wait_time)I do not think it really matters whether or not you use time.time() instead of time.clock(). In this case, it shouldnt matter much. Do note that the windows clocks are notorious for being imprecise, i.e. you may not be getting more than 50 ms precision on older systems. Again, this shouldnt matter much if at all for this case.So, threads.Youre looking at this tick thing and going but the thread API is so easy. I can just time.sleep whenever. And that statement is true, but only as far as that statement.When a program without threads runs and receives some input, it will always do the exact same thing if that input is the same. This is always true unless the processor melts, or something drastic like that. We can even argue such drastic cases as hard drives exploding count as input, but thats just arguing over inanities. You have nothing 
 more than the basic programming problems. If your program bugs on some input, you can make it bug every time. You always know where the problem is, or at least how to cause the problem. Debugging is a simple process: cause the bug, fix the exception or explore with a debugger. In this case, you take two or three weeks at most to understand audiogame_engine or one of the numerous alternatives that do exactly the same thing. Youre then on top of the world, and nothing is left that will surprise you about your programs.Now, I could tell you the threading story, but Im going to just give an illuminating example, followed by a rewrite of the illuminating example to show the problem:import threading
x = 0
def my_thread():
global x
for i in xrange(50):
x = x+1
t1 = threading.Thread(target = my_thread)
t2 = threading.Thread(target = my_thread)
t1.start()
t2.start()
t1.join()
t2.join()
print xThe answer is obviously 100, right?No.This will return a number between 0 and 100. The number will be different every time you run it. You will easily observe that addition operations are going missing. This is the simplest example that shows problems, and if youve looked around a lot, youll throw a lock in because thats super easy to do in this case. But see how nondeterministic it is? You know there is a bug because its not always printing 100. I made the number high on purpose, however. If you bring it down to 10, this program can and will run correctly sometimes.The specific reason why is because x = x+1 is actually 3 operations, and can be rewritten as follows:tmp = x
x = tmp+1The third operation is tmp+1, but you cant put that on a line by itself. These operations are run in the order they are written, 

Re: Libaudioverse Preview 1

2014-08-25 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: Libaudioverse Preview 1

Sounds which are short stop playing after the first repetition. The examples do work, but you need to run them on longer files like music. If it still doesnt work at that point, then it is indeed a bug. Im kind of thinking there will need to be a preview 2 at some point, but perhaps Ill just move from here to alpha.Re-creating the file object as you are here is just clobbering your hard disk; if you want to modify it in this manner, place file.position = 0 at the end of the while loop. While there will be a variant of the FileObject that caches for you, the vanilla one here is actually throwing out and re-reading the entire file every time you create it. Still, good to know the garbage collector isnt causing crashes; this was one of the major problems in Camlorn_audio.An object starts playing, but only when needed. To not be overly technical, the device detects that it needs the world, the world detects that i
 t needs the source, and the source detects that it needs the file. If the file were never connected, time would not advance for it (read: it would be paused). This is an incredibly useful thing, in that some objects are very expensive. A prime example is the HRTF panner, which requires 44100*128*4=22579200 mathematical operations per second. This number is scary and cannot be reduced. It also pales in comparison to what a high-quality reverb is going to need, but you probably wont ever need to run more than one reverb at a time.At the moment, setting obj.suspended to True on any object makes it stop advancing, even when needed. This is equivalent to pausing. I am going to be reworking this portion of the library to have an obj.state with a few different state values on everything: playing, playing silently, playing even when not needed, and paused. The model here is that you are asserting that a thing is true, not calling a
  method to make it so.Things like looping are missing because theyre trivial, and I have bigger fish to fry still. Looping is probably one of the next things Ill conquer (it will take maybe 10 minutes), but Ive got an even bigger problem yet: Portaudio sucks beyond all telling and i may have to rewrite it.And yeah, Im an idiot for forgetting to put a note about enum34 in the readme. Ill go fix that now. Its been so long since I installed it that I forgot I installed it.

URL: http://forum.audiogames.net/viewtopic.php?pid=186384#p186384




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Libaudioverse Preview 1

2014-08-25 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: Libaudioverse Preview 1

Im not going to build the C/C++ version for you. As far as I know it works now, but Ive not yet written the build instructions. There are actually more examples in C++ than in Python.At the moment, its only a C library. I may use my bindings generator to expose C++ classes on top of it (so C++ classes forced into a C API thats then wrapped...). Probably not, though. I just dont see the need.The reason I cant just build it is because of ABI and runtime disagreements. Some people will want a static library because theyre using a compiler that supports C++11. Some will want just the DLL. Some will want both the DLL and the export library. Im not going to figure this out for you and, given that youre choosing the complexity of C++ anyway, I feel this is completely fair. Building it, once I write up the directions, should be fine. If its not, I rate 
 this as a bug, at least so long as its my fault.

URL: http://forum.audiogames.net/viewtopic.php?pid=186422#p186422




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Libaudioverse Preview 1

2014-08-25 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: Libaudioverse Preview 1

Im not going to build the C/C++ version for you. As far as I know it works now, but Ive not yet written the build instructions. There are actually more examples in C++ than in Python.At the moment, its only a C library. I may use my bindings generator to expose C++ classes on top of it (so C++ classes forced into a C API thats then wrapped...). Probably not, though. I just dont see the need.The reason I cant just build it is because of ABI and runtime disagreements. Some people will want a static library because theyre using a compiler that supports C++11. Some will want just the DLL. Some will want both the DLL and the export library. Im not going to figure this out for you and, given that youre choosing the complexity of C++ anyway, I feel this is completely fair. Building it, once I write up the directions, should be fine. If its not, I rate 
 this as a bug, at least so long as its my fault.Edit:Not to mention the 32-bit vs. 64-bit battle, the whether I want to have more performance and not run on older computers battle...all of these things are controlled with compiler switches and CMake options, and theyre part of the decisions a C/C++ project needs to make.

URL: http://forum.audiogames.net/viewtopic.php?pid=186422#p186422




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: is coding in python easy? just interested

2014-08-25 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: is coding in python easy? just interested

I *think* audiogame_engine will mix fine with Pygames sound stuff. There may be sdl issues; I am uncertain, as I obviously only used it with my own stack.Writing your own is actually a good idea, if you want to learn. Its a manageable project in terms of complexity and size. Id rate it at intermediate: youre at the point of understanding that functions are things like numbers too, that inheritance is a powerful thing, and that time.sleep causes so many problems and actually solves nothing.Best of luck, whatever you do.

URL: http://forum.audiogames.net/viewtopic.php?pid=186468#p186468




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Pure basic: has anyone ever heard of, or used it?

2014-08-24 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: Pure basic: has anyone ever heard of, or used it?

They may be doing the following hack somewhere:list(mydict.keys())Or similar, which would indeed cause slowdowns. In general, programs that run on both versions are not-quite-Python, and you typically bring in something like six. Given the age of the software, its possible they never quite transitioned to the new stuff in 2.x-Im thinking mostly of iterkeys, itervalues, and xrange. But Id still be very, very curious to see what their actual problem is-Im assuming they at least run on Python 3, otherwise we couldnt say that it was slower there.

URL: http://forum.audiogames.net/viewtopic.php?pid=186251#p186251




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: is coding in python easy? just interested

2014-08-24 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: is coding in python easy? just interested

Libaudioverse got delayed because the first week of school is awful, I missed the deadline and decided to go ahead and port the media player example to Python, and the blog post about it wont come out the way I want. I then decided that, since I was going to do it anyway, Id go ahead and do the major thing that would break backward compatibility (rename device to simulation and physical device index to device index). There is a reason I do not like setting deadlines. And do note that Ive said preview: this is not alpha quality, isnt supported on Linux and Mac, and will break horribly for at least some people.Mobs wait, but this does not mean the engine does. Mobs that wish to wait can do one of a few things, the simplest of which is count down an integer in their tick method. This is when you explicitly dont use threads: threads are for things that need to continuously run, not things that need to 
 spend most or all of their time waiting. If you can provide a performance reason for wanting threads, we can talk about it on another topic; until then, my answer will always, always be dont. If you want me to go into why threads are so hard, Ill go find an article-it takes a good deal of writing to set things up before you knock them down hard.Audiogame_engine has a utility object that you can tick that handles scheduling things to happen in the future; the difference is that you specify the future in ticks, not seconds. It does indeed have input handling: see keyboard_handler and mouse_handler; all screens give you one. Its also got layering: pausing the game is as simple as making a pause screen and pushing it on top of the stack of screens; the pause screen simply sets itself not to forward events to things below it, which actually stops time until you pop it off. As I said, Audiogame_engine is basical
 ly exactly what Microsoft says to do in C# for XNA. Theyre far from the only one to advocate such approaches, however; many articles exist on the internet that show you how to make your own.The reason Audiogame_engine manages time is that a tick needs to happen in an instant, even if it doesnt. Youre simulating one infinitesimal bit of time, and so Audiogame_engine gives you the thing youre interested in: how long since the last one? This is called the delta. What your brother is referring to is this: if you specify speeds in velocities and know a bit about vectors, you can make it such that the game ticks as fast as the computer will let it and still have it come out right everywhere. This is particularly important for games that might slow down because of CPU constraints, but Id not worry about it just yet. I did calculate the delta for completeness, but Ive not yet had a project that needs it.Be v
 ery concerned about time.sleep calls. You should have exactly one in your entire program, and it should be exactly in the same place as Audiogame_engine puts it. If you do so, you dont need threads anymore.A few things to note: youre missing the half that handles input. Look at ScreenStack and Screen for a not-half-bad approach to managing state in your game, i.e. opening and closing minigames, inventories, and pause menus. I have yet to actually implement menu screens that just take menu item names, but when Libaudioverse is ready and I begin using the project again, those arent far behind. The reason Ive not been pushing it everywhere is because it is, indeed, missing good examples and docs; everything should have docstrings, however. Finally, tick speed is configurable when you make your MainLoop instance.See keyboard.py, mouse.py, and event_responder.py to understand how that part of it works. Sc
 reenStack and Screen are just a concrete implementation of the interface defined in event_responder.py aimed at having good state management that doesnt involve nesting if statements all day long. Its only 300 lines, which makes it about the size of any tic tac toe in the command prompt implementation Ive ever done. Im not surprised that youre having trouble with it, especially since this community advocates the nested if statements and polling approaches heavily. You seem to be at the point where you can benefit from understanding it. I do not believe that Pygame provides the higher-level primitives, but you could implement them on top of it instead if you wanted.And as for the name, well, I needed one. It was there. I will be adding more tuff to it, but its never going to be what most people think of as an engine. Perhaps I will rename it someday, if I can come up with something better.

URL: http://forum.audiogames.net/viewtopic.php?pid=186254#p186254




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: is coding in python easy? just interested

2014-08-24 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: is coding in python easy? just interested

Libaudioverse got delayed because the first week of school is awful, I missed the deadline and decided to go ahead and port the media player example to Python, and the blog post about it wont come out the way I want. I then decided that, since I was going to do it anyway, Id go ahead and do the major thing that would break backward compatibility (rename device to simulation and physical device index to device index). There is a reason I do not like setting deadlines. And do note that Ive said preview: this is not alpha quality, isnt supported on Linux and Mac, and will break horribly for at least some people.Mobs wait, but this does not mean the engine does. Mobs that wish to wait can do one of a few things, the simplest of which is count down an integer in their tick method. This is when you explicitly dont use threads: threads are for things that need to continuously run, not things that need to 
 spend most or all of their time waiting. If you can provide a performance reason for wanting threads, we can talk about it on another topic; until then, my answer will always, always be dont. If you want me to go into why threads are so hard, Ill go find an article-it takes a good deal of writing to set things up before you knock them down hard.Audiogame_engine has a utility object that you can tick that handles scheduling things to happen in the future; the difference is that you specify the future in ticks, not seconds. It does indeed have input handling: see keyboard_handler and mouse_handler; all screens give you one. Its also got layering: pausing the game is as simple as making a pause screen and pushing it on top of the stack of screens; the pause screen simply sets itself not to forward events to things below it, which actually stops time until you pop it off. As I said, Audiogame_engine is basical
 ly exactly what Microsoft says to do in C# for XNA. Theyre far from the only one to advocate such approaches, however; many articles exist on the internet that show you how to make your own.The reason Audiogame_engine manages time is that a tick needs to happen in an instant, even if it doesnt. Youre simulating one infinitesimal bit of time, and so Audiogame_engine gives you the thing youre interested in: how long since the last one? This is called the delta. What your brother is referring to is this: if you specify speeds in velocities and know a bit about vectors, you can make it such that the game ticks as fast as the computer will let it and still have it come out right everywhere. This is particularly important for games that might slow down because of CPU constraints, but Id not worry about it just yet. I did calculate the delta for completeness, but Ive not yet had a project that needs it.Be v
 ery concerned about time.sleep calls. You should have exactly one in your entire program, and it should be exactly in the same place as Audiogame_engine puts it. If you do so, you dont need threads anymore.A few things to note: youre missing the half that handles input. Look at ScreenStack and Screen for a not-half-bad approach to managing state in your game, i.e. opening and closing minigames, inventories, and pause menus. I have yet to actually implement menu screens that just take menu item names, but when Libaudioverse is ready and I begin using the project again, those arent far behind. The reason Ive not been pushing it everywhere is because it is, indeed, missing good examples and docs; everything should have docstrings, however. Finally, tick speed is configurable when you make your MainLoop instance.See keyboard.py, mouse.py, and event_responder.py to understand how that part of it works. Sc
 reenStack and Screen are just a concrete implementation of the interface defined in event_responder.py aimed at having good state management that doesnt involve nesting if statements all day long. Its only 300 lines, which makes it about the size of any tic tac toe in the command prompt implementation Ive ever done. Im not surprised that youre having trouble with it, especially since this community advocates the nested if statements and polling approaches heavily. You seem to be at the point where you can benefit from understanding it. I do not believe that Pygame provides the higher-level primitives, but you could implement them on top of it instead if you wanted.And as for the name, well, I needed one. It was there. I will be adding more stuff to it, but its never going to be what most people think of as an engine. Perhaps I will rename it someday, if I can come up with something better.

URL: http://forum.audiogames.net/viewtopic.php?pid=186254#p186254




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Libaudioverse Preview 1

2014-08-24 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Libaudioverse Preview 1

This isnt in New Releases because I will metaphorically murder anyone who manages to miss the several warnings about how its not ready for production. Also, its only useful to programmers.Anyhow: heres the blog post. Ill entertain comments and whatever via here as well as the other mentioned sources, and this is probably one of the two places (the other being my Twitter) that I will poke when the roadmap for 1.0 is ready.

URL: http://forum.audiogames.net/viewtopic.php?pid=186272#p186272




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Web development?

2014-08-24 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: Web development?

I mentioned poking this thread when Id tagged my blog. To that end, heres everything Ive written so far about the problem of realtime online games.

URL: http://forum.audiogames.net/viewtopic.php?pid=186273#p186273




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: is coding in python easy? just interested

2014-08-23 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: is coding in python easy? just interested

Threads are not necessary. Threads actually hurt. Threads will kill your productivity. Im not going to go into why because a quick Google search will bring up many, many articles about just why threads are bad. The secret to using threads is to use queues, at least in the very few cases you need them, and only have one thread on which all the work happens. The only reason that people really use threads these days is networking, because it allows placing blocking I/O in a place where it can do so in languages without good support for callback functions. The other reason-gaining extra performance from multicore systems-does not apply in Python unless 50% or so of your app is calling out to C code. Shared state between threads is horrible for reasons which become apparent as soon as you get past line 200 or so and start having bugs you cant reliably reproduce all over the place.Have a look at audiogame_engine. Its not super mature but works well enough for I3d, and I have no idea how well it plays with Pygames sound modules. But its my answer, and also the answer that many other people have come up with (actually, its almost exactly a port of how Microsoft tells you to do it with XNA). The reason I3d isnt open sourced is that Camlorn_audio sucks and is deprecated, but Im planning something in the near future with Libaudioverse that will use audiogame_engine (its my chosen platform for desktop games and game clients). Im not sure how clear it is, as a few places use some magic to make Sdl become friendly. But it should at least give you ideas.The general trick is to not wait. If you want something to happen in 5 seconds, you tel the main loop to call a function for you in 5 seconds, and then go on about your day. Typically, you achieve basic game logic
  by putting it in tick functions on the classes representing your objects, and register them with the main loop to be called once a heartbeat. Id strongly suggest reading some sighted game programming tutorials before continuing down this rabbit hole.Things that use this approach of ticking include all muds. As I recall, Diku does not even spawn a thread anywhere, and Id be willing to bet pretty much anything that Alter Aeon does not split the game logic across more than one thread. LPC doesnt have support for it, nor does unmodified Moo. I3d didnt use them for anything: input, waiting logic, physics simulation, etc. all run through tick functions on one thread. Some sighted games will split rendering the 1 polygons across multiple threads, but even there its discouraged for game logic, save in the few cases where every single enemy in a group of 1 needs to run really complicated AI logic individually. T
 wisted and Node.js exist so that network applications can run very efficiently on one core and with only one thread. The list goes on. Going into threading land is like going to Oz: all the rules you knew dont quite apply or apply in different ways.Id strongly suggest staying away from these until you understand why theyre useful. There are only two major reasons I can think of: the problem really cant run on one core or the problem is what is called embarrassingly parallelizable. In the latter case, its something like squaring 6 billion numbers: you can ask thread one to square the first billion, thread two to do the second, and so on. In this case, the threads dont know about each other, and thus you avoid literally all the problems with them. I suspect the examples you are seeing are for problems of this nature.

URL: http://forum.audiogames.net/viewtopic.php?pid=186139#p186139




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Pure basic: has anyone ever heard of, or used it?

2014-08-23 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: Pure basic: has anyone ever heard of, or used it?

To put my cards on the table and be very explicit about my opinion of C++:I am using C++ because Libaudioverse literally cannot be written in anything more programmer-friendly. I am not using C because C is missing a lot of things that make life just a bit more bearable. I am using smart pointers because, at the level I am having to work, I do not have a GC. I cant even afford to use the GC if one was available because I am writing realtime audio code and even a millisecond pause not in my control can and will cause problems. Yet, because of the data structures I must represent, manually freeing stuff is next to impossible to get right. Every single feature of C++ that I bring into the project has to be carefully considered beforehand, lest it slow things down in a way that cannot be fixed later without rewriting everything. Coding like this is not fun, at all. I believe that C++11 brings C++ even further from C in that you can
  fake having a Gc and that you have a very nice syntax for anonymous functions and closures. I would not point a new programmer at C or C++-I find it adequate, but only because I spent a lot of time finding it inadequate and figuring out what kinds of practices I would regret next week when I had to extend something. Please do not mistake adequate for undying passion, or anything above just barely acceptable.And to put my cards on the table about Purebasic, since this seems to be necessary:I used and owned Purebasic for quite a while. This would have been around 2005. I did a lot of stuff in it, sadly lost with my first computer-this was before I knew about version control, FTP servers, or external backups. I am speaking as someone with the experience of being a programmer that went through something like 5 variants of Basic, including the lesser-known BNS basic for the Braille N Speak 2000 (my first language). I stuc
 k with three for a long period of about 4 years: Libertybasic, Freebasic, and Purebasic. Purebasic, of all of them, was the closest to C; I went there directly after using it. The one thing I wish I had been told from this period was that there were more capable languages, as I didnt find C++ or Python until years later. If I could go back and make myself skip the low-level languages in which its actually obvious how many instructions every line is likely to need, Id probably be twice as far along as I am now-the higher level languages take away so many concerns. Nevertheless, I am speaking as a former Purebasic programmer and am at least passably fluent in at least 10 programming languages at the moment.@frastlinYou can go to C or C++, but Im not sure how much it would help. C and C++ tend to have their own special best practices revolving around the fact that theyre ridiculously low-level, and it took me a yea
 r or so of serious use (camlorn_audio) to reach the point where the statement C++ is a write-only language stopped being true. If you dont know what youre doing, you can bring together too many features into code that is nearly impossible to extend or understand, even a day later. As for the relation, C++ is (mostly) a superset of C; theres only one gotcha I know of, but you wont encounter it for a while. The point of knowing where C ends and C++ begins is super useful because almost everything can call out to C or C++ functions with C linkage and using only C data types. For that reason, starting with C can help you design multi-language libraries better. As for running them on windows, every C++ compiler I can think of is also a C compiler, so installing C++ *is* installing C.But in terms of algorithms and best programming practices, youll get these just as well with Python. Possibly better: 
 a lot of things like test-driven development are really easy there and really hard elsewhere (on that note, look up and learn py.test. You can thank me later). The piece you seem to be missing is experience, nothing more; experience will let you determine when you shouldnt use things, when spending an hour to rewrite a piece of code will be worth it later, etc.

URL: http://forum.audiogames.net/viewtopic.php?pid=186145#p186145




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Pure basic: has anyone ever heard of, or used it?

2014-08-23 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: Pure basic: has anyone ever heard of, or used it?

Unfortunately, not really. The only one that even professes to be accessible and the only one Ive ever had much luck with is Eclipse. Learning Eclipse is probably as complicated as learning the command line tools you would be using anyway, and the autocomplete/code correction isnt actually accessible even there (or at least not that I know of). Not to mention that the latest versions are currently broken with NVDA: this has been on my to-patch list forever now, but I dont use IDEs so I havent had the motivation to slog through the Python metaclass at NVDAs core.If you are on Jaws, you can kinda get VS2010 working. 2012 is a complete wreck, and even 2010 and jaws has bugs all over the place that make it very sarcastically enjoyable. I do remember the days of 2008 and think of them fondly. 2013 is kinda sorta better, but the debuggers are broken still and MS says that they wont have them in 2014 either.
 sp; So...sorry, and do tell the command prompt I said hi. Its only bad for the first week, and Id suggest looking up Virtuawin because Virtuawin has been a godsend for me and my 6-8 open windows (hope, teamtalk, command prompt, editor, explorer, and at least one internet browser).

URL: http://forum.audiogames.net/viewtopic.php?pid=186161#p186161




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Pure basic: has anyone ever heard of, or used it?

2014-08-23 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: Pure basic: has anyone ever heard of, or used it?

Unfortunately, not really. The only one that even professes to be accessible and the only one Ive ever had much luck with is Eclipse. Learning Eclipse is probably as complicated as learning the command line tools you would be using anyway, and the autocomplete/code correction isnt actually accessible even there (or at least not that I know of). Not to mention that the latest versions are currently broken with NVDA: this has been on my to-patch list forever now, but I dont use IDEs so I havent had the motivation to slog through the Python metaclass at NVDAs core.If you are on Jaws, you can kinda get VS2010 working. 2012 is a complete wreck, and even 2010 and jaws has bugs all over the place that make it very sarcastically enjoyable. I do remember the days of 2008 and think of them fondly. 2013 is kinda sorta better, but the debuggers are broken still and MS says that they wont have them in 2014 either.
 sp; So...sorry, and do tell the command prompt I said hi. Its only bad for the first week, and Id suggest looking up Virtuawin because Virtuawin has been a godsend for me and my 6-8 open windows (hope, teamtalk, command prompt, editor, explorer, and at least one internet browser).Edit:C# has no command line debugger anymore. This is true of all the .net languages. C++ has Gdb and Cdb, but which you want depends on the compiler. If youre a windows programmer, Cdb (works with VC++ executables) is your choice, but it has an amazing learning cliff. Gdb is for MinGW or Linux systems and works with executables made with Gcc. Its learning curve is more gentle for C, but both are equally hard when debugging C++ I think. Disclaimer: have not used Gdb with C++, but did spend about 2 months debugging near-continuously with it for a godwars variant with a coder with barely enough knowledge to cause problems faster than I ca
 n fix them and who wouldnt listen about really needing version control.But seriously, do not underestimate the debug print: printing the variables of interest at the point of interest. For Libaudioverse, this has been the only way; even for other software, good logging is going to be a lot more helpful in many cases.

URL: http://forum.audiogames.net/viewtopic.php?pid=186161#p186161




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: is coding in python easy? just interested

2014-08-23 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: is coding in python easy? just interested

Ticks are not too predictable. You can easily do 60 or 100 a second. You can, if you are good at math and adventurous, have the time between them vary. You can have the engine detect when its slow and tick faster to catch up, or make the time between ticks longer without slowing the game. But all you really need is the basics: tick 30-60 times a second, keeping the interval the same. Your players literally cant tell-its way too fast to be noticeable unless the engine gets under too much of a load to keep it up (in audiogame land, should this happen, its a bug). most games for the sighted do this, even multimillion dollar titles. If you want to learn more, you can find many, many books on game architecture.Actually doing this is a bit more difficult, and I strongly suggest reading over audiogame_engine. Audiogame_engine has a working implementation of a main loop and a bunch of other stuff you will 
 eventually need. Ticking 60 times a second is not tick, wait 1/60th of a second, its time the tick and wait however much time is left in this 1/60th of a second fragment. In audiogame_engines case, the delta--the time since the last tick--is passed. But I never used it, and you can just shrug and ignore that part. All you need is time.time(), time.sleep(), and some basic arithmetic in a while loop. You can probably adapt the code to work with your stuff, and all the low-level bits and pieces are demonstrated therein.You seem to have misconceptions as regards what is fast. You will not need more than one thread for any single-player audiogame I can think of, and Swamp probably does-at most-one thread per map. You may choose to use them at some point, but do avoid them for now. Drawing polygons is actually a bad example in that its usually not even done on the CPU, but dra
 wing even one polygon takes a much longer time than updating one npcs state (if I had to guestimate, on the order of 100x-1000x, but the graphics card parallelizes automatically).Threads are amazingly easy to start in just about any language these days. But the problem here is that the entire game is shared state. Every thread will want to modify or read the world and, because its running with other threads, will not see it right. Consider a program that updates coordinates on your objects, running in a thread. A second thread can see some objects in new positions while others are still in old ones, read off coordinates with updated x values but not updated y values, or (what you want) read everything between updates. The solution is to throw a lock into the mix, but as soon as you start doing that you start losing any benefit at all. Fine-grained locking is notoriously hard to get right, and deadlocks are notoriously hard to deb
 ug. Having a global lock that every thread holds before it does stuff means you shouldnt have bothered in the first place.An embarrassingly parallelizable problem is a problem in which each thread may live in its own universe, sharing no state save a notification that it has completed its task. This is easy, and problems like this are definitely a good introduction. Every example I can think of for the threading and multiprocessing modules are in this category. Games are not embarrassingly parallelizable: every thread will need to touch everything at some point and to some extent. The documentation you are reading is not teaching you the difference: its assuming youre a good enough programmer to know when threads are, and are not, the solution; its purpose is to show you how they work from the perspective of someone who needs them. to that end, the examples are about teaching a programmer who knows threads how to use thread
 s in Python and not showing you or even touching on all the problems you get to deal with in real-world cases.threads deserve their bad reputation. They are the only way to solve a problem which is difficult for humans to think about in the first place, and the guarantees we cant make and still have fast computers make it even harder. In lower-level languages, its possible to see half-updated variables (as in, some of the bytes in your integer have been changed while others have yet to happen). Python doesnt let you quite have this problem because of the GIL, but the GIL keeps you from getting any performance boosts on tasks written purely in Python (excluding i/o) anyway. Nothing you are doing warrants putting yourself through this particular hell-and yes, Id really go that far in this case.Let me put it this way. Some of the largest web sites out there, handling thousands of concurrent users, run in one thread.
 ; This is the purpose of Node.js, Twisted, and a bunch of other stuff. Camlorn_audio has so many threading issues related to fine-grained locking that I couldnt fix them if I wanted, and I once spent 8 hours debugging a deadlock and wrote a 15-line comment explaining what I should never ever do if I wanted it to keep working.If you 

Re: is coding in python easy? just interested

2014-08-23 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: is coding in python easy? just interested

Ticks are not too predictable. You can easily do 60 or 100 a second. You can, if you are good at math and adventurous, have the time between them vary. You can have the engine detect when its slow and tick faster to catch up, or make the time between ticks longer without slowing the game. But all you really need is the basics: tick 30-60 times a second, keeping the interval the same. Your players literally cant tell-its way too fast to be noticeable unless the engine gets under too much of a load to keep it up (in audiogame land, should this happen, its a bug). most games for the sighted do this, even multimillion dollar titles. If you want to learn more, you can find many, many books on game architecture.Actually doing this is a bit more difficult, and I strongly suggest reading over audiogame_engine. Audiogame_engine has a working implementation of a main loop and a bunch of other stuff you will 
 eventually need. Ticking 60 times a second is not tick, wait 1/60th of a second, its time the tick and wait however much time is left in this 1/60th of a second fragment. In audiogame_engines case, the delta--the time since the last tick--is passed. But I never used it, and you can just shrug and ignore that part. All you need is time.time(), time.sleep(), and some basic arithmetic in a while loop. You can probably adapt the code to work with your stuff, and all the low-level bits and pieces are demonstrated therein.You seem to have misconceptions as regards what is fast. You will not need more than one thread for any single-player audiogame I can think of, and Swamp probably does-at most-one thread per map. You may choose to use them at some point, but do avoid them for now. Drawing polygons is actually a bad example in that its usually not even done on the CPU, but dra
 wing even one polygon takes a much longer time than updating one npcs state (if I had to guestimate, on the order of 100x-1000x, but the graphics card parallelizes automatically).Threads are amazingly easy to start in just about any language these days. But the problem here is that the entire game is shared state. Every thread will want to modify or read the world and, because its running with other threads, will not see it right. Consider a program that updates coordinates on your objects, running in a thread. A second thread can see some objects in new positions while others are still in old ones, read off coordinates with updated x values but not updated y values, or (what you want) read everything between updates. The solution is to throw a lock into the mix, but as soon as you start doing that you start losing any benefit at all. Fine-grained locking is notoriously hard to get right, and deadlocks are notoriously hard to deb
 ug. Having a global lock that every thread holds before it does stuff means you shouldnt have bothered in the first place.An embarrassingly parallelizable problem is a problem in which each thread may live in its own universe, sharing no state save a notification that it has completed its task. This is easy, and problems like this are definitely a good introduction. Every example I can think of for the threading and multiprocessing modules are in this category. Games are not embarrassingly parallelizable: every thread will need to touch everything at some point and to some extent. The documentation you are reading is not teaching you the difference: its assuming youre a good enough programmer to know when threads are, and are not, the solution; its purpose is to show you how they work from the perspective of someone who needs them. to that end, the examples are about teaching a programmer who knows threads how to use thread
 s in Python and not showing you or even touching on all the problems you get to deal with in real-world cases.threads deserve their bad reputation. They are the only way to solve a problem which is difficult for humans to think about in the first place, and the guarantees we cant make and still have fast computers make it even harder. In lower-level languages, its possible to see half-updated variables (as in, some of the bytes in your integer have been changed while others have yet to happen). Python doesnt let you quite have this problem because of the GIL, but the GIL keeps you from getting any performance boosts on tasks written purely in Python (excluding i/o) anyway. Nothing you are doing warrants putting yourself through this particular hell-and yes, Id really go that far in this case.Let me put it this way. Some of the largest web sites out there, handling thousands of concurrent users, run in one thread.
 ; This is the purpose of Node.js, Twisted, and a bunch of other stuff. Camlorn_audio has so many threading issues related to fine-grained locking that I couldnt fix them if I wanted, and I once spent 8 hours debugging a deadlock and wrote a 15-line comment explaining what I should never ever do if I wanted it to keep working.If you 

Re: is coding in python easy? just interested

2014-08-23 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: is coding in python easy? just interested

Ticks are not too predictable. You can easily do 60 or 100 a second. You can, if you are good at math and adventurous, have the time between them vary. You can have the engine detect when its slow and tick faster to catch up, or make the time between ticks longer without slowing the game. But all you really need is the basics: tick 30-60 times a second, keeping the interval the same. Your players literally cant tell-its way too fast to be noticeable unless the engine gets under too much of a load to keep it up (in audiogame land, should this happen, its a bug). most games for the sighted do this, even multimillion dollar titles. If you want to learn more, you can find many, many books on game architecture.Actually doing this is a bit more difficult, and I strongly suggest reading over audiogame_engine. Audiogame_engine has a working implementation of a main loop and a bunch of other stuff you will 
 eventually need. Ticking 60 times a second is not tick, wait 1/60th of a second, its time the tick and wait however much time is left in this 1/60th of a second fragment. In audiogame_engines case, the delta--the time since the last tick--is passed. But I never used it, and you can just shrug and ignore that part. All you need is time.time(), time.sleep(), and some basic arithmetic in a while loop. You can probably adapt the code to work with your stuff, and all the low-level bits and pieces are demonstrated therein.You seem to have misconceptions as regards what is fast. You will not need more than one thread for any single-player audiogame I can think of, and Swamp probably does-at most-one thread per map. You may choose to use them at some point, but do avoid them for now. Drawing polygons is actually a bad example in that its usually not even done on the CPU, but dra
 wing even one polygon takes a much longer time than updating one npcs state (if I had to guestimate, on the order of 100x-1000x, but the graphics card parallelizes automatically).Threads are amazingly easy to start in just about any language these days. But the problem here is that the entire game is shared state. Every thread will want to modify or read the world and, because its running with other threads, will not see it right. Consider a program that updates coordinates on your objects, running in a thread. A second thread can see some objects in new positions while others are still in old ones, read off coordinates with updated x values but not updated y values, or (what you want) read everything between updates. The solution is to throw a lock into the mix, but as soon as you start doing that you start losing any benefit at all. Fine-grained locking is notoriously hard to get right, and deadlocks are notoriously hard to deb
 ug. Having a global lock that every thread holds before it does stuff means you shouldnt have bothered in the first place.An embarrassingly parallelizable problem is a problem in which each thread may live in its own universe, sharing no state save a notification that it has completed its task. This is easy, and problems like this are definitely a good introduction. Every example I can think of for the threading and multiprocessing modules are in this category. Games are not embarrassingly parallelizable: every thread will need to touch everything at some point and to some extent. The documentation you are reading is not teaching you the difference: its assuming youre a good enough programmer to know when threads are, and are not, the solution; its purpose is to show you how they work from the perspective of someone who needs them. to that end, the examples are about teaching a programmer who knows threads how to use thread
 s in Python and not showing you or even touching on all the problems you get to deal with in real-world cases.threads deserve their bad reputation. They are the only way to solve a problem which is difficult for humans to think about in the first place, and the guarantees we cant make and still have fast computers make it even harder. In lower-level languages, its possible to see half-updated variables (as in, some of the bytes in your integer have been changed while others have yet to happen). Python doesnt let you quite have this problem because of the GIL, but the GIL keeps you from getting any performance boosts on tasks written purely in Python (excluding i/o) anyway. Nothing you are doing warrants putting yourself through this particular hell-and yes, Id really go that far in this case.Let me put it this way. Some of the largest web sites out there, handling thousands of concurrent users, run in one thread.
 ; This is the purpose of Node.js, Twisted, and a bunch of other stuff. Camlorn_audio has so many threading issues related to fine-grained locking that I couldnt fix them if I wanted, and I once spent 8 hours debugging a deadlock and wrote a 15-line comment explaining what I should never ever do if I wanted it to keep working.If you 

Re: Pure basic: has anyone ever heard of, or used it?

2014-08-23 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: Pure basic: has anyone ever heard of, or used it?

I cant convey the things I like about C++11 in a short post, so I wont try. Its a major boon for those of us who think in functions, and Ive already hit smart pointers to death. Worth noting that both of these things existed--to some extent--in Boost: one day I will learn how they managed to fake lambdas, but Im definitely not there yet. Nevertheless, lambdas, atomics, cross-platform threading, shared_ptr, hash tables, and tuples are the big ones. I do not touch nor suggest touching variatic templates, and the rest is aimed at library developers in my opinion. Gcc, Clang, and VC++2013 all implement everything that Im likely to want from it. If it werent for the few killer features from C++11 that I absolutely had to have, Id still be pure C and wouldnt have spent the 3 weeks converting properly.Ive not yet seen a case of the stl throwing exceptions only on one platform, but I
 ;ve not yet started aggressively compiling on Linux/Mac. Im currently overcoming the fact that all cross-platform audio libraries I can find are either lacking features or coming with crippling bugs, so Ive got bigger concerns. I keep hearing this from the older programmers, but am unsure how true it still is as we seem to have converged on 3 implementations instead of 10-20. I looked into it pretty intensively, and everyone seems to be saying its okay now. But Im not using the STL too heavily: its only really strongly used in the graph execution planner, and I know how to reimplement smart pointers if needed.Cmake is good and awful in exactly the same ways as Php. It gets a job done and does it well, but going even a bit beyond what it wants to let you do is headache-inducing and theres 5 ways to do everything. That said, literally everything else is too slow (scons) or provides no suppo
 rt for actually figuring out where things are (excluding autoconf, but thats really Linux only).And as for Python, Ive not seen anyone complaining about performance post 3.4, but have heard some stuff about 3.3 and earlier having I/O problems. The slowdown--if any--is minimal enough that all the articles about why Python 3 is bad dont seem to mention it. Since Pypy now supports Python 3, it doesnt much matter-go use that and you get a JIT and, as of a couple months ago, an experimental implementation of STM (also known as GIL-less Python). I need to do proper research on the slowdown, but I would also argue that servers are I/O bound for the most part anyway.

URL: http://forum.audiogames.net/viewtopic.php?pid=186194#p186194




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Pure basic: has anyone ever heard of, or used it?

2014-08-23 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: Pure basic: has anyone ever heard of, or used it?

Can you provide sources? I googled the Python slowdown, but found nothing conclusive or, really, anything that would account for something noticeable in such a situation. Ive not looked closely at Python 3 myself yet as my interests with Python all seem to converge back at Twisted. Gevent is a bad idea, the people who want to help me know Twisted, and Asyncio doesnt have a few of the pieces I want. Also, everything but Libaudioverse is on hold because everything depends on Libaudioverse.My knee-jerk reaction is that this is likely to be poor implementation in the mail server, but I do not at the moment have enough information to make such claims. I find it very surprising that a mail server can run on both because, unless its using trollius, its not using one of the big (and thus optimized) options, at least none of the ones Im aware of. Imho, in a language with a plethora of better options, why us
 e TCP sockets yourself?

URL: http://forum.audiogames.net/viewtopic.php?pid=186203#p186203




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Implementing TAS support into BGT game?

2014-08-22 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: Implementing TAS support into BGT game?

Problems similar to this and the inability to send it through 3D audio are the two main reasons I hate screen reader speech. Possibly enough for me not to use it where the latter would be very nice to have, and especially if I ever figure out how to buy something more realistic. nevertheless.Im assuming youre not trying to implement the tools. A big part of TAS in my experience is that youre already running in an emulator, which provides both recording and different tools not in the original game. Id argue that once its in the game its not TAS anymore; at that point, its merely the secret hidden cheat menu. So for the purposes of this discussion, recording only.And to that end, Virtual Audio Cable, Audacity/whatever, and be done.Why? because, without access to the BGT source, its going to be very difficult to do what you want. Even with access, its going to be very dif
 ficult. The reason its not so hard in sighted land is because they just write the frames of graphics and audio to disk: nothing more is kept. But you dont have any graphics, no access to the frames of audio, and no way to make sure everyone listens at the same TTS speed. In emulator land, you just grab the emulated graphics cards output and the emulated sound cards output. Ive not seen any on PC--Im not sure how its done there, but it doesnt seem to be nearly as popular as the emulation ones and probably just uses a screen capture program.Id go so far as to say that you cant rely on your engine for playback capability, for the simple reason of determinism. Give up random numbers unless you save the seed, give up floating point numbers altogether, etc. Offhand, Im not sure what else in BGT is nondeterministic, and thus unsafe-Id bet a lot, however. Nondeterminism is
  why I dropped major client-side simulation for my MMO project (currently on hold). I tried two different approaches and it was a mess, simply because the list of not-allowed things was enormous.In terms of time, you need frames at least. The architectures you are used to are bad for a lot of reasons anyway, but especially here. I personally use a callback-based approach with a stack of active screens, such that the topmost gets input and can block ones below it from ticking. In whatever case, times need to be recorded as frame offsets from game start, not as seconds/whatever. You also need to be *completely* divorced from the system clock. This wont work either, because--again--emulators grab the emulated sound card and graphics card. If the emulator slows down, actual sound playback also slows down with it, but again you cant do that kind of thing without BGT source at least.And recording on the slowest TTS speed yo
 u can stand will just slow you down. I dont think this is the point, and thus I dont consider it a solution.Tbh, Id focus on the tools and record your computer with Virtual Audio Cable and Audacity or similar. Id also ask how many people are going to TAS your games-its kinda pointless if its only you because you wrote them. We also dont have the tools, and a big part of this is that you figure them out as part of the speedrun; in SNES-land, this isnt so hard, but with BGT it will be.Im curious to see how far you get with it.

URL: http://forum.audiogames.net/viewtopic.php?pid=185925#p185925




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Pure basic: has anyone ever heard of, or used it?

2014-08-22 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: Pure basic: has anyone ever heard of, or used it?

Sure. It has a community. I didnt say it did.But it is small. This cant even be argued. Relative to the communities for all the mainstream languages, it is small. There are a few sites for it. That is all. All the other more mainstream languages have thousands of blogs, dedicated Stackoverflow tags, multiple books, the list goes on. This part of my statement is not opinionated. I can find 10x-100x more documentation for the mainstream languages. And as for referring to the manual, Id be willing to bet quite a lot that you referred to the PB one just as much at the beginning. You have to. Its how you learn the language in the first place.Im just not seeing why, when the question which programming language should I learn? comes up, people jump off the good community to help me do it bandwagon, not to mention all the other bandwagons that dont really get replaced in
  most cases. Im not thinking about professionalism here, and I suppose theres something for because I can use it. But those who use it are able to do so because they learned it and, if the coin toss went a different way, I dont see why anyone wouldnt be saying the same things about Python. Or assembly. I really believe that we could substitute assembly in for Purebasic in this thread and, if enough people in this community had used it, have the same exact conversation.Python and C++ are what Ive seen called multiparadyme. You can but do not have to use object-oriented features in either. As of C++11, you have the ability to do the same level of functional programming in both, as both now have good support for first-class functions (see Pythons filter for a good example of why this matters). If you want, you can sort of get such features in any language with a function pointer, but it
 ;s almost meaningless without the syntactic sugar and you cant do a lot of the advanced stuff.And to be honest, you can fake OO in C-like languages, too. But it requires knowing a lot about memory representations. The idea is to create a vtable, to have all instances of the class have a pointer to the vtable, and to then call your functions by referencing the vtables directly. You can wrap this up nicely in macros, if you want and, if you put in the effort, you get inheritance and polymorphism out the other side. These are however complicated enough that people switch to C++ rather than make their own. I can assure you that you will want them for a game, too: its how you can treat all the enemies as enemies and yet have them behave differently.As for code size with C++, yes, its a bit larger. But only because of the #include statements. I do not count boilerplate code. I do not sugg
 est C++ to people looking for productivity, but the reasons for this are the same as those I would cite for Purebasic-i.e. code size is not the big one or really even on the table. What happens is, as your project gets larger, the extra lines from hello world become less and less compared to the rest. Libaudioverse is somewhere around 3000 lines now. At the beginning, the #includes were indeed numerous compared to it, but Id say theyre easily only 0.5% of the project at this point. Perhaps I should do a specific analysis, but every language has something analogous anyway, so it doesnt really matter. The rest of the code size question comes down to how good of a coder you are, not so much the language; if adding a feature comes out the other side with *less* lines than when you started, its a good sign you just did something majorly right.

URL: http://forum.audiogames.net/viewtopic.php?pid=185963#p185963




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Pure basic: has anyone ever heard of, or used it?

2014-08-22 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: Pure basic: has anyone ever heard of, or used it?

@sebbyAgain: I do not use C++ specifically for the object oriented programming. Libaudioverse was going to be 100% C, and I wrote the necessary primitives. The reason I switched was not classes, it was smart pointers which, when making graphs of interconnected nodes, are really useful. If we were not in C++11, Libaudioverse would still be C. Had that happened, Id still have missed a lot-virtual methods have turned out to be a bit of a godsend for parts of Libaudioverse, and so too has algorithm. Im not all over OO as the way, but you have to admit that classes make a nice abstraction over the construction/destruction/bunch of methods that take the same first parameters stuff.As for speed between them, I noticed no difference. This was also a reason I was sticking with C. Once Id completed the conversion (and it is a full conversion, not C++-as-C), it still ran just as fast as before. 
 This actually surprised me a great deal and was totally unexpected. I have heard of cases of math library developers using C++ over C because, via tricks with templates, you can actually get faster code; whether or not this is true, most of the math libraries I can find (in my case, specifically glm) are C++. But this may have to do more with operator overloading.As for top-down versus bottom-up: I think that top-down is what you want to aim for, but that bottom-up is what you get practically. Even in OO. But being able to do top-down, even a bit, leads to more flexible software with less corner cases. I did purely bottom-up with camlorn_audio, and it really shows in a bad way. The one isnt feasible, the other leads to bad code, but I think theres a happy medium in the middle.But my point wasnt that C++ is great. C++11 brings it into bearable and fine if you know what youre doing but not so great if you do
 nt territory. My point was merely the contradictory reasoning: Purebasic is C plus libraries, Purebasic is paid, and yet Purebasic is somehow way better than either of these even in terms of the learning curve.And as for Python being the next java, I dont think so. Theres a core thing in Java that allows many, many mediocre or even bad programmers to make progress: it assumes you are a bad programmer and does everything it can to lock you in a jail cell and plug all the outlets. Case and point: checked exceptions, lack of operator overloading, lack of multiple inheritance (somewhat alleviated in 8, far enough that the few cases Id use it for can be done), lack of first class functions (also somewhat alleviated in 8), and epic amounts of boilerplate. If Python becomes the next java, its because people seem to be starting to realize that Javas philosophy makes a lot of good programmers run in horror, or perhaps it
 s just that the good programmers are finally running and dragging the market with them.@Frastlin:Pythons syntax is so far from C as to be unrecognizable. Its definitely not based on C.Every programming language provides some mechanism by which you can include code written by others and most include a standard library. The answer to the question can I include someone elses stuff is always, always yes, but the convenience varies. In the case of C/C++, you have headers and #include, which is almost the same as copy-pasting the contents of the header into your file. This is a historical artifact from the days when compilers had to run on only a couple megabytes of ram and when modern techniques would cause us to wait additional hours, not additional milliseconds.I have also heard that Python is getting slower, but think this doesnt matter; our computers are getting faster way faster than pythons ge
 tting slower, even if it is.As for what you want, look at C first. You *have* to know what it means to be C to call stuff from other languages, as theres almost no way to directly map C++ classes. Libaudioverse does it by wrapping the C++ classes in a manually written C API, because thats actually possible once you know how.But in your case, I do not know what you would be doing that is going to run too slow. If it is, consider the algorithm, not the language. Im only doing heavy C/C++ right now because of Libaudioverse, which performs something on the order of 100 million math operations per second. I agree with sebby: you probably want to stick with Python for now.

URL: http://forum.audiogames.net/viewtopic.php?pid=186017#p186017




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Pure basic: has anyone ever heard of, or used it?

2014-08-21 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: Pure basic: has anyone ever heard of, or used it?

Unless someone cites a source about this ability to run Python 2.x programs on Python 3.3, Im going to have to say that this isnt true. I am basically certain, but if theres something I dont know, etc. The compatibility goes in the other direction; you can run some 3.x programs on 2.7.x via from __future__ import feature statements, i.e. from __future__ import division. But not many, and its only really a bridge to get from 2.7.x to 3.0 without having to do it all at once.What you can do is use the py launcher and install both 2.x and 3.x, at least on windows; it defaults to 2.7, as I recall. To get later, you use a special comment at the top of the file or a command line option. The launcher comes with Python 3.x, but you still need to have 2.x installed somewhere.Simple Python programs will in fact work on both, but critical methods on built-in data types were removed, i.e. iterkeys and itervalue
 s. The regular versions of these methods that used to return lists now return iterators. Theres a bunch of other changes involving unicode that are also not encountered by Python newcomers, and a bunch of other smaller stuff. The problem is that it is not necessarily true that all the packages you want to use work on both, even if your programs do. These features were changed in 3.0, not 3.4; moving the version later does, of course, introduce more changes from 2.x to cope with.Most of the tutorials are 2.x, though the library situation is improving. Pypy just added support for 3.3, and a lot of stuff is either already ported or unavailable but with alternatives (and some of them are now even built-in, like asyncio).@GhorthalonTheDragonYoure saying that you are a bad programmer. Have you tried other languages, especially those with garbage collection? Constructors/destructors, exceptions, and a GC can get rid of
  at least half the most common programmer errors: forgetting to allocate, forgetting to free, and forgetting to check if said allocation/initialization succeeded (in the third case, you usually get an exception, catching it at the point of the problem and not 500 lines later in a different file). I totally have to stand by my statement that Purebasic is C but prettier. I dont necessarily feel that OO is the only paradyme or the best in all situations. Classes, to me, are a handy way to get constructors and not have to remember to pass the first parameter to all the methods that touch the player. Do I use OO? yes, but only when appropriate.

URL: http://forum.audiogames.net/viewtopic.php?pid=185828#p185828




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Pure basic: has anyone ever heard of, or used it?

2014-08-21 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: Pure basic: has anyone ever heard of, or used it?

Im trying to understand the mindset here. Purebasic has every single characteristic of a language Id consider nonproductive: lack of large community, lack of large numbers of libraries, lack of large quantities of external resources, and lack of features to encapsulate beyond the function and the struct. The proceeding is barely an opinion, but the following is not. In terms of a language, it provides not much more than C; before someone mentions built-in libraries, I can get all of the built-in stuff externally. Yet, as soon as someone says C, everyone runs screaming. Im trying to figure out how two languages that are essentially the same can engender two polar opposite opinions-especially since the one everyone says positive things about is not free and the one everyone says negative things about has at least 1000 times as many users, tutorials, documentation sets, libraries, etc. And then, as soon as I mention C++, in which 
 you can program in exactly the same manner as Purebasic and still have built-in libraries for a lot of common algorithmic tasks, everyone reacts as though Ive got two heads or something.So shrug, I guess.

URL: http://forum.audiogames.net/viewtopic.php?pid=185857#p185857




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Web development?

2014-08-19 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: Web development?

Yes, exactly. Except that the lengths of the corridors and whether they turn is considered unimportant. The only information youre interested in is that two intersections are connected by a corridor. In the most basic setup, nothing else is kept. And just that is enough to write a program that can solve the maze. Going further, you can actually represent really strange things as graphs, for example an in-progress checkers game, but thats a whole second discussion about AI programming and Im by no means an expert. I really should post my 15-puzzle solver one of these days.A Wysiwyg engine of sufficient complexity to actually do something at all has to have scripting. The problem is that, for those of us who know how one might go about doing it, its pointless to actually do it. We can already make whatever we want without such things. I kinda started down that road with audiogame_engine, at least as 
 far as the basic windowing and state transition stuff, but that doesnt even have talking menus yet. Nor will it be Wysiwyg-the point is to provide the smaller pieces that everyone duplicates themselves for everything, not to be a side-scroller or what have you. These engines cant come in two versions, and thats why Audiogame Engine (written in flash, if I recall correctly) failed. It tried to be so ridiculously nontechnical that actually doing anything complex was impossible. I said this back when I was using it in early high school and barely handling 50-lline programs; Id probably have much worse things to say now.Since this is already spiraling way, way off topic and I cant actually make it much worse, Im going to try to explain Libaudioverse a bit without using the word graph. I get the feeling my comments were misunderstood to some extent.Basically, its like having boxes and wires. You can
  hook the input side of any box to the output side of any other box with a wire. Because were using special magical sockets, you can hook as many inputs from as many different boxes as you like to the same output--this allows feeding sources with the same file and controlling them all by controlling the playback time and speed of the file. The 3d simulation mostly hides this, save that a source is an object with one input that needs to be hooked to something--this enables doing things like making wind synthesizers or piping midi messages into your game world. But if you want, you can drop down and use the low-level pieces directly and make media players, for example. One of the C examples, as of yet not ported to Python because of laziness, does exactly this. A full command line media player in exactly 75 lines of C (dont you hate license comments, the 10-line macro thats needed because C doesnt have exceptions, and the inc
 ludes?). I keep managing to get distracted by the fact that school started this week, already missed the promised date for releasing the preview, and consequently kind of want to port it so that its there in Python before I do anything. It shows off every feature of Libaudioverse save array properties, which are only used in one place anyway (speaker maps for the n-channel amplitude pannere).

URL: http://forum.audiogames.net/viewtopic.php?pid=185490#p185490




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Web development?

2014-08-19 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: Web development?

Yes, exactly. Except that the lengths of the corridors and whether they turn is considered unimportant. The only information youre interested in is that two intersections are connected by a corridor. In the most basic setup, nothing else is kept. And just that is enough to write a program that can solve the maze. Going further, you can actually represent really strange things as graphs, for example an in-progress checkers game, but thats a whole second discussion about AI programming and Im by no means an expert. I really should post my 15-puzzle solver one of these days.A Wysiwyg engine of sufficient complexity to actually do something at all has to have scripting. The problem is that, for those of us who know how one might go about doing it, its pointless to actually do it. We can already make whatever we want without such things. I kinda started down that road with audiogame_engine, at least as 
 far as the basic windowing and state transition stuff, but that doesnt even have talking menus yet. Nor will it be Wysiwyg-the point is to provide the smaller pieces that everyone duplicates themselves for everything, not to be a side-scroller or what have you. These engines cant come in two versions, and thats why Audiogame Maker (written in flash, if I recall correctly) failed. It tried to be so ridiculously nontechnical that actually doing anything complex was impossible. I said this back when I was using it in early high school and barely handling 50-lline programs; Id probably have much worse things to say now.Since this is already spiraling way, way off topic and I cant actually make it much worse, Im going to try to explain Libaudioverse a bit without using the word graph. I get the feeling my comments were misunderstood to some extent.Basically, its like having boxes and wires. You can 
 hook the input side of any box to the output side of any other box with a wire. Because were using special magical sockets, you can hook as many inputs from as many different boxes as you like to the same output--this allows feeding sources with the same file and controlling them all by controlling the playback time and speed of the file. The 3d simulation mostly hides this, save that a source is an object with one input that needs to be hooked to something--this enables doing things like making wind synthesizers or piping midi messages into your game world. But if you want, you can drop down and use the low-level pieces directly and make media players, for example. One of the C examples, as of yet not ported to Python because of laziness, does exactly this. A full command line media player in exactly 75 lines of C (dont you hate license comments, the 10-line macro thats needed because C doesnt have exceptions, and the incl
 udes?). I keep managing to get distracted by the fact that school started this week, already missed the promised date for releasing the preview, and consequently kind of want to port it so that its there in Python before I do anything. It shows off every feature of Libaudioverse save array properties, which are only used in one place anyway (speaker maps for the n-channel amplitude pannere).

URL: http://forum.audiogames.net/viewtopic.php?pid=185490#p185490




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Web development?

2014-08-18 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: Web development?

Well, heh. Im about to release a preview of it, possibly this evening; it is lacking in features and documentation an isnt yet alpha quality, but the examples and basic 3d stuff works. Describing it properly is going to require a full manual or me finding someone who gets it and is better at technical writing: the concept is fine, if you get something from directed acyclic graph of audio processors, but otherwise needs informative examples/tutorials. Its honestly not that bad, and the Python examples Im going to put up are pretty clean and informative. Ive just spent so long thinking about graphs that I can no longer think of things like Libaudioverse in any other context, making writing about them in a less mathematical way difficult. Its incredibly easy to use, at least in my opinion, just hard to document without saying here, have some sample code. In a sentence, its basically 
 Pyo but fast enough to be useful in games and not necessarily GPL. Commercial licenses will happen, as Ive been careful to be the only coder. I wish I were a lawyer because then Id have copyright agreements and could get help from others. Im the only coder I know who knows DSP at all and would be interested so thats kinda a moot point anyway.Django doesnt hide things, in that you can access most of HTTp. What Django is doing is providing a framework to say if the user asks for /blog/posts/june2014, then call the get_archive function and whatever the get_archive function returns needs to go out as HTML. Its not quite that simple, in that you also use Django for web API creation (a whole second beast and I cant talk much about it for lack of experience). Whats going on with Django is that Django speaks HTTP on your behalf, ending the connection appropriately when the funct
 ion returns and figuring out what to call. It also gives you a *ton* of free web behavior, i.e. youve got a full and capable (and accessible, actually) database editor in about 5 minutes-just as soon as you define the models. It also provides a lot of nice stuff for database access/management and rendering templates-but neither is specific to HTTP. I dont believe Django uses Twisted or anything under the hood, but would need to read its actual code to check. In Twisted/whatever, youd have to implement the HTTP protocol yourself; alternatively, call out to a library that accepts incoming data and interprets it for you.Asyncio is built into Python 3. Python 2 versus Python 3 is a big topic, and Im not going to judge you one way or another. There is a backport to Python 2 called Trollius that you can install. As far as I can tell, Asyncio gets the best of the Twisted world and the best of the Gevent world at the sa
 me time, plus a few nice things that neither of them offer. If you go far down the online game creation world in the direction of Swamp, youll be writing your own protocol, so arguments about supporting Obscure File Transfer V 1.0 are kinda out the window. But yes, learning one of them is probably a pretty good idea. My argument about things like Pod6net is that they are lacking maturity: lots of people have used Twisted and Gevent, and the people who developed Twisted and Gevent brought a huge amount of how we went wrong to the Asyncio table. When you start talking about obscure packages like this, you can sometimes find that youre giving up a lot of nice stuff-for example, tutorials on how to do complex things and other libraries that complement the main framework specifically.Also, Wysiwyg tends to be pretty inaccessible in my experience. Is this for browser games or actual MMO-style things? If the latter, yo
 ure going to hit the roadblock of not having a trimesh editor, I suspect. But Im curious to see.

URL: http://forum.audiogames.net/viewtopic.php?pid=185365#p185365




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Web development?

2014-08-18 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: Web development?

No, no, no.Firstly, Libaudioverse is currently Python 2, but the binding generator I wrote for it means that I can target anything and theres no reason that it cant also be Python 3. And by anything, I mean anything, at least so long as the FFI has a specific set of low-level primitives (sorry, but BGT is out. You dont have pointers to pointers, you dont have callbacks, any capable programming language neutral library for anything needs both).In much the same way that someone who knows calculus III probably would have trouble teaching basic Algebra, I know enough about Graphs and computer science that directed acyclic dependency graph of audio processors tells me everything Id ever want to know about the audio library in question. For this reason, I find it hard to bridge the gap between what I know and what a user who doesnt know what graphs are needs to know-save, of course, via giving you examples.
 sp; When I actually write them out, theyre quite simple-I just cant get English itself to do what I want as I keep ending up using too many computer science terms. This is a problem with me as a writer, not Libaudioverse itself.In this case, a graph is not what you think. A graph is a construct consisting of nodes which are connected by edges. The particular position of the nodes is not important-graphs often represent things that dont even exist in actual, physical space! Graphs, as a computer science term, occur in all sorts of places. For example, computers connected by networks (the nodes are the computers and the edges the wires running between them), roads (edges) and intersections (nodes), etc. Most of the classical examples use train tracks, but you can also look at air ports and the planes that fly between them this way. A linked list, tree, and most other similar data structures are special cases of gr
 aphs.Someone did try to do the Wysiwyg engine for the blind, but failed. This was Audiogame Maker back in the day, and it honestly fell very, very flat. Im not too sure why weve not seen another attempt. I suspect that partially this is due to the fact that it failed so hard and partially to the fact that we honestly dont have many programmers of the required level of experience in this community.Youre not going to find too much that documents specifically for games. Its assumed that youll have some idea what you want or need by the time youre looking at low-level network programming. The difficulty is not the connection; the difficulty is figuring out what you have to send. The one good-looking thing I found was Panda3ds networking package for automatically keeping objects in sync; then it turned out that, when Disney released it, they only released the client portion. The server i
 s the hard part for that, and no one ever got a stable implementation going. Only a grad student at CMU ever tried.

URL: http://forum.audiogames.net/viewtopic.php?pid=185385#p185385




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Learning String Variables in BGT; puzzled over example.

2014-08-18 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: Learning String Variables in BGT; puzzled over example.

Not true. You can get bracket completion. Not ; though. XCode does, Eclipse does with the right Plugins, and I think VS does but am not sure.And, as usual with IDEs, it ends up not being as worth it as you might imagine. Its only reall a problem when you nest 5 or more levels deep. And, while not good practice, you will at some point.

URL: http://forum.audiogames.net/viewtopic.php?pid=185389#p185389




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Web development?

2014-08-17 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: Web development?

Be careful when choosing to use less popular packages; Twisted, Gevent, and Asyncio are written and used by many, many people. Im not saying that you should disregard the packages you have found. But if your code starts getting ugly, it may be the fault of the package and not yourself, so keep that in mind. Also, note that LGPL is arguably GPL when using Python, in that you basically cant do anything to close-source the client effectively and still obey the license.Part of network programming is not blocking. This means that you can never explicitly wait on anything. Twisted achieves this through the concept of deferred, which is confusing the first 6 or so times you see it. Gevent achieves it by being threads-but-not; other greenlets get a chance to run when you read from the network, so you can make blocking code that magically doesnt. Asyncio combines these: you can code in the gevent style, but must 
 syntactically note what is going to block (solving the a calls b calls c calls d which reads from the network, which is one of the big issues with Gevent). If you want me to talk about why Gevent is not a free lunch, I will. For a game, it ends up not mattering which of these you use, believe it or not. There is a game loop on the server which processes available messages from clients every tick and queues up new ones to go out. The networking should probably be kept completely separate from this loop, or so shows my first failed prototype. Ive seen the problems I am describing in real code.Regardless, the first time you do network programming for the server side of things right, its going to feel very wrong. Incredibly so.Here are the estimates I have given myself for something akin to Swamp but more mud-like (quests, talking NPCs, etc): 1-6 months to finish Libaudioverse and write a simple game using it, 6 mon
 ths to write an online server/client pair that contain everything needed for building, scripting, and basic gameplay, and an additional year for testing and worldbuilding before a launch. Doing this successfully is not about knowing a specific programming language, believe it or not. You will get much, much further with creative architecture; turn-based stuff is simple, i.e. board games, but realtime games definitely require it. My blog posts may not help you yet, but Ill poke this thread with a link once I have the time to go tag everything, as I need to do a bunch of small stuff for my web site soon anyway.

URL: http://forum.audiogames.net/viewtopic.php?pid=185212#p185212




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Web development?

2014-08-16 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: Web development?

Everything youve mentioned except full multiplayer is actually not so hard and, for a certain type of game, multiplayre isnt either. In this case, since its a client talking to a server, all you need is Django and perhaps the Django Rest Framework. You can do without that last one, however. Django will give you scoreboard serving in a day or two of work, though I make no statement as to the difficulty of the client (this varies widely depending on programming language). Id suggest looking at requests as well, a python library for calling HTTP-based APIs. I started learning these technologies, but am much more versed on how you make your own protocols and use the socket APIs, as this is what both of my MMO prototypes do.keep in mind that knowing exactly how HTTP works, i.e. low-level socket programming, isnt necessary. You need the basics of the internet, but after that point you can just pretend that its
  opaque and magical. This is what Django lets you do.The store is also the same sort of thing, only this time you need a request for the purchase and an error response. The error is required when two players might buy the same item: the request that gets there first wins, and the other player needs to know that that item no longer exists in the store. If done incorrectly, an online store can lead to item duplication bugs. The severity of this problem depends on the game.You can do board and card games through HTTp-based APIs, but youre now getting into places where Django will start to fall over. Django is all about responding to requests and stopping and not so much on-running processes. You can model a card game with django, but doing things like placing time limits is possibly a bit harder. Not impossible, but Id start looking to something else. For something like a card game, a custom JSON-based protocol is 
 what Id consider. Alternatively, theres HTTp streaming, but neither fits well into Django as far as Im aware. This is the point when you want to maybe look at Twisted or Gevent. Its worth noting that Gevent looks great at first but falls down hard unless you really think hard, as it has a lot of magic going on. The difference between this and the previous two things is that you probably want to keep the connection open, and Django is not at all aimed at that (the end of an HTTp request, unless its HTTp streams, is the socket being closed by the server). it is worth mentioning Python 3s asyncio, which appears to combine the best of Twisted and Gevent and has people involved from both of them. I have not used this framework, but it does look really nice. If you look at Twisted and go [[wow]], thats complex, you are so far from alone that I cant even describe how far from a
 lone you are.A chat server is the same problem as a card or board game, but easier because you neednt worry about game logic. In both of these cases, security is a concern-especially if the intent is commercial.Full realtime multiplayer games are really, really hard algorithmically. The reason for this is that the network is not instant. If I do something, it takes anywhere from 20 ms (UDP, which adds a whole new set of complexities, and Im on a really good high-end internet package) to half a second or more for the server to know about it. The server then communicates this out to other players, all of which take anywhere from 20 MS to half a second or more. Syncing the data is easy. Making the game feel like its not molasses is really hard. If you design it poorly, both in coding and gameplay terms, I dont find out about things soon enough. If you shoot me and that update takes a whole second to get
  to my client, I have a whole second where the server thinks Im dead and I dont know I actually am. If the client has to wait on the server to say okay before letting me take every step, my movement speed depends on network round-trip time; everyone ends up moving at different speeds. These are surmountable problems and Id suggest looking up the quake and half-life protocols to understand it better. Once updates need to be noticed in less than 5 seconds or so, you need to start being creative.Alternatively, you can cheat and make the server very light-weight, sharing only a bit between them. In this case, you make everyone basically play their own game, except for some shared elements. Games in the sighted world that do this include Demons Souls (you can leave messages for others and invade for PK, but its never more than two players playing together). Ive heard that Swamp does a lot of this kind of thing from a
  lot of people, but never played it far enough to make it glaringly obvious to me what it does and doesnt share.

URL: http://forum.audiogames.net/viewtopic.php?pid=185009#p185009




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Web development?

2014-08-16 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: Web development?

No. You do not stay connected. HTTp request/response pairs end with the connection closing, unless we are talking about HTTP streams. HTTP streams are a very special case, almost a hack, and Django does not support them in the manner you need. Im not aware of anything that does. Django gets a request and answers the request. It is bad practice and I believe requires a bunch of extra steps to keep the connection open for a long time because that blocks other requests or otherwise degrades performance. That is all. Django is not, in any way, for realtime online games that resemble Muds. Django will work fine for a scoring system because that is a request/response system-I ask for the scoreboard or say that this was my score today. Same with a store system, as thats got the same idea behind it-I request the list and say buy x of y-note that this doesnt solve allowing me to trivially lie about my money
 , and you have to completely trust clients to be telling the truth. By the time were on to allowing two players to trade directly, were talking about custom servers being easier by far, and anything beyond that or anything with time limits means its probably time to pull out the socket module and make our own protocol. Other things can work, but thats probably the path of least resistance.You cannot ever make a connection from a server to a client; the client must always initiate. This is true for 95% of users; the remaining 5% are those who know how to set up port forwarding and whom you have provided the needed info to. Do not be fooled by a technique known as hole-punching-you cant connect to my computer in any way unless software on my computer connects to your server first.I hate to say this because its discouraging. You may eventually be able to do an online game. You are far away from it, howe
 ver. The amount of information missing from your understanding of how this works is large enough that conveying it here simply isnt going to work. You need to research on your own, possibly looking for books or tutorials. Id start with how tcp works at a search engine, followed up by how http works. This article about using sockets with Python is how I put my first MMO prototype together. My blog contains an entire account of my adventures, but I didnt tag them so Id have to link all 7 or so articles individually (maybe Ill do that and post here again).My suggestion is this. Either make a single-player game to develop your programming skill more, develop some sort of simple online software like a blogging engine with something like Django, or both. You can add a high score system and a chat system to a single-player game, bu
 t the things you are suggesting will not work.Be very scared of the word thread. Very. Incredibly. The t-word is not the friend of programmers. The t-word is not always a mistake, far from it, but threads cause a very large number of problems-especially if you dont have a good understanding of how to use queues properly. Greenlet in Python is slightly better, but also pretty evil. Beware of client-side simulation, because thats so easy to hack its not funny (I can have whatever just by saying that I do, and you cant check it). Its also very difficult to get right. Clients should never identify themselves explicitly in requests: this is also unbelievably simple to abuse. The trick is to have a login procedure and to keep the connection open; you can identify me by my socket on the server, and then Alice cant pretend to be Bob.And drop HTTP. HTTP is a request/response system, th
 at is you get responses from the server to requests from the client. It seems to me that you have not fully grasped what this means. To repeat it one more time, the server does nothing at all unless the client asks for something. Youre going to need to learn socket programming. And I take back everything I said about not worrying about security: the things you are suggesting can be hacked in five minutes or less, most of us have the packages and whatnot installed to do it already, and the hacks can be bundled in nicely distributable scripts. I thought you were talking about locking down an Apache/Nginx configuration, not security in your code itself; I gave advice accordingly,.And finally, look at JSON. Most people do not shove all the information in the header like this-you have the ability to send along arbitrary information with post, so why not serialize entire python dicts? Django does contain support for this if you can use
  HTTP, otherwise you can use null-terminated strings over a socket (theres advantages to length-prefix, though. See the howto, it goes into that a bit).But really, I think you need to go to Stack Overflow. Theyve got people who do a generally good job on well thought-out questions, and youll be reading it all the time as a programmer anyway. Start with asking them about where to learn basic networking concepts, or better search stack overflow for such questions 

Re: Web development?

2014-08-14 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: Web development?

Youre right on ports.What kind of game are we talking about? Are you trying to do Swamp or are you trying to do something like Core Exiles? In the former case, you dont even use HTTP; HTTP is not really built for swamp-style gameplay. Its actually worth noting that swamp isnt as online as you think: you are seeing different zombies than everyone else, for example.And as for all this interconnection, if its a browser game like Kingdom of Loathing, you only need Django. Nothing more. Django does everything necessary for that.Swamp-like games are a whole different thing. You typically use a custom desktop client and a hand-written server, not the browser. Especially for audiogames, given the poor state of Webaudio-only Chrome has a full implementation, but nothing else on windows does.When we get into games that talk to web sites, theres two or three ways that Ive seen. Y
 ou can do what youre thinking and write an HTTP web-based API, but this is overkill. You can have the game write to a database and have the web site read from that database (probably the most common and what Id do). You can use something like Websockets to allow the web site to ask the game directly for the info. Pick 2 or 3, not 1. If the game is something like KoL, just make the game the web site and dont worry about talking back and forth between 3 apps. You seem to have a tendency to bring in way too many pieces.I can talk a bit about how things like swamp work, if thats the kind of info youre looking for. Aprone can probably say more, but we have different programming philosophies: Id never, ever settle for the kind of tricks Swamp uses to get around network limits and would much prefer something fully shared, where everyone sees the same thing always. This is what I am working towards with my b
 log articles and Libaudioverse (because why do it with less than the optimum audio experience?). I think that I can, but am probably a year or so out from it.Muds use TCP to transport data and speak the Telnet protocol on top of it. Theres not much to say about telnet. Its just another protocol, only this time its for talking about how wide your screen is and what youre typing at the mud clients input bar.The tutorials on how the web works dont really exist anymore. You can find them, but everyone seems to start off by hammering on Apache config files and the like until they work. Most people do not care about how HTTP works, and just want it to draw a smiley face or whatever. Typically, thats picked up a bit later, and developing a mud makes it happen faster (because Muds do not speak HTTP there are not many frameworks that hide it all away like Django). Keep in mind that the
  Django tutorials make Django look easy, but that it doesnt stay that way-it would be accurate to say that Django is probably the easiest approach I know, but theres a difference between easiest and simple. If you really want to know the gritty and very technical details, there are official specifications you can read for all of it (I had occasion to look at the TCP spec exactly once. I would never do that again). Most helpful, though, is googling http introduction or similar-there are some out there if you look explicitly for them.And finally, keep in mind that the internet is not like normal software. A bunch of different people worked on it all at the same time and all without close collaboration. Then, in the 70s and 80s, we started linking all of them together; in the 90s, the web browser became popular and the internet exploded; in the 2000s, we started having a huge explosion of games that, by now, blow World of Warcraft o
 ut of the water. The internet tends to be someone does it, someone else says good idea, so lets standardize it; most of us wish it was someone says this might be a good idea, someone experiments to see if it is, etc.

URL: http://forum.audiogames.net/viewtopic.php?pid=184732#p184732




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Web development?

2014-08-14 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: Web development?

Sockets are not HTTp and Django is not sockets. Django does one thing and one thing only: HTTP responses. This includes, as you have no doubt seen, all the other stuff to make an app out of them. But it will always be HTTp. Your scoreboard example is indeed fine, in that it is a client using an HTTp API to talk to a server-this is how I would do it too.Security is a concern, however. Those HTTP requests-should I know the format-are trivially easy to do. I can use my telnet client, curl, or any number of other programs. You would also want to use SSL here, because then I cant trivially use any of a number of command line utilities or GUI programs that others have written specifically to intercept and fake requests like yours. You debug your app with one of these, so obviously the hackers have it too.Please specify the end goal here. You are flailing around blindly among a bunch of technologies for a bunch of di
 fferent purposes, and have not clearly specified what you want when you are done. As a result, I am flailing around blindly and providing very broad explanations. I think more focused discussion aimed at specifically what you are wanting to do would be beneficial at this point. Making the mud client, for example, is only helpful for a certain type of thing-learning raw socket programming-and wont help with HTTP explicitly. Can you lay out exactly what you want to end up with at the end? There are at least 3 directions you can head in, each only tangentially related to the others and each accomplishing slightly different things.

URL: http://forum.audiogames.net/viewtopic.php?pid=184796#p184796




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Web development?

2014-08-13 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: Web development?

We are speaking entirely different technical languages, so Im not sure how far I can help. You are not ready for anything resembling Swamp, if thats what you are thinking.Start with the VPS. What you are paying with at Amazon is not the full package you need, and the parts you dont own (because you do in fact purchase it peace meal) are not a good deal for what you want/need. Put aside anything that has the word cloud in it. Put aside anything that has the word spawning multiple instances in it. This is aimed at high-end enterprise people, not you. Getting and running Linux on Amazon costs by the hour, not the month. Wait until black Friday, and VPSes with lifetime promotions fall from the sky; alternatively, look around yourself, just be aware that itll take a bit of digging. Bhost has some pretty cheep packages, but offers next to nothing in terms of extras like easy backups. Before jumping on th
 e lets make a game bandwagon, learn how to set up a basic web site on a VPS. I.e. Lamp is not a piece of software, its just an acronym for Linux, Apache, MySql, and Php.I didnt want to go here, and my advice is to start aggressively Googling. But lets talk about how data moves around. At this point, you dont know enough about this to even talk about HTTP properly. If you dont know programming, an internet project is usually not the place to start; if this is the case, go learn *anything* without the internet involved.At the lowest level of the internet, below everything, is the raw IP packet. This concept is so low and far down that only OS developers or network researchers deal with it directly. If you try as a developer, you cant: the internet will actually block a lot of attempts to use things that are not TCP or UDP. UDP is beyond the scope of this post, but Ill get to TCP.
At this level, you have almost nothing. Not even ports. The internet is an ocean and you can put a message in a bottle. Since its the internet, however, that bottle either gets lost forever or goes where you want-and no one else but the recipient gets to see it.Lets detour for a moment and talk about what a protocol means. If youve played a mud, you are actually participating in a protocol. The mud has some fixed set of commands and, should you go outside this, it either says Huh? or gives you some info on what went wrong (I dont see that here). Nothing forces you to obey the protocol of the Muds commands, but not doing so will never make useful things happen. This is exactly what protocol means.TCP is a protocol, specifically the transmission control protocol. Through various complicated and nefarious means that involve both ends of the connection, it makes sure that d ata actually arrives, almost always. Even if you unplug the internet for a second in many cases. This is where the port is. A port is simply a number from 1 to whatever, and a socket is an open TCP connection. A socket is not a port, though it does connect to them. After you establish the connection, you get a socket out of it and treat it a bit like a file on both ends-write to send, read to receive.Now, to tell the OS that you want to accept connections today, you bind to a port. More than one program may open a connection to a server on the same port, but a server may only listen on a unique port. If you try to run two web servers on the same port, one will error. A server is not hardware in this case, merely a program, so you can have more than one on the same computer. Two different computers can use the same port at the same time, as its machine specific.So we have two things. A way to sa y I wish to listen to connections and accept them. A way to make sure that our data actually got to the other end. Notice that so far theres no meaning to the port number at all. maybe port 80 is the destroy-the-server program which, upon receiving a connection, deletes itself Maybe its your mud. Run your Mud on any port and it will work fine, no problems-just so long as no one else bound to it first.And back in the old days, that was it. We didnt have HTTP yet.But someone came along and said Hey, heres an idea. And then we said port 80 is the default port for HTTP, unless the URL says something different. So if you enter google.com, your web browser looks it up and opens a socket on port 80, sends get / http/1.1, a blank line, a list of information about itself in a prescribed format, and two blank lines. This is called an HTTP request. It then waits f or whatever the server does, interprets it as HTML, and gives it back to you. Thats it. The server does whatever-read a file, run a script, calculate the first 1000 digits of Pi-and then writes some HTML to the socket, which may or may not have any relation to what the server just did, even if it almost always does.notice that I have not used the word HTML, _javascript_, or anything. These are not network technologies and only exist on the client. Html merely says I am an HTML document, heres

Re: Pure basic: has anyone ever heard of, or used it?

2014-08-13 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: Pure basic: has anyone ever heard of, or used it?

believe it or not, cdb is actually a really good debugger once you learn it. Only super useful with the MS compilers and gdb is better, but once you learn it a bit it actually does an unbelievable amount of stuff. It turns out that the problems Ive had with it (C++ template and STL debugging) exist everywhere.I believe it is now integrated with the Windows 8 SDK or Visual Studio 2013. I do not recall which, but Im almost certain that debugging tools for windows has basically been merged at this point.Unfortunately, mdbg, the command line debugger for .net, was killed and removed; consequently, debugging the CLR requires Visual Studio. The Visual Studio debuggers exist in this weird place between UIA and MSAA and are known by Microsoft to be broken in terms of accessibility, so only jaws sees them. There are enough other problems with the accessibility of VS that its not worth it imho. Technically, the latest version
 s of cdb have a little support for the CLR, but I think its not even to the point of setting breakpoints. I dont use the .net languages because Libaudioverse is C++, and I can build a pretty good case for C++ over them in a professional environment these days (sharing between five platforms).Finally, heres an interesting tidbit. Windows is the only platform I know of that offers a full debugger API. Its a set of COM objects that, apparently, both VS and cdb/WinDbg use. I.e. you can, in theory, make your own debugger. This is a bigger project than it sounds because of lack of documentation, and not something Ive explored.

URL: http://forum.audiogames.net/viewtopic.php?pid=184578#p184578




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: accessible java IDE/SDK?

2014-08-13 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: accessible java IDE/SDK?

You can also use Swt in your own projects.And also, Ive seen swing apps that work fine. You have to check a box, however. Its no longer install the access bridge. Instead, youre now supposed to check a box in control panel. Unfortunately, theres no way to turn this off and its been almost a year since I last did it. Im not saying that swing accessibility is fantastic, but it does work at least some.The latest versions of eclipse crash NVDA on next. There is an open ticket for it and I got volunteered to patch (lack of interest from anyone else, etc), but this requires understanding a Python metaclass at the core of NVDA, so I havent actually done it. See ticket #3872. Patching NVDA for Eclipse support is low on my priority list, however.

URL: http://forum.audiogames.net/viewtopic.php?pid=184591#p184591




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Working with NVDA in C++

2014-08-13 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: Working with NVDA in C++

If you go for accessible_output, go for accessible_output2 instead. Accessible_output is no longer developed. its at http://hg.q-continuum.net

URL: http://forum.audiogames.net/viewtopic.php?pid=184636#p184636




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Web development?

2014-08-13 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: Web development?

This is long. I apologize for this, but this is an extremely complicated topic and your questions touch every part of it.Im not 100% sure on which parts are questions to be honest, but think I can clear this up at least a bit. Lets run through a request on the internet, as I think this will tie a lot together.When you enter something in your web browsers address bar, it does one of a few things, but the end goal is an ip address. If you enter one, nothing else happens-it just goes ahead and opens a connection. If its a domain name, i.e.google.com, the web browser does a more complicated algorithm to contact a domain name service, which you do not typically control yourself. To get a domain name, you purchase it and, after some period of time (seconds to hours), it appears and starts working. The domain name is everything before the first /, and the domain name service is like a dictiona
 ry that maps them to ip addresses.This connection is a simple socket, and the fact that youre using http or https or whatever is indicated by the port. Http is on port 80. Im not going to go into details here because its highly technical and something that I dont fully know, but it is more than possible for multiple clients to connect to the same port. Each connection is differentiated by the OS for you, and no programmer I know can explain the specific mechanism offhand because its simply not important how it works. What you cant do is have multiple servers on the same port, because the OS on the webserver needs to know which program wishes to respond to the connection request. Everything here is actually informal, i.e. you can make port 80 ftp or a mud, but youd not be obeying the HTTP protocol at that point.Third, your web browser sends an HTTP request and HTTp headers. This includes a bunch
  of standard stuff plus a bunch of browser-specific stuff. It is these headers that allow for a virtual host, because the server can see which domain name you originally used. I.e. google.com, camlorn.net, etc can all be on the same machine.As for the server, it tries to handle the request. Basically all servers know how to do standard html files and some Linux distros are even set up for it out of the box. What you do when you set up something like PHP is tell the server that the URl needs to be processed by something else; this can be either a scripting engine like PHP or a full-on redirect to another webserver (which is what you do for something like Django). The reason Im not being too concrete here is that an HTTp connection is exactly the same mechanism that a MUD uses for telnet, just the MUD happens to speak http commands. You can write web servers that just output the HTML for hello world, and the only thing that s
 tops me connecting my web browser and at least getting a log-in screen is that the MUD isnt sending the browser HTTP commands back.Finally, when its done, the server closes the connection. This tells the browser to go ahead and show it.So now that Ive laid that out some, lets clear up a few things.Domain names point at a static IP address, which means you need a VPS or a high-end internet plan to use them. There are some services that do redirects to dynamic IP addresses (i.e. changes every hour, like most home internet), but Ive never had luck and setting up all the forwarding is more trouble than its worth. Im not even going to get into NAT, because its complicated and an unfortunate consequence of some bad decisions and underestimation in the 70s and 80s.You dont want Amazon stuff It is very very pricy. Get a 5-dollar VPS and configure the web server or get a shared host an
 d let them configure it all for you. Amazon is aimed at very, very high-end enterprise people. You technically can use it like a VPS, but its not that simple.A shared host is not a VPS. The difference is that a shared host doesnt even typically give you a whole computer, and locks you down completely. A vPS gives you full admin rites. Ssh is just a connection program that you use, like a mud client. The actual Linux shell it connects you to is something like 10x as powerful as the windows command prompt. A VPS is a computer running on a computer, in the same way that something like VMWare works. A shared host is just a folder you can put files in, sometimes with some additional features like database access and PHP; the advantage of the latter is that a shared host does all the setup to get things working right. Under no circumstances use Dropbox, even if you are grandfathered into the old public folders. 
 This is not worth it in the long run, and youll need to upgrade as soon as youre even marginally popular and cant run PHP or anything but static HTML. A VPN has no relation to web hosting and is another topic which I cant talk about for lack of ever needing one ever.Wanting to install something like twisted and your comment about unlimited calls doesnt actually make sense at all. Im not sure why you would 

Re: Web development?

2014-08-13 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: Web development?

This is long. I apologize for this, but this is an extremely complicated topic and your questions touch every part of it.Im not 100% sure on which parts are questions to be honest, but think I can clear this up at least a bit. Lets run through a request on the internet, as I think this will tie a lot together.When you enter something in your web browsers address bar, it does one of a few things, but the end goal is an ip address. If you enter one, nothing else happens-it just goes ahead and opens a connection. If its a domain name, i.e.google.com, the web browser does a more complicated algorithm to contact a domain name service, which you do not typically control yourself. To get a domain name, you purchase it and, after some period of time (seconds to hours), it appears and starts working. The domain name is everything before the first /, and the domain name service is like a dictiona
 ry that maps them to ip addresses.This connection is a simple socket, and the fact that youre using http or https or whatever is indicated by the port. Http is on port 80. Im not going to go into details here because its highly technical and something that I dont fully know, but it is more than possible for multiple clients to connect to the same port. Each connection is differentiated by the OS for you, and no programmer I know can explain the specific mechanism offhand because its simply not important how it works. What you cant do is have multiple servers on the same port, because the OS on the webserver needs to know which program wishes to respond to the connection request. Everything here is actually informal, i.e. you can make port 80 ftp or a mud, but youd not be obeying the HTTP protocol at that point.Third, your web browser sends an HTTP request and HTTp headers. This includes a bunch
  of standard stuff plus a bunch of browser-specific stuff. It is these headers that allow for a virtual host, because the server can see which domain name you originally used. I.e. google.com, camlorn.net, etc can all be on the same machine.As for the server, it tries to handle the request. Basically all servers know how to do standard html files and some Linux distros are even set up for it out of the box. What you do when you set up something like PHP is tell the server that the URl needs to be processed by something else; this can be either a scripting engine like PHP or a full-on redirect to another webserver (which is what you do for something like Django). The reason Im not being too concrete here is that an HTTp connection is exactly the same mechanism that a MUD uses for telnet, just the MUD happens to speak http commands. You can write web servers that just output the HTML for hello world, and the only thing that s
 tops me connecting my web browser and at least getting a log-in screen is that the MUD isnt sending the browser HTTP commands back.Finally, when its done, the server closes the connection. This tells the browser to go ahead and show it.So now that Ive laid that out some, lets clear up a few things.Domain names point at a static IP address, which means you need a VPS or a high-end internet plan to use them. There are some services that do redirects to dynamic IP addresses (i.e. changes every hour, like most home internet), but Ive never had luck and setting up all the forwarding is more trouble than its worth. Im not even going to get into NAT, because its complicated and an unfortunate consequence of some bad decisions and underestimation in the 70s and 80s.You dont want Amazon stuff It is very very pricy. Get a 5-dollar VPS and configure the web server or get a shared host an
 d let them configure it all for you. Amazon is aimed at very, very high-end enterprise people. You technically can use it like a VPS, but its not that simple.A shared host is not a VPS. The difference is that a shared host doesnt even typically give you a whole computer, and locks you down completely. A vPS gives you full admin rites. Ssh is just a connection program that you use, like a mud client. The actual Linux shell it connects you to is something like 10x as powerful as the windows command prompt. A VPS is a computer running on a computer, in the same way that something like VMWare works. A shared host is just a folder you can put files in, sometimes with some additional features like database access and PHP; the advantage of the latter is that a shared host does all the setup to get things working right. Under no circumstances use Dropbox, even if you are grandfathered into the old public folders. 
 This is not worth it in the long run, and youll need to upgrade as soon as youre even marginally popular and cant run PHP or anything but static HTML. A VPN has no relation to web hosting and is another topic which I cant talk about for lack of ever needing one ever.Wanting to install something like twisted and your comment about unlimited calls doesnt actually make sense at all. Im not sure why you would 

Re: Pure basic: has anyone ever heard of, or used it?

2014-08-13 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: Pure basic: has anyone ever heard of, or used it?

I would not start with gdb to learn this. Debuggers are actually hugely complex, GCC is known to be a platform thats hard to develop for, and gdb has had close to or over 20 years of continuous hacking and development. Clang spun off them and shares no common code in part because of this, and GDB involves just about everything you could ever want to know about anything to do with your computer all at the same time. Think hundreds of man-years of development and so complex that they have actually admitted that they have trouble finding developers who can fully understand the GCC stack at this point. This is outside the experience level of everyone I know everywhere, including every professor Ive ever met. What Microsoft has done is exposed the API as a set of COM objects, and then called into it from elsewhere. I.e. there is a debugger, and you just need to write an interface on it.In actuality, the debuggers are usually made wi
 th the compiler. I.e. Gdb only debugs GCC executables, with very limited support for other stuff. The API Microsoft provides, therefore, only works fully on MS executables with the MS symbol format. You cant port it in any short amount of time: leaving aside the fact that its COM and Windows and that you dont have actual source code, youd probably have to either completely rearrange GDB into some new and interesting format or write your own debugger that supports the GCC or Clang symbol formats.My advice to everyone here is stay far away. There are enough options that work already, and itll just chew through your time like you wouldnt believe. The only reason Id do this ever is for pure fun, not because Im expecting anything at all to come of it.

URL: http://forum.audiogames.net/viewtopic.php?pid=184647#p184647




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Pure basic: has anyone ever heard of, or used it?

2014-08-12 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: Pure basic: has anyone ever heard of, or used it?

Googling, I see at least 2 free .net obfuscators.And as for other languages, like C++, its also very easy there in a lot of cases. Heres the general picture. While this is a bit harder, its only a bit; only one person need crack it, however:1. Start your program under CDB, the Microsoft command line debugger.2. Fix the windows symbol path (.symfix), enable line loading (.lines, may work in some cases if the developer is an idiot and embedded the debug symbols into the program), type g.3. Do whatever is necessary to get a demo over message, as this is a point in the program where the program has just made a check for activation.4. return to the debugger. Press ctrl+c.This is where it gets a bit tricky. The command of interest is k, to examine the stack. Also, l+* (if you can get lines) and l-* (to turn it back off so you see assembly again). Specifically what you get from here depends on how t
 he program was compiled. You can skip any of the windows functions. Youre looking for the last few frames in the executable. If youre fortunate, and you are in a lot of cases, you get function names; if not, its a bit of guess and check. You can disassemble with the debugger, though Ive not yet had occasion to work at that level. Youre looking for something that looks like an if statement, i.e. uses the conditional jump commands. Fortunately for us, we have one additional piece of information; we can allow the program to exit and see what happens, stepping through at the assembly instruction level. Whether this is helpful depends a lot, and its case-by-case. But it may be possible to just delete a call to exit. Youre rarely going on no information at all; you usually have at least a little bit.Finally, you patch the check to always be true, remove the check, or otherwise interfere w
 ith the check. Id suggest putting it in the activation checking function so that if the program checks elsewhere, itll still work out.I have not done this because why bother? I only know how because Ive been working with Cdb and similar for a good while now. But the truth is that all software cracking is a why bother? There is always, always someone smart enough to crack your software. It doesnt matter what you use. Ive never done a C++ crack, but itd take anywhere from an hour to a day regardless; depends on how much information I can extract and how quickly I can find guides. Someone who has probably has it down to a science, has written custom tools, etc...and can do it in an hour or three. Ive seen it done a couple times, i.e. BGT music/sound extraction (yes, really). It doesnt matter. if someone wishes to crack it, they will. And it only takes one for everyone
 . Youre not fighting everyone. Youre fighting the smartest programmer who would find it worthwhile to crack your software. Since you dont know who this is, best to think smartest programmer I know of anywhere instead. Even being tangentially aware of a way to crack the software means there is someone out there who can.

URL: http://forum.audiogames.net/viewtopic.php?pid=184522#p184522




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Books on C

2014-08-07 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: Books on C

if the goal is Swift, skip all the intervening stuff and just do it. C will not help you learn Swift, save perhaps by making you a better programmer in general. Swift is closer to Python than anything I know, but is still strongly typed and brings in attributes of all the other languages I know, too.Objective-c is apparently a nice language. I disliked it because of the verbosity and because XCode highlights every single problem I have with Mac accessibility, but nothing is really wrong with it. While it, too, is a superset of C, you can skip right to it: you dont typically use char* and all the C libraries, as I understand, and it has some niceties like reference counting. You need a Mac for both of these, though (sorta...you can technically run obj-c on windows, but...).Assembly isnt worth your time unless youre coding for embedded hardware or doing some really hardcore stuff like OS development. The modern x86 ar
 chitecture is not aimed at programming in assembly anymore. Its literally gotten to the point where your compiler can and will usually do a better job programming in assembly than you can--to get good performance out of it, you have to know about all sorts of stuff that I dont actually know myself, simply because there is no need for me to do so. Examples of the ones I do personally know about include cache friendliness and unrolling and auto-vectorization of tight loops.Go is an interesting language with a lot of unique features, and may not be a bad choice. The problem with Go is that there are a few quirks that make it unfriendly to a screen reader user (whether or not a function starts with a capital letter determines if it is public is the big one here). They can be worked around. The big killer is that Go is a server language; nice enough to work with, but with few options for desktop libraries. If the goal is a game, I
 9;d suggest avoiding Go...for now.I also dislike Perl. It does indeed have a lot of little special cases, and at least one thing (file I/O as I recall) places very, very heavy emphasis on the difference between capital and lowercase. Again, you can work around this. The only language I havent found an easy way to work around is Lisp, but the case sensitivity has semantic meaning bit is a big annoyance of mine.

URL: http://forum.audiogames.net/viewtopic.php?pid=184091#p184091




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Books on C

2014-08-05 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: Books on C

Unless you have a pressing reason to learn C specifically, dont. C++ is more complex but better, if only because it now provides limited automatic memory management. Unless you have a pressing reason to learn C++ specifically or are already a very good programmer, also dont. That said:The C book from 1975 is drastically outdated. Back then, you couldnt compile its examples on a different compiler, let alone 40 years of standardization, improvements, development, etc. Not only wont the programs compile, but updating them will be hard. This situation is now better, in that all the major platforms implement at least C++ 03. Most of them have implementations of C++11 (which introduced smart pointers, the limited form of automatic memory management I swear by), but C++11 is too new to find many Im new to C++ resources that show you its features. The reason I and a lot of other C++11 programm
 ers know the new features is because we are far along enough to need them, though I can make a very good argument that shared_ptr is something that new programmers should be shown immediately. If you are on an embedded platform, you will be lucky to have C99/C++98, so Im not going to waste time waxing poetical about C++11 until I know that you have it. It would also be helpful to know your programming experience and background before I try to help past this post.The two main references these days seem to be http://www.cplusplus.com and http://www.cppreference.com. Both offer links to tutorials if you poke around. Your best bet is to Google for tutorials, imho. If youre dead set on a book, this SO answer gives a lot of them.Heres a direct link to a tutorial th
 at appears to be pretty decent: http://www.cplusplus.com/doc/tutorial/Im having trouble finding anything that doesnt assume you already know how to program. If this is a problem, Im afraid I cant help. The work I do in C/C++ these days often requires consulting the standard when I need something new; thats the only reference for the most advanced features and guarantees, and consulting it is a sign that youre probably doing something dangerous (so when I do, I immediately consider redesign possibilities). I know it too well to pull a bunch of good learning tutorials out of my hat, basically.C is an incredibly simple language, at the cost of having to manage literally every allocation and deallocation, having no automatic cleanup (you can get far with preprocessor magic, but Im not even going to try to explain how I pulled off those tricks without a full blog a
 rticle), having no encapsulation that you dont make yourself (no equivalent of BGTs classes, and all Im going to say is enjoy implementing vtables), etc. C++ gives you object oriented features and a good standard library, This latter point is arguable, but having sets, vectors, maps, hashtables, and the algorithm header is a godsend as compared to C. In C everyone writes their own version of all the standard data structures from scratch. My last point is this: C++ is a monster that you tame, not a programming language that you learn.Ill help further if I can. Specific questions would be helpful.

URL: http://forum.audiogames.net/viewtopic.php?pid=183746#p183746




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Books on C

2014-08-05 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: Books on C

Er. No. See this timeline, since apparently knowing something isnt a qualification in these parts. C needs a compiler, so merely knowing that a book about C existed in 1975 is sufficient to inform me that a compiler must have existed for it. And we were more than moving on from punch cards by that point, all be it not yet at the point of home computers being anywhere near common.As for compiling the programs, he said he cant. This is sufficient proof that something is either wrong with the programs themselves, or they were written before C was standardized, modernized, and etc. I am sure I could get them working if I put effort into it, if only by downloading older compilers. I would not suggest someone new to the language try to do so. One concrete example of an archaic feature that comes to mind is the old-style function declaration, wherein you use only types
  and the empty () means a function taking any number of parameters. I can exclude the compiler because those have programmers working on them who know way more than everyone I know including myself put together. I can exclude the programmer, because this is a transcription from a book which should be expected to know what its talking about. Given that the first C standard wasnt published until 10 years later and we hadnt yet seen the rise and dominance of the x86 processor, it is very logical to assume that a modern compiler--almost 40 years later!--might have trouble. It is sad that I need to spell out my logic; I know these languages and their histories as well as anyone on these forums. It is illogical to assume that a language with no published standard and no major dialect did not change in some incompatible way in the 7 years between 1975 and 1983, so I am very unclear what windows has to do with anything.Also note that I g
 ave a lot of helpful info, and I feel the warning is warranted in this case. If you have a problem with my verbosity, I dont see how quoting my post helps. If you have a problem with me personally, just say so and have done. I felt obliged to say something because Ive seen too many programmers think that they absolutely need to know these languages, try to learn them, and give up on ever learning another language again. I have given my warning; if king gamer222 really wants to learn it Ill help him do so to the best of my ability. I am the last person to say that these languages are useless or dont have a place. They do: you sometimes really do need the performance.But obviously arguing with you is pointless anyway. I have yet to be on a thread where you have a problem with my opinions and provide good, logical, and concrete reasons they are incorrect. You always attack me directly instead. Doing so 
 is not constructive; it merely places me in a position wherein I cannot defend myself without starting yet another war. Sigh.I will decrease my verbosity only when people stop saying that I am wrong without being able to tell me why. I do not mind being wrong. I do mind being told that I am wrong by someone who can not tell me why I am wrong and simply says that I need to try things. If I am verbose, it is because I have great need to declare and specify my reasons; if I simply say x is good, y is bad, that carries no weight whatsoever. Apparently I have yet to establish any sort of credibility, despite being one of the few people to ave any success providing 3D audio whatsoever. Maybe I just need to go write a game before people will take me seriously here; apparently all my other programming is not sufficient to show that I might just have a clue in your eyes.

URL: http://forum.audiogames.net/viewtopic.php?pid=183797#p183797




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Pure basic: has anyone ever heard of, or used it?

2014-07-31 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: Pure basic: has anyone ever heard of, or used it?

I have used it many years ago. I suspect I will be ignored, but just skip to Python or even C++ for that matter. Purebasic is basically C with a pretty syntax and a bigger standard library.Its been a long time since I touched it, so it is possible that it has changed (but I hear from others that it hasnt, so...). Firstly, its not free, and you have literally 100 free options and at least 10 that I would call better. Secondly, the higher level constructs are missing--garbage collection, classes, inheritance. Everyone I know who has used it has graduated to something better and looks back on it with horror.Theres two things worth saying here. First is what I think of as the PHP Phenomenon. All the sane programmers hate PHP, including most if not all of the major programming bloggers, everyone I know at my college who can actually program, and everyone I know outside college. P
 HP is pretty much universally agreed to be awful, huge articles have been written about why this is true, and people seem to have finally stopped using it for new projects. But PHP has two things: at first glance, its great and fun and helpful, and you only find out later that its awful. The second is that everyone looks at how much of the web it powers, and automatically assumes that its somehow this fantastic thing-in reality, everyone just bolted on stuff with no thought to the future, theres 5 or 6 ways to do everything and you have to know them all because who knows what todays project did (and a lot of them use more than one), and to really drive it home this is a web programming language that requires a server and yet it even has openAL bindings. My point is that a good programmer can work with anything. Having a game written in specific language tells you only that it is technically possible, and gives no statement 
 one way or the other as to the actual quality of that language. For example, I see no reason I couldnt do space invaders in assembly, though it would take a while and Id never suggest that anyone try such insanity.the second thing worth saying is that, if you choose a less capable and less well-tested language, you never find out about all the nice things youre missing and why you wish you had them. Its like asking someone from the 1800s if they think they need this thing called electricity or that thing called running water. Until you have and understand the features, its not even possible to understand why youd need or want them. I rate Purebasic as the 1800s of programming: its C with nice syntax. Modern programming languages automatically manage memory, clean up stuff, provide very nice ways to reinitialize levels and such (a ton of the bugs in BK3 are because he doesnt have classes with construc
 tors in HSP), and a bunch of other stuff. Even C++ has seen the light now, providing first-class functions and a limited form of garbage collection (I dont exactly recommend it, but I do recommend it over PB).Heres the secret. I suspect that everyone is going to ignore or disbelieve this. The programmers who forgo or move on from BGT are likely to realize that BGT was hiding 30 years of literature, code examples, forum posts, and best practices from them. When you go with BGT, you can get going quickly. But you also give up the 30 years of almost every programmers attempt to make a game including, most importantly, the failures. The coding habits of this community as a whole tend to be 20 years outdated at least, and all the problems that come up here have already been solved by the sighted (a quick Google search can be very informative on most of them). The reason that we dont see a ton of Shades of Doom clones
  written in BGT is this, and not anything to do with the language.Im curious why you need a patent and why you think that Purebasic uses less symbols. C/C++ is a bit heavy on them, but everything else only really uses the math operators and the ; these days (and ; is super, super optional now).

URL: http://forum.audiogames.net/viewtopic.php?pid=182996#p182996




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Open-source complete game in BGT

2014-07-29 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: Open-source complete game in BGT

Im not saying that it necessarily has to be. But thats the impression I got from the first post.You cant learn too much from a side-scroller codebase by itself. I can already tell you the broad points and save you the trouble of reading the code, and the fine points need more explanation than a function. If the goal is to teach, then the code of such a side-scroller also needs to be *heavily* commented, even if everyone who reads it comes in with understanding of the prerequisite knowledge. The biggest problem is that to learn the most from it, the person who writes it needs to have mastered writing side-scrollers; Id posit that such people probably arent super interested in doing another one all by themselves for the learning purposes of others.As for getting useful code from it, thats the wrong approach also. The following is not the most obvious thing, but its what a lot of the good programmers 
 do. I call it, for lack of knowing the official title, library-driven development. The idea is that this useful code and these useful modules need to be developed as separate entities from day one and not depend on each other. You then glue them together with code that knows how to call sound_lib and collision_lib and pathfind_lib and...into a game. While they can be combined as an open-source game, this places them outside the game itself. This has three major benefits: a bug in one is not likely to be caused by another, each can be downloaded and used separately from all the others, and different people can maintain each piece. But the reason that I bring this up is as follows: the useful code is nicely separated, separably downloadable, easily installable, and understandable in small chunks. You can do a how x works piece and not have to worry about also needing to describe y, z, and w at the same time.
  Id suggest a model like this over one big, monolithic open-source project. The gains dont show up from day one, and Im not sure if theres enough people in this community that know enough about good program design to make sane API specifications for each piece, especially if theyre to come together and still remain sane when used at the same time.Think about what BGT is: you could learn each piece of BGT alone, because it only required itself. That is what Im suggesting here.

URL: http://forum.audiogames.net/viewtopic.php?pid=182706#p182706




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Open-source complete game in BGT

2014-07-28 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: Open-source complete game in BGT

Python is a better choice, especially if/when libaudioverse is working and/or someone makes basic panning alternatives. This is not to do with language, however, its to do with libraries. You can get all sorts of stuff in Python land: easy networking, easy geometry, easy data structures (the third is important a bit down the road when you want to have 1000 enemies and [[wow]], that collision code just wont cut it), easy databases, etc.I might open source I3d. Im trying to decide if Im going to make I3d the Libaudioverse example or not. I3d is probably not too helpful to anyone trying to learn, however, as it tries to be a somewhat accurate simulation and uses all 3 dimensions (I heard from those I gave copies to that it was quite fun to play, but got called away from it by other projects). If the goal is teaching people things, Id not do a side-scroller as this project; you could, but you probably also n
 eed a set of tutorials explaining how various things work. A well-done space invaders, dodge the incoming objects, or similar is a much happier place to start. And avoid first-person shooters if the goal is teaching people: all the complexities of a side-scroller plus a heavy dose of trig.

URL: http://forum.audiogames.net/viewtopic.php?pid=182537#p182537




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: help programming a game...

2014-07-27 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: help programming a game...

The fix can range from add in some missing braces to youre screwed. Since this was intentional, I can say with 99% certainty its the latter. Unless you are very familiar with the code, you will not be able to restore it if huge chunks go missing; it is very doubtful that anyone else can. The only fix for this is to have procedures in place: a version control system prevents accidents and a frequent backup policy, especially to a server that only someone very trusted has access to, prevents malice. A distributed version control system (either Git or Mercurial) can also help because, if someone goes far enough to wreck histories, someone else probably has an offline copy. But as for recovering or fixing what you have, unless youre very lucky and its just some missing braces? it may honestly be better to restart from scratch.Sorry that I cant give better news. This is a serious
  thing. If you did it at a job and went far enough to actually, truly destroy something (companies typically have the stuff I mentioned in place), your career and future life without massive legal proceedings would be over. The company for which you worked would probably also be ruined for the simple reason that meeting deadlines on their products would have, overnight, become almost laws-of-physics impossible.

URL: http://forum.audiogames.net/viewtopic.php?pid=182389#p182389




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: is coding in python easy? just interested

2014-07-26 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: is coding in python easy? just interested

SoundRTS is pygame. I have the source on my hard drive, now that its open source. The code is very unpythonic, so be warned if you decide to dive in: my 30-second glance shows at least 3 Python stylistic and best practice violations. This sounds like Im being pedantic, but its important to follow the best practices and style guide of your language if your language bothers to give you one (google python pep 8, follow it religiously, youll thank me later when you suddenly dont have to look up if thats a function and when people arent laughing at your code. The only concession I allow is 1 tab instead of 4 spaces, and obviously some of the alignment points are basically impossible for us).As for sounds, loading sounds into ram at game startup is slow in everything. Even C++. Even more so if its not .wav files--ogg and mp3 can easily take a while, not to mention expanding to twice or three 
 times the size.And as for pan, if this is something you consider hard, then open source your panning module. The reason its easy in BGT and the reason its somewhat harder in other languages is because people write stuff and keep it to themselves. Since so many people have trouble with this and youve presumably got one, give it to the community.

URL: http://forum.audiogames.net/viewtopic.php?pid=182203#p182203




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: is coding in python easy? just interested

2014-07-26 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: is coding in python easy? just interested

You dont want to throw sounds out unless you have to. The issues that can cause are complex, but basically boil down to hard disk I/O issues. If you want to make a cache, which is the right way, you should look at the weakref module, but dont throw them out when done.Basically what happens is, everything is fine until it gets to a computer with a slower hard drive or less CPU power. Alternatively, someone tries to make a game that wants to load 10 or 15 sounds at once for *immediate* playback, and the entire thing stalls because the hard drive just cant.There are 3 solutions to this.The first is to just load everything at game startup, the beginning of a level, or some other time. This first option works until you or someone using your code gets too big for ram, which almost never happens. The key here is that you dont want to duplicate sounds that are already loaded: you have to make info on where the sound i
 s panned separate from the sound itself. If you dont youre looking at each in-game sound from the same file taking as much ram as the size of the file or more if the file was encoded.The second option when the first becomes too slow is to load all sounds, but use something like the futures module, or some other multithreaded solution. In Python, this isnt complex at all so long as they dont need to share state (they dont). For most games, if they reach this point, its the third that you actually want and not this one.The third way is called a cache. Its like your browser cache in most respects, if youre familiar with that. Supposing that youre not handing out sound objects and are referring to sounds by file, the idea is that you load 20 or 30 or 50 and then stop. Pick a number, any number. When the user of the library requests a sound that isnt loaded and the cache is a
 s full as you allow, you kill one of the loaded ones and bring in the new one. My preferred strategy for this if I had to give one would be least used gets dropped; other options include least recently used, smallest, largest, etc. One of the things you can do is make cache size based on how much RAM its using: for a given sampling rate, its the size of the sample format (2 for 16-bit or 4 for 32-bit) times the sampling rate times the total time of audio in the cache.But where this last one really shines is this. If sounds are objects and not just one-off events (you want to support this because then you can move it without stopping it playing, among other things), then you can take advantage of the language. Each sound object containing panning info and etc, points at a sound data object. You can keep these data objects in a dict by file name and, when a new sound is requested, look it up there. The magic is that there is a type
  of dict in python called the WeakValueDictionary. When nothing else in the program is using the sound data object, it will automatically be removed from the dict. This means that, if the lookup fails, you just load and add a new one. No special code is needed for removal, and the game coder using the library is responsible for, say, not loading 500 hours of audio into ram at once.But sharing the files behind the scenes and not constantly reloading the files are both very, very important musts.

URL: http://forum.audiogames.net/viewtopic.php?pid=182214#p182214




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: is coding in python easy? just interested

2014-07-26 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: is coding in python easy? just interested

Im not sure, as my familiarity with sdl_mixer is lacking. You may end up needing to create a duplicate when you actually want to play it, which is okay. The thing that you want to avoid is reloading sounds that are already loaded; if a copy is needed for playback, you can probably live with it.The sdl_mixer that Im thinking of is a C-only thing. If you mean Pygame, it separates them, as I recall. That is, channels are responsible for playing and sound objects hold the actual data. the disadvantage with Pygame is that youll have to work out a channel reuse strategy--the built-in ones are sufficient only for very basic things.

URL: http://forum.audiogames.net/viewtopic.php?pid=182219#p182219




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: movement and turning for an fps.

2014-07-20 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: movement and turning for an fps.

Im with CAE here...the restrictions dont actually make sense without a rationale or example.Velocity is a unit vector (dx, dy) representing a facing direction and some constant v representing movement speed, such that the next position of the player is (x+v*dx, y+v*dy). If you turn, dx and dy both have to change; the only time either of them is 0 is if one is facing one of the 4 cardinal directions.If youre trying to make aiming separate from movement, you can do that: simply record the movement facing direction separately, and give separate keys to change it. I feel like youre trying to make navigation easy in that you cant walk anything but north/south/east/west, but also allow for actual aiming. The problem there is that it leaves no reliable way for me to get closer or further away from the enemy or, should the game be smart enough to simulate bullets (and you want this!) reliably strafe (also known as side-stepping).
 But the math is easy enough, though the equations I could give you will not do what you expect without stating conventions. The problem on these forums is that everyone is using a different set: some, like myself, follow trigonometry; some expect positive angles to mean clockwise; and some expect 0 degrees to mean north or west or up or etc. So we need to know three things: what/why are you trying to achieve, what do you consider a facing direction of 0 degrees, and can you deal with positive angles of rotation being counterclockwise? Im assuming BGT, or Id tell you a set of conventions you should obey and then point you at one of the many, many libraries that does this kind of math plus a billion other things besides (some to many of which you will want once you learn what they mean).

URL: http://forum.audiogames.net/viewtopic.php?pid=181455#p181455




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Sound Libraries

2014-07-18 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: Sound Libraries

Im using Portaudio for the moment. It doesnt matter what I use, though: the audio output is completely separate from the mixer and, in fact, you could write your own if you were so inclined. The audio output code lives in a corner by itself. I will need to talk to it directly in future, but Portaudio works well enough for testing. There are unfortunately some latency issues Ive not yet tried to fix, so I may have to drop it.But tbh, that code is the simplest code in the entire thing. Libaudioverse is somewhere around 2500 lines at this point, and the portaudio code is somewhere around 85 of them. Ripping it out and replacing it with the stereotypical multi-backend decider that a lot of people use (that is it looks at whats available and automatically picks the best library for your platform) is going to be the the work of a day, and it can fall back to Portaudio until I write better backends. All t
 hese do is provide a way to send samples to the sound card so it doesnt matter what you pick-theres no particular advantage in terms of DSP, only in lower latency.Also, I think our definitions of easy are different. Most audio APIs that provide for only sample output are easy: learning to use one and integrating it with something else takes something like 2 or 3 hours tops for me, especially since the mixer does not know about the audio API. I consider nothing about them difficult. There are much harder programming problems for Libaudioverse; actually writing audio backends isnt one of them.

URL: http://forum.audiogames.net/viewtopic.php?pid=181160#p181160




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: creating status sounds in python

2014-07-18 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: creating status sounds in python

Libaudioverse currently has Sine. I havent added the others yet, but can do so in like half an hour: they are useless for testing purposes, so I didnt bother. the code from the Sine wave works for all of them, I just ahve to point it at a table representing the other shapes. More useful to your current problem, though, is that Libaudioverse can pitch bend files in the way just described. You could create your audio progress bars by just looping and pitch bending a file, which gives much more interesting sounds.I give no ETA on a release. It will be ready when its ready. Im not going to rush it: rushing leads to sub-par code. Im building a library for games, but also a research platform: a lot of Libaudioverses code is based around being able to add new effects easily. Examples of such include Waveguide synthesis (its sufficient to say that it makes string-like and piano-like sound
 s), various reverb algorithms that are good at different things, volumetric sources (giving a source a size instead of just a position), etc. Im getting very close to something I can show off, though YMMV on how good the examples make it look without tutorials. Its traditional enough in terms of how audio libraries tend to work, but not traditional with how Audiogames.net teaches new blind game programmers BGT audio libraries aught to work. But thats okay-in its current form, its 10x more powerful than the standard solutions in this community and 2 or 3 times more powerful than what most sighted games use, and Im only just beginning.

URL: http://forum.audiogames.net/viewtopic.php?pid=181175#p181175




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Sound Libraries

2014-07-17 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: Sound Libraries

I have dropped OpenAL. I think OpenAL sucks and hate it more than I can say. camlorn_audio uses OpenAL; Libaudioverse never did. I will never ever touch it again (unless someone pays me, anyway).Youre looking at it wrong. You cannot pull the frequency of a sound out given two samples--this is not what the FFT does. The FFT gives you the frequency of sinusoidal components of the sound. Figuring out the frequency, i.e. is this middle C, is something that people spend years working on. There is no mathematical tool that can give you the frequency, only a list of where the sine waves are. Having Calculus gives enough that, cobbling together bits of knowledge from all over the internet, you can build a bridge to a workable understanding. I have never needed anything after single-vaeriable calculus, nor have I yet needed to use differential equations in any form.The core of the magic isn
 39;t something you get to see until after differential equations, or at least until you understand the Laplace transform. I do not understand why what I use works, only that it does. I also spent about 6 months studying it. Theres two things that most people dont realize: DSP is as much an art as a science, at least when talking about audio, and DSP is very, very deep. Unless youre an electrical engineer or one of the few majors that needs it for everything everywhere, youre not going to know why everything you want to use works. The other thing about DSP is that, in actuality, its a discrete version of the stuff that goes into signal processing, something which has been important since the first radio, and the applications of both fields are so wide as to make audio look like an island in an ocean of possibility. Audio and images are the least important applications. How about telephones? The internet?
 sp; Analysis of waves in the ocean?

URL: http://forum.audiogames.net/viewtopic.php?pid=181046#p181046




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Sound Libraries

2014-07-17 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: Sound Libraries

Edit: Ive got no theory from university. This is all stuff I did outside school in my own time. Its perfectly doable, if you give it time and dont stop reading.I have dropped OpenAL. I think OpenAL sucks and hate it more than I can say. camlorn_audio uses OpenAL; Libaudioverse never did. I will never ever touch it again (unless someone pays me, anyway).Youre looking at it wrong. You cannot pull the frequency of a sound out given two samples--this is not what the FFT does. The FFT gives you the frequency of sinusoidal components of the sound. Figuring out the frequency, i.e. is this middle C, is something that people spend years working on. There is no mathematical tool that can give you the frequency, only a list of where the sine waves are. Having Calculus gives enough that, cobbling together bits of knowledge from all over the internet, you can build a bridge
  to a workable understanding. I have never needed anything after single-vaeriable calculus, nor have I yet needed to use differential equations in any form.The core of the magic isnt something you get to see until after differential equations, or at least until you understand the Laplace transform. I do not understand why what I use works, only that it does. I also spent about 6 months studying it. Theres two things that most people dont realize: DSP is as much an art as a science, at least when talking about audio, and DSP is very, very deep. Unless youre an electrical engineer or one of the few majors that needs it for everything everywhere, youre not going to know why everything you want to use works. The other thing about DSP is that, in actuality, its a discrete version of the stuff that goes into signal processing, something which has been important since the first radio, and the applications of bot
 h fields are so wide as to make audio look like an island in an ocean of possibility. Audio and images are the least important applications. How about telephones? The internet? Analysis of waves in the ocean?

URL: http://forum.audiogames.net/viewtopic.php?pid=181046#p181046




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: creating status sounds in python

2014-07-17 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: creating status sounds in python

The difference between pitch bend and increasing the frequency and resynthesizing is that pitch bend works everywhere. To pitch bend something, you manipulate the buffer after synthesis, not change the loop.Ill try to explain this too, since I seem to be on a role or something:We normally talk about time in seconds, but we can also talk about time in samples. In sample time, 1 means advance one sample, 2 means advance two samples, etc. In the same way that we can say 12:00 is 12 hours after the beginning of the day, we can say that 12 sampletime is 12 samples past the beginning of our buffer.You can pitch bend a sound by playing it faster. What you want to do is make a second buffer. Say that we want to make something 1.2 times higher. We start by taking the 0th sample from our buffer, and putting it in the 0th sample of the new one. Bear with me on this next bit: it is not as nonsensical as 
 it sounds. We then take the sample at sampletime 1.2, that is 20% between the sample at index 1 and the sample at index 2, and put it inn as the second sample in the new buffer. We continue this pattern: the 3rd sample in the second buffer is at 2.4 in the first buffer, so 40% between samples 2 and 3, the third is at sample time 3.6, so 60% after sample 3, etc.How do you compute them, then? Im obviously being an idiot or insane or something--Im telling you to use floating point indexes. Obviously you cant, but you can take a weighted average and guess. To get the sample for sampletime 1.2, get sample at index 1 (hereafter s1) and the sample at index 2(hereafter s2). Then:offset = sampletime-floor(sampletime)
w1 = 1-offset
w2 = offset
result = s1*w1+s2*w2This is a bit like an old tape player. If the tape starts moving faster, it starts sounding like chipmunks. You continue the above pattern until the whole number part equals the length of the buffer minus 1, and stop.So why? because it works on anything. If you have a handy mathematical method by which you might synthesize a sound from a frequency, you dont need it. But really, what you have most of the time is just an array of bytes, say a piano at middle c. If you know that d is some factor above c you can pitch bend to it--this wont sound super realistic past a point, but works well enough for lots and lots of situations. Id suggest seeing if Pygame has this already, though I suspect it doesnt.If youre looking for a really cheep way to pitch things up (but not down, unfortunately--down needs the above logic), you can increase the pitch by a factor of 
 two easily. To do so, take every other sample from the original buffer and put it in a new one that is half the length. Trippling is every 3rd sample, etc. Going down in pitch and going up by decimal factors is hard, but theres the quick way for whole numbers.

URL: http://forum.audiogames.net/viewtopic.php?pid=181048#p181048




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Sound Libraries

2014-07-16 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: Sound Libraries

Ive heard that its also hard to get a hold of the papa Sangre engine, assuming you are ready to pay whatever they ask. The problem with iOS development, however, is much more fundamental: Xcode is the example of why I consider Mac accessibility to be flawed at the Voiceover level. Youre not going to enjoy developing for iOS unless you get something like Ruby Motion or know how to write custom scripts to make Xcode suck less, and possibly not even then. You can do it, its just not exactly fun--the only blind person I know doing it on a regular basis uses a Windows VM for code editing.As for why Im going to support it? Libaudioverse is bigger than the audiogaming community or the blind person. Sighted people want and need this software too, and being able to share code across platforms has become a very, very big thing in the computer science and programming world. If you wanted, you could combine Libaudioverse 
 with Sdl and write games for 5 platforms.

URL: http://forum.audiogames.net/viewtopic.php?pid=180872#p180872




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: creating status sounds in python

2014-07-16 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: creating status sounds in python

Numpy is very fast, very compact, and very capable if you know a bit of math. The main point of it with sound code, however, is memory consumption. Especially for larger buffers, the fact that Python has to use what is called boxxed types hurts you: an integer is the integer itself, plus some data saying that its an integer. In addition, python lists are actually arrays of pointers to the objects in the list, rather than the objects themselves--so youve got some extra data for that, too (its possible python optimizes this case, but I dont believe so).Numpy does a few things, most majorly storing ints as an unboxxed type. Its also got convenient syntaxes and functions for a bunch of math operations: everything from basic stuff like find the min or max in an array through convolution, the FFT, trigonometry, and a bunch of matrix operations. The list is so extensive that I cant recall them all without looking at 
 the docs, but anything mathematical in python typically brings Numpy in (I use it, for example, to make .hrtf files from the MIT kemar Hrtf dataset for Libaudioverse). The problem in terms of this discussion is that were discussing something primarily mathematical as an abstract and qualitative thing, but the examples of how to do this assume that youre capable and willing to use things like Numpy (and tbh Numpy will let you do stuff like trivially apply and design filters, though I havent done that there myself). It is worth noting that Numpy docs tend to be accessible, at least if you know LaTeX a bit.

URL: http://forum.audiogames.net/viewtopic.php?pid=180895#p180895




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: creating status sounds in python

2014-07-16 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: creating status sounds in python

Heres the other thing about this. People only use those four because sine waves add together to make interesting sounds and the rest make interesting sounds when filtered and detuned, especially if you can have moving filters and all sorts of stuff. The thing here is that youre never going to have interesting sounds synthesized in realtime without a sound library or enough knowledge of Numpy and math to fake it. The other wave shapes dont exist like you think they do. When we start talking about complex sounds, we start talking about them in terms of the volumes of the sine waves that make them up. There is only one basic wave, the sine wave, and all other waves can be described in terms of it.I didnt want to go into this because it brings up more questions until you actually work with it and requires knowledge of both notations for complex numbers for any sort of quantitative understanding, but I think a qualitative desc
 ription is in order.There is a thing called the FFT, for the Fast Fourier Transform. As I said, every sound in all the world is made of a sum of of sine waves--specifically, for a fully precise representation, you need an infinite number of them. But computers are quantized and only capable of a certain precision, so we can make it finite in computer land (and, in all honesty, its possible to make it finite in real life for many cases). instead of talking about adding specific sine waves, we say were going to add sine waves at certain frequencies always and specify the relative volumes and phases of them--a sine wave thats ignored simply has a volume of 0. The phase is when they start: the part I glossed over is that we dont have to start all the waves at the same time--we might start 1000 hz at time 0, hold 1001 hz until time 0.2, and the like. This system can let you talk about manipulations of sounds in a meaningful mann
 er: one way to apply a lowpass filter is to apply the FFT, turn down all the frequencies you consider high, and then undo the FFT to get a sound you can play out of it.So what happens in real life, when you get your music synthesizers and whatnot, is one of 3 things: we do our analysis and resynthesis off the FFT, we get a complex wave shape by recording and pitch bend it in realtime (which is trivial, believe it or not), or we start from the basic shapes and apply filters and effects. The first of these is really, really, really rare. The second of these also brings up an interesting point: those other waves can and usually are either recorded and cut down to one period or simply drawn with a mouse.How exactly we get from here to code, though, hits the wall of I know math really, really well. Basically, you can pretend that its one second of audio no matter how many samples you have and then choose to play it back--its the same reason
 ing I gave for the basic functions, only this time the function comes from a table and you interpolate between values with a weighted average or, in the few cases you need it, a more complex algorithm called a spline. Im too tired at the moment to write sample code for the weighted average approach: its simple enough, but its also where one of those issues with floating points is hiding, and I dont want to work it out again in Python. It comes down to like 10 lines, however.As for programmatically working with the FFT, I suggest not doing that. You need trig and knowledge of complex numbers to figure out how to interpret the results and its the opposite of intuitive. Finding or working out sample code to do pitch bend, either yourself or with Pygame, is worth it: you can record a wave file and just pitch bend it, which gives you a great number of interesting sounds for what is--in the grand scheme of things--barely any code
  (pitch bend is my weighted average thing again).Im sorry this explanation cant be more clear. Im trying very very hard to avoid words like magnitude and angle of a complex number, frequency bins, and the like. If you want to learn about this stuff, I suggest installing Pyo, reading its tutorials, examples, and documentation, and trying stuff. You can come to a practical understanding of the FFT without math, but the only way to do so is to play with it in an accessible environment. One way to get access to something FFT-like is to play with Audacitys equalizer. The funny thing is that its good at describing sounds but not so much at synthesizing them: the filtered waveform approach is more common. Pyo can let you play with this, too, either using wave files or the basic shapes.basically, from here out, your road to understanding is experimentation more than anything. You dont have the pr
 etty pictures and cute diagrams, nor the math to understand the equations. Therefore, the best thing you can do is play and listen to the results.

URL: http://forum.audiogames.net/viewtopic.php?pid=180922#p180922




___

Re: Sound Libraries

2014-07-15 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: Sound Libraries

@sljI do not have access to the Papa Sangre engine. It does not run on anything thats not iOS, and is of little interest to me because of that. I would also need to pay for access. iOS and Android are in the works for Libaudioverse, but dont expect anything on that front for 6 to 8 months (iOS requires super-optimization. Compiling for iOS is quick, but being able to run effectively in realtime is hard). The mixer itself is pure Ansi C++11 and I make an effort to never violate the standard.@frastlinIm not familiar enough with those programs to see how your analogy compares to what is actually going on. Each input can be connected to *exactly* one output, though an output can go to any number of inputs. The specific process of sharing an effect, therefore, is the construction of a mixer with, say, 32 inputs. You then send that output to the shared portion and connect your objects to its input
 s. This is the low level again, however-the 3d simulation is much simpler. I made sacrifices and compromises to be able to run as fast as Im running: one of these was an implicit mixer at each input. Pyo sort of does this and a bunch of other stuff. The result is an audio library that cant do powerful things in realtime for games and only works for Python. If youre looking for something it is similar to, go look at the Pyo tutorials and then think about how great that would be if it was fast enough to run in realtime while handling 100 sources of audio, reverb, and music (Bryan Smart did Headspace, but only gets 16 sources out of it total as I recall).The way something like footsteps will work is as follows. Sources are merely speakers and get their audio from something else. In this case, its a node that reads a file. What Im going to do is add support for queuing files and a callback that tells you
  when its finished one of them. What you do then is put your walking code in the callback and decide what sound you want to play. This is something I ran into with Camlorn_audio, and it was only solvable with the creation of--you guessed it--threads. If you dont want anything playing right now, you just dont queue the next one. To avoid issues with threads, youd typically do this by telling your main loop to call that deciding code (every language possibly including BGT provides a threadsafe flag, so the callback becomes something like 3 lines and the main loop just does a standard if(should_decide_next_footstep)).The thing to remember is that libaudioverse separates 3D simulation completely from how the audio is arriving: objects can be files, urls, midi synthesizers, etc. You then tell a source to read from one of them, controlling characteristics specific to files through the file object. This is a little hard to e
 xplain in forum post appropriate length, but there will obviously be tutorials and examples. This is going to be commercial and better come with docs. Regardless, the 3D simulation could care less as to where it gets audio from.The benchmark works as follows. It starts by creating 10 sources connected to sine wave objects and synthesizing 5 seconds of audio from them (Libaudioverse can synthesize to buffers instead of the sound card). It times this and, if it is less than 5 seconds, runs the test again with ten more. The benchmark is capable of synthesizing 5 seconds of audio in 5 seconds for anywhere between 100 to 200 sources, depending on the aforementioned factors. Because there is a lock on the device, actually making Libaudioverse take 100% of the time for synthesis will block your code as you call into it, so its lower--as I said previously, 100 is what can probably be expected on a PC from the finished product after a bit of op
 timization.And Im going to be applying to MIT, probably Stanford, and possibly a few other places Ive not found yet in the fall. Im not stopping at a masters program. Im going all the way to doctorate, if at all possible.

URL: http://forum.audiogames.net/viewtopic.php?pid=180765#p180765




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: creating status sounds in python

2014-07-15 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: creating status sounds in python

All right, here goes. Im going to show how we get from the statement I want to make a sine wave to I have a buffer that contains a sine wave, including all the reasoning. Trig is not required, so long as youre willing to accept the things I say about the sine function--and then, the view of the sine function in audio is different from that in trig, anyway. This is long. I will entertain questions. There are no complete programming examples because the programming is very unimportant.A lie about your SpeakerThis is a lie about your speaker. It is true enough to be useful, while not actually really being true. Pretend that youve got a spring and a plate on the end of it. The plate will naturally sit at some position, which we will call 0 units. You can push this plate inwards, say to -5 units. you can pull this plate outwards, say to 20 units. In our hypo
 thetical lie-brand speaker, this spring can be contracted and expanded by an electrical signal. Say that the minimum contraction is at -5 volts and the maximum expansion is at 5 volts. By rapidly varying the voltage applied to this speaker, we can vibrate the plate in a predictable pattern.Different speakers have different ways of talking to them and different minimum and maximum voltages. Your sound card sits between your program and the speaker and deals with this for us. The minimum and maximum value depends on the format of the buffer--for a 16-bit int, its something like -32767 to 32767 (I dont have the maximum values of different int sizes memorized). most audio programmers prefer to use -1.0 to 1.0, and thats what Im going to use here. Getting from a buffer from -1.0 to 1.0 is simply a multiplication by the maximum value in the new format, and virtually everything these days will let you just not bother and set
  the audio format to float. Im going to come back to this buffer at the end, but its enough to know for now that if our function ever goes above 1.0 or below -1.0, its bad. The minimum contraction corresponds to -1.0 and the maximum expansion to 1.0.Continuous-time audioEvery sound in the real world is a continuous mathematical function that cannot go to infinity or -infinity. Your footstep, your car, everything. This is different from the computers notion of audio, which is at the end of this post.Im not going to start with a sine wave, because its complex. Im going to start with a sawtooth wave because this lets me demonstrate how this works before adding a complexity that the trigonometric functions bring in. The % operator means remainder, i.e. 2%3 is 2, 4%3 is 1, 9%3 is 0, 12%3 is 0, and 13%3 is 1. Furthermore, this is defined on floating point values: 2.5%2 is .5, 4.
 7%2 is .7, 5.3%2 is 1.3. You can try the following mathematical function in Python, if you want to see what it looks like-but Ill tell you. It goes up at about a 45-degree angle from 0 to 1, drops back down to 0 at 1, and then goes up again from 1 to 2, and so on. For the purposes of this post, t represents time in seconds and must start at 0--time is never negative.So, that said, lets derive a sawtooth wave. The function representing a sawtooth wave is simply t%1. Since this function repeats every 1 second, we say that it has a period of 1 second.theres two problems. I said that the minimum and maximum value need to be -1.0 and 1.0 respectively. This function has a minimum value of 0 and a maximum value of 1. Furthermore, the frequency of this function is too low--specifically, its 1 HZ, well below the human hearing range. So lets fix them.The first problem is easy. If I mult
 iply the function by 2, its minimum value stays 0 and its maximum value becomes 2. The way I get from here to the range we want is to subtract 1. This gives:2*(t%1)-1Which is a 1 HZ sawtooth wave at maximum volume--that is, its minimum value is -1.0 and its maximum value is 1.0.The next thing we want to do is to make its frequency change on demand. The period of a function a is related to its frequency by frequency=(1/period). Say we want to make it play at 500 hz. By basic algebraic manipulation, we can see that the period needs to be 1/500th of a second. We basically want t to move faster--to go through 500 periods between t=0 and t=1. We can get this effect by replacing t with 500*t.2*((500*t)%1)-1But something similar holds for all frequencies. Let frequency in hertz be f. How about this?2*((f*t)%1)-1Which is a sawtooth wave at any frequency. It will repeat f t
 imes a second instead of just once per second.The Sine WaveSo lets apply this process to the sine wave. The minimum value of the sine function is already -1 and the maximum value of the sine function is 1, so were all good there. The period of the sine function is a bit tricky, however: its 2*pi--if you just do sin(t), its going to repeat every 2*pi seconds.The first thing we have to do is get rid of the 2*pi period. We want to use the above derivation, which works only on functions with a 

Re: creating status sounds in python

2014-07-15 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: creating status sounds in python

All right, here goes. Im going to show how we get from the statement I want to make a sine wave to I have a buffer that contains a sine wave, including all the reasoning. Trig is not required, so long as youre willing to accept the things I say about the sine function--and then, the view of the sine function in audio is different from that in trig, anyway. This is long. I will entertain questions. There are no complete programming examples because the programming is very unimportant.A lie about your SpeakerThis is a lie about your speaker. It is true enough to be useful, while not actually really being true. Pretend that youve got a spring and a plate on the end of it. The plate will naturally sit at some position, which we will call 0 units. You can push this plate inwards, say to -5 units. you can pull this plate outwards, say to 20 units. In our hypo
 thetical lie-brand speaker, this spring can be contracted and expanded by an electrical signal. Say that the minimum contraction is at -5 volts and the maximum expansion is at 5 volts. By rapidly varying the voltage applied to this speaker, we can vibrate the plate in a predictable pattern.Different speakers have different ways of talking to them and different minimum and maximum voltages. Your sound card sits between your program and the speaker and deals with this for us. The minimum and maximum value depends on the format of the buffer--for a 16-bit int, its something like -32767 to 32767 (I dont have the maximum values of different int sizes memorized). most audio programmers prefer to use -1.0 to 1.0, and thats what Im going to use here. Getting from a buffer from -1.0 to 1.0 is simply a multiplication by the maximum value in the new format, and virtually everything these days will let you just not bother and set
  the audio format to float. Im going to come back to this buffer at the end, but its enough to know for now that if our function ever goes above 1.0 or below -1.0, its bad. The minimum contraction corresponds to -1.0 and the maximum expansion to 1.0.Continuous-time audioEvery sound in the real world is a continuous mathematical function that cannot go to infinity or -infinity. Your footstep, your car, everything. This is different from the computers notion of audio, which is at the end of this post.Im not going to start with a sine wave, because its complex. Im going to start with a sawtooth wave because this lets me demonstrate how this works before adding a complexity that the trigonometric functions bring in. The % operator means remainder, i.e. 2%3 is 2, 4%3 is 1, 9%3 is 0, 12%3 is 0, and 13%3 is 1. Furthermore, this is defined on floating point values: 2.5%2 is .5, 4.
 7%2 is .7, 5.3%2 is 1.3. You can try the following mathematical function in Python, if you want to see what it looks like-but Ill tell you. It goes up at about a 45-degree angle from 0 to 1, drops back down to 0 at 1, and then goes up again from 1 to 2, and so on. For the purposes of this post, t represents time in seconds and must start at 0--time is never negative.So, that said, lets derive a sawtooth wave. The function representing a sawtooth wave is simply t%1. Since this function repeats every 1 second, we say that it has a period of 1 second.theres two problems. I said that the minimum and maximum value need to be -1.0 and 1.0 respectively. This function has a minimum value of 0 and a maximum value of 1. Furthermore, the frequency of this function is too low--specifically, its 1 HZ, well below the human hearing range. So lets fix them.The first problem is easy. If I mult
 iply the function by 2, its minimum value stays 0 and its maximum value becomes 2. The way I get from here to the range we want is to subtract 1. This gives:2*(t%1)-1Which is a 1 HZ sawtooth wave at maximum volume--that is, its minimum value is -1.0 and its maximum value is 1.0.The next thing we want to do is to make its frequency change on demand. The period of a function a is related to its frequency by frequency=(1/period). Say we want to make it play at 500 hz. By basic algebraic manipulation, we can see that the period needs to be 1/500th of a second. We basically want t to move faster--to go through 500 periods between t=0 and t=1. We can get this effect by replacing t with 500*t.2*((500*t)%1)-1But something similar holds for all frequencies. Let frequency in hertz be f. How about this?2*((f*t)%1)-1Which is a sawtooth wave at any frequency. It will repeat f t
 imes a second instead of just once per second.The Sine WaveSo lets apply this process to the sine wave. The minimum value of the sine function is already -1 and the maximum value of the sine function is 1, so were all good there. The period of the sine function is a bit tricky, however: its 2*pi--if you just do sin(t), its going to repeat every 2*pi seconds.The first thing we have to do is get rid of the 2*pi period. We want to use the above derivation, which works only on functions with a 

Re: creating status sounds in python

2014-07-15 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: creating status sounds in python

% is technically modulus. The English formula 2%3 is technically read 2 mod 3, and the definition is a bit more complicated (except in C/C++ where % really is remainder--the first thing I had to do was write my own using the bigger definition). Since were only talking about positive numbers, we dont need the complicated clock analogies and the following will do nicely:2%3=2 because 3 goes into 2 0 times with 2 left over.13%5 is 3because 5 goes into 13 twice with 3 left over.x/y says how many times does y go into x. x%y says if I put y into x however many times it goes in, whats left? You could write, though Im not sure how much it helps in understanding:x%y == x-int(x/y)*yIf were talking about ints, then x/y throws out the remainder. x%y throws out the x/y part, keeping only the remainder. Id suggest trying some examples in the Python repl to understa
 nd it.As for the definition on floats, if we say 3.5%2, were asking for the remainder of dividing 2 into 3.5. Clearly, 2 goes into 3.5 once, so we say 3.5-1*2, which gives us 1.5. Since its defined on floats, we can do 0.75%1--1 goes into 0.75 0 times, with a remainder of 0.75, so the result is 0.75.The following Python lines may prove illuminating:[i%5 for i in xrange(15)]
[(float(i)/3)%1 for i in xrange(9)]The last is the sawtooth wave taken every 1/3rd of a second at frequency 1 hz (we dont have to write *1).And heres a more algorithmic but 20 times less efficient approach that might be clearer for those who dont get algebra:def remainder(x, y):
 while(x  y):
  x-=y
 return xHopefully this clears it up.

URL: http://forum.audiogames.net/viewtopic.php?pid=180790#p180790




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: creating status sounds in python

2014-07-15 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: creating status sounds in python

Edit: Ive left my original explanation below, but it came to my attention that I may have misunderstood a comment of yours to mean that youre expecting it to return two values. If this is not the case, you can stop--it returns the remainder. Nevertheless, the below provides a good deal of examples and such that might make it clearer, all be it the explanation may be too basic for some. I do discuss how it can be defined on decimals, though, which is something most people dont know.% is technically modulus. The English formula 2%3 is technically read 2 mod 3, and the definition is a bit more complicated (except in C/C++ where % really is remainder--the first thing I had to do was write my own using the bigger definition). Since were only talking about positive numbers, we dont need the complicated clock analogies and the following will do nicely:2%3=2 because 3 goes into 2 0 times with 2 left over.1
 3%5 is 3because 5 goes into 13 twice with 3 left over.x/y says how many times does y go into x. x%y says if I put y into x however many times it goes in, whats left? You could write, though Im not sure how much it helps in understanding:x%y == x-int(x/y)*yIf were talking about ints, then x/y throws out the remainder. x%y throws out the x/y part, keeping only the remainder. Id suggest trying some examples in the Python repl to understand it.As for the definition on floats, if we say 3.5%2, were asking for the remainder of dividing 2 into 3.5. Clearly, 2 goes into 3.5 once, so we say 3.5-1*2, which gives us 1.5. Since its defined on floats, we can do 0.75%1--1 goes into 0.75 0 times, with a remainder of 0.75, so the result is 0.75.The following Python lines may prove illuminating:[i%5 for i in xrange(15)]
[(float(i)/3)%1 for i in xrange(9)]The last is the sawtooth wave taken every 1/3rd of a second at frequency 1 hz (we dont have to write *1).And heres a more algorithmic but 20 times less efficient approach that might be clearer for those who dont get algebra:def remainder(x, y):
 while(x  y):
  x-=y
 return xHopefully this clears it up.

URL: http://forum.audiogames.net/viewtopic.php?pid=180790#p180790




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: creating status sounds in python

2014-07-15 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: creating status sounds in python

Edit: Ive left my original explanation below, but it came to my attention that I may have misunderstood a comment of yours to mean that youre expecting it to return two values. If this is not the case, you can stop--it returns the remainder. Nevertheless, the below provides a good deal of examples and such that might make it clearer, all be it the explanation may be too basic for some. I do discuss how it can be defined on decimals, though, which is something most people dont know. I also apparently posted at the same time as CAE.% is technically modulus. The English formula 2%3 is technically read 2 mod 3, and the definition is a bit more complicated (except in C/C++ where % really is remainder--the first thing I had to do was write my own using the bigger definition). Since were only talking about positive numbers, we dont need the complicated clock analogies and the following will do nicely:2%3=2 beca
 use 3 goes into 2 0 times with 2 left over.13%5 is 3because 5 goes into 13 twice with 3 left over.x/y says how many times does y go into x. x%y says if I put y into x however many times it goes in, whats left? You could write, though Im not sure how much it helps in understanding:x%y == x-int(x/y)*yIf were talking about ints, then x/y throws out the remainder. x%y throws out the x/y part, keeping only the remainder. Id suggest trying some examples in the Python repl to understand it.As for the definition on floats, if we say 3.5%2, were asking for the remainder of dividing 2 into 3.5. Clearly, 2 goes into 3.5 once, so we say 3.5-1*2, which gives us 1.5. Since its defined on floats, we can do 0.75%1--1 goes into 0.75 0 times, with a remainder of 0.75, so the result is 0.75.The following Python lines may prove illuminating:[i%5 for i in xrange(15)]
[(float(i)/3)%1 for i in xrange(9)]The last is the sawtooth wave taken every 1/3rd of a second at frequency 1 hz (we dont have to write *1).And heres a more algorithmic but 20 times less efficient approach that might be clearer for those who dont get algebra:def remainder(x, y):
 while(x  y):
  x-=y
 return xHopefully this clears it up.

URL: http://forum.audiogames.net/viewtopic.php?pid=180790#p180790




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Sound Libraries

2014-07-14 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: Sound Libraries

Well, to provide concrete details of what I have (a more detailed and much more technical blog post is around the corner, but I want a couple more things done first):the library consists of objects that you connect. Think of objects as boxes with ports on them--each port can have a wire connected to it. Out of each box also comes a number of wires which you can split as many times as you want. Ports represent audio inputs and wires represent audio outputs. Each box takes audio from its inputs, does something to it, and then spits out audio on its outputs. In addition, boxes also have switches and dials--the properties--that let you control exactly what the boxes do. Examples of boxes include the mixer (combines multiple audio sources), the panner (pans audio with or without Hrtf), the limiter (prevents audio from going above 1.0 or below -1.0--this is needed to prevent odd things on some sound cards), the file node, the sine wave generator
 , and a bunch of others that Im in the process of writing. This is the level you would work at for writing a custom simulation of your own, music software, media players, voice streaming, etc: Libaudioverse is by no means Audiogame specific. camlorn_audio was, which was a mistake and also had to do with the fact that OpenAL tries to be game specific, too.The next level up and what most people are going to want is the 3D simulation. You create an environment, which is an object with a bunch of properties on it representing things like room size and echo and reverb--basically whatever I code. You then use this environment to create sources. On the environment is a pair of properties that specify the position and orientation of you, known as the listener in audio land. Each source has properties representing its position, orientation (it will be possible to make sources that sound different if theyre facing away from you, i.e. simul
 ate speaker playing music), size (specified as the maximum distance at which the source is to be audible), and other things. While the usage of the first set of objects is not simple, the usage of this set is extremely so, involving something like 2 function calls to initialize at program start and 1 to create a source.Finally, the library will provide callbacks. I am going to implement those tomorrow and doing so is going to be trivial, but they needed some now-completed infrastructure first.Ive been working on this since the summer began, and Im about 75% to an alpha release. one of the landmarks is going to be reimplementing Unspoken on top of it--the thing libaudioverse can do that camlorn_audio cant even now is integrate itself with NVDAs audio APIs. The reason that it hasnt gone faster is because I needed to implement a general and flexible infrastructure and I chose C over C++ (see the link I linked in m
 y last post). I now have the ability to turn out new bindings in a day at most, and Python already works (Ive not released because its still missing essential features and the bindings are still a bit raw-nevertheless, they are completely functional). The 3D simulation is lacking in features but works, and the library has full Hrtf support. I have the ability to implement literally any type of LTI filter, and quite a few things that arent (this means things to people who know about DSP, but translates to lowpass, highpass, bandpass, band-reject, dc blocker, and a few other things to those who dont).As for performance, I have written a benchmarking program. The benchmark can manage anywhere from 100 to 200 sources in realtime on a single core and without SSE. Specifically what I get depends on background processes and whether the last change I introduced is doing something stupid and inefficient. In real program
 ming, for a variety of reasons, this is going to translate to 70-100 playing sources for most people. If you create too many, the mixer will be too busy to answer requests from your code in a timely manner, consequently dropping your frame rate (theres a device lock). There are 2 optimizations I have yet to implement. One of these makes it scale to the number of cores you have (its currently only using one) and one is SSSE. I expect each of these alone to increase the performance by at least a factor of two. The HRTF I am testing with is a 128-point response, which sounds twice as good as the one OpenALSoft lets you get away with; given that Im getting this many sources, if I made the sacrifices OpenALSoft does, Id be outperforming it already (its default HRTF takes 4 times less computing power). I can make those sacrifices; perhaps better, I can leave those sacrifices in your hands if you want them. If you aren
 t using HRTF, consider the number of playing sources unlimited.Finally, I am not planning to sell bindings separately and you will be able to use it for free if your app is open source. Im going to work out some pricing schemes that depend on how much you want to sell the app for, with a 

Re: is coding in python easy? just interested

2014-07-13 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: is coding in python easy? just interested

Modern _javascript_ does audio synthesis and is just-in-time compiled on some browsers--on a modern browser, doing that shouldnt be a problem.As for collision detection, yeah. This is one of those programmer knowledge thing. The specific optimization that youre looking for is a data structure called a spatial hash, but its so much easier not to bother and to use ODE or Box2d which implement it plus a bunch of other optimizations and stuff.

URL: http://forum.audiogames.net/viewtopic.php?pid=180570#p180570




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: is coding in python easy? just interested

2014-07-13 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: is coding in python easy? just interested

Well, the thing with the physics simulators is that you dont have to use them as such. If you so choose, just plug in your shapes and ask if they collide. If you dont tick it, it doesnt simulate. This may not be true of Box2d, but it is true of ode and some others.What youre actually describing is voxels. In that case, converting the voxels to a trimesh and culling the triangles that form surfaces between voxels can quite possibly be efficient (even more so if you divide it into multiple trimeshes intelligently). If you are using Ode for collision and simulation, it looks like you have to do this (I havent tried) because Ode apparently has problems with flush edges. If you only want to use Ode for collision, make each voxel a 1x1x1 meter geom, and use their spatial hash (you will get multiple contact points when the player is on an edge but, because the simulation isnt being handled by Ode, its not
  going to literally explode). trying to make a sidescroller that is accessible and workable with Box2d being used for *all* simulation is on my to-do list, simply because it would be moving us away from the discrete tile approach. In addition, it can handle proper simulation of things like bullets; that is, objects that have velocities so high that they move multiple lengths in one tick. Perhaps even more fun, it can handle ricochet, though using this for gameplay purposes is probably not doable in a side-scroller (it might be in a first-person game, however). Also, that possibly means wall jumps.And this thread just went very off topic.

URL: http://forum.audiogames.net/viewtopic.php?pid=180584#p180584




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Sound Libraries

2014-07-12 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: Sound Libraries

Core audio is not like Direct Sound. Core audio, should it be available for windows, would invalidate all audio work I have ever done. Ever. Its the most advanced sound library Ive ever seen, save Pyo which has major speed issues and is Gpl (with no commercial version). Confusingly, there is also a core audio on windows, but its not the same-the Windows core audio is an extremely low-level way of talking to the device.To be 100% clear on OpenALSoft, the source limit is not the end of the world. You can get around it if youre clever, but this cleverness is not at all simple. OpenAL splits audio into sources and buffers. A source represents information on location in 3D space, cones, and some other stuff. A buffer holds audio. You attach buffers to sources. The problem is that all properties of a source are needed for audio so, in order to share a source between sounds, youve got to
  write a not-so-small intermediate layer that remembers what the source used to be set to--i.e, you have to make your own source object that supports having the actual source pulled out from under it. If you dont attach a buffer to a source, it takes basically zero space and zero CPU, yet we can only reliably have a couple hundred without hacking OpenALSoft itself (he says he wants to remove this limit, maybe he did, but there are others just as annoying). This is the *least* of the issues I had with OpenALSoft-Ive mentioned the rest here and here. The other reason I ended up doing my own is that OpenAL is rigid: you get a source, at most 4 effects in parallel, and then the sound card, but theres a bunch of stuff that can be done if the library lets you actually manipulate the sound graph yoursel
 f (i.e. synthesizers, making audio radars becomes much easier, get a copy of the audio stream without hassle, and a friend of mine has an idea for environmental reverb that might actually let you hear the shapes of rooms).Of the libraries listed here and disregarding 3D audio, Bass is good. SDL is just a low-levle wrapper around the sound card unless you also use SDL_Mixer, and Fmod now uses a graphical studio thing like most of the commercial offerings. Irrklang is also something worth looking at in that its supposed to be very simple, but Ive not used it. The python options for easy audio include Pyo (powerful, will take an hour to learn but is the most flexible, has major, major speed and latency issues and primarily aimed at research), PyAudio (low-level wrapper over Portaudio, may be useful but will require writing a mixer), and Pygame (looks easy enough, limited API, cant do too much with it but its sufficient for i.e. SoundRTS o
 r Shades of Doom quality sound). The additional windows option is XAudio2, but this is C++ or maybe C#, may or may not have latency issues, and looks extremely complicated.Thats the limit of my knowledge.

URL: http://forum.audiogames.net/viewtopic.php?pid=180474#p180474




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: creating status sounds in python

2014-07-12 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: creating status sounds in python

Is explanation still wanted? I dont want to type up a long explanation of how basic sound synthesis works unless someone actually wants to read it.

URL: http://forum.audiogames.net/viewtopic.php?pid=180476#p180476




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Computing project

2014-07-12 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: Computing project

Since today is my find old audiogames.net posts:The speech solution for python is Accessible_output2, here. You will need mercurial to pull it down. It works on Windows and, I believe, Mac and Linux. It may (low probability) have a bug with Jaws and NVDA being installed at the same time, but no one has been able to send me a test case and I dont have Jaws installed so Ive not been able to fix it (if someone wants to tell me what is going on, if its even bugged at all, I have the power to do so). Binding universal speech with ctypes is also the work of like half an hour if you dont know ctypes (and if you do, 10 minutes max).But youre never going to be able to switch from a window to the console and back, so getting Pygame working without a window or more preferably screen reader speech is what you want (I also believe windowless Pygame for audio is doable, but do not ha
 ve great familiarity with Pygame).

URL: http://forum.audiogames.net/viewtopic.php?pid=180478#p180478




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Sound Libraries

2014-07-12 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: Sound Libraries

I already have started fixing this problem for real, but Im not accepting contributions because its going to be commercial. Before everyone jumps on me, Libaudioverse will be free for open source games by virtue of being GPL--if youre going to force closed source and still be free, you can probably afford whatever I decide (Im thinking $20-$30 for these games) or open source your game because, you know, its free anyway. I can offer commercial licenses by virtue of being the only contributor and/or getting copyright agreements in place, which is why Ive not been screaming for help. Ill probably have something releasable in 1-3 months--I finally got past a bunch of stupid low-level infrastructure, managed to solve the bindings problem (my bindings maintain themselves, no human required), and correct the mistake of choosing C over C++11. I
 m going to write something on my progress shortly, as it is now significant enough that I can actually have a meaningful article. There will also be something else on how I fixed the bindings problem as at least one friend of mine thinks that its worthy of Hacker News.Unfortunately, I dont think collaboration will work. There arent enough people on these forums with enough knowledge of mathematics. The only reason that Ive managed to get where I have is because I went to college, got through Calculus 2, and spent about 6 months hammering my head against DSP until I was able to build a mental framework of whats going on. This is not an easy problem mathematically nor programming-wis: if youve not had at least calculus, youre not going to be able to understand anything beyond pan. All of the explanations involve derivatives and integrals, complex numbers, raising complex numbers to exponents, and usually Eul
 ers identity. At least 3 of those also involve non-trivial trigonometry. The current libraries are where you get without this knowledge-going further requires it. The Libaudioverse repository is about to hit the thousand-commit mark, to give some idea of the scope of the problem. The reason that camlorn_audio used OpenAL instead of a custom mixer is that, when I wrote it, I hadnt made the journey through DSP hell. And my grasp of DSP is still not complete, merely complete enough that I can do useful and cool things.Its also not something you understand by reading code. Code does not tell you the original formulas or why youre suddenly adding and subtracting x and y. Understanding the basics of DSP is something that can only be done with mathematics, not via code examples. Sad but nevertheless true. Having the example in front of you isnt going to help much unless you know where the 20 lines of 
 magic math came from.beyond those problems, a truly powerful library is going to require at least a little familiarity with graphs (the data structure, not the kind with graph paper) and must be written in C++. To be truly fast, youre also looking at at least one of 3 things: cache friendliness, SSE, or multithreading the actual synthesis algorithms-none of these is trivial, though the last is surprisingly simple if you architect for it when you start coding. Theres also at least one lock-free algorithm at the bottom of Libaudioverses audio code: in order to properly talk to audio devices, you cant accidentally priority invert the audio thread.Im not trying to depress people or scare interested people away, but Im not going to sugar-coat it. I did DSP outside school and it took a very long time and a very lucky find of an arguably accessible resource (its go
 t LaTeX alt text) as well as reading lots of Wikipedia articles over and over. I think its a very interesting field and learning it will teach you a lot of other math in the process. But getting far enough to understand what is going on with HRTF is going to take a while-not to mention reverberation, which combines all of the DSP basics plus a bit of personal creativity; it is said that only the original designer will ever understand all the parameters in a reverb algorithm.Basically implementing a good quality DSP library takes a bunch of tricky math stuff, some computer science stuff, and a bunch of low-level issues (hello to floating point subtleties) and combines them in a blender. Most sighted programmers cant do this kind of coding, as its really a specialized domain--people specifically go to college for DSP, and the only reason I know it at all is because I spent a year or so on it.And for the record, using something like this 
 in your game is easy. Its making it in the first place that is so difficult.If people want to discuss things related to DSP, Ill try to help if I can. I have a practical understanding--the kind you can program with. Im still working towards a full mathematical understanding, but Ill get there in the end as the hardest part is behind me now. I think theres one or two others floating around this forum that understand the topic as well. My particular advantage as to 

Re: is coding in python easy? just interested

2014-07-12 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: is coding in python easy? just interested

Python is fast enough that I seriously considered (and still am, in a way) doing my MMO project in it. Game load times is not a function of language in this case-I suspect that the Pygame games under discussion are not streaming and load all sounds at game startup, which will slow anyone and anything down. Do not assume that Python is the bottleneck until you know how to use the profiler and can prove it-and even then, it is more likely the algorithm and not the language. Should Python prove too slow for a specific algorithm--rare in this day and age--you can use ctypes and implement it in C/C++, whereupon it wont be anymore. The only reason I may drop it for my MMO project is because Ive decided to take the approach of brute forcing the problem, and am suddenly talking about allocating, copying, deallocating, and generally doing stuff with a million objects a second (I dont want to get too technical, but Python is fast enough for this too
 . Im leaving it for lack of frameworks that fit the model I want to work in, because writing and optimizing my own is going to take valuable time).As for Pythons easiness: compared to most other languages Ive worked with, Python will get complex things done the quickest in most cases (and the exceptional cases Im thinking of fall under the category of research into computer science and not everyday apps or games). The indentation habits it forms make you a more valuable programmer on sighted dev teams, and tbh youll end up wanting indentation in other languages too (its much more convenient than scrolling up 20 lines with your screen reader to count the braces). I dont have specific tutorials to link as its been literally years since I first learned to program, but there is an unbelievable amount of documentation on getting started with it--I strongly suggest a quick Google search.If your specific goal is 
 an NVDA add-on, you want to learn Python 2.7. Python 3 is a rework of the language-its mostly the same, but it broke backward compatibility and has had the effect of splitting the community; were only just now seeing a merge. NVDA itself uses 2.7 and not 3. It is also worth noting that Python itself is easy, but NVDA add-ons are not: you will need enough skill to read the NVDA source, though you need not be able to actually build it yourself. NVDAs aAPI for add-ons is literally all of NVDA itself (as opposed to Jaws and WE which give you a predefined subset); there are consequently ways to replace literally everything. The downside is that the API is all of NVDA, so you have to do a bit of poking about in the source to figure out where what you want to work with is and how it works.@tward:Do you have any evidence of Python even approaching the point of being too slow for an Audiogame? The newer versions of SoundRTS (
 this was one of those its the programmers fault for not knowing the difference between an array and a hash table and not putting the UI on a different thread than the networking) handles literally thousands of units with no problem. Theres a few of us who set up very long-running games--my particular favorite for performance testing the game is getting a large number of mages with summon dragon. This isnt the first time Ive seen you call out Python for slowness, so I figured Id ask. My personal opinion is that it could implement literally any Audiogame currently available, with no noticeable degradation of performance.

URL: http://forum.audiogames.net/viewtopic.php?pid=180522#p180522




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: is coding in python easy? just interested

2014-07-12 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: is coding in python easy? just interested

Python is fast enough that I seriously considered (and still am, in a way) doing my MMO project in it. Game load times is not a function of language in this case-I suspect that the Pygame games under discussion are not streaming and load all sounds at game startup, which will slow anyone and anything down. Do not assume that Python is the bottleneck until you know how to use the profiler and can prove it-and even then, it is more likely the algorithm and not the language. Should Python prove too slow for a specific algorithm--rare in this day and age--you can use ctypes and implement it in C/C++, whereupon it wont be anymore. The only reason I may drop it for my MMO project is because Ive decided to take the approach of brute forcing the problem, and am suddenly talking about allocating, copying, deallocating, and generally doing stuff with a million objects a second (I dont want to get too technical, but Python is fast enough for this too
 . Im leaving it for lack of frameworks that fit the model I want to work in, because writing and optimizing my own is going to take valuable time).As for Pythons easiness: compared to most other languages Ive worked with, Python will get complex things done the quickest in most cases (and the exceptional cases Im thinking of fall under the category of research into computer science and not everyday apps or games). The indentation habits it forms make you a more valuable programmer on sighted dev teams, and tbh youll end up wanting indentation in other languages too (its much more convenient than scrolling up 20 lines with your screen reader to count the braces). I dont have specific tutorials to link as its been literally years since I first learned to program, but there is an unbelievable amount of documentation on getting started with it--I strongly suggest a quick Google search.If your specific goal is 
 an NVDA add-on, you want to learn Python 2.7. Python 3 is a rework of the language-its mostly the same, but it broke backward compatibility and has had the effect of splitting the community; were only just now seeing a merge. NVDA itself uses 2.7 and not 3. It is also worth noting that Python itself is easy, but NVDA add-ons are not: you will need enough skill to read the NVDA source, though you need not be able to actually build it yourself. NVDAs aAPI for add-ons is literally all of NVDA itself (as opposed to Jaws and WE which give you a predefined subset); there are consequently ways to replace literally everything. The downside is that the API is all of NVDA, so you have to do a bit of poking about in the source to figure out where what you want to work with is and how it works.@tward:Do you have any evidence of Python even approaching the point of being too slow for an Audiogame? The newer versions of SoundRTS (
 this was one of those its the programmers fault for not knowing the difference between an array and a hash table and not putting the UI on a different thread than the networking) handles literally thousands of units with no problem. Theres a few of us who set up very long-running games--my particular favorite for performance testing the game is getting a large number of mages with summon dragon. This isnt the first time Ive seen you call out Python for slowness, so I figured Id ask. My personal opinion is that it could implement literally any Audiogame currently available, with no noticeable degradation of performance.Edit: if you want to make redistributable packages, which Id not worry about for a while, you want Py2exe or Cx_freeze. No one uses Pyinstaller anymore. Beware, for here there be dragons-python makes this a bit harder than it has to be, so Id not worry about it for a while.

URL: http://forum.audiogames.net/viewtopic.php?pid=180522#p180522




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: a few audio gaming/programming questions

2014-07-11 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: a few audio gaming/programming questions

I can post the ten lines needed to apply a lowpass filter to a sound, which is a cheep and efficient way to make things sound at least a bit different when theyre behind you. Unfortunately, this is C++ and wont help unless you have a way to write custom DSP callbacks-you have to get the filter in the pipeline. Recording an in-front and behind sound is also feasible; you can apply the filters with audacity and encode as ogg, which is small and avoids the legal issues of MP3, so having lots of sounds wont kill you. Ive not played Road to Rage, but doubt it implements a full HRTF. Lowpass filters are simple enough, however, and provided by most libraries. If someone wants to go down the road of how to design and implement simple filters, we can talk offline-Ive got some things that might help-but be warned, for here there be post-calculus mathematics (that said, using a lowpass filter someone else designed is just cut-and-pa
 ste).Pygame is where its at for simple and quick audio in Python. I wrote Audiogame_engine, which provides a simple SDL window, keyboard, and mouse handling interface, including handling tick timing and allowing control and menu overlays. This still requires audio, unfortunately, so falling back to Pygame is probably what most are doing. Camlorn_audio crashes a lot in Python, mostly due to error propagation issues and people never actually being able to provide test cases that would crash it reliably; nevertheless, Audiogame_engine works well and allows a lot of stuff. Disclaimer: Ive not tried to combine it with Pygame, and Pygame probably offers something similar in functionality if you look hard enough.As for being on topic with the what kind of games, CAE really hit it on the head: weve got simple side-scrollers out our ears, space invaders out our ears, and card games
  galore. More things like BK3, but in English, could be cool: if you havent played it, BK3 manages to transcend the side-scrollers are one-dimensional lines, providing an experience at least close to what sighted side-scrollers are like. I personally want something similar to Zelda or the newer Metroids, but thats hard to do well (the older Metroids are also fun and doing something similar in audio is probably quite doable-theyre only side-scrollers, and BK3 managed to overturn a lot of my assumptions about such). But seriously, basically anything goes-a better question is what kind of game do you want, because youll probably have players no matter what it is and youre the one who has to be motivated to finish it.

URL: http://forum.audiogames.net/viewtopic.php?pid=180404#p180404




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: a few audio gaming/programming questions

2014-07-10 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: a few audio gaming/programming questions

yeah. OpenAL is very, very, very bad. Very. It looks really great at first, but its a fight between specs being the documentation and programmers not implementing them, everyone having abandoned it like 5 years ago except one guy who insists that his programming library must act exactly like a fake sound card, and it missing the infrastructure to build advanced features.What it basically boils down to is this: you can get cool 3D audio but only if using OpenALSoft and if the user fiddles with some magic Inis (in all honesty, theres my fork that allows you to force options, but its whats called a quick hack really), there are ridiculous limits that stopped really being an issue around 2000, and you have to write higher level stuff yourself, for example audio decoding, file caching, and the like. It will work for simple games, but as soon as you want to do something a little complex it fails hard. In my case, it was accurately pl
 aying footsteps and having the sound change properly with the terrain. O, and that INI? If you edit it wrong youll just break things, and no you cant distribute it with your app-theres one system-wide file and thats it.So Im writing my own, as I finally managed to learn DSP to the point of being able to do so. I cant call it useable yet, and I must confess that it will be commercial for closed-source projects. Outside of my work, though, theres nothing I can find. If you care only about mac and dont mind Objective-c, you can use Core Audio which looks really nice, but this is probably not the case. As for BGT, it probably wont happen--I am hearing that BGT does not have the ability to be called from C Dlls, which means that writing a complete binding for anything that uses a callback function is impossible (and you really, really want callback functions). This includes mine. T
 heres also some recent work by Microsoft to make personalized HRTFs using a Kinect, but this isnt available yet (and who knows when/if it ever will be). Creative has not officially stopped caring, but theyve taken down most of their web sites related to it. Unfortunately, while they did still care, they took out everyone else working on 3D audio via patent trolling of some sort or other. I could rant further, but it would probably not be useful as the rest of it has to do with the atomicity of OpenAL error checking and the absurd need for a thread for everything (also, Ive written it elsewhere).As for programming language, I am personally fond of Python. I would stay away from C++ as debuggability is a killer and productivity will be low. BGT will get you going quickly, but getting beyond the BGT ecosystem (which is basically a spec of dust compared to what you get if you invest a bit of time to get set up with something in
  another language) is clearly not something doable from inside BGT. Id stay away from the JVM, not because it cant be done but because youre going to end up then requiring anyone who doesnt have the right version to download a 200 MB package and install it. Other languages that might be good include C# (everyone has the .net framework these days) and I really cant think of anything else at the moment.Since youre not able to get 3D audio yet, picking something you know thats capable of playing sound and getting keystrokes is a viable option. And whatever you do, never underestimate game programming tutorials aimed at the sighted-you dont care about the graphics, but all the rest--those parts about how you should react instead of act, including all the code on setting that up, proper control handling, collision, how best to do time--apply to you too. I think that underestimating such tutorials is why we don&
 #039;t have a new game from someone every week: if you adopt the practices that sighted game programmers figured out for you and also adopt the everything is a library mentality, you end up with a bunch of pieces you can just reuse again and again. All we need is for someone to open source enough of them.hope this was helpful, though I cant notice that really its primarily depressing on the audio front anyway.

URL: http://forum.audiogames.net/viewtopic.php?pid=180293#p180293




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: a few audio gaming/programming questions

2014-07-10 Thread AudioGames . net ForumDevelopment room : camlorn via Audiogames-reflector


  


Re: a few audio gaming/programming questions

Warning. Incoming rant of anger, with extra helpings of anger and rantiness. If you delve down into OpenALSoft, that is you write no intermediate abstraction, its fine. Not great, not at all, but fine. The specific issue I had with threading was that, in order to implement streaming without requiring some sort of library tick function, you have to use a thread. This thread can error but OpenAL cant deal with thread local error info at all, so you dont know which thread caused it. Unfortunately, there are a few resource limits that you can exceed, and the only way to know is to capture and read the error codes. There are thread local contexts which sort of solve the problem, but this then involves somehow making sound objects that live completely on another thread and all sorts of insanity to actually make it look like its not; and if you want to play long pieces of music and the like, grab from the web, or any
  such thing, this functionality is not optional. Going further, getting a simple this-sound-is-done callback is impossible without threads. So yes-as I said, works in simple cases. To clarify it also works if your software deals with it directly. But its almost impossible to abstract into something usable and simple. I should know: I spent a year trying. I could have written a game with it, but I didnt want a game, I wanted a reusable and simple sound library. Im not going to reimplement sound for every game I write. OpenAL cannot be bent into this shape reasonably. Possibly not at all.Its also not true that it ensures everyone has the same features as the enterprising user can edit that Ini, suddenly doing things like setting the source limit to 32, turning off Efx, etc...and I dont suggest OpenALSoft because its not long until people get the particularly bad idea to copy their game
 ;s custom Ini over yours, and then its game x is not compatible with game y because game x is broken and takes OpenALSoft with it. At least one thing that some will wish to change is the source limit: stopped and paused sources take no CPU, its easy to use the one source is one sound mentality and theres no downside, to doing so. Yet the only way to raise it is the system-wide ini. Hope your users are feeling charitable, and also technologically capable. Id really strongly suggest staying away from OpenAL unless youre a good enough programmer to figure out how to put the pieces together and also a good enough programmer to figure out how to write a sound scheduler, as most action games and most rpgs are going to want more than 256 (I believe this is the default) loaded sounds.As for HRTF, thats the INI trouble. The only way to get OpenALSoft to play HRTF is if the system playing the audio is configur
 ed at 44.1 khz or all of the following are true: you provide a hrtf dataset for all sampling rates, instruct users to edit the Ini file to point at the HRTF database, and provide the support required for those users who do not know how to do so. The default ini is configured to turn hrtf off, so you need to edit it for that too.And god help you if youre dynamically linking via the Creative proxy: its now hard to get, isnt developed, and also means that some users will no doubt have an outdated OpenALSoft. And yet OpenAL Soft is it as far as hrtf goes. I really want 3D audio, but OpenAL Soft is not worth my time.If you know of one of the commercial tools that has hrtf and is blind accessible, let me know. So far as I know, only Wwyse may have it, and not until recently. Most if not all of them now rely on heavily graphical studios--i.e. great for sighted artists, not great for blind people. Clearly, the state of 
 all of this has made me extremely bitter.DirectX will play sound, but post-xp you get no 3D from it and might as well just use BGT. If youre not in BGT, theres Bass which abstracts it nicely and works somewhat on other platforms. Python has Pygame. But all of these have two things in common: no good hrtf and no good environmental reverb. If you want to talk about post-xp audio from Microsoft, youre looking at Xaudio2: the direct sound stuff is now emulated.So basically hrtf but you get to implement all the things you need to actually have an audio engine instead of what is, essentially, a convolver-or no hrtf but youll get somewhere tomorrow instead of in 6 months. Your choice. My personal opinion is that if you need to ask the question where do I start coding games? youre not ready for all the crap OpenAL thinks you should have to deal with. Maybe I wrong. Id go so far as to 
 say that OpenAL is the worst API Ive ever seen, save perhaps for how IA2 and MSAA work and why theyre hard to implement if youre using a Gui library (thats yet another rant of mine but is off topic for this one so...). The problem is that OpenAL is deceptively friendly at first, or Id have started Libaudioverse a year ago and might actually be somewhere by now (or not, as some of the