Advertisement Jump to content
  • Advertisement

conditi0n

Member
  • Content Count

    4
  • Joined

  • Last visited

Community Reputation

4 Neutral

About conditi0n

  • Rank
    Newbie

Personal Information

  • Role
    Programmer
  • Interests
    Design
    Education
    Programming

Recent Profile Visitors

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

  1. conditi0n

    Economic Development Simulation Game

    As far as I know, one of the most famous examples of games mimicking real economics is World of Warcraft's auction house: http://www.academia.edu/6347993/The_Real_Economics_in_a_Virtual_World It doesn't have to be overly complex. You can do it all on a console at first, then expand it with networking. I suppose the real challenge would be the idea of innovation. Perhaps you can have "patents"? Where players with the most patents are the most likely to become the landlord/capitalist within the next phase of the timeline (where the timeline will be some event that triggers the next big innovation, like how you were talking about textile factories).
  2. Not C#, these are instead C++, but you should be able to get an idea if you know C#... https://www.amazon.com/Engine-Architecture-Third-Jason-Gregory/dp/1138035459 http://www.gameprogrammingpatterns.com/ (you can read free on the web if you scroll down) Other books exist, such as the Game Programming Gems and GPU Gems sagas, but these are mostly hodge-podge algorithms with optimizations you may never need for a simple engine. Then there are many many math and physics books, but again probably not that useful just yet. That is, as long as you aren't writing it from the ground up. If you are, you will need to know linear algebra and trigonometry from the get-go. If you want to write decent physics you'll need calculus.
  3. conditi0n

    Firing bullets in all directions Unity C#

    There's actually some redundant code here, but anyway, this code uses some trigonometry to solve it's problem by converting between two coordinate systems: the one we know and love, cartesian (x,y), and polar (r, angle), one that is more useful when you're working with circles (or ships apparently). These two coordinate systems are just used when you are trying to rotate in a circle on a 2d plane, when you need to get a position that you can use in world space (you can't use polar coords in unity world space!). The formulas one uses to convert between these is the following: To cartesian: x = r*cos(angle), y = r*sin(angle), if r is 1 you get a direction, which can still be useful; To polar: angle = atan2(y, x) (don't use atan, use atan2, this corrects the quadrants), and r is the distance from what you're interested in rotating around. All of this derives from ratios of a triangle, which you will want to master, and how it fits into a unit circle, which is also worthy of mastering. pure math: http://www.mathispower4u.com/trigonometry.php game-math-oriented: https://www.youtube.com/channel/UCF6F8LdCSWlRwQm_hfA2bcQ What this code does is 1) (first two calculations) The programmer wants to get a vector that represents the trajectory of an object from the origin of the world to a point at the end of the direction point, where the direction point is connected to the start point (confusing, I know, but this is what he wanted to do). He does this by getting an angle, using anglestep, (remember: he wants to go in a CIRCLE) and converting it to cartesian coordinates. This gives him the "direction" of trajectory. He then adds it to the starting point, getting the projectileDirectionPosition components (this does not make up a direction vector, this is a world position; it adds the direction to the start point and makes some large vector that goes from the tail of starting point to the head/arrow of the direction vector) 2) (second two calculations) The programmer then turns the components into a vector object and subtracts each component by the startPoint (a + b - b, undoing what he did in the first two calculations), normalizing it (undoing the radius multiplication), then multiplying it by a speed (radius?!). He now has a direction vector, you can envision this as an arrow pointing out of the startPoint, and the longer it is, the more velocity it has. It can also be envisioned as a arrow sticking out of the origin; these point in the same direction -- they are just at arbitrary positions (a proper direction vector!). 3) (last of it) He then simply instantiates the object at the start point, and gives it a 0 rotation, and gives it the trajectory velocity he worked very tirelessly to calculate. Remember: imagine an arrow; doesn't matter where, but it shows the direction the object will go in when applied to velocity.
  • 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!