• Advertisement
  • Popular Tags

  • Popular Now

  • Advertisement
  • Similar Content

    • By Arnold // Golden Donkey Productions
      Hi, I've been working on this issue for a while and haven't yet found an answer.
      Does anyone know the best way to convert unity's LAT & LONG into a vector 3 position that I could use in a virtual world (if it's even possible). 
      Thankyou in advance
    • By wobbegong_
      I am taking an absolute beginner's game development course and we have just finished game jams in small groups. Our current assignment is to get feedback from people working in any aspect of game development. I would very much appreciate any feedback! The game is up on itchi.io (sound warning) https://wobbegong.itch.io/zombie-shooter It's essentially a very basic PvE.
      I also have some things I'm wondering about, but you don't necessarily have to answer these. 
      1. Do you have any tips on working with physics? My group wrestled a bit with Rigidbody physics not totally working the way we wanted to -- jumping ended up kind of floaty and inclines seem to mess up movement. Alternatively... how can I build terrains with depth that won't result in wonky physics?
      2. How can I keep up the level of challenge in an interesting way as the player progresses through the waves?
      3. What are some of your personal guidelines for creating title screens?
      Thank you very much in advance!
    • By ethancodes
      I'm having a weird issue with detecting a collision. I've tried everything I could find online but nothing seems to work. I have a brick object. It has a 2D Collider attached and I have also attached a 2D Rigidbody on it. I also have an EndScreen 2D Collider. The EndScreen 2D collider is tagged with "EndScreen". I am trying to detect when a brick collides with the end screen collider and simply print "game over" in the console. 
      This is my current code for this part of the program, it is attached to the bricks:
      void OnCollisionEnter (Collision2D collision) { if (collision.gameObject.tag == "EndScreen") { Debug.Log("Game over"); } } Several things have happened depending on the set up. If I have the rigidbody 2D set as static, my ball object can still collide with the bricks, but I get no Log message. If I set it to Kinematic or Dynamic, I get absolutely no interaction between the ball and the bricks, and nothing when the bricks pass through the collider. I have tried to set the collider to a trigger and use OnTriggerEnter2D, no change. I have tried to put the rigidbody on the EndScreen object and tried to set it's body type to all 3 settings, no change. The only thing I can think of that I have not done is put the script on the EndScreen object and switch the tag to the bricks. The reason I have not done this is because I will have several types of bricks, some of which will have different tags. 
       
      Please tell me somebody can see what I'm doing wrong here, because I'm losing my mind over something I feel should be ridiculously simple. Thanks.
    • By Sandman Academy
      Downloadable at:
      https://virva.itch.io/sandman-academy
      https://gamejolt.com/games/sandmanacademy/329088
      https://www.indiexpo.net/en/games/sandman-academy
      https://www.gamefront.com/@sandmanacademy
      http://www.indiedb.com/games/sandman-academy
    • By Sandman Academy
      Downloadable at:
      https://virva.itch.io/sandman-academy
      https://gamejolt.com/games/sandmanacademy/329088
      https://www.indiexpo.net/en/games/sandman-academy
      https://www.gamefront.com/@sandmanacademy
      http://www.indiedb.com/games/sandman-academy
  • Advertisement
  • Advertisement
Sign in to follow this  

Unity Learning from Other's Code

This topic is 703 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey guys, this is just a general question about the practices of learning coding. How exactly do you guys learn from other's code without it completely overriding your own ability to solve a similar solution. I ask this because I am currently working on my own game engine. After using Unity/Source/CryEngine/Unreal Engine 4, I have learned a lot about efficient rendering pipelines, shader abstractions, and multithreading. I see this directly affecting my own code writing to the point that it feels like copying to me. For Example, Unreal Engine uses the "FVertexFactory" class to handle runtime shader selection ; vertex stream management , and shader parameter binding. It also uses "FVertexFactoryType" as a way to abstract shader input, each FVertexFactoryType has a corresponding shader file that determines how to get common information like tangents/normals/position etc. Because of this, I have added a similar class to my engine that handles the same logic but with a few extensions, such as dynamic instancing. Source Engine and UE4 both have a class for each shader that they use in engine, and I have chosen to use something similar to their implementation. The engine for The Order 1886 uses a text description language for material shader generation , and I have implemented a similar solution. It seems that it might get to a point where my entire code base is just a combination of different engines that i've used, or read about, instead of something that is purely of my design. I wanted to know if this is something that other's have experienced, both novices and industry professionals, and is it okay? In a gdc article for Uncharted 2's Shader system, they showed a code base that looked eerily similar to UE3's, even stating that their developers had a background in Unreal, So Should I somehow try to forget , or steer away from, the implementations that the best game engines use? 

Edited by AThompson

Share this post


Link to post
Share on other sites
Advertisement

I'm writing an engine to learn some of the internal mechanics, such as rendering ; entity-component systems , file management/streaming, object reflection,  physics, and etc. I built a few small engines previously for courses, like a bowling game. Now I want to build one as an entry into my portfolio . My end result is to create a small turn based rpg

Share this post


Link to post
Share on other sites

In response to the earlier section of your response, thank you for it by the way, my issue seems to not be that I don't understand why they took the approaches that they did, but that I can not find a better way to achieve the same result, which causes my code to mirror theirs in a way . For example when it comes to shader abstraction , creating a class per shader reduces the cost of wasting time on parameter look ups. It also helps with shader type look ups and serialization , using somewhat of a class factory. Abstracting the vertex input of your shaders , via FVertexFactory in UE4 , allows you to keep the same main shader code, and just change the small shader sections, such as getting local position of the vertex, which is mandatory for a good shader generator. Having a c++ class , and a class factory via FVertexFactoryType, forces a contract between c++ client code and shader code. 

Share this post


Link to post
Share on other sites

Thank you Glass_Knife , I've actually gone through a fair amount of those code bases. My question was more related to; what is the thin line between learning from another code base to better yours, and what is just copying the work done by other engineers, which can be really bad, especially if it's open source but still copywrited.

Share this post


Link to post
Share on other sites

If you're reading other people's code, you will see stuff done in a way you've never seen it before.  Maybe it's a new algorithm, or C++ trick, or just understand how they structure their header files and code, resources, and build scripts.

 

If you are just copying other's code, you aren't learning anything.

Share this post


Link to post
Share on other sites

Well I'm not explicitly copying, it's more like I'm reading through some of these great game engines, and seeing that the more I read, the more my code looks closer to these engines. So in reality the code isn't 100% of my own creation, but my modified version of what I learned from a reading. Maybe I'm just overthinking it.

Share this post


Link to post
Share on other sites

I'm writing an engine to learn some of the internal mechanics, such as rendering ; entity-component systems , file management/streaming, object reflection,  physics, and etc. I built a few small engines previously for courses, like a bowling game. Now I want to build one as an entry into my portfolio . My end result is to create a small turn based rpg

 

 

Looking at existing art is a good way to understand where the field of interest is, today. Re-creating that is a good way to understand what's happening inside.

 

However, (and this may also be where you're struggling with), at the end of the day, you've reached what already exists. At this point you can dump your engine in the trash (it has done its job to help you understanding the current solutions). It's better to use anything existing, if only for the sole purpose that it is actively being maintained by someone else than you.

 

 

I am a software engineer, never take job interviews, and I am totally not into game engines, but if I would do both things, and get you, my question would be something like "You made your own engine, interesting. Please tell me how it differs from the existing ones, and why?"

 

[Scared you there, eh?]

 

 

To understand the question, take a step back.

 

In engineering, there are always trade-offs. You want the best of everything, but you cannot have it, so you let go of some area in order to gain in a different area that you consider more important. By making such design decisions you arrive at some solution, which is thus the least bad in all design goals.

 

It's the same in code. The design space of "an game engine" is close to infinite. To arrive at a solution, you must make choices. With each choice you narrow the design space by chopping off some area that you consider less interesting. As engine designer making the choice, however, you better have a deep understanding of what you throw away.

 

Existing art is just unique solutions in an infinite design space (like small dots in the empty universe). They have made a zillion trade-offs in the design space to arrive at where-ever they are in the design space. As engine designer, you should understand what the current art dropped, and why that is reasonable. If your solution is different, you must have made a different trade-off somewhere, and be different/better in some area.

Edited by Alberth

Share this post


Link to post
Share on other sites

Learn from more than one. Chances are they won't solve anything the same way, which means now you've got two great ideas to copy, and you can't copy both :P

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement