|
Yeah, shaders with a 1D lookup texture for the palette is probably the best way to go.
|
# ? Mar 12, 2008 22:08 |
|
|
# ? May 13, 2024 07:33 |
|
I'm cross-posting this with the XNA thread: I've added the GamerServicesComponent to my game, but it looks like I need to do something about controls when the Live Guide is open. Say I have a sprite on the game screen that moves left and right with the D-Pad. When I open up the Live guide and I'm hitting left and right to change tabs, my sprite is still moving inside the game in the background. Is there a way to disable controls when the guide is open?
|
# ? Mar 13, 2008 00:39 |
|
Ferg posted:I'm cross-posting this with the XNA thread: The Microsoft.Xna.Framework.GamerServices.Guide has a property called IsVisible. That should tell you whether the guide is up, so you can ignore input.
|
# ? Mar 13, 2008 01:27 |
|
more falafel please posted:The Microsoft.Xna.Framework.GamerServices.Guide has a property called IsVisible. That should tell you whether the guide is up, so you can ignore input. Awesome, thanks! While we're on the subject, is there a way with GamerServices to have a gamer's profile display the game they're playing as opposed to XNA Studio? My anal retentive side wants others to see what game I'm actually playing rather than seeing that I'm "just" using XNA studio.
|
# ? Mar 13, 2008 03:39 |
|
king_kilr posted:I'm looking to build a game similar to Operation Space Hog(for those of you who haven't played it, a) check it out, its free, b) it's a 2d scroller space game where you have a ship and you get upgrades and stuff), with the intention of ultimately making it online-coop, I'd like to build it in python(by far my strongest language), any recommendations for what library to use, my understanding is that it would be either PyGame or PySoy, any other advice would be great. PySoy doesn't make much sense for 2D games and as far as I can tell its developers don't recommend it be used in real projects yet anyway. Look into Pyglet for graphics/audio/input and Twisted for the networking layer. My experience with both libraries is very limited but they stood out ahead of the rest when I was evaluating these things a while back.
|
# ? Mar 13, 2008 04:02 |
|
trashmatic posted:PySoy doesn't make much sense for 2D games and as far as I can tell its developers don't recommend it be used in real projects yet anyway. Very cool, thanks, the networking stuff I'm going to look at later, first I want to put together the game, pyglet doesn't appear to have linux support, or can I just download the source and put it on my python path.
|
# ? Mar 13, 2008 04:41 |
|
Ferg posted:Awesome, thanks! It looks like rich presence is not supported in the XNA framework at this point, but supposedly they're working on it. The way MS does rich presence requires some server-side support that I'm not sure they want to support for XNA games.
|
# ? Mar 13, 2008 04:54 |
|
I got pyglet through the Arch Linux AUR. But in any case, I think all you need to do is unpack the source tarball and do a 'python setup.py install'. EDIT: Actually, scratch that. What you really want to do is get the new alpha and just run easy_install on the .egg file. Grab the docs as well, and check out the 'astraea' example game. trashmatic fucked around with this message at 05:24 on Mar 13, 2008 |
# ? Mar 13, 2008 04:59 |
|
Someone asked earlier about a 2D game engine in C#: I've been playing around with SDL.net a bit and I'm fairly impressed with it. AnimatedSprite classes sure do take out a lot of the work.
|
# ? Mar 13, 2008 05:35 |
|
vanjalolz posted:Someone asked earlier about a 2D game engine in C#: I've been playing around with SDL.net a bit and I'm fairly impressed with it. AnimatedSprite classes sure do take out a lot of the work. This is quite awesome - thanks.
|
# ? Mar 13, 2008 19:22 |
|
So I'm working on putting together some basic AI for a 2d sidescroller a la mario. (Although it is a fair bit more complex than Mario, but it's from the same angle.) Due to the nature of the gameplay and plot, I need to have a number of enemy types that can arbitrarily respond to any other enemy type (and indeed, any unusual object in their environment.) My first thought was to follow the standard object oriented approach -- model it like it exists in the real world. But I realized that would be unbelievably complex, and way more work than needed, and I started to do some reading. One model that particularly stuck out to me was a 'smart-world' or stimulus based approach. Rather than having each AI evaluate what everything in the world meant for their situation, I would drop little 'beacons' into the world that projected a type in a certain radius. So one might be food, or enemy, or loud noise, or fear... etc. Then, the AI for a unit just polls the nearby beacons, selects which is the highest priority, and changes state appropriately. That seems straightforward enough to me. However, I'm looking into doing some pathfinding for my characters. The easiest (and most coarse) method is just to push them around until they stop moving, and then turn them, and push a different direction. That's what my first prototypes did, and I'm not satisfied. I've read about A* and nodegraphs, and I can see how I might use these to navigate with a flying agent, land based enemies don't seem to make sense. Can anyone point me to resources (or give me some pointers [HA! programming joke!]) on managing 2D navigation?
|
# ? Mar 15, 2008 22:41 |
|
Pfhreak posted:Can anyone point me to resources (or give me some pointers [HA! programming joke!]) on managing 2D navigation? It really depends on what kind of terrain you are talking about and how your characters move. Can you give us a better idea?
|
# ? Mar 16, 2008 02:18 |
|
very posted:It really depends on what kind of terrain you are talking about and how your characters move. Can you give us a better idea? Yeah. We're using a physics library, and all of the agents will be affected by it. We are defining the world using textured polygons of arbitrary size. Thus, the world isn't tiled. The agents have a bounding box that defines their collision size, and they currently move back and forth by sliding along the ground. (By altering their linear velocity.) Does that help? I'm trying to think of a similar game. Abuse is pretty close. (Actually, they make their source available, maybe I'll check that out!)
|
# ? Mar 16, 2008 03:50 |
|
Pfhreak posted:
I have had an AI class in Uni, but havent worked on game-purpose AI (yet), so read the following with a grain of salt. Why do you have trouble dealing with land based navigation? Id assume its the same as air navigation, only the network of nodes were the agent can move to is more limited (id suppose you switch that by altering the costs on the edges that link to non-ground nodes and setting it to infinity, thus causing any algorithms you run on your new node network to consider those edges as "impassable" objects). I would also assume that each edge on your network has an associated action with which a client can traverse said edge (for instance if node A is on the ground and node B is directly above node A (in the air), then the action from A->B would be "jump"). You can use A*, or some other optimal solution finding algorithm to determine the optimal action for your agent at any time (actions judged by their end results). If you know your intended action (for instance a Goomba in Mario would want to try and get to the square that mario is in) you can run a shortest path algorithm to determine the optimal path from the agent's current node to the target node. Then have your agent follow that path by traversing the edges the shortest path algorithm returns.
|
# ? Mar 16, 2008 04:02 |
|
Pfhreak posted:Yeah. We're using a physics library, and all of the agents will be affected by it. We are defining the world using textured polygons of arbitrary size. Thus, the world isn't tiled. The agents have a bounding box that defines their collision size, and they currently move back and forth by sliding along the ground. (By altering their linear velocity.) Abuse uses tiles, but it'll probably still be useful.
|
# ? Mar 16, 2008 04:08 |
|
This might be a really simple question, but I'm having a giant brainfart. Using XNA: My levels have a time limit. I'd like to display remaining time left on-screen, but only in seconds. I initialize my 'timer' variable to the map's timeLimit variable, but code:
code:
What's the logic I need here?
|
# ? Mar 16, 2008 18:53 |
|
IcePotato posted:This might be a really simple question, but I'm having a giant brainfart. Timer = TimeLimit StartingTime = gameTime.TotalRealTime.seconds; then in the idle function do Timer = Timer - (gameTime.TotalRealTime.Seconds - StartingTime); If i figure it out correctly gameTime is the time since the start of the game (that's how GLUT counts time if i recall correctly). So you need the time at which the level starts rolling (Starting Time) and you subtract that from the current time value when you want to update the timer, giving you the elapsed time in seconds. Not 100% sure though, cause i havent done any XNA development.
|
# ? Mar 16, 2008 20:23 |
|
IcePotato posted:doesn't work, because that's the elapsed time between steps. Why doesn't that work, isn't that what you want? I'm assuming you want to update the timer whenever Update is called, and subtract off the elapsed time since the last time update was called. You'll get that from gameTime.elapsedGameTime. [edit] Ah I see. Yes, you want elapsedGameTime, not elapsedRealTime.
|
# ? Mar 17, 2008 02:24 |
|
stromdotcom posted:Why doesn't that work, isn't that what you want? I'm assuming you want to update the timer whenever Update is called, and subtract off the elapsed time since the last time update was called. You'll get that from gameTime.elapsedGameTime. thanks - I didn't really understand the difference. Ended up fixing it by taking the value of the map's timer, multiplying by 1000 to get milliseconds, and subtracting the value of elapsedGameTime in milliseconds. Then when I draw my time, I just divide timer by 1000 to go back to seconds.
|
# ? Mar 17, 2008 16:08 |
|
For those of you working with XNA, I got a bunch of requests to do a series of tutorials on building animated models with Blender for XNA and finally did it. This has always been a major stopping point for me -- either I hire someone to do it, or the project dies. I always just wanted to know how to whip up something temporary in Blender and get it to work, and then hand it off to a modeler. Links: Part 1: Non-UV Texturing Part 2: UV Texturing Part 3: Rigging Part 4: Animating and Exporting The topic comes up every 5 seconds on the XNA forums, so these were geared towards coders.
|
# ? Mar 19, 2008 22:26 |
|
stromdotcom posted:For those of you working with XNA, I got a bunch of requests to do a series of tutorials on building animated models with Blender for XNA and finally did it. This has always been a major stopping point for me -- either I hire someone to do it, or the project dies. I always just wanted to know how to whip up something temporary in Blender and get it to work, and then hand it off to a modeler.
|
# ? Mar 20, 2008 01:31 |
|
Wow, this has a lot of promise.
|
# ? Mar 20, 2008 01:46 |
|
stromdotcom posted:For those of you working with XNA, I got a bunch of requests to do a series of tutorials on building animated models with Blender for XNA and finally did it. This has always been a major stopping point for me -- either I hire someone to do it, or the project dies. I always just wanted to know how to whip up something temporary in Blender and get it to work, and then hand it off to a modeler. Very nice.
|
# ? Mar 20, 2008 15:49 |
|
Quaternion camera question~ The way I'm doing it is basically this; if key = a m_x -= 1.0f if key = d m_x += 1.0f .. so on for y/z (m_y, m_z) drawloop { m_camera = quatmultiply(m_camera, eulertoquat(m_x, m_y, m_z)) m_x = m_y = m_z = 0 matrix = quatcreatematrix(m_camera) glMultMatrix(matrix) glTranslatef(-m_position.x, -m_position.y, -m_position.z) } Which works great. Except in one case. It suffers from standard rotate x then y != rotate y then x. It does not suffer from gimbal lock, however. As an example, if you yaw left 20 units, pitch up 20 units, yaw right 20 units, pitch down 20 units, you'll end up rolled right very slightly from your previous rotation. Any ideas?
|
# ? Mar 20, 2008 16:08 |
|
You're not taking the camera's current orientation into account when rotating, so all rotations are being performed around the same 3 axes. You need to take the axis the key command is supposed to rotate around and rotate *that* to be relative to the camera before using it to change the camera itself. I made a fairly long post about this a few pages back. You already have most of it down, so just look at the last two blocks. haveblue fucked around with this message at 16:24 on Mar 20, 2008 |
# ? Mar 20, 2008 16:22 |
|
HB posted:You're not taking the camera's current orientation into account when rotating, so all rotations are being performed around the same 3 axes. You need to take the axis the key command is supposed to rotate around and rotate *that* to be relative to the camera before using it to change the camera itself. So if I'm understanding right, to yaw I should be getting the "y" axis from the current rotation and multiplying the current rotation by the quat generated by (m_x, ("y")) instead, then doing the same for the other axes that need to be rotated that frame?
|
# ? Mar 20, 2008 16:37 |
|
Murodese posted:So if I'm understanding right, to yaw I should be getting the "y" axis from the current rotation and multiplying the current rotation by the quat generated by (m_x, ("y")) instead, then doing the same for the other axes that need to be rotated that frame? Pretty much. You already have the current camera orientation as a quat. You take the natural Y axis and rotate it with this quat, so that from the camera's perspective it's where the Y axis should be. Then you rotate the camera around this new axis by the amount the user inputted.
|
# ? Mar 20, 2008 16:47 |
|
I'm teaching myself HLSL and am having a real bear of a time with it. I can follow the tutorials showing how to apply a basic effect, and I can implement other peoples shader files (if they have sample code...) but I'm having trouble making the logical breakthrough to implementing more than just a basic effect. For example: I have seen samples of normal mapping and cel shading, but can't figure out how I would apply both effects given that the samples I have render in distinct ways. XNA is the platform I am using and really all I need is a good source of reference for building increasingly complex effects, preferably starting off simple and building from there. I find the examples of XNA to be to basic, and the white pages on MSDN goes from shallow to deep with little notice. What sources would your recommend? Also, if anyone just likes talking about this mind melting poo poo feel free to PM/IM me.
|
# ? Mar 21, 2008 22:52 |
|
Use Render Monkey if you're just playing around with shaders. You can compile and debug any kind of shader(GLSL, HLSL, CG). As for how they work, polish up on your linear algebra. Shaders are 1,000,000% mathematics.
|
# ? Mar 21, 2008 23:52 |
|
One of my problems is I can't find any examples of doing something like I want to do, so maybe you could answer this. If I wan't to have normal mapping and toon shading in one shader, should they be different passes in the same technique, or different techniques?
|
# ? Mar 21, 2008 23:59 |
|
Girl With Huge Tits posted:One of my problems is I can't find any examples of doing something like I want to do, so maybe you could answer this. If I wan't to have normal mapping and toon shading in one shader, should they be different passes in the same technique, or different techniques? You should be able to write a shader that does both. One technique involves calculating the fragment color based on the normal, the other is calculating the normal by a transformation of a texture sample. If you can find examples of both it should be relatively simple to create a shader that does one and feeds the result into the second.
|
# ? Mar 22, 2008 00:27 |
|
Girl With Huge Tits posted:One of my problems is I can't find any examples of doing something like I want to do, so maybe you could answer this. If I wan't to have normal mapping and toon shading in one shader, should they be different passes in the same technique, or different techniques? You can call functions from other functions. So if you add functions to do the two effects, then do something like: code:
|
# ? Mar 22, 2008 01:55 |
|
god drat I am so bad at basic math. I'm trying to calculate the path of a bullet in my top-down strategy game - basically I want to draw the bullet moving at a specific speed until it hits something.code:
|
# ? Mar 24, 2008 16:22 |
|
totalSeconds is not the time of that frame, it's the total time elapsed since your game was launched. You have to calculate the frame time by storing the elapsed time from the last frame and finding the difference.
|
# ? Mar 24, 2008 16:33 |
|
HB posted:totalSeconds is not the time of that frame, it's the total time elapsed since your game was launched. You have to calculate the frame time by storing the elapsed time from the last frame and finding the difference. at some point I am going to stop and wonder how many times I will make the same loving mistake. Unfortunately I don't have time for that now because I need to completely refactor my engine - all of my rookie, this-is-my-first-game mistakes have piled up to the point that I feel better just redoing almost everything. Well, at least I'll have a lot of good material for my end-of-semester report. e: wait, no. I might've gotten this part right - According to the doc, ElapsedGameTime is the amount of time since the last frame, .TotalSeconds just gives me a double with the fractional number of seconds, as opposed to .Seconds, which only gives an int containing whole seconds IcePotato fucked around with this message at 16:39 on Mar 24, 2008 |
# ? Mar 24, 2008 16:36 |
|
Does anyone have any good tutorial links to a tile engine in C#? I've been following XNAResources.com but their tutorials are outdated and ever since updating to XNA 2.0 things like EnsureDevice(), BeginScene() and EndScene() are broken and I've little idea of how to fix them.
|
# ? Mar 24, 2008 17:15 |
|
Cedra posted:Does anyone have any good tutorial links to a tile engine in C#? I've been following XNAResources.com but their tutorials are outdated and ever since updating to XNA 2.0 things like EnsureDevice(), BeginScene() and EndScene() are broken and I've little idea of how to fix them. I've only glanced briefly at it, but this looks good: http://www.kersson.com/articles/article.aspx?ar=41
|
# ? Mar 24, 2008 18:42 |
|
IcePotato posted:
Location is the location of the bullet, and path returns the current location of the bullet? I'm assuming you call path like code:
VVVV That too. You should normalize your "slope" vector, and multiply by speed * time. Jake Armitage fucked around with this message at 23:04 on Mar 24, 2008 |
# ? Mar 24, 2008 18:53 |
|
IcePotato posted:god drat I am so bad at basic math. I'm trying to calculate the path of a bullet in my top-down strategy game - basically I want to draw the bullet moving at a specific speed until it hits something. I'm confused as to why you're dividing your direction vector by speed*time instead of multiplying it, for one.
|
# ? Mar 24, 2008 22:08 |
|
|
# ? May 13, 2024 07:33 |
|
position += velocity * deltaTime
|
# ? Mar 25, 2008 00:37 |