LO's Sharp Devs

C# , XNA Game Development Blog. Intentionally more than only for game authors but for C# programmers in general.

Moje zdjęcie
Nazwa:
Lokalizacja: Poland

wtorek, 25 listopada 2008

[Testing Environment – DB p. 1] Authorization

I’m going to use this DB entry article to introduce notation I’m going to incorporate In following articles. First of all I put in charge READIBILITY – as more important in those rather learning materials, than any common (or custom) notation or standard.

First of all – table naming conventions:
• Names are simple, singular words, separated with underscore, describing the content or entity
• Tables containing dictionary data start with prefix "dic_"

I’m not designing there multilingual support (but I left this an open issue – I use dictionary tables whenever translatable data appears, so one can easily add translations table for them if necessary) or care for all fields that might be useful – I’m going to incorporate as few fields only when they are needed or excused by current article. I also do not care now schemas, ownership or complicated indexes (well I put them in place, but I will not mark them on diagrams or discuss this area).

System is being designed in the way that can be used both by stationary users, offshore ones as well with closed and public beta testers. Therefore a set of permissions is going to be implemented. System is also designed to support many games (as well generally other IT projects) and allow access one parson to many games. Here it goes basic DB schema:



Some notes about tables and fields:

Game – main table, now just containing game identifier and simple name.
User – table containing users, fields are obvious, but one might require additional comment – it’s display_name, that is going to be used on forums, lists etc. Generally it shall be name + surname, but is intended to be unique (but for security reasons different than login).
Dic_user_role – intended to contain main role that user has in given game. It does not grants any permissions – it’s rather used as sub header on forum, discussions, logs etc.
Dic_access_permission – defines available permissions to the system
Assigned_access_permission – lists permissions that has been granted for specific game access. Field value might be used by some permissions, but we do not use it yet.
Game_access – defines user has access to specific game (with dates) at particular role with set of granted permissions.

There might be defined specific default template of permissions depending of assigned role to just assist in creation of user access. This might be stored in db or be defined only on backend application. Administrator shall have full possibility to limit or extend that list for particular user.

środa, 19 listopada 2008

[Game - Audio] Dynamic Music

Yes, today it is time for well known subject, that various developers tried to beat many times already. Dynamically changing music. Thing simple as an idea but very hard to implement.

I will just run through various attempts or ideas I've seen or thought about and in the end propose my own idea, that is obviously some kind of compilation of best solutions :)

In most cases there are just two (sometimes more) types of music in ordinary game: "normal" music that goes through most of the time and "dynamic" one appearing during fight or something. There sometimes appears "special" music connected to particular event or location. Typical game may contain several tracks of each type picked randomly and in line with current game situation.

In old days there were just midi tracks, that were swapped, eventually swapped channel by channel to receive "smoother" transition. This was quite simple to implement and resulted with nice transition. Now, even in era of advanced sound cards (X-Fi?) midi is simply too poor and simple, and of course sounds very poor on weaker cards.

Similar results could be obtained using mods, where samples of instruments (or even voices) were digitalized, not synthesized in real time. This improves quality on low-end cards, but still is no good quality.

Then designers started using music on CD or MP3 (and similar formats). The quality can be very high but is has real drawback in smooth transition - most of the time developers rely on external libraries that have to buffer tracks before play, can play only one track at the moment etc. This gives no way for nice transitions - (like in Morrowind / Oblivion where game frozen for second or two, then another track started from the beginning), or when this is fluent - one can easily determine where one track ends and another starts - what is big clue of being attacked, or even tracked by the enemy - what shall not happen in horrors and similar games. This is bad also for themes that have to warm up first - so are silent in the beginning etc.

My proposal is to develop own replay library that can buffer several tracks and then design GROUP of tracks that are connected by some "theme" and then prepare special matrix (for example with accuracy of 5 seconds) which points into which second of track of other type to jump when being in particular place in current track. Of course such places in tracks shall be first composed by musician, but having that in mind - themed groups can be doable.

It can be even upgraded, so particular transition may be done in several ways, of one will be picked randomly, giving feeling of variability. Or also may be programatically changed from "rapid" change in violent situations into fluent change (jumping into warm-up section?) in more "thrilling" moments. This matrix may also contain information of conditional loops in one track to avoid "repetition" feeling (hearing warm-up section is quite significant in my opinion) in selected situations.

Of course that requires careful music design - so all track types in one theme group
have several ways of jumping from one to another. One may even design special themed "jingles" (short pieces of sound) that would help in jumping from one tension to another (sudden chord that matches following battle music or in the opposite - fading ending of rush music) or just build bigger diversity in transitions. But this is also a great benefit itself - having music themed and dynamically changing inside one theme adds to the game movie soundtrack feeling, where music is written up to accompany current scene. This shall add great value to the game immersion.

Comments? You are welcome.