Jump to content
  • Advertisement

HappyCoder

Member
  • Content Count

    928
  • Joined

  • Last visited

  • Days Won

    1

HappyCoder last won the day on September 29

HappyCoder had the most liked content!

Community Reputation

5068 Excellent

About HappyCoder

  • Rank
    Advanced Member

Personal Information

  • Interests
    Design
    Programming

Recent Profile Visitors

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

  1. HappyCoder

    My main complaint with OOP

    I definitely agree that OOP can be easily abused and I posted examples that were contrived to make OOP look bad. I guess my major problem is the way OOP is taught. I feel like most new programmings come into programming trying to solve everything with OOP and do it poorly.
  2. HappyCoder

    My main complaint with OOP

    In an oop world, these refactors can be a big pain. Moving functions onto other classes is non trivial. Moving functions to different files is.
  3. I think that object oriented programming has one major flaw. Consider the type below. struct Circle { Vector2 center; float radius; }; Now imagine we want to add functionality so the circle can Calculate area/circumference of the shape Draw it to a canvas Add the shape to a spacial index Serialize the shape to a file A naive way to implement this with OOP is class Circle : SpacialIndexLeaf { public Vector2 center; public float radius; public float CalculateArea(); public void DrawToCanvas(Canvas canvas); // spacial index interface public BoundingBox GetBoundingBox(); public void WriteToFile(File file); } This creates a hard dependency from Circle on Canvas, File, and a soft dependency in the spacial index by implementing an interface. This makes it much harder organize dependencies in a meaningful manner. The shape code, which should be just a simple representation of geometry. Now depends on spacial index code, rendering code, and io code. How did we get into the mess? The circular dependency between the data of a class and the functions of a class inherent in object oriented programming. Lets try to fix this problem using OOP approved methods. First lets try wrapper classes class Circle { public Vector2 center; public float radius; // no dependencies, this one stays public float CalculateArea(); }; class CircleRenderer : Renderable { public Circle circle; public CircleRenderer(Circle circle); public DrawToCanvas(Canvas canvas); }; public CircleSerializer : Serializable { public Circle circle; public CircleSerializer(Circle circle); public void WriteToFile(File file); }; This definitely fixes the dependency problem. It has the unfortunate side effect of greatly multiplying the number of classes in the code. Adding new shapes would require having many parallel classes scattered throughout the code base. How about combining all the shape rendering code into a single class. class Circle { public Vector2 origin; public float radius; public float GetArea(); }; class ShapeRenderer { public void RenderCircle(Canvas canvas, Circle circle); public void RenderRectangle(Canvas canvas, Rectangle rectangle); ... }; class ShapeSerializer { public void SerializeCircle(File file, Circle circle); public void SerializeRectable(File file, Rectangle rectangle); ... }; Less classes to manage, that is a plus. This has the downside of having a ShapeRenderer and ShapeSerializer that could grow to depend on a lot of different classes. If you only need to render a circle you still need to use a class that references all the other classes you don't care about. You also need to construct a class just to call a function. Moving where code is implemented changes what class may need to be constructed. Lets solve this problem without OOP. struct Circle { Vector2 origin; float radius; }; float CalculateArea(Circle circle); void Render(Canvas canvas, Circle circle); void Serialize(File file, Circle circle); No more circular dependencies between functions and data, or classes. Data depends on other data. You could define all the data structures in a completely different module from all the functions. Functions depend on data and other functions. The implementation of functions can be moved freely around in files without having to worry about which class the function should belong to. Moving where functions only changes where the functions are imported from. Classes to solve polymorphism nicely, but I think there are other solutions that don't have the inherent circular depedency problem that OOP has. I personally think that golang has a good approach here. Any thoughts on this?
  4. HappyCoder

    Making a (bad) movie... with AIs

    How much of the work is manual? How much is generated by an AI?
  5. I would love your help. I can PM you my email/discord. What communication method do you prefer?
  6. I am working on a game for VR where you create spells by drawing symbols in air and combining them in interesting ways to create various unique spells. Here is a video detailing how the mechanics of the game work. https://www.youtube.com/watch?v=K2W6GI8HQWw The game takes place in a wizards tower. Different rooms have portals that lead to different "dream worlds" that have distinctive themes. Each world is like a Mario 64 world with different power orbs to collect. Each orb will require you to solve a puzzle or defeat enemies by building spells tailored to the situation. The puzzles are open ended and will have many solutions. Power orbs can be spent to increase player power such as increasing health, mana, spell damage, or move speed. So far the team is just me. I am primarily a programmer with enough skill in blender to create functional assets for the game. I really need an artist to bring their artistic style to the project. Take the art direction anywhere you would like while keeping the amount of work required to finish the project achievable. I don't have the budget to pay you upfront for your work. You will get a share of any revenue that may come from the game. I would also love help on game design, particularly with level, puzzle, spell, and enemy ideas. I'm not even looking for someone with professional experience in this regard. If this project is interesting to you, even if you don’t fit the descriptions above, I may be able to use your help so go ahead and PM me. There are more story details but I left them out of this post for brevity. If you are interested on the current direction for the story I can post it here or PM you the details.
  7. HappyCoder

    How tightly can I compress my sprites?

    I just came up with a name for that. I don't really know if there are any existing resources about it. I was just looking at your sprite for any places there is a lot of redundancy and brainstorming ways to reduce that redundancy. I think you are on the right track. If you look at the image I attached you can get a feel for what I was trying to get at. The first frame of an animation is stored normally. Every next frame is stored as the difference from the previous frame. Since you are using a color pallete instead of RGB values you would store the number you need to add to the previous frame index value to get the new value. So as a simple example suppose you had the image 0 1 1 0 1 2 2 1 1 3 3 1 0 1 1 0 and another (notice only the second row of pixels change) 0 1 1 0 0 2 3 0 1 3 3 1 0 1 1 0 the diff would be 0 0 0 0 3 0 1 3 0 0 0 0 0 0 0 0
  8. HappyCoder

    How tightly can I compress my sprites?

    The walking frames seems very similar you might be able to store the diff between them instead of the full frame. EDIT: You couldn't rely on a simple RGB color diff to get results. Instead, the "color" of the diff image would just be an integer representing the offset of the color index from the pallete. So if the color is the same between two images it would be 0. Moving from the first color to the second color in the pallete would be a 1, moving from the second color back to the first would be (colorCount - 1), so 3 if you had only 4 colors in your image. The goal of the diff is to reduce entropy in the image and create as many continuous pixels that are the same as possible. This diff technique would only give you savings for frames that stay mostly the same. It may be difficult for a computer find similar images so there may be a manual process telling the computer what frames of animation go together.
  9. I would give all their own constant buffers. You create bullets as needed and when you are done with an object you return it to an object pool. The next time you create a bullet you check in the object pool if there are any unused bullets. If so, you use it, if not you create a new one. Each bullet will have its own transformation matrix associated with the constant buffer. The bullets can share the same index and vertex buffers.
  10. HappyCoder

    Animation from Blender to Unity

    Without seeing the animations I wouldn't be able to say for sure by my gut feel is that there are problems with interpolation between keyframes and the representation of rotation between the two platforms. If blender, for example was specifying rotation using euler angles in any order other than x y z for the angles and unity simply converted same orientations at the keyframes to use the order x y z the interpolation would come out differently. When you select the misbehaving bones in blender what do you get in the drop down in the rotation properties? (seen as XYZ Euler in this image) You can then check the animation curves in unity and see what values it uses to represent the rotation If unity is using rotatoin.x, rotation.y, and rotation.z and blender is using something different then your rotation interpolation would be weird
  11. HappyCoder

    Animation from Blender to Unity

    what exactly is wrong with the animation? Does it fail to import altogether? Does it import animations that are completely wrong or are they mostly correct and just have a few things that are off? Are you importing the .blend file or exporting and importing some other format?
  12. That is pretty wild. He obviously knew what he was talking about.
  13. HappyCoder

    What is Unity Animation Curve formula

    Is this one of the posts you are referring to? https://answers.unity.com/questions/464782/t-is-the-math-behind-animationcurveevaluate.html
  14. HappyCoder

    Sandbox MMO Idea ( My Video Game Idea )

    This is a large scope for even a AAA studio. There are certainly some interest ideas in your post but nothing stands out as being the hook, or unique interesting concept, to your game that would set it apart from the rest. If you are actually interested in making games you need to start smaller. Way smaller. Pick a single interesting mechanic and create a small game around that mechanic to explore how it effects game play. This would be a game like Undertale or Braid. Another approach would be to pick an established genre and just make a really well polished version of that game like Hollow Knight. Even a game like Undertale is large in scope for somebody new to games. You need to start much smaller.
  15. HappyCoder

    Turn-based multiplayer combat

    This game could work but my gut reaction is that it will be too slow paced to keep players engaged. Turn based games usually rely on a player managing many different characters and having total control over a single faction. This does two things. It allows the player to coordinate all units in a faction. This allows the player to strategize and gives the game depth. The second thing is making the game more challenging trying to manage and keep track of many things at once. This makes the game challenging and without challenge players will get bored. Trying to coordinate players would really only work well in high levels of play. At lower levels players aren't as good and will make mistakes or will intentionally troll their team. It would be hard for players to come up with a strategy working separately. To be effective, they would need to be coordinated by one person calling the shots and everybody else executing them. If done poorly it would basically be one person playing the game and everybody else following orders and could be very boring for those following orders. This would move all the challenge from trying to coordinate your units to trying to coordinate with others which may end up feeling like a frustrating escort quest. You may be able to make this idea work but you should make a simple prototype to play test it to, 1) see if my gut feel are actually going to be problems/find other problems with the idea and 2) try to come up with solutions to the problems. A few ideas to fix the potential problems I listed is to give many actions a player can perform on their turn increasing mechanical depth and making it more challenging. Choices may include healing yourself, healing an ally, charging a powerful shot, using a gun turret, repairing a gun turret, sending in a spy drone to locate enemies, planting land mines, putting up a barrier, and so on. You need to tune the complexity so the game is challenging enough to keep players engaged.
  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!