Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!

1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Member Since 06 Jul 2009
Offline Last Active Oct 15 2014 07:15 PM

Topics I've Started

Would it make sense for me to develop on virtual machine? (And question on Linux distros)

16 September 2014 - 07:09 PM


I know virtualization is used if you are targeting something like a console, but in this case I am developing with desktop computers in mind: SDL2 for linux/windows/mac.


Currently I run Linux Mint, and have been programming on it, but I have been interested in running a virtual machine as I use this computer for other day-to-day purposes. Would a virtual machine allow a better 'sandbox' environment for my development purposes?


I have about 0 experience with setting up and running virtual machines; two options I have been made aware of are VirtualBox and LXC.


Mint serves my purposes fairly well and I recently upgraded to 17 Qiana (which should be supported for several more years). In building some open source repositories, I have found things like the gcc included in buildessential may not be the latest version (I have 4.8.2, it appears I would have to manually install the latest 4.9.1). Does the 'rolling distro' nature of Arch make it easier to stay up-to-date on these things? or does it merely mean that I would never have to 'install' a new version of Arch?

Many to one relation in an SQLite database

14 December 2013 - 12:45 PM

I am converting a spreadsheet of game notes into a database.

I have a table of character Classes for an RPG (fighter, mage, etc)

One of the columns shows the Races that a Class can be in a comma seperated list:

ClassId       ClassName     Race 
------------- ------------- ------------
1             Rogue         Man           
2             Mage          Man,Elf       
3             Warrior       Man,Dwarf,Elf

I'm new to SQL and not sure how to translate this into a database file.


Here is what I'm thinking:


1.  I make a 3rd table that holds the relation.


I think this is the most proper solution. The drawback for me are that I would have to create and manage an extra table.  Also, to me the comma separated list like seen above is the preferable way for me to display the data and I'm not sure what other ways there would be to display the three possible Races together on one row (I don't think SQL/SQLite has syntax to concatenate strings or build lists?)


2.  I make a column for each race and use a boolean 0 or 1 value


This could be pretty clear. The only disadvantage I see is that I would have to create new columns whenever adding new races.


3.  I just leave the Race column as a comma seperated value


I could still query the column with statements like

select * from Class where Race like '%Elf%';

But I think this would make it hard to put any kind of constraints on the field (like a FOREIGN KEY constraint to make sure the Race exists in the Race table).


Thoughts or suggestions are appreciated.


Continuous Collision Detection of 3-dimensional Convex Hulls with Rotation and Translation

19 October 2013 - 10:41 PM

I am looking for methods that take into account rotation as well as translation for continuous collision detection.


My broad phase algorithm uses swept maximal bounding spheres returning a start time when the objects will be within their maximum radius.

I have two ideas how to handle the next phase of collision detection:

1 ignore rotation:
A simplified collision I am considering is to ignore rotation from the beginning of the narrow phase and use a GJK representation to raycast the relative motion of the objects to the origin. This should give an intersection time by a raycast against a convex hull. This method will result in colliding objects to stop rotating for a portion of the time step, and can miss collision due to rotation over the timestep.

2 bisection search:
Doing a bisection search of instantaneous GJK tests at increasingly smaller intervals, presumably down to a fixed size. If a collision is detected then only earlier points in the bisection need be considered (reducing the search space), but to rule out collision completely the full space needs to be searched. This seems fairly expensive and can still miss collisions where the periodicity of motion is between the test points.


I have found some indication that dual numbers or dual quaternions + screw theory may have some application but it seems like an advanced topic and so far the only game-related application I have found is in mesh deformation, not collision detection. Screw theory seems promising, but I'm not sure it applies to situations where the axis of rotation is not the same as the axis of translation, or if that is just a sub-set of certain screw motions.


Some possible resources:




Applying Player Movement to Velocity Vectors

10 August 2013 - 06:16 PM

In my initial code I had player movement applied directly as offsets to the position and orientation data.


My idea was to try and change that, so that player movement and rotation was instead applied once to the player's velocity or angular velocity vectors.


With simple translation this is easy. However, when the player rotates, the translation vector needs to change direction. This means subtracting the old vector and adding the new one. To complicate things further, the same is true of the 'up' vector if the player is pitching downwards.


So before each physics update the old vectors are subtracted, a new orientation matrix is calculated for the next frame, and the velocity vectors are re-applied in the proper directions.


This worked for either translation or rotation alone, but when moving and rotating simultaneously I ended up with residual velocity (around 0.02-0.07 units/sec, compared to a movement speed of around 1.6-8.0 units/sec). It's small enough that it seems like it could possibly be a rounding error but also not so small that there could be some small error in my algorithm, or else the method described above is just not possible.


I wanted just one set of velocity and angular velocity vectors, so that during the physics update step all collision could be handled in one step. Otherwise I will have to make a second collision step if I simulate player movement separately. This seems undesirable since my player is just an instance of a mobile game entity which I will be adding later, so all these objects would add more overhead to the movement step.




Oriented Bounding Box or Bounding Rhombohedron?

07 July 2013 - 03:46 AM

When defining an Oriented Bounding Box by the 3 ortho-normal sides of the box, I wondered what would the consequences be of letting those three edges be at any arbitrary angle?

The first question is if any 3 arbitrary edges do not always perfectly define a rhombohedron (ie the combination of edge lengths and angles doesn't work out right). This is an assumption on my part that any 3 edges joined at a common point will form one of the opposite corners of the rhombohedron. If this is not the case then I will definitely stick with an ortho-box.

The second problem is the containment test which I think should be the same. I'm assuming 6 dot products; 1 for each edge of the opposing corners.