Jump to content
    1. Past hour
    2. Touchscreens do simply suck for a lot of game input, it is odd where we've ended up in a situation where having awful input controls is standard on phones, where there were even portable devices in 1980 that had better input... https://en.wikipedia.org/wiki/Game_%26_Watch It is one of those odd things, I don't know whether it is because google haven't encouraged game controllers, or that the market hasn't been buying devices with buttons. You could say that dedicated gamepads are the ideal solution, but then loads of games don't support gamepads, probably simply because they aren't standard, a chicken and the egg situation (and google makes it overly difficult to support them, they aren't even in the emulator for instance). Another 'odd' decision is that android APIs don't seem to support right clicking with mice. Everything is touchscreen orientated, your mouse is a finger. Which makes it a challenge to make any kind of 'desktop like' app on android. I've love to know the (presumably commercial) reasoning behind actively degrading experience with mouse. One cynical reason is that google presumably make a lot of their money by people mistakenly clicking adverts by mistake with touchscreens, and this is less likely with mouse.
    3. For this case you don't need the distance and angle, only the direction. As @Lactose sad you can calculate it direction = enemy - player (direction toward enemy) and normalize it. Since enemy moves at some speed, by doing this calculation you will probably miss it. If you want to hit it every time you will have to shoot in front of the enemy which complicates a bit the calculation.
    4. Migrating all my code would be close to impossible for this project unfortunately...
    5. Today
    6. Could you please explain this a bit further as I think I have not grasped it fully yet? So by this you are saying we would use an interface for two possible scenarios. In one case to hide the implementation and to provide only the "public" interface and in other to use it for polymorphism. I always kinda connected the two concepts. For DirectX part I guess they use the interfaces only for the first scenario, if I understood you correctly? Where in the second scenario we would create a class interface to be able to use a base pointer for inherited classes, for polymorphism.
    7. On my phone I noticed holding one point, then touching another while still holding, will make it forget the first, though it might depend on the app. Maybe you are experiencing something similar and could work around it?
    8. vinterberg

      Silly Input Layout Problem

      You don't get access to them by a float4x4 in your shader, you retrieve your ins. matrix by four "float4 INSTANCEx" and then you assemble those into a matrix again Something like this: struct VS_INPUT { ..... float4 World0 : MWORLD0; float4 World1 : MWORLD1; float4 World2 : MWORLD2; float4 World3 : MWORLD3; }; cbuffer Buffer1 : register(b0) { float4x4 MatrixWorld; ..... }; VS_OUTPUT main(VS_INPUT Input) { VS_OUTPUT Output; float4x4 mworld = float4x4(Input.World0, Input.World1, Input.World2, Input.World3); mworld = mul(MatrixWorld, mworld); .....
    9. I think it might be better to use a different 2D engine, since this one is unsupported and seems buggy..
    10. I just want to shoot towards the enemy so I guess I wouldn't require the distance. I guess I would require the directional vector of my enemy towards the player right? or I would need to do something with the angle?
    11. Get the vector from the enemy to the player (vectorFromEnemyToPlayer = player - enemy). If you want a directional vector, just normalize the vector. If you want the angle, use atan2(vector.y, vector.x). If you want the distance, there should be a function to get the length or magnitude of the vector.
    12. There are two Entities in the game and we controlling one of them. The other entity moves in a particular direction throughout the game and I want to make the AI like the enemy shoots at my player after some duration of time. I am using Directx 10 SDK for this. I think I would need to calculate the distance between the two entities and shoot it towards the player. I would need to calculate the distance between the two vectors and direction of A towards B. How to calculate the direction between the two?
    13. @Endurion Yes I do use right-left and bottom-top. Regarding your second tip: I added 10 pixels to both width and height to get 1600x900 as "client rect" as seen below (it was 1590x890 in unaltered windowed mode). Is this what you meant? The problem persists. (still is drawn with missing lines every 80 pixels or so (as seen earlier in this thread)). I also matched it manually so the rectangle/restored rectangle becomes 1600x900 but this still gives the same missing lines of pixels.
    14. Yes I found in some compilers you need to use this-> to access members in template. Was not a big deal, just a little ugly as you say.
    15. Thanks, I'll try that! I've currently hit another problem (non-automatic fallback to member usage in derived templated classes, where I for sure don't want to paste this-> all over the place), but that's another story
    16. I am not a macro ninja but am wondering if it is to do with the second ## in this expression. Maybe you don't need it.
    17. I didn't get a notification about the challenge either. I do get notifications for every reply or citation though. This forum vs. group thing is really really not a good idea. Edit: Shouldn't be member of a group be enough to get notified? I surely can't "follow" every new entry if I don't know there is a new entry.
    18. Awoken

      Beginning developing

      @NikiTo Don't be so hard on yourself : )
    19. Regarding the modified RECT from AdjustWindowRectEx. Make sure you're passing right-left and bottom-top to HGE; there's a reason when Left and Top go negative. Other, more hamfisted approach: Use Spy to calculate the difference and adjust the size in the HGE calls accordingly.
    20. Not for all cases. For example for case where a base class uses a one instance of mechanism and one of derived uses a other instance for other purposes static array will not work while pointer to member sent to mechanism template still serve statically. Really i use it to 2-way pointers concept, for cases while required a back-pointer to object that have predefined role like a owner, parent in visiblity tree and so on. It allow to speedup check is object allready added to predefined role collections and speed up deletion becouse intrusive data keept current index in collection. Using pointers to member allow to keep in object pointer to owner of collection instead of pointer to collection instance and provide to collection field address where to store intrusive data. By this way collection and adding/remowing and so on mechanism can be incapsulated to separated template class instead handle it by set of methods in both holder and holding object for each use case. Also intrusive data members and collection can have a different behavior. For example some of them have to check a circular dependencies on setting new holder. For other it not required becouse it varrantied by architecture. And for some kind of collections like processing lists it have to check is other master list contains object thet have be added.
    21. I'm not sure I understand your use case but it seems to me you could do the same thing with an array and an index. I suppose the member pointer would let you space out the members you are referencing in odd ways...... In any case I'll probably never need it myself but at least I know it exists now if the need should ever arise.
    22. Unlike normal pointer it allow to replace instance pointer keeping a field or member function on wich it point untouched. I often use pointer to member function to implement delegates similar to C++ Builder core implemented delegates. Also it good thing to incapsulate some complexive mechanism that require to keep some intrusive info in object and used more than once for single class. By using pointer to member as template parameter (or constructor parameter for dynamic mechanism linking) you just can figure to its mechanism instance what same field it have use to store its intrusive data.
    23. Yeah looks like you are right. It's even half the size of a regular pointer on my compiler. I'm still not sure what you would use it for since you can do the same thing with a normal pointer, and it doesn't really save you any space since you need the object pointer anyway. I guess there is probably some use case or they wouldn't have added it, but I can't come up with it off the top of my head.
    24. Member pointer have a big difference with just a pointer. Just a pointer hold a memory address, while pointer to member hold a offset from object start, so require to provide poiner to instance to calculate actual address.
    25. Fulcrum.013

      Beginning developing

      Of cource it planar. Is you see any FPS around where it not a planar? It just some kind of optimisation that allow to use a same G vector for any object instead to recalculate it for each object every frame that involve a expensive vector normalisation operation. 🙃
    26. krb

      Beginning developing

      Having worked in a low level office job with countless guys obsessed with fantasy sports I can confidently say you would still have a basement, it would just be filled with pictures and uniforms of grown men that catch a ball instead of whatever you have going on now. Maybe work on time management. I have the same problem sometimes, set times for meals and cook a few before hand so you have stuff ready to go and it's easy to make, that helped me eat more regularly. I've been using my game making time to try and make projects for game jams. Having set goals and an end point makes the work seem finite and doable.
    27. Randy Gaul

      Polygons and the Separating Axis Theorem

      The idea instead of computing min/max along an interval, you can use the concept of support points. This can reduce some redundancy in your code and potentially make it easier to pin-point the problem.
    28. Thanks for the advice everyone! I updated my resume with the feedback I received here, as well as with a link to my newly made portfolio website JonahBrooks.net. I'll try to commit to github more regularly so it doesn't look abandoned, and I'll try to make a more substantial game demo in the coming months. Thanks again for all the feedback and advice! Jonah_Brooks_Resume.pdf
    29. NikiTo

      Beginning developing

      It was never a business. Nobody took money form the kids and we all were volunteers. I did for that kid what i would do for my little kid brother, or for my own child. My conscience is white clear. I am not anymore volunteering there. I tried it to see how is it, but we were forced to force kids to code. Some kids wasn't wanting to code, and was watching youtube. The organizers told me to force them somehow to code. Not cool for me. And i stopped volunteering there.
    30. Yesterday
    31. Hodgman

      DirectX interfaces

      They're inherited/implemented internally somewhere else (e.g. Inside d3d11.dll). You're not supposed to inherit/implement them, because you're a client of the interface, not an author of the D3D runtime The purpose of interfaces is to fully hide all implementation details from an object's client's (and sometimes also to enable polymorphism). In this case, we have no idea what the implementation of ID3D11Buffer looks like, because it's hidden behind the interface. This also allows MS to constantly change the implementation behind the scenes (with Windows update, or graphics drivers, etc) and our software doesn't care, because we talk to those different implementations via the interface.
    32. Dirk Gregorius

      Polygons and the Separating Axis Theorem

      I would not implement it like this. I gave a presentation on SAT maybe this is helpful. http://media.steampowered.com/apps/valve/2013/DGregorius_GDC2013.zip
    33. swiftcoder

      Beginning developing

      Around these parts, we generally prefer to encourage newcomers to the field. We also prefer to keep discussion in the For Beginners forum at least somewhat relevant to helping out the original poster. With that kind of attitude, I can only hope you aren't in the business of teaching kids anymore. Not all kids are the same - I certainly would have taken an interesting project over sweets at any age.
    34. If you would like to see the full picture (three .pde files), you can view the code at my GitHub repository here. If interested you can also run the program yourself if you have Processing installed. Here though is the code which implements the SAT to detect collisions and create the MTV. Please tell me if you see any mistakes. class CollisionHandler { PVector detectCollision(PShape shape1, PShape shape2) { float magnitude = 999999; PVector direction = new PVector(); ArrayList<PVector> axes = new ArrayList<PVector>(); axes.addAll(getAxes(shape1)); axes.addAll(getAxes(shape2)); for(int i = 0; i < axes.size(); ++i) { PVector axis = axes.get(i); PVector p1 = project(shape1, axis); PVector p2 = project(shape2, axis); if(isOverlap(p1, p2)) { float overlap = getOverlap(p1, p2); if(overlap < magnitude) { magnitude = overlap; direction = axis; } } else { return null; } } return direction.mult(magnitude); } ArrayList<PVector> getAxes(PShape shape) { ArrayList<PVector> axes = new ArrayList<PVector>(); for(int i = 0; i < shape.getVertexCount(); ++i) { PVector v1 = shape.getVertex(i); PVector v2 = shape.getVertex(i + 1 == shape.getVertexCount() ? 0 : i + 1); PVector edge = v2.sub(v1); PVector axis = new PVector(-edge.y, edge.x); axis.normalize(); axes.add(axis); } return axes; } PVector project(PShape shape, PVector axis) { float min = axis.dot(shape.getVertex(0)); float max = min; for(int i = 1; i < shape.getVertexCount(); ++i) { float projection = axis.dot(shape.getVertex(i)); if(projection < min) { min = projection; } else if(projection > max) { max = projection; } } return new PVector(min, max); } boolean isOverlap(PVector p1, PVector p2) { return p1.x < p2.y && p1.y > p2.x; } float getOverlap(PVector p1, PVector p2) { return p1.x < p2.y ? p1.y - p2.x : p2.y - p1.x; } }
    35. Dirk Gregorius

      Polygons and the Separating Axis Theorem

      It seems you are computing the penetration wrong which results in overshooting I guess. The SAT test is really simple in 2D. You only need the vertices (in some order - CCW or CW) and the transform (translation and rotation). How do you compute the MTV?
    36. Here are two videos showing the collision handling between polygons. The collisions between the hexagon and the triangle are resolved as you would expect, with the hexagon being moved back by the MTV such that it is resting against the triangle. The collisions between the two triangles however are not resolved correctly, with the moving triangle jumping back a small distance upon collision resolution. I would like some help understanding why this happens and how it might be resolved. Also attached is an image showing two rectangles, both specified as being of width 200 pixels and height 140 pixels. One is made using the Processing rect() function and the other is a Polygon object constructed as described in my last post. As you can see, there is a noticeable disparity between their respective dimensions, with the Polygon object having smaller width and height. I would like some help understanding how to create the polygon such that its width and height are those specified by the parameters of its constructor, regardless of initial vertex rotation. Thank you. polygoncollision1.mp4 polygoncollision2.mp4
    37. Sergio Gardeazabal


      Airburner is an air combat game inspired in games like Hawx and Ace Combat and also old school simulators how F-22 Air Dominance Fighter. I trying combine the best of 2 worlds, the the freedom of an simulator (full axes control, no cutscenes in middle of gameplay, no take control over the camera in mid gameplay,etc) , and the quick action of an arcade air combat game. As i like to describe it, Airburner is a Fast pace air combat game where the player is always in control The game is developed in Unity since August of 2017 , but i had to pause the development in 2 times to work in other projects to raise money. That's pause were a 3 months pause in December , and 2 months pause in July. This is the first prototype that i had working in December 2017 In that stage the game barely worked because i was loading the whole world at the same time, which causes a lot of memory leaks and floating precision point errors. In the second stage of the development, i started to address that problems making a custom Unity editor tool , that is basically a level streamer. I took the whole world and divided in chunks, create a database with Scriptable Objects , and in runtime only load the tiles that rounding the player. Also when the player move from one tile to another , i move all world to the origin to avoid floating point precision error. This is a video of this tool working after a week of development. Since then, in the next two months , i created the editor tool set to be able create a level with the main tool. An editor tool that allows me load a specific sector, add models,waypoints,spawn points,etc, and save it to the database. Also i created a proxy system for the transform component, maintaining the interface using hiding so i had to make minimum changes to mi current code at the time. That proxy system for the transform was necessary because , streaming the level, there is a lot of element that no exist in run time at the time, but i need to know where they are, for example ,waypoints. This is a screenshot of the current state of that editor tool. I have planned release it as editor toolset in the Unity Asset Store in the future, but i will need polish the interface for that. This is a video demo that i made in july of the gameplay of the game with only air enemies at the moment. Today , after that last pause i’m optimising my Level Stream tool to have extra performance that i could use for large draw distance or better details in general. One of those changes is , detect which terrain tiles are visible in the camera, and don’t draw the tiles that aren’t visibles. Needs some adjustments but the result is promising. Also at this stage , all the art (Sound,VFX,UI,3D models) in i consider it placeholders, because i’m not an artist and i made what i did that i can, but is not that i want for the game. So the plan is when the game is in a more definitive stage of development, that reflect my original design, i will look to hire artist,UX designers,Sound Designers,etc. I don’t do that now , because i don’t have the funds yet, so probably i will seek for funding o use my savings which i building right now. In the mean time, i'm working in the VFX, this a video where i testing the first iteration of a prototype shader that i made with Amplify, for my Volumetric Explosion framework that i will be using in the game.
    38. Apparently so. I'm not sure why anyone would need that level of protection but there you have it. You can use a plain old int * to do the same thing, the only difference being it can point to any int, and not just one which is a member of class A.
    39. The error in fact means exactly what it says: you cannot use the same command list to record commands that use more than one swap chain buffer. To fix the error, you need to submit the command list and reset it before using it for the next buffer in the swap chain. As for the render targets, using the same back buffer in every frame is incorrect. You need to query current back buffer index from the swap chain every time after you present.
    40. Usually when I think of interfaces, or when I read about them, I see them as something as they are made in C#. There is a keyword for it and it's used for classes that can not be instantiated, they have to be inherited. In C++ they can be made by making a member function a pure virtual function, with = 0, where they are called abstract classes. When I was coding with DirectX I used "DirectX interfaces". Actually if I remember correctly DirectX uses them for almost everything. Some example would be ID3D11Buffer. I know that it's a COM interface though I don't know much about it. I never inherited them, though maybe someone would expect this because they are interfaces. I always used them as "real" objects, I would get their pointer through some function like CreateBuffer() or some similar method. What confuses me is why they are "called" interfaces and have an "I" in front? Are they maybe totally different from interfaces that I described, like C# interfaces, and have some other intended use?
    41. No worries, the thread is not hijacked, it's actually what I wanted. This is not my code, I'm reading a book and the author used this to explain something else though I did not understand this part and that's why I'm asking. Declaration of "int A::*pInt;" in B::function() was intentional. So, does putting "A::" in front of it makes it only "bound" to objects of A, so the pointer can access only A members? I'm still confused about it and using the pointer with a "." as it's not declared in original A class.
    42. Oh my god, I'm blind. The method actually has a return type of 'void' not 'Float3'. I guess this is what I get for copy-pasting the method registrations and forgetting to check the return types. This is the correct binding: if(engine->RegisterObjectMethod("Physics", "void ClearVelocity() const", asMETHOD(Physics, ClearVelocity), asCALL_THISCALL) < 0) { ANGELSCRIPT_REGISTERFAIL; } Thank you for the help.
    43. WitchLord

      X64 GCC native CallFunction gives invalid this pointer

      Most likely the problem is with how you've registered the Float3 type. Can you show me how you've registered it? Just the call the RegisterObjectType is needed. I also want to see the C++ declaration of this class so I can verify if the registration is correct. Even without seeing your code I would risk a guess and say that it should be registered like this: engine->RegisterObjectType("Float3", sizeof(Float3), asOBJ_VALUE | asOBJ_POD | asGetTypeTraits<vec3>() | asOBJ_APP_CLASS_ALLFLOATS); The last flag, asOBJ_APP_CLASS_ALLFLOATS, is probably what you're missing in your code. This flag has no effect on Windows, as the C++ ABI on Windows doesn't change with the members of the classes, but with gnuc on Linux it makes a difference, which is why I believe this is the cause of your problem.
    44. Randy Gaul

      Polygons and the Separating Axis Theorem

      I'd like to help but I have trouble understanding what you need help with. Maybe you can try asking a more specific question as opposed to some paragraphs, and also if you can post a video/gif showing your problem that helps a lot as well.
    45. Totally no information about this error on the internet, so I'm sharing the solution: The same (one) back buffer resource is used in consecutive frames. Most probable cause of this is using only the first descriptor from render target descriptor heap in all frames, so every frame doing this D3D12_CPU_DESCRIPTOR_HANDLE handle( rtvDescriptorHeap->GetCPUDescriptorHandleForHeapStart() ); commandList->OMSetRenderTargets( 1, &handle, false, nullptr ); instead of this D3D12_CPU_DESCRIPTOR_HANDLE handle( rtvDescriptorHeap->GetCPUDescriptorHandleForHeapStart() ); handle.ptr += backBufferId * rtvDescriptorSize; commandList->OMSetRenderTargets( 1, &handle, false, nullptr );
    46. WitchLord

      Typo in scriptfilesystem.cpp

      Thanks. I've fixed this in revision 2548.
    47. Awoken

      Slopey McSlopeface (part 1)

      What will we do on this berg? so many possibilities.
    48. O the struggles of procrastination and motivation. It gets us all. Over the years I've become comfortable with the cycles of motivation and procrastination. I know that even if I resent my project one week, I'll love it again another. The artist you're working with is doing an incredible job, it looks professional. However, I wonder why such hardened structures would expose their soft insides via those tin-foil hoses sticking out. If I was in a jeep passing by I'd get out and cut a hose or two.
    49. I have programmed an implementation of the Separating Axis Theorem to handle collisions between 2D convex polygons. It is written in Processing and can be viewed on Github here. There are a couple of issues with it that I would like some help in resolving. In the construction of Polygon objects, you specify the width and height of the polygon and the initial rotation offset by which the vertices will be placed around the polygon. If the rotation offset is 0, the first vertex is placed directly to the right of the object. If higher or lower, the first vertex is placed clockwise or counter-clockwise, respectively, around the circumference of the object by the rotation amount. The rest of the vertices follow by a consistent offset of TWO_PI / number of vertices. While this places the vertices at the correct angle around the polygon, the problem is that if the rotation is anything other than 0, the width and height of the polygon are no longer the values specified. They are reduced because the vertices are placed around the polygon using the sin and cos functions, which often return values other than 1 or -1. Of course, when the half width and half height are multiplied by a sin or cos value other than 1 or -1, they are reduced. This is my issue. How can I place an arbitrary number of vertices at an arbitrary rotation around the polygon, while maintaining both the intended shape specified by the number of vertices (triangle, hexagon, octagon), and the intended width and height of the polygon as specified by the parameter values in the constructor? The Polygon code: class Polygon { PVector position; PShape shape; int w, h, halfW, halfH; color c; ArrayList<PVector> vertexOffsets; Polygon(PVector position, int numVertices, int w, int h, float rotation) { this.position = position; this.w = w; this.h = h; this.halfW = w / 2; this.halfH = h / 2; this.c = color(255); vertexOffsets = new ArrayList<PVector>(); if(numVertices < 3) numVertices = 3; shape = createShape(); shape.beginShape(); shape.fill(255); shape.stroke(255); for(int i = 0; i < numVertices; ++i) { PVector vertex = new PVector(position.x + cos(rotation) * halfW, position.y + sin(rotation) * halfH); shape.vertex(vertex.x, vertex.y); rotation += TWO_PI / numVertices; PVector vertexOffset = vertex.sub(position); vertexOffsets.add(vertexOffset); } shape.endShape(CLOSE); } void move(float x, float y) { position.set(x, y); for(int i = 0; i < shape.getVertexCount(); ++i) { PVector vertexOffset = vertexOffsets.get(i); shape.setVertex(i, position.x + vertexOffset.x, position.y + vertexOffset.y); } } void rotate(float angle) { for(int i = 0; i < shape.getVertexCount(); ++i) { PVector vertexOffset = vertexOffsets.get(i); vertexOffset.rotate(angle); shape.setVertex(i, position.x + vertexOffset.x, position.y + vertexOffset.y); } } void setColour(color c) { this.c = c; } void render() { shape.setFill(c); shape(shape); } } My other issue is that when two polygons with three vertices each collide, they are not always moved out of collision smoothly by the Minimum Translation Vector returned by the SAT algorithm. The polygon moved out of collision by the MTV does not rest against the other polygon as it should, it instead jumps back a small distance. I find this very strange as I have been unable to replicate this behaviour when resolving collisions between polygons of other vertex quantities and I cannot find the flaw in the implementation, though it must be there. What could be causing this incorrect collision resolution, which from my testing appears to only occur between polygons of three vertices? Any help you can provide on these issues would be greatly appreciated. Thank you.
    50. NikiTo

      Beginning developing

      I was making once with a kid boy a shooting game in Scratch at Coder Dojo. When the staff said everyone to have a break to pick some sweets, that boy kept staying with Scratch. When his mother came to take it home, I told her that it is not normal for a kid to skip sweets because of Scratch(almost every other kid left Scratch and gone to the table with the sweets). I advised her to not bring that kid more and to not let it become a programmer.
    51. GoliathForge

      Suggestion for choosing challenges

      is a cheat or pre make deterrent as to not nullify the challenge duration contract. lol... I would argue that the list should be quite large and one new one pushed for every one poped. That could add new flavor to potentials and still keep it a mystery. Epic Ninja Coder.
    52. phil67rpg

      shooting bullets

      why did downvote me I am asking a very simple question
    53. Hi everybody, Me, Xylvan, announces Xilvan Design are building 3D games. Since 1993, our kindly official gaming related pages (please click on each links): Soul of Sphere Platinum v3.75. Age of Dreams:Abyss of Atlantis v1.5. Lights of Dreams IV: Far Above the Clouds v9.17. Candy World II: Another Golden Bones v9.37. Candy Racing Cup: The Lillians Rallies v2.97. Candy World Adventures IV: A Cloud of Starfield v6.57. Candy to the Rescue IV: The Scepter of Thunders v7.07. Candy in Space III: A dog to the Space v5.47. Candy's Space Adventures: The Messages from the Lillians v17.27. Candy's Space Mysteries II: New Mission on the Earthlike Planets v7.27. Discover more than 10 games which are coded in Blitz3D by Xylvan(Alexandre) from Xilvan Design. Download them on my new websites: Plenty of games wait you HERE: - New Xilvan Design Website - Hope you will like them all! To watch the videos of our games: - Xilvan Design Youtube Channel - You may need to Subscribe to our channel for more infos about our new releases! Friendly, Alexandre L., Xilvan Design.
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!