• Advertisement
Sign in to follow this  

Unity Learning about how games work, do i have this backwards?

This topic is 2174 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

I am someone who uses unity 3d and a lot of engines and some very high level frame works a lot. I was thinking to myself recently that I dont know how many of these things work, or in fact why. I dont know why 2d coordinates start in the top left corner, nor how 3d graphics seem to work. I just know that they do. This troubled me and I wanted to learn more. I figured as someone who wanted to specialize in software development It would be good to focus on those topics. I know a lot of java and I decided maybe I should look at LWJGL and try that library. It seems great. A way to use many gl calls in java and learn about more advanced topics. I then was reading that JmonkeyEngine used LWJGL and that it would be a better idea to use that because in the end i would be (at best) recreating that tool. This started to perplex me about how abstraction works with what I type in to how it actually works. I then thought to myself maybe it would be best to use regular OpenGL and SDL instead of LWJGL to learn. This got me thinking that you could infinitely go down the chain of lower level languages and Ideas until you got to binary.

So after that long winded post, how much abstraction is good in learning about how to develop a game and its systems? Or is it best to use the highest level tool you have because one could argue," why not use assembly", and even lower level stuff. I like Java a lot and I am not a big fan of manual memory management, but is this ok if I want to learn more about how games work using java and LWJGL?

Thanks

Share this post


Link to post
Share on other sites
Advertisement
how much abstraction is good in learning about how to develop a game and its systems[/quote]

Depends on abstraction. OGl/LWJGL/etc. are just APIs. The abstraction they provide is the graphics pipeline, something which has been defined formally in every intro computer graphics class. Another topic is linear algebra.

Java is not relevant here either, it's just another language and if using OGL it does it the same way. They are just convenience implementation which may cut down on some boilerplate code.

Unity and MonkeyEngine provide different abstractions again, including scene and asset management, the usual simulation logic and perhaps a few more things.

I dont know why 2d coordinates start in the top left corner, nor how 3d graphics seem to work.[/quote]
First learn linear algebra, there are plenty of courses since it's typically intro level. Next look into rendering pipeline, it's often more advanced (perhaps 3xx type course), but concepts are universal across just about all APIs. Only thing related to implementation is the pre-/post-shader approach (DX9 vs. DX10+).

why not use assembly[/quote]
Because it's not only not an abstraction, but also not very practical or useful. Assembly is just means of encoding a concept for given hardware. It does nothing to help understand computer graphics better.

Share this post


Link to post
Share on other sites
Thank you for the advice. I see what you are saying and I thank you for the leads(Linear algebra,into to computer graphics,etc). The reason I brought up assembly was because I took a course on it and it was very painful for me and it was the lowest level things I dealt with. That is why I thought that if one argues to go lower level you could eventually hit assembly and eventually hit a why bother.

Share this post


Link to post
Share on other sites
That is why I thought that if one argues to go lower level you could eventually hit assembly and eventually hit a why bother.[/quote]

In many ways, shaders are a form of GPU assembly. So are SIMD instructions which are common in graphics algorithms since they are a good fit. But learning those will not teach the concepts behind graphics.

Main high-level concepts are:
- fixed/variable time step simulation
- linear algebra, forms the basis for representing 2D/3D spaces
- graphics pipeline, somewhat hardware-specific, since hardware evolved around proven concepts

Technologies:
- toolchain - vague, but perhaps important to make as transparent as possible, the *real* value of engines
- platform - Flash vs. native vs. sandbox vs. ... It defines the constraints and trade-offs
- language and APIs - defined by platform. While in general there are few restrictions, some are good fit, others are not. On Windows, Java + DX is a very poor fit, even though it's technically doable.

The only stuff that really matters:
- Fun and getting other people to like what you build. Nobody will ask how it was built.

Share this post


Link to post
Share on other sites
Little off the subject but what did programmers do before there was Directx or any other Graphics API? Did they make there own? Was game programming in DOS before there was Windows much more difficult then it is today?

Share this post


Link to post
Share on other sites

Little off the subject but what did programmers do before there was Directx or any other Graphics API? Did they make there own? Was game programming in DOS before there was Windows much more difficult then it is today?

Yes.

In the 90s era, before Voodoo launch, you had either ModeX or similar common video modes or later VESA. There was a list of memory addresses and interrupts (mov ax, 13h; int 10;). Then you simply wrote to screen buffer. If you wanted to draw a line you implemented Bresenham's algorithm. Same for circle. And polygon fill. Or just wrote to memory directly. There were libraries (Pascal had BGL), which were fairly high level and user friendly, but slow. And slow back then mean that filling a circle could take 5 seconds compared to 120fps that was possible using tweaked assembly.

Before that, Hercules graphics or such was really basic. You would look up which chip does the logic, add a ram chip, solder everything and that was it. A "graphics card". It would be just part of memory you wrote to and read from, like the rest of code. GPUs still work in mostly the same way, but those parts were hand assembled from off-the-shelf components and they worked.

On home computers, it was similar. Graphics were mostly non-existant, but certain chips could be forced to do graphical stuff. If they supported sprites, you'd use that. Then there were hacks, such as redefining the look of fonts so that characters would form graphics. There were no standards, you read through the chip specs.

Interestingly, there were some types of graphics which were absurdly trivial compared to today. Parallax scrolling is one such effect, it was just a single shift with no abstraction in between, making it effectively free. Today one would likely need to move a texture around through entire driver architecture or use a shader which is again an incredibly complex framework with compiler in between.

There were tons of books on tweaks and hacks and obscure algorithms that made things possible at all. These tweaks are still largely present today deep in drivers or hardware, but exposing the to end user simply isn't viable let alone useful. Most were just techniques which were a good fit for hardware.


But considering I can do canvas.drawTo(...) today and have hardware accelerated graphics running instantly in any browser, old times are best left forgotten.

I'd even argue that using DX/OGL today is a bit low level. One is much better off using stuff that gives you entire character with skinning and animation or pathfinding code or such.

Knowing the APIs is still useful if doing phone or similar development, it allows much more direct and lightweight approach. But it's increasingly hard to justify development effort in commercial setting given given how much middleware is available.

Share this post


Link to post
Share on other sites
Hidden
To be blunt, that is literally an invalid question these days. Nothing used that far back could be an any benefit to you today. But yes, everything was coded from scratch and manually. Engines did not come around until years later.

As for what you need, well, above repliers have suggested learning linear algebra etc.
I flunked Algebra II.
Then I flunked it again.
Then I flunked it again and dropped out of high school.

Why do I know Algebra II and calculus? Because I found a use for them while learning how to program later on.

Don’t learn linear algebra.
Learn how to make games, and when you encounter something along the way you don’t understand, learn it.
It is really that simple.

It is true that I know only a subset of all linear algebra. Which is probably why I am fairly successful. I may not be able to talk the talk at a table full of math experts, but I know all the math that actually applies to my life/career, and anything beyond that may help me at those conventions with math experts we all know I so-often attend (sarcasm), but is otherwise time better spent on various graphics techniques, AI theory, etc.


That being said, yes, Java will cause you problems down the road. Check online for game-programming positions. Use http://www.gamedevmap.com/ to find companies in any part of the world where you would want to work, including those closest to you (but I would recommend traveling the world, and I don’t mean just hypothetically).
Any jobs asking for Java skills?
I haven’t seen such a thing yet, and you won’t either.

Making games with Java? A useless skill. Start C++ and your last disadvantage will be out of the way.


L. Spiro

Share this post


Link to post

So after that long winded post, how much abstraction is good in learning about how to develop a game and its systems? Or is it best to use the highest level tool you have because one could argue," why not use assembly", and even lower level stuff. I like Java a lot and I am not a big fan of manual memory management, but is this ok if I want to learn more about how games work using java and LWJGL?

Thanks

It just depends on what you want to learn and accomplish. If making games is your goal, there's no reason not to keep using Unity or whatever other engine you want to learn. If you want to learn more about how graphics works under the hood, then OpenGL or Direct3D is probably what you want to study. And if that's your goal you'll want to get into the linear algebra stuff sooner rather than later.

Share this post


Link to post
Share on other sites
Regarding, specifically, JmonkeyEngine vs LWJGL: what are you drawing? Do you have models, textures, lights and scene graphs in general, for which an engine is suitable, or do you stuff low-level data into nontrivial buffer structures in order to run your custom shaders, for which you don't need any library help besides taking care of OpenGL contexts and other objects? If you need something special, does the graphics engine allow you to make arbitrary OpenGL calls?

Share this post


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

  • Advertisement
  • Advertisement
  • Popular Tags

  • Advertisement
  • Popular Now

  • Similar Content

    • By Innoc uous
      I'm working on a space game, and I suck at art. I would love to get some help from someone who is more skilled than me. Things I need include modular space ship parts and GUI elements. Nothing too fancy, just functional so I can get a prototype put together. This could potentially become a serious project, but for now this is just a hobby project.
       
      In this video, you can see a few things I already completed
      :2018-02-24 20-08-13.flv2018-02-24 20-08-13.flv
    • By Innoc uous
      If you want to incorporate noise into your shaders, the Turbulance Library has you covered. Using code I gathered from this library, I made a cginc file that contains all you need to easily implement noise into your unity shaders. Who knows how this stuff works, but man, does it work well!
       
      https://pastebin.com/LLCUpJut
       
      Here is an example of what you can create using these noise functions.
       
    • By Nio Martinez
      I'll be buying a new laptop as my workstation for building games, Mostly 3D but not hard core. 
       
      I'm stuck at choosing between these 2 specs below. Does this really matter and if so, can some one tell my how and why it matters. 
      Choice1:
      Intel core i5-8250U (8th gen Kabylake refresh)(6 MB Smart Cache, 1.6 GHz Base with Turbo Boost up to 3.4 GHz) 4 cores 8 threads
      RAM 8 GB DDR4 (2400 MHz)
      GPU 2 GB DDR5 Nvidia MX150 256 bit
      SSD: yes
      Choice2:
      Intel core i7-7500U 2.70GHz Base Processor (4M Cache, up to 3.50 GHz Boost) 2 Cores, 4 Threads
      RAM 4 GB DDR4 (1800 MHz)
      GPU 2 GB DDR5 Nvidia GeForce 940MX 256 bit
      SSD: No
       
    • By Manuel Berger
      Hello fellow devs!
      Once again I started working on an 2D adventure game and right now I'm doing the character-movement/animation. I'm not a big math guy and I was happy about my solution, but soon I realized that it's flawed.
      My player has 5 walking-animations, mirrored for the left side: up, upright, right, downright, down. With the atan2 function I get the angle between player and destination. To get an index from 0 to 4, I divide PI by 5 and see how many times it goes into the player-destination angle.

      In Pseudo-Code:
      angle = atan2(destination.x - player.x, destination.y - player.y) //swapped y and x to get mirrored angle around the y axis
      index = (int) (angle / (PI / 5));
      PlayAnimation(index); //0 = up, 1 = up_right, 2 = right, 3 = down_right, 4 = down

      Besides the fact that when angle is equal to PI it produces an index of 5, this works like a charm. Or at least I thought so at first. When I tested it, I realized that the up and down animation is playing more often than the others, which is pretty logical, since they have double the angle.

      What I'm trying to achieve is something like this, but with equal angles, so that up and down has the same range as all other directions.

      I can't get my head around it. Any suggestions? Is the whole approach doomed?

      Thank you in advance for any input!
       
    • By devbyskc
      Hi Everyone,
      Like most here, I'm a newbie but have been dabbling with game development for a few years. I am currently working full-time overseas and learning the craft in my spare time. It's been a long but highly rewarding adventure. Much of my time has been spent working through tutorials. In all of them, as well as my own attempts at development, I used the audio files supplied by the tutorial author, or obtained from one of the numerous sites online. I am working solo, and will be for a while, so I don't want to get too wrapped up with any one skill set. Regarding audio, the files I've found and used are good for what I was doing at the time. However I would now like to try my hand at customizing the audio more. My game engine of choice is Unity and it has an audio mixer built in that I have experimented with following their tutorials. I have obtained a great book called Game Audio Development with Unity 5.x that I am working through. Half way through the book it introduces using FMOD to supplement the Unity Audio Mixer. Later in the book, the author introduces Reaper (a very popular DAW) as an external program to compose and mix music to be integrated with Unity. I did some research on DAWs and quickly became overwhelmed. Much of what I found was geared toward professional sound engineers and sound designers. I am in no way trying or even thinking about getting to that level. All I want to be able to do is take a music file, and tweak it some to get the sound I want for my game. I've played with Audacity as well, but it didn't seem to fit the bill. So that is why I am looking at a better quality DAW. Since being solo, I am also under a budget contraint. So of all the DAW software out there, I am considering Reaper or Presonus Studio One due to their pricing. My question is, is investing the time to learn about using a DAW to tweak a sound file worth it? Are there any solo developers currently using a DAW as part of their overall workflow? If so, which one? I've also come across Fabric which is a Unity plug-in that enhances the built-in audio mixer. Would that be a better alternative?
      I know this is long, and maybe I haven't communicated well in trying to be brief. But any advice from the gurus/vets would be greatly appreciated. I've leaned so much and had a lot of fun in the process. BTW, I am also a senior citizen (I cut my programming teeth back using punch cards and Structured Basic when it first came out). If anyone needs more clarification of what I am trying to accomplish please let me know.  Thanks in advance for any assistance/advice.
  • Advertisement