|
203
|
Developer / Technical / Re: The happy programmer room
|
on: November 25, 2011, 11:35:24 AM
|
How memory management works, coding patterns used more often by C programmers, why the Java designers chose pure oop with none of c's procedural stuff, the kind of stuff Java protects its users against. Plus he'll be more well rounded.
It sounds like you're saying here that using C++ will make you a better Java programmer because it will teach you that using C++ is a bad idea. ...you make a compelling point.
|
|
|
|
|
205
|
Developer / Technical / Re: GML in Unity
|
on: November 25, 2011, 11:25:29 AM
|
|
I think this is a very smart approach. As the programmer, it is way easier for you to adjust things to accomodate the artists than it is to make artists adjust to accomodate the code. In fact I suspect you could go even further and maybe throw together a GML interpreter!
(I'm STILL confused by this thing where Unity is based on Mono and yet restricts you to like three languages for the executed code. Shouldn't you be able to like... something something... bytecode... assemblies?)
|
|
|
|
|
206
|
Developer / Business / Re: Why Bundles and Steam Sales Aren’t Good for Most Indies
|
on: November 25, 2011, 11:03:51 AM
|
I feel like I'm very lucky when I can get someone to buy something of mine for $1 or $2. Most of my stuff is given away for free and I'm not sure I've gotten the hang of convincing people to download it, even then. My big worry is that I'm limiting my audience by charging money at all, while not likely in the process making all that much money back. I'm very proud of my work but it's also all very small-scale and short. It's unclear to me why I deserve better than app store or steam-bundle prices for what I made. The game I put on the iPhone app store for $2.99-- let's say someone else had made it, and sold it to me for $9.99. I think I'd enjoy it, but I'd roll my eyes and feel like $9.99 was a ripoff. Meanwhile-- I'm not really sure you (tametick) are correct you're "the 99%". If I'm not mistaken, you're successfully selling a game at all. I would estimate "the 99%" are those of us making RPG maker games and Ludum Dare projects and Flash games on Newgrounds and not successfully making any money period. Which leads to a question. If knowing that a lot of indie games eventually suddenly drop from $10 to $1 (gotta save that price of a big mac value meal!) dilutes the value of the $10 games or makes people less willing to buy at that price-- then shouldn't the enormous, teeming mass of free indie games, facebook F2P shit, NES ROMs, and $1 games on Wii Virtual Console similarly dilute the market? If there's someone out there who absolutely OMG won't pay $10 for a game if they have an alternative, then it seems to me there is so much opportunity to obtain entertainment without paying that extra $9 that the battle is already lost even if the app stores shut down and the humble bundle / steam bundle stuff halted. Like: 5 or 6 years ago, you’d remember that the price for a desktop indie game used to be about $15-20. A cheap “casual” game would cost you maybe $10 Actually, I don't remember this. What I remember is 5 or 6 years ago is playing Cave Story and Knytt and Punishment and paying $0. At that time I wasn't buying indie games at all (unlike today) because no one was making games for mac back then. I also remember people complaining $15 for Braid on XBLA was too much back around that time (but buying it anyway). Meanwhile, when I look at today-- I do see people charging $10 or $15 for games, and I see $10 games on the app store. So actually, I don't think I see much of a difference between today and then in terms of the upper and lower bounds of pricing and how people react to those poles. What I do feel like is different now vs then is that back then there was a whole lot less. Fewer games for sale and fewer games for free download. Perhaps if there is downward economic pressure on prices now vs 4-5 years ago, it's due to the increased amount of games competing for eyeballs-- not changes in the way people buy things? The "gatekeeper" aspects of Steam / Humble Indie Bundle seem like a different problem. -- tl;dr if I actually got a chance to participate in a bundle where I got 50¢ per download instead of 0¢ per download I'd jump at it and it would be objectively for my purposes the best business move I'd ever made. I expect that the people making other indie games are adults (or at least reasonably astute 16 year olds) and that if they participate in a bundle it is similarly because they think it is a good business decision. If they think selling to me for <$2 is not a good business decision they are free to charge $10 and then make a case to me I should pay that.
|
|
|
|
|
208
|
Developer / Technical / Re: The grumpy old programmer room
|
on: November 22, 2011, 10:13:37 PM
|
|
Today realizing that some of this code might someday be read by another human being, today dumped my years-old, somewhat arbitrary habit of using SELF_EDIT as the #define flag I use to indicate I am compiling in debug mode, in favor of the more traditional _DEBUG
|
|
|
|
|
209
|
Developer / Business / Re: sxc.hu
|
on: November 22, 2011, 08:39:54 PM
|
Maybe they assume you will sell the game.
Actually, it's possible. I'm considering emailing them back to ask about that. At a minimum I'm going to suggest they make it more explicit that games are disallowed, so that people don't get into the trap I did (assume it's ok to reuse, throw some resources into a project, have to take them back out).
|
|
|
|
|
210
|
Developer / Business / sxc.hu
|
on: November 22, 2011, 06:08:14 PM
|
Thought this was interesting. Was doing " klik of the month club" this month. Needed some pictures of rocks. Typed "stone texture" into Google. Found a page full of links to stone textures from leniently licensed stock image sources. A bunch came from a website that looked, at first brush, fantastic: http://sxc.hu/ . It's run by the people who run istockphoto; it's like a wiki-like pool of open-licensed stock photos. They have a standard license, and individual image contributors who choose to donate to the website can add additional license terms. But then I look at said standard license and I find myself scratching my head. The following is a legal agreement between You and the owners of SXC.hu ("Website"), HAAP Media Ltd. ("SXC", "We") which governs the use of non-watermarked images ("Images") downloaded from our Website. By downloading an Image You agree to be bound by the terms of this Agreement automatically, without any other conditions or declarations. If You do not agree with these terms, You are not allowed to download the Image.
All Images on the Website are copyrighted and they are the properties of SXC or its Image providers. All rights are reserved unless otherwise granted to You. Your rights to use the Image are subject to this agreement and the restrictions specified at each Image.
We hereby grant to You a non-exclusive, non-transferable license to use the Image on the terms and conditions explained in this Agreement and on the Image preview page FREE OF CHARGE.
You may use the Image In digital format on websites, multimedia presentations, broadcast film and video, cell phones. In printed promotional materials, magazines, newspapers, books, brochures, flyers, CD/DVD covers, etc. Along with your corporate identity on business cards, letterhead, etc. To decorate your home, your office or any public place.
You may not use the Image For pornographic, unlawful or other immoral purposes, for spreading hate or discrimination, or to defame or victimise other people, sociteties, cultures. To endorse products and services if it depicts a person. In a way that can give a bad name to SXC or the person(s) depicted on the Image. As part of a trademark, service mark or logo. SELLING AND REDISTRIBUTION OF THE IMAGE (INDIVIDUALLY OR ALONG WITH OTHER IMAGES) IS STRICTLY FORBIDDEN! DO NOT SHARE THE IMAGE WITH OTHERS!
Always ask permission from the photographer if you want to use the Image In website templates that You intend to sell or distribute. For creating printed reproductions that You intend to sell. On "print on demand" items such as t-shirts, postcards, mouse pads, mugs (e.g. on sites like Cafepress), or on any similar mass produced item that would contain the Image in a dominant way. Well... that's a slightly odd set of can/cannots there. So can I use it for a game? Well: It says "multimedia presentations". I don't know what else to call a game. So toss some rock images into my click n play project and I use their contact information: Hello. I would like to point out a general problem with your licensing terms. I found your site looking for stock images to use in a video game I am creating. I found your website very useful. However when I went to look at your licensing terms: http://www.sxc.hu/info.phtml?f=help&s=7_2I discovered that the image licensing terms are, what seems to me, unnecessarily specific in a manner which is awkward and potentially limits the usefulness of the website. Specifically, your license terms say the images may be used in: "websites, multimedia presentations, broadcast film and video, cell phones" and "in printed...materials" Because you so specifically list uses of images, it is ambiguous whether a type of use analogous to these, but not specifically listed (in my case, a video game) is allowed. I suspect the video game qualifies as a "multimedia presentation". But why create the ambiguity? It is my suggestion that your image license agreement would be more helpful if a more general term, like "artistic works", were used under your list of allowed uses, rather than trying to enumerate every possible use of an image. You also might find the "creative commons" licenses useful as examples of licenses which protect the copyright owner while allowing a wide range of derivative uses.. (Note that rereading their terms, I find my email contains an inaccuracy: Their terms say you may put them in printed materials, unless those printed materials are to be sold.) Anyway a few days later I receive the following email: Hello Andi,
Thank you very much for your email.
The permitted uses are specific and will remain as such. Use in video games is not permitted.
Please let us know if you require further assistance.
Regards,
Darek
iStockphoto Team
NOTICE: This message is intended only for the use of the addressee, and may contain information that is private, confidential or otherwise restricted from disclosure. If you are not the intended recipient, any distribution or copying of this communication is strictly prohibited. Although we try our best to offer useful advice on interpretation and other issues, you should bear in mind that nothing we say should be construed as legal advice on any particular issue or be considered a substitute for seeking proper counsel for your legal affairs. If you have received this in error, please notify iStockphoto.com immediately by contacting []. Well, that's a polite response. But... huh? So I don't care about using these images. I can get a photograph of a rock somewhere else, I don't want to mess with an IP source that's going to be difficult, and the klik n play game doesn't even work. But... how does this even make sense? Why on earth make a set of rules that make it legal to put something into a video, but not a game? How precisely are we to determine the difference between a video game and a "multimedia presentation"? If a game is sufficiently abstract/arty and noninteractive, does it become a multimedia presentation? You can use it in a "website", but not a video game-- what if the video game is embedded in a website? I kind of want to be difficult about this, try to claim games=multimedia presentations or at least make a contrived video game that qualifies as a powerpoint presentation or "film" rather than a game, and see if we can get a court ruling that Passage is a work of art and not a video game or something (disclaimer: I LOVE PASSAGE)
|
|
|
|
|
211
|
Developer / Technical / Re: So guys. wxWidgets.
|
on: November 22, 2011, 11:02:47 AM
|
|
So some time ago I used wxWidgets (back when it was wxWindows), and then later I had the opportunity to spend a lot of time with Qt. My take is that wxWidgets really is a very nice platform, however, I wouldn't ever use it just because Qt covers the exact same ground but is imo nicer. They're very similar in design and scope but Qt just gets a lot of basic things very right and, at the time I used it, was the much more complete of the two solutions. Basically I can't think of an application where I feel like wx is appropriate but Qt isn't more appropriate (now that Qt has moved to LGPL anyway). I haven't used OGL with wx but with Qt it's just a matter of placing an opengl widget on the screen and overloading the "draw opengl here on screen update" method.
I do want to stress though it was a long time ago I used wxWindows, so my view of it is out of date. In particular I don't have any idea, after all the recent changes, which of the two between wx and qt is currently receiving the most active development. And again wx seemed good enough that if you have some external reason to want to use it (ie ide support) then it seems like a good choice.
|
|
|
|
|
212
|
Developer / Technical / Re: iOS Application Event Loop
|
on: November 21, 2011, 06:19:52 PM
|
Technogothica: So, based on your description, I agree you have chosen the correct architecture. Simply for the record: If the background thread were to dispatch an NSOperation every time a new thread arrived, the operation queue could potentially overflow with redundant events. The continual allocation, processing and deallocation of NSOperation objects, many of which may be discarded anyway, would be an unnecessary hit on performance, memory and battery. I doubt GCD would be any better, though it's worth a test if I have time.
I am very certain that GCD will be more efficient than NSOperation, and what bookkeeping it does will be far more lightweight than Objective C objects (although GCD can have hidden costs, at least in objc mode, for example if you create a block in objc mode there will be retain calls). I believe Apple has made claims GCD is more efficient than a mutex. I will note that if you have something that at maximum will be happening 120 times a second (unless something very surprising is happening I doubt you will be streaming video at more than 120fps... and if you are streaming >60fps video to a phone that can't refresh faster than that maybe that is something to rethink also) I doubt you are looking for performance in the right place if you are worried about the performance cost of creating 120 objective c objects in a second. But my understanding is GCD should be appropriate even in inner loops so tight that objc_msgsend starts to be considered a burden... As for the specific issue of "but I don't want to flood the queue": I think GCD might have some primitives for handling this situation already. For example I know there's some kind of concept of placing messages in a "group"; I'd be curious if this or a mechanism like it could be used potentially to coalesce messages such that only one "new frame!" type message is in the queue at a time. However, I have no interest in looking things up far enough to determine if this is true or not since I agree you've already got the right approach and GCD is not particularly relevant to what you're doing right now...  But, if this were a situation I personally were looking at (notification of event needs to be passed to main thread; event may occur many times before main thread gets around to servicing its messages; do not want to flood queue with redundant messages) the way I would likely handle it is to simply have one message, meaning something like "wake up and poll all the worker threads". The worker threads could then very well themselves efficiently negotiate the question of "is there more than one 'please wake up and poll us' notice dispatched to the main thread currently?". You could probably just have a single "worker-threads-need-attention message inflight" flag, set on when the first message is sent to the main thread and turned off when the main thread receives it, and I bet if one were just a little clever setting that flag on and off could probably be done purely with atomic TAS.
|
|
|
|
|
213
|
Developer / Technical / Re: Construct 2 vs Game Maker vs Game Salad vs Stencyl
|
on: November 21, 2011, 03:06:29 PM
|
|
I think that Construct 2 making a case for why they consider their product better than comparable products is useful information even if we must consider that information is not from a purely objective source
Personally though I'm not sure speed is the most important criteria I'd judge one of those programs by. If I were doing something speed-critical, it is unlikely I would create it with a gamemaker-like tool.
|
|
|
|
|
214
|
Developer / Technical / Re: iOS Application Event Loop
|
on: November 21, 2011, 01:23:58 PM
|
Does an NSTimer with a small duration cause any problems like the event queue filling up with unprocessed messages?
Nope, NSTimer won't try to call your callback more often than it's able to. It's very good about keeping up, though; ask for a timer that fires at 60hz, and it will in fact fire at 60hz most of the time. If you call an NSTimer with a RIDICULOUSLY high rate, like thousands of fires per second, you will eventually reach a point where the event queue has so many timer fire messages in it that desirable messages (usually "touch end") are dropped. However, this is a rare event and not a killer. (As long as you have not written your game to assume that all touches which begin eventually end. DON'T EVER ASSUME THIS.) Average Software recommends an NSTimer with a duration of 0.0. According to the documentation, the interval of a timer is defined as: "The number of seconds between firings of the timer. If seconds is less than or equal to 0.0, this method chooses the nonnegative value of 0.1 milliseconds instead." However I would say that "fire this every 0.1 seconds" is a good proxy for "run whenever idle". CADisplayLink is what you want if you want to just say "wake me up when it is time to display a frame". I do not think it is the correct solution to the specific problem gothica suggests? I think there's some way to actually tell the cocoa event loop "call me whenever you're not doing anything else". I find this suggestion of how to do this using GCD: http://stackoverflow.com/questions/7356820/specify-to-call-someting-when-main-thread-is-idle but do not know if this truly works. However: Technogothica, I do not think you are going about this in the right way to begin with. You usually do not need to write a "run when idle" handler yourself; rather what you really want is to engineer your program such that the Apple-provided run loop is doing the things you wanted your 'run when idle' loop to do, for you. This should always be possible. (Among other things, if you are truly running "whenever idle" then you are going to be 100%ing the CPU and people with laptops with loud fans will hate you.) In particular, you say "The idle processing I want to add is to poll the state of background threads synchronously with user interface updates". What I would suggest is that instead of polling, when the background thread must communicate something to the main thread, it "push" by calling performSelector:onThread:withObject:waitUntilDone: (there is also a performSelectorOnMainThread). http://cocoawithlove.com/2009/08/safe-threaded-design-and-inter-thread.htmlThis will cause the requested method to be invoked on the desired thread on the next visit to that thread's "run loop". Aside from this, what I would suggest is that you research GCD. It's quick to learn and allows you to perform all kinds of elaborate and really neat tricks. GCD is like NSOperation/NSOperationQueue but more cleanly designed. It's also what the "run loop" in newer versions of OS X / iOS is based on, which means if you're using GCD you're effectively being given access to the primitives of the os x/ios run loop, and it is expressive enough I think it mops up the use cases where performSelector:onThread: isn't so hot. Using this you could do something like signal from a secondary thread like "schedule this function to run on the main thread's event loop, but only do so with the lowest possible priority". You can also use this to perform performSelector:onThread:-like messaging from non-objective-c code, and receive these sorts of inter-thread "messages" on threads which do not actually have a cocoa run loop.
|
|
|
|
|
215
|
Developer / Technical / Re: The happy programmer room
|
on: November 18, 2011, 01:52:20 PM
|
|
FTGL does this interesting thing of simply rendering all the letters in the font into one big texture, then making each character a poly into that texture when it's time to draw text.
|
|
|
|
|
216
|
Developer / Technical / Re: The grumpy old programmer room
|
on: November 18, 2011, 10:07:52 AM
|
I click on a button on the title screen that starts the game. Yay, woo, I'm walking around. Then I click close [insert memory deallocation here] and it goes back to the title screen. The memory usage of the game does not go down. When I click on the start game button again, it goes up by roughly the same amount. This continues to happen throughout the timespan of the game. Ah. Okay. Sorry, yes, that is the correct way to check for a memory leak and that is indeed a memory leak. Edit:Problem solved. Cleaning then rebuilding solved the issue.  That's terrifying.
|
|
|
|
|
217
|
Developer / Technical / Re: The grumpy old programmer room
|
on: November 18, 2011, 09:16:16 AM
|
Edit: Do I need to set my pointers to NULL after deleting them?
Assuming C or C++: No, you do not need to, but it is a very good idea to do so anyway (as long as the pointer variable is something that persists and not scoped function local). (1) it allows you to test the pointer later to see if it is freed. (2) It means if you wind up in the debugger, you can look at the variable and tell whether it has been deleted or not.
|
|
|
|
|
218
|
Developer / Technical / Re: The grumpy old programmer room
|
on: November 18, 2011, 09:14:48 AM
|
No matter how much stuff I free, I can't make the memory usage of my game go down.  1. For what reason do you think you need the memory usage of your game to go down? 2. How, in this sense, are you measuring the memory usage of your game? Like are you just looking at top or the ctrl-alt-del box or something? For several reasons, in some operating systems memory once grabbed by a process will tend to stay with the process; freeing in this case just means that memory has been freed up within the process to be reassigned. So the memory usage of my game is destined to keep increasing and increasing? Are you on a Windows machine? What I'm asking is-- Is the problem that the longer your program runs, the more memory it grabs and you cannot stop this growth? Or is the problem that, you perform an action, memory increases, you free the memory allocated during that action, memory does not decrease in the ctrl alt del box? In either case the solution is the same, you need to find a memory profiler and run in that. That will allow you to discover (1) how much memory am I *using*, actually, not just how much is assigned to the process? and (2) all this extra memory, where in my program is it being allocated? And no I don't use Windows, but my understanding is that for several reasons including at the least memory fragmentation the in the ctrl alt del box can overestimate the amount of memory being actually used by your program at the moment.
|
|
|
|
|
219
|
Developer / Technical / Re: The grumpy old programmer room
|
on: November 18, 2011, 09:03:10 AM
|
No matter how much stuff I free, I can't make the memory usage of my game go down.  1. For what reason do you think you need the memory usage of your game to go down? 2. How, in this sense, are you measuring the memory usage of your game? Like are you just looking at top or the ctrl-alt-del box or something? For several reasons, in some operating systems memory once grabbed by a process will tend to stay with the process; freeing in this case just means that memory has been freed up within the process to be reassigned.
|
|
|
|
|
220
|
Developer / Technical / Re: Haiku OS
|
on: November 14, 2011, 09:31:00 PM
|
|
What would one need to do in order to ensure a piece of software which already works on Linux (say, an SDL game) could run on Haiku?
|
|
|
|
|