Sign in to follow this  

Unity the hardest thing about game programming

Recommended Posts

u235    359
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() {
   //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() {
   struct engineObject {
      //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
Grafalgar    548
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 :)


Share this post

Link to post
Share on other sites
Basiror    241
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:
- 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
JD    208
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  

  • Similar Content

    • By dobbey
      Who are you?
      We call ourselves Dobbey. Our team currently consists of two people.
      We are both early 20's and come from Germany. At the moment this is our hobby.
      What's the name of the game and what is it about?
      The game is called Insane and it is a 2D adventure puzzle game with horror elements.
      Insane is about a scientist who has been doing human experiments for years.
      His most successful experiment is number 73, which seems to be mentally labile.
      This experiment manages to flee one day but can't distinguish between reality and imagination.
      In this game you will find a creepy atmosphere with difficult and varied puzzles.
      What inspired you?
      The style of the game is inspired by Limbo. But we were also inspired by Jump 'n' Run games and movies.
      Of course, we have also our own elements like an inventory system, butterfly effect, the "INSANE" effect, using a QR-Code..
      Which program do you use to develop the game?
      We are programming it with Unity. In our opinion, it is the best program for indie games.
      And of course we are working with Photoshop to create the graphics.
      What platform will Insane be available on?
      For PC.
      How can I support you?

      Here you can see some of our screenshots.


      (You can find the animation on Twitter/Instagram.)



      (You can find the animation on YouTube.)

      What do you think about it?
      Yo can see more screenshots or videos on Twitter, Instagram or YouTube.
    • By Liquid1Phantom
      Hello, my name is Thomas and I am currently starting up a project. 
      The project is going to be a very hardcore, and tactical FPS that is similar to Escape from Tarkov. It will be made within Unity, and will be programmed in C#. Currently, I have a Unity project started, an organized Discord setup, and as well as a very organized Google Drive. The Google Drive has art references, and plenty of folders for organization. Lastly, the payment for this project will be solely rev-share as I have no money.
      I am looking for anyone who can contribute: 2D artists, 3D artists, composers, programmers, etc.
      If you would like to help out and be of use, please email me at:
      Alternatively, add my Discord: Thomas#3788
    • By ilovegames
      Score points by shooting enemies! Before you is one of the best representatives of the simulator sniper games genre, with stunning graphics, quality effects, and realistic ballistics of bullets. It will not be easy to win for sure. Are you ready? Then take a sniper rifle and fight!

  • Popular Now