General

C++ Game Library written by the society
[ Trac | Subversion | WebSVN ]

General

Postby salo » Wed Dec 05, 2007 11:47 am

Post here if you have any questions about how to use/compile the library. We will also post here if there are any important changes made to the library that may affect your code. For example: Instance 'set' and 'get' has now become 'variable' due to a conflict and will shortly have an overided [] operator.

Documenation is available at http://www.dcs.warwick.ac.uk/~nick/wgd-lib along with some tutorials on Trac for the latest release but does not match the latest SVN version which has some undocumented features.
salo
 
Posts: 188
Joined: Sun Oct 08, 2006 2:58 pm
Location: Coventry

Re: General

Postby salo » Sun Dec 09, 2007 9:49 pm

The current SVN version now works in visual studio 8 (2005), an example project can be found in the test folder and the project to build the library is in the wgdlib folder. No special stuff needs to be installed as sound, music and wiimotes do not yet work with VS and are disabled. This has not been tested on other machines so if you find missing files or problems with the projects then let me known.

PS. In Dev-C++ animated X models no longer work for some reason... we are looking into it.

There will be a release with a VS library etc soon.
salo
 
Posts: 188
Joined: Sun Oct 08, 2006 2:58 pm
Location: Coventry

Re: General

Postby salo » Sun Dec 16, 2007 11:19 am

We still have no internet at our house and now the unencrypted network next door has gone so we will not be able to commit changes to the wgd svn. We have moved all of our work to a local SVN repo and will continue with it there until next term when we hopefully get internet back.
salo
 
Posts: 188
Joined: Sun Oct 08, 2006 2:58 pm
Location: Coventry

Re: General

Postby salo » Wed Dec 19, 2007 10:45 am

It has bloom and HDR!!!! It can also render a camera to a texture which can then (using the database...) be mapped to any texture in the scene or a shader and hence it can do real-time reflections!!!!

Here is a screenshot (without reflections :( ):

http://www.dcs.warwick.ac.uk/~nick/wgd-lib/wgdlib2.png
salo
 
Posts: 188
Joined: Sun Oct 08, 2006 2:58 pm
Location: Coventry

Re: General

Postby Dunk » Wed Dec 19, 2007 2:17 pm

Holy crap bloom!
Holy crap stargate!
Holy...crap...database?

I think someone needs to post a tutorial about how to use the database properly, otherwise I'm just going to bypass it again next time.
I can see potential for changing stuff in game though, like having a multiplayer game with a "dungeon master" player who controls events around the other people...
User avatar
Dunk
 
Posts: 483
Joined: Fri Oct 22, 2004 4:11 pm
Location: Coventry

Re: General

Postby salo » Thu Dec 20, 2007 10:35 am

Good idea, one database tutorial coming up... We were going to do this for the version 2 release. Hopefully we will have shadow mapping before then as well as fully working collision detection. :D
salo
 
Posts: 188
Joined: Sun Oct 08, 2006 2:58 pm
Location: Coventry

Re: General

Postby Dunk » Thu Dec 20, 2007 3:05 pm

Well if you want to wait for release 2 - I'm probably not going to use the library until next term, not sure if anyone else is using it at the moment...
User avatar
Dunk
 
Posts: 483
Joined: Fri Oct 22, 2004 4:11 pm
Location: Coventry

Re: General

Postby Alan » Sat Jan 12, 2008 11:52 pm

Changes I've noticed:

* need to compile with -lopenal now (BTW, why is this? It generates linker errors without it, but I'm not using audio at all. Same with -lbluetooth and -lvorbisfile.)

* INSTANCE_LOCATION and INSTANCE_CONSTRUCT have been combined into INSTANCE
Alan
 
Posts: 609
Joined: Tue Oct 17, 2006 8:05 pm

Re: General

Postby salo » Sun Jan 13, 2008 11:13 am

It only needs -lopenal if you have openal installed on your system. I could add something to the configure script to disable audio manually if you wish. Bluetooth is needed for Wiimotes. Our ultimate plan is to remove all library dependencies but this is not possible currently.

As I mentioned in reply to your bug report, the way instances are managed by scene has changed in version 2.0. This is not compatible with version 1 (hence a different major version).

Other changes of significance include:
- Instance groups: an instance that contains other instances but still works with octree.
- Wiimote IR sensors (woo!)
- HDR and bloom effects (optional)
- Iterator in scene to iterate over specific instance types, instead of directly using database objects (no longer possible).
- Render to texture (using extra cameras with texture objects attached).

Planned changes:
- radiosity lightmaps (partially implemented)
- more control over update and draw order when using scene.
- transparency sorting.

Known issues:
- Shader variables not set correctly (due to mesh material sorting).
salo
 
Posts: 188
Joined: Sun Oct 08, 2006 2:58 pm
Location: Coventry

Re: General

Postby someone » Sun Jan 13, 2008 11:59 pm

How to use groups:

All instances can now have child instances, The position of the children is in relation to the parent, so if you move or rotate the parent, all of its children will also move. You can use this feature to group instances into sections by using a dummy parent instance as a container.

to create a group in a dst file
Code: Select all
wgd(scenes)(cur)(instances)(group1) = {
        (type, instance),
        (children, {
                 (child1, { ... }),
                 (child2, { ... }),
                 ( ... ),
        })
};


type instance will act as a dummy object, but you can use any instance as a parent.
All children can have thier own children allowing as much depth as is needed.

all child instances are automatically added properly to the scene so calling Scene::current()->draw()
will draw them all.

A good example of how this works is a car model can have seperate wheel models that can turn independantly but still move with the car.

the iterator by default doesn't go through child instances, but you can iterate through a group by telling the iterator to use that group:
Code: Select all
Instance *group = Instance::get<Instance>("group1");
for(Scene::Iterator<IModel> i = group->begin(); i<i.size(); i++)

The alternative is to make the iterator recursive so it will iterate through all child objects it finds too,
Code: Select all
Scene::Iterator<Instance> i;
i.recursive(true);
for(i = Scene::current()->begin(); i<i.size(); i++)
User avatar
someone
 
Posts: 161
Joined: Tue Oct 04, 2005 1:42 am
Location: Somewhere else

Re: General

Postby Dunk » Mon Jan 14, 2008 12:31 am

What happens if you make the parent object a child of the child? :twisted:
A->B and B->A

or A->B, B->C, C->A?

If it's anything like source, it will crash horribly.
User avatar
Dunk
 
Posts: 483
Joined: Fri Oct 22, 2004 4:11 pm
Location: Coventry

Re: General

Postby someone » Mon Jan 14, 2008 5:47 pm

What happens if you make the parent object a child of the child? :twisted:
A->B and B->A

IF you make this the case at runtime using the console, nothing will happen as the dependancies are already in place, but it crashes if you have to build a scene with a loop like this from a dst file or changing the current scene. The only way to make this happen is to make a reference to the parent instance in a child instance.
User avatar
someone
 
Posts: 161
Joined: Tue Oct 04, 2005 1:42 am
Location: Somewhere else

Re: General

Postby salo » Tue Jan 15, 2008 4:47 pm

The library now runs on the DCS video wall :D . Note that currently the video wall hardware does support shaders and hdr but the distributed rendering software (chromium) does not... something I hope to fix. There is also a slight bug with the mouse.
salo
 
Posts: 188
Joined: Sun Oct 08, 2006 2:58 pm
Location: Coventry

Re: General

Postby Dunk » Tue Jan 15, 2008 5:03 pm

Wait... are we doing headtracking on the DCS wall now?
User avatar
Dunk
 
Posts: 483
Joined: Fri Oct 22, 2004 4:11 pm
Location: Coventry

Re: General

Postby richardhp » Tue Jan 15, 2008 5:54 pm

how do you change levels??
i do this:

DB::runScript("../levels/level2.dst");
Scene::current("level2");

but it crashes, am i missing something?
richardhp
 
Posts: 189
Joined: Mon Oct 23, 2006 9:10 pm

Next

Return to WGD Lib

Who is online

Users browsing this forum: No registered users and 0 guests

cron