Jump to content
  • Advertisement

IceCave

Member
  • Content Count

    78
  • Joined

  • Last visited

Community Reputation

412 Neutral

About IceCave

  • Rank
    Member

Personal Information

  • Interests
    Programming

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Thanks for your answer, to your question: that is complicated... I am programming a framework to help working with a multithreaded environment and that includes sending data (objects) between threads. Normally those objects are then put in a container for further execution on this specific thread and their "execute()" method is called on them in order to process whatever they want to do on this specific thread. Basically it goes like this: Object O#42 wants to execute stuff on Thread T#42. The framework then manages the whole process of introducing O#42 to T#42 and T#42 then calls execute() - "Hey you are now on this thread, now do what you wanted to do here". So far so good but I would like to have the option to program custom containers in order to do more advanced stuff then just "execute()". Right now it works like this that in the execute() method the object removes itself from the standard container and readds itself to a known target container (candy adds itself to candyshop_container). This works! Now why change a running system? Security! I noticed that this system is very unstable from a static coding perspective. The developer might very well accidentially (or by intention) tell the framework to call an objects "execute()" on the thread candyshop_container is located at but then - in the execute() method - add the candy to another container located on another thread. The framework was developed in order to avoid such concurrency. I figured it is best to hide the whole "delivery" process from the developer and not give him any control about the threads data flow. Which brings us back to the mentioned problem: My framework only knows to deliver [object] to [container] on the thread that is associated with [container]. The solution could be to let the container make a dynamic cast in order to find out what object was delivered.
  2. Imagine a manufacturer producing candy. He puts the candy in a package and sends it to his customer through the local postal service. After some days the package arrives and the customer has to decide what to do with the arbritary contents of the package without knowing what is inside. This is exactly my problem: I have this OOP problem where a "delivery service" delivers objects from a source to a consumer - multithreaded with a delay. The objects are buffered. However, the delivery service has no class information about the stuff being delivered so the consumer has no idea what he is getting. However, this is crucial information in order to decide what to do with the delivered items, i.e. where to store them. I was told that stuff like dynamic_cast (C++), instanceof (Java) or "is" (C#) is in general very bad OOP but I don't know how to solve this problem another way. The first thing that came into my mind was using Generics but I think this is impossible because giving the package generic information is one thing but retaining those information when the package is processed in the central delivery system is another. Dynamic casts seem to be the best solution but I am hesitating because of what I was taught from day one. Any thoughts?
  3. When drawing an object in a solid color, is it more advisable to make a shader with a color input or use a shader with a texture input and use a 1px texture?
  4. IceCave

    Animate 2d walking/running

      Perfect! A matching google keyword saves a lot of lifetime. This is the last and best animation I made from what I have learned from your post in Paint.Net. Suggestions? (There is a serious bug in this new forum software, don't know why this image is so gigantic) It's enough for prototyping for now. Now I need to make a running animation.     "Believable" was the word I was looking for. My human-like character animations are not very believable. Most of my walking/running attempts didn't really made the stick figure look like they are moving but doing jumping jacks while hovering over the floor. I realize now as well that this is a pretty complex theme. I was hoping that there was maybe an animation software that could prerender these complex, yet everyday animations in game dev.
  5. IceCave

    Animate 2d walking/running

    I have problems drawing a 2d walking/running stick figure animation for my game. I noticed this is a problem of a lot of games made decades ago but still today many games lack of proper walking animation even with 3d bone-animations (don't know how to call them). Tried a few tutorials on drawing this looking natural and even a stick figure software where you can adjust the limbs. Has anyone any tips?
  6. I want to draw a seamless repeating texture as screen filling background. My idea was, instead of drawing a lot of single quads, to draw a single static screen filling quad, set the texture to "repeat" and adjust the uv-coordinates in the shader.   I am in holidays right now and on my Mac OS X the GPU tracing tools do not start up so I can't check what is happening inside the shader to debug. This is the simple Vertex-Shader uniform mat4 projectionMatrix; uniform mat4 modelMatrix; uniform mat4 worldMatrix; uniform sampler2D texture_diffuse; in vec4 in_Position; in vec2 in_TextureCoord; out vec2 pass_TextureCoord; void main(void) { gl_Position = projectionMatrix * modelMatrix * in_Position; vec4 uv_multiplier = vec4( 1.0, 1.0, 0, 0 ) / (projectionMatrix * worldMatrix * modelMatrix * vec4(textureSize( texture_diffuse, 0), 0, 0)); pass_TextureCoord = in_TextureCoord * uv_multiplier.xy; } This is a 2D game, so there is no Z-coordinate. I calculated it by hand, yet the screen is colored by the color of one single fragment of the used texture.   I am not asking you to calculate it for me, but maybe you have a quick idea what is wrong or maybe you have a better idea to achieve this effect! :)
  7. For 20 years C++ was the recommended standard language, especially in the gaming industry. Mostly because it is fast and powerful, inheriting most programming language standards you can possibly think of. There were a lot of languages to come and go, and some stayed.   I.e. Java, since 1995 the most hated of them all (at least how I experienced it). Considered really slow, JIT is shit and its strong OOP rules and type safety is disabling the programmer or for whatever reasons. Causing (among others) a lot of religion flame wars between believers.   C# is basically a Java copy but with some changes to the base architecture like support for pointers, tuples, structs and more, extending the idea of Java. Now this isn't a Java/C# comparison or discussion! C# wasn't "well" received at the beginning, either. However, in the last two/four years I noticed that in general and in this forum C# suddenly got a big popularity boost, including but not limited to gaming industry.   I am neither against nor for C#, I get paid for writing code in a lot of languages, but What changed? Why is C# or JITs (or for whatever reason Java and C# were hated) acceptable, now?       My personal interpretation for a very long time was Unity and possibly the name "C"# causing a popularity boost among young programming beginners causing old hands to rethink their stance. Or is it just computers getting more powerful?
  8. I have drawn and scanned some sketches by hand with the intention to post-process them with GIMP on the computer and use those images then in my game.   This is a rendered scene (on Android) of my very first sketch try: [attachment=33301:device-2016-09-18-154457.png] As you can see there is a green border around those objects which should be partially transparent/grey-scale. I have used the wand tool in GIMP to remove the scanned white paper at exactly those borders.   When I put this image over the same background image in GIMP, there is no such "green border" appearing. It seems also independent from the background color.   Does somebody know what could cause this to happen?
  9. Simple question, I am utilizing a general physics library in my game or at least I want to. (I don't actually want physics in my game but simple fast raycasting and collision detection which doesn't seem to be available in a library without all the other physics stuff as well.) Now the basic problem is that those libraries available don't know MY game (of course) so the only feedback I get is when two physical bodies have collided with each other and I get both bodies in a "collision handler object".   The question: How can I add "logic" to the game?   Neither know I those two objects nor do both objects know each other. Sure I have information available like mass, position and velocity but that doesn't help at all. The real question in games is: Is it a bullet? A unit? A collectable object? Which player owns this object?   The only way I have found to solve this problem is to give the physics body a pointer to its related object in my game and make a dynamic_cast in the collision handler to check for all possible classes that differ in how a collision is handled.   This has nothing to do with OOP, though. I have read multiple times that this is bad practice in OOP if you don't know the actual class an object is based on anymore during runtime.   So how to do it otherwise?
  10. IceCave

    Advice Wanted - Bad luck or just me?

    1. Depends on how big the company is. The employee writing the webpage might not be the same person doing the job interview or checking the applications. 2. That is exactly what you want to achieve! They don't write this on their webpage for nothing! They want you to read this so they get people matching those requirements and people repeating those requirements in their letter have a) read the announce and informed themselfes about the company (no standardized mass-application) b) are possibly exactly what they are searching for or at least are claiming to be which leads you to the next step -> the job interview.   According to your statement you should neglect them? It is important that you match their qualification requirements and often companies write them into their announce.   As I said though: Mix them into your application together with your other benefits and why you want to work there. Don't just copy paste the whole webpage block and send it to them.
  11. IceCave

    Advice Wanted - Bad luck or just me?

    Companies often have an announcement for which people they are looking for on their website. A good trick is to just copy those requirements and mix them into your cover letter about yourself and they will get interested. Internships in computer science can get payed up to 15€/h for 40hours a week, that is 2400€/month. Especially for computer science! However, there are different wealth areas in Germany poor & rich that either pay you that much money (mostly south-west) or just a tiny bit (mostly north-east), however life sustaining costs are also entirely different. 800€ should get you covered over the month in any case and still have some spare money and that is what counts. At least if you are not trying to work in Munich.)   Here comes the sad part: Companies in Germany don't have to pay you anything, legally. No joke! There are enough companies out there that exploit your circumstance as an internship to get a free worker. The same companies do not value as a worker and at the end they let you carry paper from one bureau to another. I know that from first hand experience after working at 6 different companies: The less they pay you, the less they value you and the more repetitive unchallenging work you are doing. Value your time! And they will value yours. 800€ a month is okay if you have nearly none experience because the company will end up spending money on people training you then, mostly.   While computer science is generally a growing industry that pays well, I am not so sure for game companies anymore. From everything I hear this is a hard and risky profession. Maybe others can say more about that part.
  12. I was wondering how to calculate a car to drive to a certain position in space. While a tank or a person can turn around their own axis a standard car cannot, it needs to turn around until it is facing the destination point in space and then start driving into it's direction.   My first thought was calculating the angle between the desired direction and the current direction of the car every cycle     and let the car turn step by step until delta angle is zero.   However I think this might be overkill to do for lots of cars in my Android racing game. I always try to avoid sin and cos because I was told they are very expensive to compute on CPU and I wanted to ask if there is a better faster easier way to calculate this? Or if this is a good way to go.   Thanks Best Regards
  13.   I strongly disagree, this is just not true at all [spoiler] public class TestChamber {     public static ArrayList<String> stringContainer;     public static void main(String[] args) {         long start = System.nanoTime();         for (int i = 0; i <= 10; i++) {             test(1000000);         }         long end = System.nanoTime();         System.out.println(">>> Running time " + ((end - start) / 1000000000)                 + "seconds");     }     private final static void test(int numberOfAllocations) {         stringContainer = new ArrayList<>(numberOfAllocations);         long combinedTime = 0;         for (long i = 0; i < numberOfAllocations; i++) {             combinedTime += allocate();         }         System.out.println("---------");         System.out.println("Total:   " + (combinedTime / 1000000000d)                 + "seconds");         System.out.println("Average: " + (combinedTime / numberOfAllocations)                 + "nanoseconds");     }     private final static long allocate() {         double r = Math.random();         long start = System.nanoTime();         String string = Double.toString(r);         long end = System.nanoTime();         /*          * Add to something to avoid possible JVM code improvements which might          * affect runtime          */         stringContainer.add(string);         return end - start;     } } [/spoiler] > On the first run this code allocates 1Million random strings (on my laptop) in 0.9 seconds(!!!) with an average speed of 917 nanoseconds (!!!) per allocation The whole code runs in 15seconds (10.000.000 strings). > allocating 10million empty strings needed 0.04 to 0.2 seconds > combining 10million times two strings "string = s1 + s2" needed 0.08 to 1.15 seconds   Of course the whole speedtest varies a lot by the size of each string but in this test every string has about 18-22characters which should be enough.   I don't know what the OP is actually doing, but if he isn't reading in over 10.000.000 string values which took in my test above about 15seconds on my laptop this shouldn't matter at all.        Yes, both C# as well as Java offer a "StringBuilder" which is a very good way to tackle this, agree. StringBuilders, however, are sadly not handled similar like primitive types as it is the case with normal Strings. I.e. "stringbuilder1 + stringbuilder2" won't work or using StringBuilder in a switch statement :/ _______________________________________________________________________________________________________________     @TS Now what I actually believe is the source of all evil is, that you are doing a lot of (unnescessary) String comparisons, searching for character sequences, splitting strings and stuff like that. The solution to that is overthinking your data-format and parsing-logic from the ground up. There is not much to say without more information on your side besides that Strings in Java are UTF-16 encoded and string/character operations of any kind can be very heavy.
  14. IceCave

    Game Development Laptop

    When I want to use my Laptop in bed there are several steps to take: 1. Plugin the powercable 2. Plugin the mouse 3. Make place for mouse 4. Plugin Cooling Pad or the 90°C/200°F on my stomach combined with the bedsheet get reeeeeeeeeeeaaaaaaaaaallllyyyyyy uncomfortable 5. Rearrange all cables so it is comfortable   "Portability" is just half of the truth.
  • 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!