Amarth

Members
  • Content count

    48
  • Joined

  • Last visited

Community Reputation

122 Neutral

About Amarth

  • Rank
    Member
  1. OpenGL Loads of small objects

    Okay, thanks, seems about what I thought then. I've currently implemented it with one big texture and one VBO with interleaved position/texture data. Seems to work nice. I've seen a small performance increase, but when handling many objects I'm mostly CPU-bound in other code at the moment. Oh well. I suppose that allows me to add stuff that puts some more load on the GPU then...
  2. Heya all! I'm currently creating a 2D engine in OpenGL, just as an experiment really. The way I learned OpenGL is with direct mode, using glBegin(GL_QUADS) calls to draw my sprites. I'm currently achieving something like 20FPS for 10.000 quads. I haven't kept up with recent developments, but it seems these days there are other ways with better performance, things like VBOs. So what is the best way to send loads and loads of small objects (basically 2 triangles per sprite) to the GPU? Keep in mind that these objects will change position (and scale and angle) every frame. My current idea is to create one big VBO, put all the coordinates in there (transformed on the CPU) and send it over to the GPU. Will that increase performance? Also, how do I combine that with texture mapping? Think animations: each sprite might have a different texture. Can I batch-upload a list of texture id's to be used together with the vertex data? Or perhaps I should use one big texture and create appropriate texture coordinates? Ah, so many questions. Anyone with some answers? Thanks!
  3. Twisting the rules

    Quote:Original post by jpetrie Superpig touches on this point in his journal. I quote, regarding element "signifigance" (emphasis mine): Quote: There are two tests I've described in the past for this: The "layman" test: I find someone on the street and give them $20 to play your game end-to-end, then ask them, "Did the game have ponies in it? Did the game have accountants in it?" If they answer no then the element is not sufficiently present. This part is interesting. How do you define end-to-end if the game is meant to be played multiple times? Anyway, thanks all. I've thought of another possibility that might be doable to pull off - parallel storylines. The story of the little girl and her pony is as least as important as the story of Jack Bauer and his explosions, and they could be woven together meaningfully.
  4. Twisting the rules

    How does the following sound? Use all 4 elements in the game, but on a given playthrough, you will only see one or two of them. If the game is highly replayable (thinking Nethack-like here, or perhaps Strange Adventures in Infinite Space), you'll see the 4 elements in the game in the same amount of time as any other game, thus you could say it satisfies "An element must have a significant presence in the game to be considered as included." However, this would have a significant advantage. I'd like to try creating a somewhat more serious thriller game (1) but I find it kind of hard to create a good storyline where all of those elements feature. It seems like you can only create slapstick comedy with this stuff. Leaving out ponies makes it possible to create a single solid storyline I think (2), but I'm also thinking about a bit of an experiment in my game here, by making the story have a certain amount of randomness. What would you think? (1) I will fail horribly. (2) Thinking about this, the combination ponies + explosions is hard. I really can't conceive a way to combine these that doesn't fall into comical situations, and there will be enough games here that do that already.
  5. Good GA practice programs

    Also, why is TSP about UI? Generate a couple of points to represent cities, calculate using your algorithm, print out your result to a file, load in $FAVORITE_MATH_PACKAGE (try R if you need a free one), draw there.
  6. 4e6

    Another question, will Java 6 be available? Not really necessary, but the scripting stuff is yummy.
  7. 4e6

    Quote:Original post by Dark Adept The minimum spec from last year is here. Hmm, technically, aren't those maximum specs? :P
  8. 4e6

    Quote:Original post by d000hgWell MSVC is the best development tool available today (but don't take it personal, d000hg) It seems like this entire thread is about personal preferences... I'd prefer it if people would code good games for Linx/Mac, but what do I care if someone doesn't want to spend the time doing it? Each to his abilities, I say. This is supposed to be fun, right?
  9. 4e6

    Quote:Original post by superpig The contest will be starting at some point this month. Only 27 days remaining!
  10. I have some sort of idea, which might be isomorphic to the solution I'm trying to find, or a step in the right direction. It might also be totally wrong. Also, I haven't worked it out fully yet. Split the given array in pairs, as with the min/max search, and discard the bigger ones of each of these pairs. Divide the remaining smaller ones into new pairs, doing the same thing. This will eventually yield you the minimum in n-1 comparisons, I believe. Now, the second smallest number has to be one of the numbers 'beaten' by the smallest one. There are at most (exactly?) ceil(log2(n)) such numbers, right? So, we can find the smallest among these in ceil(log2(n)) - 1. Now I only need to find some spiffy way to stick the numbers in an array so that it's clear which numbers are compared to each other. I think it might be something heap-like, but I can't really visualize it.
  11. Mmmm... I need some more pushing. I'm not reading the links yet, though. Dumbing down random selection might be the solution, but since it's defined after the exercise, that feels kind of cheating. I suppose there is another way. (mostly writing towards Nytegard, here) You need some sort of semi-sorting, is that what you're aiming at? Only the first couple of steps from one of the other algorithms? I don't really see how you could make some sort of half-sorted array from it, though. Do I need to think the 'heap' way or the 'quicksort partition' way, or is it something entirely else? Perhaps another question to push me around (hopefully in the right direction): what are the memory constraints on the algorithm I'm searching? Constant, or a function of n? That sequence around the start is really puzzling me, btw. If there's some sort of recursion at play in it, I don't see it. I'm feeling kind of dumb at the moment. Don't let that bother you. Now that you've started the thread this way, don't just give the answer, let me search a bit more, please :).
  12. Nytegard: Either I don't get what you mean, or you don't get what I mean. Getting an element of an array is constant time, of course, but how does that help me here? Colin Jeanne & mikeman: that was my first idea, too, but I think Wc-duck has it right there: that would do 2n-3 > n + ... comparisons on an array like 1,9,8,...,2. Other ideas?
  13. Hello all. I have a (rather advanced, I think) programming question. Assume an array of length n, filled with real numbers. It is easy to write an algorithm to grab the smallest/largest of these numbers with n-1 comparisons. However, CLRS poses an exercise (9.1-1) in which you have to find the second smallest of n elements, with n + ceil(log2(n)) - 2 comparisons in the worst case. The given hint is to also find the smallest element. I have no idea how to do this... Where does the log come from, for example? Every algorithm I can devise takes about 2n comparisons in worst case. Note, you're not doing homework for me here - not in the strict sense of the word. It is not something I *need* to know/work out/blah, I just encountered it in the book and wondered how it's done, while studying for my exam. So, yes, it's kind of schoolwork, but more on a want-to-know basis, I don't think they are ever going to ask this. Anyone has an idea? Thank you very much! -Amarth
  14. Lua, Java and headaches

    Well, yeah, that's kind of what I meant. A program can't keep a script from going into a very long or even endless loop, that would violate basic computability theory :). Faster development time, well... It's not really feeling like it. But flexibility, yes, THAT's what I'm doing it for :). To allow others to change parts of the game without needing to set up a complex development environment, mostly. I find it pretty hard to put the line between where the program ends and the scripting starts, and I don't really manage to get this done in a nice way... It's got ugly all over it. Are there examples of not-too-complex games out there that are worth studying? I can't seem to find them...
  15. Hello all. I got some questions about integrating Lua and Java with (surprise) LuaJava. I think I kind of got how it works theoretically, but I might be doing things wrong, feel free to point me to the right way. I think my questions are not bounded by Java, so feel free to answer if you're using C++ or something, I'll be able to translate :). First of all, I have the idea that the scripting should allow for lots of modification, but it should be hard to break the game by changing the scripting. Thus, I have implemented most of the important stuff (init, game loop, ...) in Java. Am I right in that decision? The problem I'm facing now is on how to share stuff towards Lua. Let's say, when I start a new level, I want to call a Lua script to generate that level. How do I pass in the necessary objects from Java? I've been looking at the stack, but I don't really see how to access it in Lua (I feel like some sort of important point about Lua is swooshing far over my head, though). Or should I make sure to construct the Java objects in Lua - moving most of the code to Lua instead of Java, and making my program prone to breakage from inexperienced level developers? Or should I use loads of static methods (like with factories and singletons) - those seem easy to call from Lua, but it kind of defeats the purpose of having an object oriented design. Perhaps I'm just searching for all sorts of advice you people can give me about Lua, I don't really know. I feel a bit lost :). All the guides and tutorials and manuals seem to do the basic stuff, and I really don't have an overview of how it all works together... I hope someone can help me move a bit onward. Thanks! -Amarth