• Create Account

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

PrestoChung

Member Since 06 Jul 2009
Offline Last Active May 26 2015 07:09 PM

In Topic: Quaternion slerp: is this correct result?

14 May 2015 - 09:01 PM

Okay, I can see how that could be now. The thing that helps me understand is slerping to 0.5 gives an even shorter angle, but 0.25 again gives the same angle as 0.75. So the point is travelling from (-1 0 0) -> (1 0 0), but around some other axis. I think the calculation I just did on getting the difference between q0 -> q1 shows that the axis is not the y axis like I thought it would be, but it must be correct because I'm getting the same answer as the slerp method.

In Topic: Quaternion slerp: is this correct result?

14 May 2015 - 08:28 PM

Maybe I'm not understanding what the purpose of slerp then is, I thought the point was to get an intermediate orientation between a start and end orientation?

Right now I'm going to try calculating the difference between q0 and q1, then scale that by the appropriate amount, and apply q0 and that new rotation in order to get a combined rotation, although it seems like I'll have to convert back and forth between an axis angle representation to be able to scale it easily.

In Topic: Would it make sense for me to develop on virtual machine? (And question on Li...

18 September 2014 - 05:38 PM

9

LXC is not a VM: you'll run into video driver grief sooner or later if you use it like one.

Are video drivers the only issue to worry about? I'm thinking of, for instance, if I'm just working on a command-line server for my game (SDL_net) and not using any graphics rendering.

Edit: crud, looks like there might not be haskell bindings for SDL_net

In Topic: Would it make sense for me to develop on virtual machine? (And question on Li...

16 September 2014 - 07:55 PM

Why are you looking for a sandboxed environment?

I use this machine for day-to-day use; I don't want to bloat the system with too much experimentation. I suppose it would give me some piece of mind to be able to start with a blank slate.

In Topic: Many to one relation in an SQLite database

14 December 2013 - 02:05 PM

I would go with option 1. And, in fact, I would have two new tables: a table for Race and a table that maps classes to race, which I would call something like ClassToRace. ClassToRace would just have two columns, a ClassId column and a RaceId column, which are foreign keys into the Class and Race tables, respectively. The Race table would have a RaceId and whatever other information is relevant to races (RaceName, stats, etc).

The Class table now wouldn't have any Race column at all. If you want information about the races a class supports, you would have to query the ClassToRace table to get all the rows that match ClassId, which will give you the RaceId of each race that ClassId supports.

I already have a Race table so this is why I thought it would be the most correct way to relate the two.

It won't display as nicely as the snippet you posted in the SQL program, but is that really going to matter? It seems more likely to me that all you really want is the information, which your application will use as it sees fit. And you application can display the information however it likes. You shouldn't be making database design decisions based on how SQL displays the information, because that's largely irrelevant to your needs.

At this point I am still in the process of converting from CSV files dumped from spreadsheets. First I am reading the CSV file and then dumping from sqlite3 as an SQL script so that I can edit the definitions and then read them back in as complete tables.

I'm thinking the database is essentially static while my program is running (I have a main-memory array-based database system for in-game entities). But as it is a work in progress I will still be making changes to the database outside of the application.

So, is this a bad thing? I wanted a more regularized representation than a spreadsheet. And it's more natural for me to be able to edit database files from the command-line.

There is a set of 'best practices' for architecting databases, called Database Normalization. You don't necessarily have to follow all of the guidelines, but at least it will give you some ideas and insight that you can apply if you want to.

http://en.wikipedia.org/wiki/Database_normalization

Thanks for this. SQL has been harder for me to learn than programming languages because it seems like resources are less centralized, so more resources on general design topics are great for me right now.

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

This has terrible performance. It is an unindexed query. This means that you are reading your entire table every time you retrieve a line.

If you ever want to make the "who is an elf" query, you should definetly normalize your database.

Is it going to matter if a table has only between 3 and say, 500 rows?

Edit: The database is more for character creation. Player chooses a Race, next screen might list the Classes that are available to that race. But this database is not the in-game entity database.

PARTNERS