|
dsage posted:How would you get around having opengl textures that are not 64, 128, or 256 pixels in width/height? Do you need to support an older spec? OpenGL 2.0+ supports non power-of-two textures natively. Otherwise, yeah, what krysmopompas said.
|
# ? Jun 10, 2008 21:50 |
|
|
# ? May 25, 2024 14:20 |
|
vanjalolz posted:I hear that NeHe is bad, but there is a LOT more stuff on there than Nate's website. I really really don't get the NeHe hate. Ok, it isn't professionally written, and they've stopped really updating it, so there are big gaps. But what there is is useful. It provides little test bed applications you can download and quickly play with which is sometimes all you really need. I've been coding professionally with OpenGL (both above and below the API) for 10 years now, and the NeHe stuff still comes in useful simply as repository of information in a compact form.
|
# ? Jun 10, 2008 23:33 |
|
krysmopompas posted:ARB_texture_non_power_of_two Non-power-of-two textures are glacially slow on a lot of hardware.
|
# ? Jun 11, 2008 04:53 |
|
In my game I have a "Scene" object which is right now is little more than a list of entities. It does per-frame logic like updating, rendering, and testing for collisions. In at least two cases, my ParticleEmitter and Weapon objects, I want to be able to add entities to the scene. I'd like to just add the objects to the scene (particles, projectiles) as they're created. I understand treating particles as full entities is probably inefficient but I'm abusing composition in my entity classes so they're already pretty lightweight and require no attention that wouldn't be needed anyways. In any case, I definitely need projectiles to have full collision and everything else other entities need. I've thought of a few ideas for solutions which all feel dirty to varying levels. 1) Pass Scene to the ParticleEmitter and Weapon classes. This is not a dependancy I'm happy about. I'd also need to do some minor hackery to prevent objects added to the scene during update traversals from invalidating iterators and such. 2) Keep and manage my own list of entities in a list. This is a lot of duplicated code that's already found in scene in the case of Particles. In the case of Projectiles, I'm also going to need to add a lot of ugly functionality for checking for collisions between the list of projectiles and objects found in the scene. 3) Use callbacks and when I want to add a particle I raise an onCreated type event which is listened to by Scene. Meh. 4) Add a bunch of entities and to the Scene and set them dormant. Then pass those entities to the ParticleEmitter and Weapon classes on creation and they turn entities on and off. Two lists of pointers - not really dangerous with smart_ptr, but still. Lots of usually inactive junk that needs to be iterated over in Scene. Bleh. Anyways, like I said, I don't like any of these solutions, but at least it shows I've put a little thought into it What's the correct way to approach this?
|
# ? Jun 11, 2008 07:18 |
|
I always run into a similar problem. If unix has taught me anything, its that your base class entity should have a getParentScene() method then you can this->getParentScene()->addEntity()
|
# ? Jun 11, 2008 11:48 |
|
guenter posted:1) Pass Scene to the ParticleEmitter and Weapon classes. This is not a dependancy I'm happy about. I'd also need to do some minor hackery to prevent objects added to the scene during update traversals from invalidating iterators and such. What's wrong with this? Is it just the minor hackery or is having the sub entities dependent upon the master entity considered 'bad form' in OOP? I've always done it this way (not that I'm an expert or anything), I'd be interested to hear if there's a better alternative.
|
# ? Jun 11, 2008 12:26 |
|
guenter posted:In at least two cases, my ParticleEmitter and Weapon objects, I want to be able to add entities to the scene. I'd like to just add the objects to the scene (particles, projectiles) as they're created. During what operation are the particles and projectiles created? Some poll operation done per update? You can always just pass a function object to that operation, and then when the ParticleEmitter or Weapon object needs to add a particle or add a projectile, it passes the necessary data to the passed-in function object. This keeps you from making the ParticleEmitters and Weapons from storing redundant data/introducing a dependency and it also allows you to separate the logic that the ParticleEmitter and the Weapon go through from exactly how the newly introduced data is added to the scene. For instance, you mentioned there may be iterator invalidation because you'd be adding entities to your scene during an update -- if that is the case, the function object passed into your poll function could just add new entities to some temporary list that just lazily adds the new entities to the scene at the end of the entire scene update. If you later change the way your scenes and updates work, for instance, if you change it so that iterators don't get invalidated when you add new entities to the scene (i.e. by using a different container type that doesn't invalidate iterators when a new element is added, such as a list), then all you have to do is change the implementation of the function object you pass to poll while the poll operation itself remains unchanged. A bare-bones example: code:
|
# ? Jun 11, 2008 16:58 |
|
That's interesting. I could pass a functor that adds objects to the scene, like an interface, instead of giving the entire scene to Weapons and ParticleEmitters.
|
# ? Jun 11, 2008 21:31 |
|
OneEightHundred posted:EDIT -- In MD3D they're called LockRectangle and UnlockRectangle respectively. Apparently the MSDN pages for them are broken and the only documentation for them are in Japanese, so good luck. I think that about sums up the problems I've been having. I've tried various things, including using a library called SlimDX which replaced a lot of the functionality taken out, but it seems that whatever I try, Direct X does not want to play with this data as-is. With that in mind, the only option I can see is to decompress it myself and present it in whatever format DirectX wants. Is it documented anywhere what format directX considers to be a "bitmap"?
|
# ? Jun 12, 2008 20:17 |
|
Can someone point me toward a good, no-bullshit discussion of quaternions that includes practical code examples? I always end up finding either high-level descriptions of the math involved or API-specific implementations. I'd love to see a bridge between the two somewhere. I haven't found the gamedev articles to be particularly helpful (they seem to suffer from the same problems).
|
# ? Jun 13, 2008 01:44 |
|
Thug Bonnet posted:Can someone point me toward a good, no-bullshit discussion of quaternions that includes practical code examples? I always end up finding either high-level descriptions of the math involved or API-specific implementations. I'd love to see a bridge between the two somewhere. I haven't found the gamedev articles to be particularly helpful (they seem to suffer from the same problems). The O'Reilly book Physics for Game Developers has a good explanation of quats. I haven't seen a good online discussion, but I can't say I've looked.
|
# ? Jun 13, 2008 03:52 |
|
more falafel please posted:The O'Reilly book Physics for Game Developers has a good explanation of quats. I haven't seen a good online discussion, but I can't say I've looked. I'll definitely check out the book. Is it good otherwise?
|
# ? Jun 13, 2008 09:10 |
|
Thug Bonnet posted:Can someone point me toward a good, no-bullshit discussion of quaternions that includes practical code examples? I always end up finding either high-level descriptions of the math involved or API-specific implementations. I'd love to see a bridge between the two somewhere. I haven't found the gamedev articles to be particularly helpful (they seem to suffer from the same problems). As far as the basic concept, which I found makes them a lot easier to digest: Any rotational transformation can be represented as a rotation around an axis in space. Quaternions are exactly that. The advantage is that they are valid as several other types of values as well (i.e. as sphere coordinates and complex numbers) so there are a lot of valid ways to manipulate them. The X, Y, and Z components are the rotation axis multiplied by the sine of the rotation angle, the W component is the cosine of the rotation angle. Getting the opposite transformation can be done by negating the X, Y, and Z components (which reverses the rotation direction), or by negating the W component (which flips the rotation axis). For why it does those, see the previous paragraph, and remember that negating a sine result is the same as negating the angle, and negating a cosine result is the same as a 180-degree offset of the angle. Since these operations cancel each other out, negating all 4 components will actually result in the same transformation, which is useful if you're trying to manipulate the sign of the W component. As a sphere coordinate (X^2 + Y^2 + Z^2 + W^2 = 1), it's easy to fix error accumulation by just renormalizing them, they're easy to store compactly because you can recalculate its W component (and force the sign), and you can interpolate them smoothly with spherical lerp. As a complex number, multiplying two quaternions produces the same result as combining their rotations the same way as a matrix concatenation would. If you need some code, you can rip off mine: http://svn.icculus.org/teu/trunk/tertius/src/tdp/tdp_rotation.hpp?view=log http://svn.icculus.org/teu/trunk/tertius/src/tdp/tdp_math_quat.hpp?view=log http://svn.icculus.org/teu/trunk/tertius/src/tdp/tdp_math_quat.cpp?view=log http://svn.icculus.org/teu/trunk/tertius/src/tdp/tdp_math_matrix.cpp?view=log (Has the matrix-to-quaternion code) If you want some no-bullshit explanation of the math involved and formulae: http://www.euclideanspace.com/maths/geometry/rotations/conversions/index.htm OneEightHundred fucked around with this message at 10:19 on Jun 13, 2008 |
# ? Jun 13, 2008 09:38 |
|
I usually start here: http://www.j3d.org/matrix_faq/matrfaq_latest.html
|
# ? Jun 13, 2008 16:47 |
|
How is animation handled in 3D with XNA? Is there a good tutorial perhaps?
vanjalolz fucked around with this message at 16:16 on Jun 15, 2008 |
# ? Jun 15, 2008 16:10 |
|
vanjalolz posted:How is animation handled in 3D with XNA? Is there a good tutorial perhaps? I know they have custom content processors to import animations. I'd just go download it and have a look through the documentation. It's quite extensive and practical stuff. OK here's something I'm curious about : I'm making a top down shooter. I've created my own archive format to store game info. I'm leaving all the art assets up to XNA, but I figured I'd build my own format to store all my animation and tileset data. The main reason for doing this was so that I could encrypt the data. I wrote a class library and it works like a charm. I can pack lots and lots of files easily, and get a MemoryStream of a file in the archive. You basically enter a password for each operation and if the password is wrong, the method just fails. Now my question is, what's the best way to store the key to the archive? The simple answer is to use the same key for all the archives and store it as a constant in the game, but I can't imagine that'd be very secure. Oh yeah, right now I'm using a symetrical key system.
|
# ? Jun 16, 2008 01:10 |
|
Intel Penguin posted:Now my question is, what's the best way to store the key to the archive? The simple answer is to use the same key for all the archives and store it as a constant in the game, but I can't imagine that'd be very secure. No method will, in practice, be any better than this. The DRM problem is incredibly hard to solve. What are you trying to prevent through your use of encryption? It sounds like you may be using the wrong tool for the job.
|
# ? Jun 16, 2008 01:22 |
|
Sounds like you're trying to stop people from editing the files to get an unfair advantage in game. I think you'd need to use some kind of CRC method for this, but ultimately you just need to put in more effort protecting your game than the hackers are willing to put in to break it.
|
# ? Jun 16, 2008 04:59 |
|
vanjalolz posted:Sounds like you're trying to stop people from editing the files to get an unfair advantage in game. I think you'd need to use some kind of CRC method for this, but ultimately you just need to put in more effort protecting your game than the hackers are willing to put in to break it. They could just edit the CRC to match the modified data. If he's trying to prevent editing by cheaters, then he wants to use a signature and a public key. If he's trying to protect his art assets from copying, then embedded watermarks might be the best plan. If he's trying to protect his game from wholesale piracy, then I have some bad news...
|
# ? Jun 16, 2008 07:42 |
|
ShoulderDaemon posted:They could just edit the CRC to match the modified data. It's the prevention of tempering I'm looking to prevent. Though I doubt anyone will have the motivation to crack my game. My project is so hobbyist. I don't plan on selling it, and chances are it won't go beyond my circle of friends. I was just curious.
|
# ? Jun 16, 2008 07:56 |
|
If it were for multiplayer cheat-prevention, I'd base the it on a hash of a host-dictated concatenation of random segments of loaded assets. Someone who could bypass that would probably write a trainer before bothering with content editing.
|
# ? Jun 16, 2008 08:08 |
|
Null Pointer posted:If it were for multiplayer cheat-prevention, I'd base the it on a hash of a host-dictated concatenation of random segments of loaded assets. Someone who could bypass that would probably write a trainer before bothering with content editing. Yeah, for multiplayer this means that the cheater needs to at least alter the program code or directly manipulate the network stream (and keep a copy of the unaltered files, but that's obviously easy). For single player, you probably want to just sign the data files, and store the public key in the program executeable. You could also hash the data files and store the hashes, but that means that every time you change the data, you have to recalculate the hash, alter the code, and rerelease the program. Either way, the cheater has to change the program executeable itself (which is far from difficult, but at least isn't trivial). If you have more time to put into this, then augment your data model: Wherever you would normally just have a constant in the data, add the possibility to use the CRC of a segment of a data file, XORed with a constant (with the other data file, the start and end of the segment, and the XOR constant specified inline). Then just pepper your data files with spaghetti references to eachother. A cheater could still attack the data files, but they'd have to write a helper program to undo the cross-references first, or risk random in-game corruption. To make it even more devious, incorporate the same references into your program code, at critical points of the program.
|
# ? Jun 16, 2008 08:21 |
ShoulderDaemon posted:A cheater could still attack the data files, but they'd have to write a helper program to undo the cross-references first, or risk random in-game corruption. Also, he should pepper the assets directory with goatse pictures in random formats and sizes to keep people from digging around in the content folder.
|
|
# ? Jun 16, 2008 23:05 |
|
Related, there's a fascinating article on crack-protection at Gamasutra.
|
# ? Jun 17, 2008 03:27 |
|
I want to convert eye-coordinates into world-coordinates in my geometry shader, but soemthing is a bit off here:code:
edit: nevermind, got it. heeen fucked around with this message at 18:30 on Jun 17, 2008 |
# ? Jun 17, 2008 18:06 |
|
I'm working on product that has a haptic knob on it, and I want to add an easter egg, so I'm thinking of break out. It seems simple enough, since I don't have much time to work on it. The only thing I don't know is the rule for the ball bouncing off of the paddle. I know the angle varies by the position the ball strikes the paddle, but does anybody know exactly how? Or, what are some other simple knob based games I could implement that could make use of force feedback? For breakout, I'm just making the user feel a bump as the paddle hits the wall.
|
# ? Jun 19, 2008 16:21 |
|
FigBug posted:I'm working on product that has a haptic knob on it, and I want to add an easter egg, so I'm thinking of break out. It seems simple enough, since I don't have much time to work on it. The only thing I don't know is the rule for the ball bouncing off of the paddle. I know the angle varies by the position the ball strikes the paddle, but does anybody know exactly how? There's always the original dial game, "Pong"
|
# ? Jun 19, 2008 16:59 |
|
FigBug posted:breakout If you know how to work out the default angle, then you can just fudge it depending on how far away [the ball and paddle collision point is from the center of the paddle]. vanjalolz fucked around with this message at 03:25 on Jun 20, 2008 |
# ? Jun 19, 2008 17:02 |
|
FigBug posted:I'm working on product that has a haptic knob on it, and I want to add an easter egg, so I'm thinking of break out. It seems simple enough, since I don't have much time to work on it. The only thing I don't know is the rule for the ball bouncing off of the paddle. I know the angle varies by the position the ball strikes the paddle, but does anybody know exactly how? You might want to try something where you add the distance from the center of the paddle to the ball to the ball's x speed, then do something like (assuming you're using some sort of vector for the ball's speed) normalize the ball's speed, and multiply it by the speed you want. I haven't tried this, so I have no idea how it works in practice.
|
# ? Jun 20, 2008 00:13 |
|
Intel Penguin posted:It's the prevention of tempering I'm looking to prevent. Though I doubt anyone will have the motivation to crack my game. Delayed-response poisoning strikes me as one of the best solutions because it makes the trial-and-error process much more time-consuming: In single-player games, remove something critical that makes the game unbeatable. In multi-player games, delay bans for a long time after the cheats are detected. In either, act buggy. Personally, for multiplayer games, I really think the solution is to make a better player moderation system. I've seen too many games where, for example, kick votes invariably fail to go through because they require a majority vote and the people who aren't getting griefed or steamrolled by a cheater can't be bothered to vote. There has to be a better way. OneEightHundred fucked around with this message at 11:12 on Jun 21, 2008 |
# ? Jun 21, 2008 11:09 |
|
OneEightHundred posted:Personally, for multiplayer games, I really think the solution is to make a better player moderation system. I've seen too many games where, for example, kick votes invariably fail to go through because they require a majority vote and the people who aren't getting griefed or steamrolled by a cheater can't be bothered to vote. There has to be a better way. maybe everyone HAS to vote, but you can choose to abstain in which case your vote is taken out of the equation. or let the players report others and keep logs of the games for proof.... ugh. it's almost not worth it.
|
# ? Jun 22, 2008 02:32 |
|
Only games I've seen require you to enter a menu and add a vote to kick. When X number of votes are reached, it kicks. Its not a yes/no vote, its a vote to kick.
|
# ? Jun 22, 2008 13:47 |
|
I'm not saying that there needs to be a better way to do a kick vote, if anything I think kick votes have repeatedly proven their uselessness. Compulsory voting would be far too easily abusable for griefing. There are other forms of player moderation, like karma-type systems, but the only one that doesn't suck horribly is "have a shitload of admins." I'm trying to come up with a better way of letting the players clear the shitheads off servers, because if something like that exists, problematic cheaters would not get far, and it would have benefits in getting rid of other problems as well, i.e. griefers. OneEightHundred fucked around with this message at 22:15 on Jun 22, 2008 |
# ? Jun 22, 2008 22:04 |
|
Oh yeah, I also want to encrypt the save games. I know people will probably be able to crack it fairly easily, but I think any encryption is better than exposing the savegames as plaintext.
|
# ? Jun 23, 2008 22:22 |
|
Plaintext saves aren't a great idea for numerous reasons, especially if you're using floating point numbers which lose information when converting to/from ASCII. Regardless, hacking savegames is probably the last thing you should worry about. It's more likely someone will just write a trainer, in which case anything you do to the savegame data is kind of moot. I really have to ask: What do you expect to get out of all this security? Is the title you're releasing even big enough for people to waste their time hacking it?
|
# ? Jun 24, 2008 09:43 |
|
If you just want a quick and dirty method to stop people messing with the file, then hard-code a salt value into the exe and append the MD5 of the save file contents + salt to the end of the save file. It's not going to stop anyone with enough nouse to go through your exe to find the salt value and write a tiny tool to 'sign' modified save files, but then you were never going to stop someone with the skills to do that anyway.
|
# ? Jun 24, 2008 11:10 |
|
OneEightHundred posted:Plaintext saves aren't a great idea for numerous reasons, especially if you're using floating point numbers which lose information when converting to/from ASCII. Regardless, hacking savegames is probably the last thing you should worry about. It's more likely someone will just write a trainer, in which case anything you do to the savegame data is kind of moot. My need for it isn't proportionate to the number of replies I've gotten. I was just curious, really. and no, it's not really worth too much security. I just wanted a "quick and dirty" method like the one just posted above. Although the idea of someone actually writing a trainer for my game is kind of cool.
|
# ? Jun 25, 2008 01:34 |
|
Another semester, another delightful project unit - this time we're allowed to use C++ though :v Same trouble as before (many pages ago), Quaternion twist. ie. When in free-look mode with the camera (space-sim style), a rotation of left-down-right-up or any similar combo will end up with a slight twist around the z axis. Code is here: http://chimtest.game-host.org/CameraExample.rar Please ignore the lovely glbase code, I'm just using it to drop in the class and test it. Function that probably causes it: Camera::glCamera() (Camera/Camera.cpp) You're also welcome to mock my unfinished code and suggest improvements / berate me for doing stupid things. e; logic in my brain suggests that this is intentional quaternion rotation (which I can explain properly with my hands but not on paper) ee; vanja is gay Murodese fucked around with this message at 15:48 on Jun 25, 2008 |
# ? Jun 25, 2008 15:39 |
I've got a message rendering function and a strange problem associated with it:code:
Jo fucked around with this message at 04:26 on Jun 29, 2008 |
|
# ? Jun 28, 2008 17:24 |
|
|
# ? May 25, 2024 14:20 |
|
Jo posted:I'm not sure why that one line would make so much of a difference. I've tried changing textures to no avail. Double check that your font texture is loaded properly, and make sure you're rebinding the old texture once you're done (with the font drawing stuff). eee; Muro your code is bad, consider yourself berated. Quaternion sounds so much like quantum physics.
|
# ? Jun 29, 2008 04:49 |