• What do you need help with? V. 3.0
    4,884 replies, posted
I fail to see how resolving in two directions can even work, you're only supposed to resolve the most shallow penetration :v:
[QUOTE=Chris220;30871441]I fail to see how resolving in two directions can even work, you're only supposed to resolve the most shallow penetration :v:[/QUOTE] This happens if I do that [url]http://i.stack.imgur.com/NLg4j.png[/url]
[QUOTE=SupahVee;30873741]This happens if I do that [url]http://i.stack.imgur.com/NLg4j.png[/url][/QUOTE] Can't you just check the other one twice?
[QUOTE=esalaka;30876102]Can't you just check the other one twice?[/QUOTE] I'm bad at understanding stuff easily... can you elaborate a little bit more?
[QUOTE=SupahVee;30869050]...[/QUOTE] Take a look at the XNA tutorial "platformer" on microsoft's apphub, really, they handle the collisions with tiles and their special cases quite nice. I've had the same type of problem that you asked on stackoverflow / GD and was able to solve it thanks to the apphub demo. I'm not sure how exactly you handle collisions in your game right now, but maybe you could play around with "sensors" at the corners of your AABBs. Sensors have the advantage that the reactions to collisions are rather obvious. For example: If only the topleft and the bottomleft sensor are active (colliding with someting), it's obvious that you have to move right...
[QUOTE=SupahVee;30876320]I'm bad at understanding stuff easily... can you elaborate a little bit more?[/QUOTE] Check collisions on X. Check collisions on Y. Re-check collisions on X.
[QUOTE=esalaka;30876504]Check collisions on X. Check collisions on Y. Re-check collisions on X.[/QUOTE] Y velocity will be set to 0 anyway since a collision was detected on Y axis. [editline]3rd July 2011[/editline] [QUOTE=Felheart;30876377]Take a look at the XNA tutorial "platformer" on microsoft's apphub, really, they handle the collisions with tiles and their special cases quite nice. I've had the same type of problem that you asked on stackoverflow / GD and was able to solve it thanks to the apphub demo. I'm not sure how exactly you handle collisions in your game right now, but maybe you could play around with "sensors" at the corners of your AABBs. Sensors have the advantage that the reactions to collisions are rather obvious. For example: If only the topleft and the bottomleft sensor are active (colliding with someting), it's obvious that you have to move right...[/QUOTE] Tried the demo. 1. It is tile-based. My game is not tile-based, I place AABB as tiles just for convenience. 2. It sucks balls. The player floats when he jumps in a ceiling, sometimes he also gets stopped for no reason at all after jumping in a ceiling.
The problem is specifically falling into spikes? Make them just not collide on the Y axis?
[QUOTE=SupahVee;30876521] 1. It is tile-based. My game is not tile-based, I place AABB as tiles just for convenience. 2. It sucks balls. The player floats when he jumps in a ceiling, sometimes he also gets stopped for no reason at all after jumping in a ceiling.[/QUOTE] 1. There is absolutely no problem with it being tile-based. I'm sure you can query your engine/level about all the rectangles that the player can collide with. After that, the process is practically the same. 2. It's a tutorial program for a reason, what did you expect, a complete game?? The player floating is a) fixed in 5seconds and b) has nothing to do with collision. What I meant to hint at was the reaction to collisions. Maybe I misunderstood the question... can you tell what exactly is the problem? Or maybe you just need to handle the collision between your spikes and the player as a special case?
SFML using boost threads, is complaining that the internal image size is too large. Only happens when doing crap inside a thread. Any ideas how to fix? Edit: Fixed by not trying to create an sfml object inside a thread. Any ideas why this causes it to crap out?
Getting errors with [url=http://pastebin.com/1MQTdPXw]this code[/url]. I get the following errors: [code]main.cpp: In function ‘int main()’: main.cpp:67: error: cannot convert ‘int (*)[(((long unsigned int)(((long int)mapSizeY) - 1)) + 1u)]’ to ‘int (*)[10]’ for argument ‘3’ to ‘void initializeMap(int, int, int (*)[10])’ main.cpp:68: error: cannot convert ‘int (*)[(((long unsigned int)(((long int)mapSizeY) - 1)) + 1u)]’ to ‘int (*)[10]’ for argument ‘3’ to ‘void paintMap(int, int, int (*)[10])’ [/code] Anyone know what's wrong? Been trying to fix it for about an hour..
[QUOTE=theJohn;30878102]Getting errors with [url=http://pastebin.com/1MQTdPXw]this code[/url]. I get the following errors: [code]main.cpp: In function ‘int main()’: main.cpp:67: error: cannot convert ‘int (*)[(((long unsigned int)(((long int)mapSizeY) - 1)) + 1u)]’ to ‘int (*)[10]’ for argument ‘3’ to ‘void initializeMap(int, int, int (*)[10])’ main.cpp:68: error: cannot convert ‘int (*)[(((long unsigned int)(((long int)mapSizeY) - 1)) + 1u)]’ to ‘int (*)[10]’ for argument ‘3’ to ‘void paintMap(int, int, int (*)[10])’ [/code] Anyone know what's wrong? Been trying to fix it for about an hour..[/QUOTE] void initializeMap(int mapSizeX, int mapSizeY, int map[][10]) Change int map[][10] to int map[][] or to int ** map.
[QUOTE=ColdFusionV2;30878197]void initializeMap(int mapSizeX, int mapSizeY, int map[][10]) Change int map[][10] to int map[][] or to int ** map.[/QUOTE] Neither of those work :/
I'm not 100% certain on this, but I think the problem is as follows: You're using a gnu-extension for variable-length arrays. Those arrays are still held on the stack though. The problem is now that the functions you want to pass them to don't know the size of that array (since it's variable-length). This is further confirmed by the code working if I change the array-definition to a hard-coded size of 10x10 or use the C++0x constexpr keyword to mark those integers as compile-time constants. [editline]4th July 2011[/editline] There's also a [url=http://gcc.gnu.org/onlinedocs/gcc/Variable-Length.html]solution[/url] ("You can also use variable-length arrays as arguments to functions"), but it only appears to work in C.
Initialize map as a 1 dimensional array using: [code]int *map = new int[mapSizeX * mapSizeY];[/code] and then to access it use [code]map[y * mapSizeX + x][/code] and delete using: [code]delete []map;[/code]
Still trying to get used to this crap in VS2008: [url]http://dl.dropbox.com/u/12453703/STLmindfuck.png[/url] Is there any way to "simplify" the definitions in the yellow box? I keep having to Google the function... E.g. at this link ([url]http://www.cplusplus.com/reference/string/string/replace/[/url]) there is a much simpler definition: [code]string& replace ( size_t pos1, size_t n1, const string& str, size_t pos2, size_t n2 );[/code] Which is a bit easier to comprehend + easier on the eyes.
[QUOTE=Shootfast;30885219]Initialize map as a 1 dimensional array using: [code]int *map = new int[mapSizeX * mapSizeY];[/code] and then to access it use [code]map[y * mapSizeX + x][/code] and delete using: [code]delete []map;[/code][/QUOTE] Or if you're more experienced, you could use boost::multi_array.
Experienced or lazy? Actually, using boost for something as simple as an array is completely unneeded.
<wrong page. again.>
I'm trying to compile OgreNewt for Ogre3D following [url=http://www.ogre3d.org/addonforums/viewtopic.php?f=4&t=11510]this tutorial[/url], but on step #4 every time I click "Configure" it spits out this error without even letting me do anything: [code]Looking for OGRE CMake Error at cmake/FindOGRE.cmake:100 (MESSAGE): Could not find OGRE. Make sure you have the OGRE development headers installed. Otherwise, try setting LIBRARY_SEARCH_DIRS and INCLUDE_SEARCH_DIRS to the place OGRE was installed with -DLIBRARY_SEARCH_DIRS=<path/to/lib> -DINCLUDE_SEARCH_DIRS=<path/to/include> Call Stack (most recent call first): CMakeLists.txt:58 (FIND_PACKAGE) Configuring incomplete, errors occurred![/code] I don't know what the development headers are (I have the SDK installed, if that means anything) and I don't know where those commands are supposed to go (I tried launching the app with those parameters, nothing changed). Any help here?
[QUOTE=Felheart;30877041]1. There is absolutely no problem with it being tile-based. I'm sure you can query your engine/level about all the rectangles that the player can collide with. After that, the process is practically the same. 2. It's a tutorial program for a reason, what did you expect, a complete game?? The player floating is a) fixed in 5seconds and b) has nothing to do with collision. What I meant to hint at was the reaction to collisions. Maybe I misunderstood the question... can you tell what exactly is the problem? Or maybe you just need to handle the collision between your spikes and the player as a special case?[/QUOTE] I tried implementing the same collision system as in the AppHub demo (by copy-pasting most of the stuff). However the "jumping" bug occurs in my game, while it doesn't occur in the AppHub demo. [jumping bug: [URL]http://i.stack.imgur.com/NLg4j.png][/URL] To jump I check if the player is "onGround", then add -5 to Velocity.Y. Since the player's Velocity.X is higher than Velocity.Y (refer to the fourth panel in the diagram), onGround is set to true when it shouldn't be, and thus lets the player jump in mid-air. I believe this doesn't happen in the AppHub demo because the player's Velocity.X will never be higher than Velocity.Y, but I may be mistaken. I solved this before by resolving on the X axis first, then on the Y axis. But that fucks up the collision with the spikes as I stated a few posts back. It's like I have to choose between shit or piss, either way it sucks balls. :<
I'm going to have to start on the networking side of my game soon, but I haven't had any experience of networking past a simple chat client / server. Does anyone have any tips for common mistakes to avoid / when to use TCP / UDP etc? I was going to do something like the following description. The game has a 32 x 32 world map which has town building, dungeons etc on individual tiles. The dungeons themselves are separate maps. To join the server and receive the world overview map [code]Client sends handshake packet to see if it can join, including version number Server sends back confirmation / rejection based on player count and client version, and if the client can join it also sends names / versions of resource packages needed Client confirms it wants to join, and lists resource packages that it needs to download Server sends resource packages Client confirms it received them Server sends 32 x 32 world map Client confirms it received it Server sends information about which dungeons other players are in Client confirms[/code] Then when the world map changes (a player moves to a different dungeon / to a town building) [code]Server sends a packet containing the player ID of the player that moved and the x, y they moved to, and a timestamp so if the packets are received in the wrong order things won't mess up. Client confirms[/code] When the player wants to visit a dungeon / town building [code]Client sends request with the x,y of map they want to visit Server confirms / rejects, sends basic info about the map (number of chunks, level, etc) Client confirms Sever sends individual chunks (small groups of tiles) Client confirms each chunk Server sends state of each entity in the map, including players Client confirms Server broadcasts to other clients in the map that the new client has joined Clients confirm[/code] The part that I have no idea about is the general updating of entity position while clients are playing. Should I send the client's input to the server, or the new state of the client? Should I do periodic broadcasts of the state of every entity in the map every so often, and if so, how frequently?
When a client can see an entity, send updates each time the entity changes. Whenever a client enters an area where they can see an entity, update that entity.
Whats a good way to handle very primitive (No shaders involved) lighting for a tile based game. Would it be acceptable to just have a black texture over the tile that I can then change the alpha of when the player explores it? Also, what would be the easiest way to get the tiles that the player is next to? Would a multidimensional array suffice?
I've just got MonoDevelop set up for C# (VS messed up installation for me long ago, I'd probably need to reformat my computer to be able to install it clean) and I've been trying to figure out how to use SFML.net with it. Can anybody give me any assistance? I tried following the MonoDevelop site's guide on adding libraries but it seemed to have a different "Solutions Pad" to the one I have and I can't add any packages. [QUOTE=NotoriousSpy;30897797]Also, what would be the easiest way to get the tiles that the player is next to? Would a multidimensional array suffice?[/QUOTE] 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 That'll give you the surrounding 8 cells, you can loop through in different ways to get the various tiles. You can basically step back / forward to any tile in your array with combinations of -1's, 0's, 1's and map widths. Did I just make everything way more confusing for you? D:
[QUOTE=Cello;30898677]I've just got MonoDevelop set up for C# (VS messed up installation for me long ago, I'd probably need to reformat my computer to be able to install it clean) and I've been trying to figure out how to use SFML.net with it. Can anybody give me any assistance? I tried following the MonoDevelop site's guide on adding libraries but it seemed to have a different "Solutions Pad" to the one I have and I can't add any packages. 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 That'll give you the surrounding 8 cells, you can loop through in different ways to get the various tiles. You can basically step back / forward to any tile in your array with combinations of -1's, 0's, 1's and map widths. Did I just make everything way more confusing for you? D:[/QUOTE] Nah I understand. What about the speed difference between lists and arrays? Also, would that be a viable solution for lighting?
[QUOTE=NotoriousSpy;30902687]Nah I understand. What about the speed difference between lists and arrays? Also, would that be a viable solution for lighting?[/QUOTE] I don't really know regarding the difference between lists and arrays, it's kinda language-specific and I only have experience in AS3/haXe. I've not done any tilebased lighting systems before, but it seems like it'd work pretty well - could get a little intensive if your lighted area is massive, not sure though.
Does anyone know of a free private Git hosting?
Does anyone know of any good UI design tutorials/articles?
[QUOTE=Doritos_Man;30905505]Does anyone know of a free private Git hosting?[/QUOTE] I personally use my remote shell for that but I think there was a host that let you host privately.
Sorry, you need to Log In to post a reply to this thread.