Jump to content

  • Log In with Google      Sign In   
  • Create Account


Brian Sandberg

Member Since 10 Oct 2003
Offline Last Active Yesterday, 04:05 PM
-----

#5164795 How To Save A Non-Grid-Based Level For A Game

Posted by Brian Sandberg on 04 July 2014 - 03:37 PM

Like Lactose wrote, there are loads of ways of doing it.  It'd probably be best for you to start out using some standard format like XML or JSON, instead of inventing your own text or binary format.  Then you'd have a file like

 

<map>

  <object id="MyObject">

   <type class="MyAwesomeObject" />

    <position x="100.023" y="39.5" z="-882" />

    <rotation z="23" />

  </object>

  ...

</map>

 

or

 

[

  {

     id: "MyObject",

     type: {

        class: "MyAwesomeObject"

     },

     position: {

       x: 100.023,

       y: 29.5,

       z: -882

     },

    rotation: {

      z: 23

    }

  }

  ...

]

 

Your language of choice will most likely an API for easily serializing/deserializing objects to text like this.

 

Depending on the size of your level, you can either keep it in memory as a flat list of objects like this, or you might need a spatial partitioning datastructure, like a simple 2d array or a quadtree, to contain the objects, so you dont have to traverse them all in order to touch the objects in a smaller area.




#5156995 Scripting solution for C# project

Posted by Brian Sandberg on 30 May 2014 - 11:14 AM

You could solve the clumsy-syntax issue by storing your state in a 'dynamic' object instead of your propertybag.  Serializing that should still be simple and quick.




#5153797 How do you know if you are not reinventing the wheel in your language

Posted by Brian Sandberg on 15 May 2014 - 10:34 AM

My wheel has an extra degree of freedom and is more of a ball joint really, and also has fittings for when I later want to attach a jet engine.  Don't judge; it seemed like a good idea at the time :)

 

Seriously though, there can be good reasons for reinventing the wheel.  It can be a learning experience, or you may need some feature that doesn't exist and makes it faster to reimplement from scratch than add to an existing library. If you're writing code as a hobby, then write what interests you. If you're doing a job for money, then other considerations become more important.




#5093984 Your opinion on C# graphical libraries

Posted by Brian Sandberg on 14 September 2013 - 06:15 AM

You can get C# bindings for just about every popular library.

 

For example, have a look at OpenTK for OpenGL bindings; you can certainly learn the basics with that, and since half the industry is running on OpenGL, it is something you can take with you.

 

Most 2D games are still made with a 3D API like OpenGL, but if you want a 2D API for the easier learning-curve, have a look at the bindings for SDL or SFML.




#5030154 Starting with OpenGL ES 2

Posted by Brian Sandberg on 08 February 2013 - 01:13 PM

Yes, you can do your OpenGL programming on Ubuntu.  OpenGL 2 is effectively a superset of OpenGL ES 2, so if you stay within the confines of the ES features, you'll be fine.  Mesa also supports the ES2 profile, so you could have a look at that.  But if you want to write for mobile devices, having access to one will serve you well.

 

I'm sure other people, and Google, will can link any number of tutorials; I remember this book as being helpful http://www.amazon.co.uk/OpenGL-ES-2-0-Programming-Guide/dp/0321502795

 

Do you mean if there's a chance to learn the fundamentals in 6 months?  Yes, definitely!  Especially since you probably already know a lot of the basic concepts and math from XNA.

 

Making an indie game can pay for college roughly the same way buying a lottery ticket can, unfortunately.  It's possible, but luck plays a huge factor.




PARTNERS