Sign in to follow this  
u235

Unity the hardest thing about game programming

Recommended Posts

Ok, mainly all my game programming has been done with engines that have everything taken care of for you, so that all you have to do is basically create your art and sounds, use the engine's loader and tell it what to do with what's been loaded. However, it's my belief, as is with the rest of the community(I think), that one should have an understanding of the lower level stuff that goes into an engine to effectively use it. This is what I have set out to do, but I am hitting a major snag. I am currently learning DirectX and I go through all these tutorials, and I understand the concepts presented very well. I can go through the code and understand everything that's going on. But whenever I try to implement the techniques into my own projects, I really have trouble applying what I've learned. Now I may be wrong here, but I think it just looks more difficult than it actually is. This is because everything done in a tutorial is presented as engine code rather as game code and makes things seem more difficult that it actually is because you only have to write, for example, object loading code once then you can just use that code for any object.
int main() {
   //init
   engineObject.load("world.x");
   engineObject.render();
   //clean up
}

The above would be using an engine. Now if you were to do the same thing, except using your own code to load the file, it would look more like this:
int main() {
   //init
   struct engineObject {
      //properties
      //vertices
      //other stuff
   };
   //A cubic ass ton of code to load and render the world.
   //clean up
}

Now my question is this: Once I have a loader, a renderer, an animator etc. done I can go back to where I started and treat my code just like an engine, right? I mean, obviously even after all that is done there will still be a great deal of work, but it won't seem AS insurmountable. Is this a correct assumtion or am I missing something? Thanks for reading and I look forward to the replies. -AJ

Share this post


Link to post
Share on other sites
The tutorials you're reading don't necessarily have 'engine code' but more likely 'reusable code.' Since good engine code -is- reusable code, I can see where you get the two confused :)

Fact is, if you just want to go and, you know, test some cool new Direct3D thing out, or mess with DirectSound, or whatever, you don't necessarily need an existing engine for it. Just could very easily hack something up that'll allow you to do what you want to do.

However, what you'll realize very quickly is that you do the same stuff over and over again in order to test something, and you'll identify great 'reusable code' candidates. Those guys you'll put into such constructs as your 'Object.Load' and 'Object.Render' calls.

Having reusable code is very nice, and will save you much headache in the future ;) It does not maketh for an engine though. But it will provide a clear starting point for you.

So my answer to your question : Don't get too bogged down trying to write an extensive engine. You'll end up like me writing tons and tons and tons of code doing all kinds of magnificent behind-the-scenes crap and end up with .. a bouncy ball (although, it is a very magnificently bouncy ball nonetheless ;)). Instead, when going through tutorials write good, clean, solid -reusable- code that gets you to what you want to do. This has three major benefits:

(1) You'll get to muck around with the tutorials quickly and easily
(2) You'll start learning good coding practices very early on.
(3) You'll have a good start to really understand what it means to make an engine, and if you're clever about it, a nice start to your own engine.

Again, in your case: good, clean and reusable code should be your goal. Making an awesometastic game engine will come later =)

I hope that answers your question :)

Graf

Share this post


Link to post
Share on other sites
Before you start an engine think about the data formats you want to use and if you can get content in these formats


The next step is to think about how complex/advanced your engine shall be.
Once you know what you really want, go on and collect information about the different parts you need to implement

Some canditates for code reuse are:
- image loader
- config loader
- virtual filesystems
- 3d format loaders that convert to your engine internal format


Then think about how you want to connect all the part of your engine:
e.g.:
- game code to game dll
- engine code to engine dll
- network into a sperate thread for reading, writing and de-/compression of packets
- content management systems, that keep track of the resources you have loaded for a level in order to release them on level change
- consoles are a good addition to make debugging a little bit easier later on
- GUI <-> game interaction
- input control
- render management


A renderer is more than just a loop to send 3d data and texture ids to the GPU.
In order to get decent results you need to consider a more complex shader implementation that gets associated with your 3d objects.
These objects need to be culled at runtime and sorted by shader/texture.

Sound and particle effects play another important role, however with particle effects I would be careful, since overuse of particle can make the scenery unclear and probably require too much attention by the player

Call of Duty 2 is a good example in my opinion although I respect opposing opinions.

If you look for some reuseable code components, I have a little library here which is still in development and shall be for free for non commercial objects.

Just pm me if you are interested

Share this post


Link to post
Share on other sites
Actually you want the bare essentials in tutorial code because you don't care to learn the framework when you care about gfx code for example. The framework is something to pursue once you're tired of writing zillion times the same code over and over. However a framework in not necessarily an engine. It's more like a small piece of the whole that allows you to write test cases faster. A game engine contains many more things that tutorials never implement into their frameworks because it's not needed. I suggest you take a look at real game code instead of tutorials to see what it entails.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Partner Spotlight

  • Forum Statistics

    • Total Topics
      627671
    • Total Posts
      2978551
  • Similar Content

    • By StefanJo
      Hi everyone!
      I have just released a project called Line Driving to the Unity Asset Store.
      Line Driving is complete project ready for release for both Mobile and PC. 
      It is a game where you have to draw your own road for a car using mouse controls or touch input.
      Features:
      1.Simple to understand,detailed commented scripts 
      2.Well-written documentation 
      3.Mobile-ready 
      4.Unity Ads implemented 
      5.Easy to customize 
      and much more… 
      Link to the asset: https://www.assetstore.unity3d.com/#!/content/101595
      Support email: sjovanovic0831@gmail.com



    • By Kurupted Playz
      Hey, I'm looking for some people that can help me with a game that I'm making that is a 3d platformer.
      I mostly need someone for character design and animation,  I can do some coding but if you can do coding as well you're still welcome because I'm still not the greatest at coding just yet.
      if you need to contact me add me on discord @ Kurupted#1206
       
    • By Jcyshadow97
      Hi,guys.I m working on a Fantasy RPG.Currently i m work alone on the project.I really need someone can make UI stuff.If someone can handle it please feel free to contact me on email: 270514974@libero.it.
      Thank you guys and sorry for my english.
       
       



    • By STRATUM the Game
      Hey, everyone! This is my first post here.
      I would like to know what you think about my project called STRATUM. It's a 2D platformer that is heavily based on storytelling and boss fighting while trekking through the world.

      Everything in STRATUM takes place in the first century AD, in a world that wraps our own universe, called  The Stratum. A parallel Universe that is the home of the Christian deities . In this game you will play as a Dacian warrior, unfamiliar with everything in this world, you’ll get to know and understand The Stratum together with him.
      The main thing that I want with STRATUM is to reinvent the known lore and history of the Christian deities and realms. 
      The story is unconventional, it plays down a lot of the mysticism of Hell or Heaven and it gives it a more rational view while keeping the fantastic in it. What do I mean by that? Well, think about Hell. What do you know about it? It's a bad place where bad people go, right? Well, that's not the case in STRATUM. I don't want to describe such a world. In STRATUM, there is a reason for everything, especially for the way Hell is what it is in the game. "Hell" is called The Black Stratum in the game.
      This world is not very different from Earth, but it is governed by different natural laws.
      The story will also involve the reason why this world entered in touch with ours.

       
      What do you think about all that I said? Would you be interested in such a game? I have to say that everything is just a work of fiction made with my imagination. I do not want to offend anyone's beliefs.
      I want this to be a one man game. I have been working alone on it (this was my decision from the beginning) from art to effects to programming to music to sound effects to everything.
      I also have a youtube video HERE if you want to see the way the game moves and the way my music sounds.
      Please, any kind of feedback will be highly appreciated. If you have something bad to say, do it, don't keep it for yourself only. I want to hear anything that you don't like about my project.
       
    • By LimeJuice
      Hi, it's my first post on this forum and I would like to share the game I am working on at the moment.
      Graphics have been made with Blender3D using Cycle as a renderer and I am using Unity3D. It's a 2D game, one touch side-scrolling game for iOS and Android.
      Here some pictures, and you can have a look to the gameplay on this video :
      Feedbacks ?
      And if you want to try it, send me your email and I will add you to the beta tester list!
       
       








  • Popular Now