• What do you need help with? V. 3.0
    4,884 replies, posted
[QUOTE=esalaka;30912716]I personally use my remote shell for that but I think there was a host that let you host privately.[/QUOTE] What about cheap Git Hosting? I saw GitHub but I still feel that $7 is a bit too much for just 3 people working on a small project
Looking for tutorials on how to use PDCurses with C++. Anyone got some?
I'm working on a client / server system using TCP, and it works great when the server and clients are on the same computer. But if I try and host on my PC, and join from my laptop, it times out while trying to connect to the server. Both are on my local network. What sort of things do I need to set up to let them communicate over a local network?
[QUOTE=theJohn;30913319]Looking for tutorials on how to use PDCurses with C++. Anyone got some?[/QUOTE] [url]http://tldp.org/HOWTO/NCURSES-Programming-HOWTO/[/url] ncurses and pdcurses are basically identical, so that'll do. It's a very good set of tutorials.
I've posted my collision problem in a more ordered manner here [URL]http://gamedev.stackexchange.com/questions/14486/2d-platformer-aabb-collision-problems/[/URL] Can someone take a look at it?
I'm trying to create a plugin for Firefox that finds words and replaces them with other words. However, I want to replace certain instances of bb code on Facepunch. Where should I start?
Has anyone used polycode with C++? I need some help, getting stupid errors like unable to open windows.h
<rerr> [editline]5th July 2011[/editline] I need help on deciding how to try to parse a Makefile-like language it is very crucial and I don't know shit about parsers :saddowns:
[QUOTE=SupahVee;30914960]I've posted my collision problem in a more ordered manner here [URL]http://gamedev.stackexchange.com/questions/14486/2d-platformer-aabb-collision-problems/[/URL] Can someone take a look at it?[/QUOTE] I've got the same problem now, but solved it with a different approach. Try this: [url]http://pastebin.com/9GDGeZNb[/url] This approach tests the 4 corners of the player (assuming player and tiles/aabbs are the same size) There are 3 cases that can happen (normally). Only one sensor is active, this happens when the player collides with a single block. Two sensors, happens when standing, colliding with a wall (in flight)... Three sensors, when _walking_ against a wall with active gravity. Try it and tell me if this helped... edit: Don't wonder about the if(true), I just used it so I can collapse that region. And "SmallestComponents()" is that: [code] private Vector2 SmallestComponents(List<Vector2> collection) { float x = collection[0].X; float y = collection[0].Y; for (int i = 1; i < collection.Count; i++) { if (Math.Abs(collection[i].X) < Math.Abs(x)) x = collection[i].X; if (Math.Abs(collection[i].Y) < Math.Abs(y)) y = collection[i].Y; } return new Vector2(x,y); } [/code]
[QUOTE=Felheart;30918155]I've got the same problem now, but solved it with a different approach. Try this: [url]http://pastebin.com/9GDGeZNb[/url] This approach tests the 4 corners of the player (assuming player and tiles/aabbs are the same size) There are 3 cases that can happen (normally). Only one sensor is active, this happens when the player collides with a single block. Two sensors, happens when standing, colliding with a wall (in flight)... Three sensors, when _walking_ against a wall with active gravity. Try it and tell me if this helped... edit: Don't wonder about the if(true), I just used it so I can collapse that region. And "SmallestComponents()" is that: [code] private Vector2 SmallestComponents(List<Vector2> collection) { float x = collection[0].X; float y = collection[0].Y; for (int i = 1; i < collection.Count; i++) { if (Math.Abs(collection[i].X) < Math.Abs(x)) x = collection[i].X; if (Math.Abs(collection[i].Y) < Math.Abs(y)) y = collection[i].Y; } return new Vector2(x,y); } [/code][/QUOTE] I tried your method but it doesn't seem to work, it crashes if I hit a wall on the left (because Overlaps.Count is 0) and is generally buggy :(
Overlaps.Count can only be 0 if Collisions == 0. If Collisions == 0, then Overlaps is not used. Look at the original code, my guess is that you made a small mistake / change. Try to step trough the code with the debugger. And what kind of exception is thrown? Also, "generally buggy" is NOT a helpful description of what exactly is wrong, please be more precise. edit: you didn't just blindly copy my example code, or? Maybe your problem is in line 25? x and y can be out of your level bounds. I catch that in "IsTileSolid" in my game...
I decided on using a BoundingSphere for my light, although now I'm not entirely sure how I would block the tiles through walls from being lit up as well.
[QUOTE=Felheart;30923142]Overlaps.Count can only be 0 if Collisions == 0. If Collisions == 0, then Overlaps is not used. Look at the original code, my guess is that you made a small mistake / change. Try to step trough the code with the debugger. And what kind of exception is thrown? Also, "generally buggy" is NOT a helpful description of what exactly is wrong, please be more precise. edit: you didn't just blindly copy my example code, or? Maybe your problem is in line 25? x and y can be out of your level bounds. I catch that in "IsTileSolid" in my game...[/QUOTE] I found the problem. I was setting the bounds to Position.X/Position.Y where it should've been Position.X - Width / 2 and Position.Y - Width / 2. It seems to work, but it fails in this situation: [img]http://dl.dropbox.com/u/3724424/Programming/diagram3.png[/img]
I am trying to switch from DevC++ to Visual Studio 2008. I installed it and DirectX SDK. When I try to build some DX project I get: Error 1 fatal error C1083: Cannot open include file: 'd3dx9.h': No such file or directory c:\documents and settings\antonio\desktop\new folder\main.h 13 dxgraphics03 [sp]Yes I am the definition of a noob.[/sp]
[QUOTE=SupahVee;30923393]I found the problem. I was setting the bounds to Position.X/Position.Y where it should've been Position.X - Width / 2 and Position.Y - Width / 2. It seems to work, but it fails in this situation: [img]http://dl.dropbox.com/u/3724424/Programming/diagram3.png[/img][/QUOTE] Thats right. I didn't think of tiles placed that way. The fix is very easy. I have made an elegant solution for the problem by reusing the 3point collision code: [url]http://pastebin.com/rmiyXqKD[/url] [QUOTE=Cello]Multidimensional arrays are easy but they can get pretty inefficient with large sets of data. If you reduce your map down to a 1D array, you can find the neighboring cells by: map[currentIndex+gi+gj] Where gi's values are -mapWidth, 0, +mapWidth and gj ranges from -1...1[/QUOTE] That sounds interesting. Why would multidimensional arrays be slower/inefficient? Also, excuse me for being dumb but I don't get how I would get the neighboring 8 cells. Could you explain all this a bit more in detail please? Would be real nice to speed up my game (that has huge levels). @NotoriousSpy: Without shaders I think your only hope will be to trace a ray to every tile inside the bounding sphere of the light. I have the feeling that this will be pretty resource hungry, but as long as you only have a few lights it should be absolutely no problem...
[QUOTE=Felheart;30924183]Thats right. I didn't think of tiles placed that way. The fix is very easy. I have made an elegant solution for the problem by reusing the 3point collision code: [url]http://pastebin.com/rmiyXqKD[/url] [/QUOTE] Thanks! That fixed it. I found two more problems, though. --- [img]http://dl.dropbox.com/u/3724424/Programming/bug1.gif[/img] When falling down at an high enough speed, and sliding towards a wall, the player gets trough the floor. --- [img]http://dl.dropbox.com/u/3724424/Programming/bug2.gif[/img] If I keep the jump key pressed, hitting a corner of a wall while in the air will make the player jump again immediately without resetting velocity.
Google helped me build that poject :) @SupahVee: How do you make these gifs ? Edit: When you fix all the colliding stuff, ditch the game and sell that code ;)
[QUOTE=SupahVee;30924492]Thanks! That fixed it. I found two more problems, though. --- (large image) When falling down at an high enough speed, and sliding towards a wall, the player gets trough the floor. --- (large image) If I keep the jump key pressed, hitting a corner of a wall while in the air will make the player jump again immediately without resetting velocity.[/QUOTE] 1. There is no easy fix to this. It's an obvious flaw in the algorithm. Option a) Clamp the maximum velocity. Option b) Do more updates per frame. Option c) The best solution: If the velocity passes a custom threshold, do more iterations of the collision algorithm with smaller time values. This will save performance and still be perfectly accurate, but it might take a few minutes to implement ;) 2. You should be able to figure this out. It's so easy I'm not going to explain this. Besides, this is not a bug having anything to do with the collision function. It's more likely a bug in your engine. The only thing that would help is to reset Velocity.Y at the correct point and as already said, that point should be very easy to find. By the way, how do you record those gifs ? What program do you use?
[QUOTE=Felheart;30924843]1. There is no easy fix to this. It's an obvious flaw in the algorithm. Option a) Clamp the maximum velocity. Option b) Do more updates per frame. Option c) The best solution: If the velocity passes a custom threshold, do more iterations of the collision algorithm with smaller time values. 2. You should be able to figure this out. It's so easy I'm not going to explain this. Besides, this is not a bug having anything to do with the collision function. It's more likely a bug in your engine. The only thing that would help is to reset Velocity.Y at the correct point and as already said, that point should be very easy to find. By the way, how do you record those gifs ? What program do you use?[/QUOTE] CamStudio + VirtualDub. Here's another gif with the moving platforms and also some problems. These are harder to reproduce. Any idea if these can be fixed? [img]http://dl.dropbox.com/u/3724424/Programming/bug3.gif[/img]
I don't know if it's your drawing function, but your tiles/rectangles/whatever seem to overlap. I'm not absolutely sure if that is causing the problems, but it might be. Try to make all BoundingBoxes not overlap each other! The bug at the end of your gif... it seems to be a combination of being pressed out of the level by the spikes and not enough collision checks per frame... Are you sure you call the collision routine every time the other things in your level changed the position? Try to make the collision-boxes of the spikes bigger, as big as a tile. Does this fix the problem?
[QUOTE=Felheart;30925339]I don't know if it's your drawing function, but your tiles/rectangles/whatever seem to overlap. I'm not absolutely sure if that is causing the problems, but it might be. Try to make all BoundingBoxes not overlap each other! The bug at the end of your gif... it seems to be a combination of being pressed out of the level by the spikes and not enough collision checks per frame... Are you sure you call the collision routine every time the other things in your level changed the position? Try to make the collision-boxes of the spikes bigger, as big as a tile. Does this fix the problem?[/QUOTE] They look like they're overlapping because of the draw code (the borders). They're not overlapping. I call the collision routine once per frame, on every object. Should I call it more often?
Ok. Once per frame should be enough. In the gif it looks like the spike-hitbox is smaller than the tiles. Did you try to increase its size? Make the spikebox the same size as the tiles your level is build with and see if this helps. Maybe the speeds/velocities might be to big. (solution: more and smaller updates) Or some unhandled corner cases in the collision function might be the problem. Try to get some values for when the function produces an error / generally use the debugger to find out what exactly is wrong...
I dont understand what i am getting this error D:\sfml2\SFML2test\Engine.cpp|28|error: expected primary-expression before ';' token| [code] class Tile { private: sf::Sprite baseSprite; int tileId; public: static ImageManager* imgMgr; Tile(int tileid); ~Tile(); void setImage(int tileid); void Draw(int x, int y, sf::RenderWindow* rw); int GetTileID(){return tileId;} }; [/code] Here: Tile::imgMgr = &ImageManager; Edit: yes i know im a noob, but why this is funny? tell me
So I was inspired by that guy a few pages back who wrote a program to parse a fp thread for its ratings, and I decided to blatantly copy him, except I would make it better. Have a nice list of each user who posted, how many times they posted, average posts per page, total ratings, total x rating, average x rating per page etc. I hit a little snag because htmlagilitythinger wants me to use XPath, which I have no idea how to use. Could someone write me an xpath query that selects all <li> tags who's class value contains the string 'postcontainer'? The class value is longer than that, so it has to contain it, not be equal to it. I tried this, but it said it was null (I guess that means it didn't find any matches.) [code] li[contains(@class, "postcontainer")] [/code]
I want to make a Firefox Plugin that replaces all hd tags with media tags. Where should I start?
How do I remove the System.Windows.Forms.TextBox, Text: and just have the input [img]http://gyazo.com/30a05be84374c69643277485401d6c36.png[/img]
[QUOTE=Ardosos;30930872]I want to make a Firefox Plugin that replaces all hd tags with media tags. Where should I start?[/QUOTE] just make a userscript [code] hd_video_tags = document.getElementsByClassName("hd_video"); for (i = 0; i < hd_video_tags.length; i++) { hd_video_tags[i].setAttribute("class", "video"); } [/code]
[QUOTE=Doritos_Man;30931033]How do I remove the System.Windows.Forms.TextBox, Text: and just have the input [img]http://gyazo.com/30a05be84374c69643277485401d6c36.png[/img][/QUOTE] can we see the code you used to bring that messagebox up?
[QUOTE=robmaister12;30931310]can we see the code you used to bring that messagebox up?[/QUOTE] [code] private void button1_Click(object sender, EventArgs e) { MessageBox.Show("Username: " + UsernameInput + "\n" + "Password: " + PasswordInput); }[/code]
[QUOTE=bobthe2lol;30930743]Could someone write me an xpath query that selects all <li> tags who's class value contains the string 'postcontainer'? The class value is longer than that, so it has to contain it, not be equal to it. I tried this, but it said it was null (I guess that means it didn't find any matches.) [code] li[contains(@class, "postcontainer")] [/code][/QUOTE] Your predicate looks right, but remember that the default axis is child::, and the <li> elements you seek are probably not direct children of the root node (or whatever you're using as your context node). You could specify descendant::li to search all descendants of the context node, or use the shorthand //li to ignore the context node and just search the whole document. [editline]5th July 2011[/editline] BTW, consider that the @class might contain something like "myweirdpostcontainerclassname" that would pass the contains() check, but isn't actually the same CSS class name. If you want to be really precise with the predicate, you could do something like [code]//li[contains(concat(" ", normalize-space(@class), " "), " postcontainer ")][/code]
Sorry, you need to Log In to post a reply to this thread.