Friday, December 12, 2008

[code] Compiling on a share with VC2005

While trying to compile on a share (with all permissions) I got an error message concerning the opening of a '.rsp' file. After a bit of search it turns out to be a known issue.

To fix it, simply redirect temporary files to a local directory, such as:
$(temp)\$(ProjectName)\$(ConfigurationName)
(setting in Configuration Properties -> General, Intermediate Directory)

More info on
http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=101276

Friday, November 28, 2008

[tips] Sharing a folder from the command line

Ever had a (windows) laptop screen or graphics card died? (ie. the 'headless' computer effect). Well it just happened to me. Now, here is where it becomes tricky: How do you get to the files without taking the laptop apart? (you don't want to void the warranty, you don't trust support when they swear your data will be just fine).

One idea is to share folders so that you can access the files through the network. But that does not seem too easy without a screen... Well, usually you can get to log into windows without visual feedback. It is also fairly easy to launch a command line (CTRL-R (run) on XP; on Vista use the 'windows' key, type "cmd [enter]" and your are in). But, how can you share a folder from the command line, so that it will show up on the network?

I found the answer here: http://support.microsoft.com/kb/295622. There is a command line tool, WMIC, which lets you do many things, such as sharing a folder, from the command line. In principle you can even create the shared folder remotely. In my case it did not work out (password was refused for some reason) but I could do it 'blindly' from the command line.

Hope it helps!

[grrrr] Sorry, your IP is outside the US

I've always found region locking to be a significant annoyance (ie. you cannot play a console game in Europe if you bought it in the US, and vice versa). But even if I don't like it, I can only recognize that it is an efficient way to force money out of customers (what is a right price anyway?). I just admire the irony of globalized companies putting such measures in place...

However, region locking on Internet - especially for video on demand - defies any sort of logic. It has become a sort of marketing reflex, hurting the very interests it is supposed to be protecting. Exactly like these stupid moves we sometimes do, such as looking at your watch when you're holding a glass of water.

Let me explain. I like many of the latest US shows. I want to reward the people making the show and I am perfectly fine with the idea of paying to watch them online. So, here I am, on a popular VOD website, my credit card number half entered, when suddenly, a doubt strikes me. The sort of thought that you sometimes get, along the line of: 'no way ... that would really be too stupid'. But no, there it is, in the service agreement I too quickly agreed with: "We do not broadcast outside of the US".

Darn.

Where this really gets mindbloggling is that 1) there is no equivalent service in my country 2) most of these shows will never be on TV here anyway 3) I could watch all of them, 'for free', with very little effort. So what the hell is going on? ... go figure ...

(note that even if bullet 3 stops being an option somehow (!!) it becomes even worse: people will never get to discover the show, they'll be even less inclined to buy it on DVD ...).

Friday, July 25, 2008

[electronics] PICs

Before I started programming computers, I was always trying to build some eletronic boards doing various stuff. Well, I am saying 'trying' because I never quite managed! Problem was, doing cool stuff quickly required a lot of equipement. Plus, contrary to the computer world, you have to go to a shop in person to buy the parts - and sometimes wait for weeks for them to ship in (no, there was no 'order-it-over-the-internet' at this time ... who said I am getting old?).

Anyway, I never dropped the idea of coming back to electronics one day. I mean, computers are great, but actually building a physical device really is something I find amazing.

Luckily, a new collegue of mine - David Grelaud - turns out to be an electronics guru :) He pointed me out a familly of microcontrollers - PIC's from Microchip - which are in fact fairly easy to use. These little things are programmed in assembler. Code is compiled on the PC and sent to the device through a programmer. You can order a relatively inexpensive programmer, which comes with a demo board, and get started! All tools to program are provided, as well as lessons to learn progressively the assembly language. The programmer is extremely simple to use: Just plug it to your computer USB!!

Ok, but how about the circuit board? Well, this is what is so cool about the PICs. They are extremely easy to use from a hardware point of view. I made a simple demo card with only a few wires, one resistor and a tricolor LED! I can program it from the PC, unplug the programmer and it becomes independent! Here is my - really ugly - card, plugged to the programmer:





You can also see how simple it is on this tutorial.
There are even C compilers for the PICs (C18, CCS, MikroC, PICC, SDCC). I am using SDCC which is open-source, but expect some not-so-easy install process. I had to hack a little bit because my PIC (18f4580) was not directly supported. But well, nothing too horrible if you are familiar with low level hacking (for those interested, use the 18f4585 template and setup the config bits directly in hexadecimal in the c code). The compiler produces a file containing the raw byte code (a .hex file) that is directly written into the PIC using the programmer. And voila, it just works !!

Amazing - now I am spending hours tweaking my rgb LED :-) (by quickly switching red/green/blue you can produce any color).

My head is just buzzing with cool projects to try on. I expect things will quickly complicate, but I know that the first step is always the most difficult.


Hey, did you know you can even create USB devices with a PIC ???!!?

Monday, June 9, 2008

[research] Lazy Solid Texture Synthesis

Our latest work on texture synthesis from example has been accpeted to EGSR 2008!! Check it out here: http://www-sop.inria.fr/reves/Basilic/2008/DLTD08/.

The key idea is to synthesize solid textures for surfaces, but only for the voxels around the object. Hence we never have to store or compute the entire volume. Our GPU implementation is very fast, so we can in fact synthesize a texture for the interior surfaces whenever an object is cut or broken. We obtain much more variety than a direct tiling of a 3D tile, which would create visible repetitions along some directions (and require storing a full volume tile). There is no pre-process of the object interior (ie. no thetrahedrons, no prior-knowledge of where the object will fracture) so our approach could be used for interactive breaking of large structures.

This is a collaboration with Yue Dong and Xin Tong (from MSRA). The project was very fun to work on, and I hope you'll find it interesting and - most importantly - useful.

I will add some more material on the paper webpage soon.

Saturday, May 17, 2008

[game] ragsmash

I just corrected the 'elastic band' problem in Ragdoll Smasher. This was due to a different handling of timers in XP and Vista.
This is now fixed!

Tuesday, May 13, 2008

[game] Ragsmash on YouTube

Someone posted a video of him playing Ragdoll Smasher on YouTube :-) watch it here

At least I know someone played the game ;-) It's really cool for a 'wannabe' game developer such as myself to discover this kind of things. Highly enjoyable.

A few explanations on the weird things happening that the player points out:
- guys stuck mid-air happen because the game only simulates 3 bodies. So it assumes others already landed. I could correct it ... but well, it's sort of fun.
- the 'elastic band' effect is more difficult. I have to look into it but it is likely due to instability in the stepping of the physics. Due to this, a very large force is produced. ODE is not able to propagate forces fast enough and one bone flies away while the rest of the body remains where it is.

Anyway, I am always happy to hear about ideas for a new version of Ragdoll smasher, so feel free to make suggestions. I had another stupid idea involving a chainsaw ... I played too much Doom I think ;-)

[C#] grabing pictures from a webcam

I have been looking for a simple way to grab a picture from a webcam, using C#. Well, it appears it is not so simple :-) The easiest solution I found is described here.

The code is simple, the only difficulty is to install the WIA sdk before (download from here, WIAAutSDK.zip). Don't forget to execute 'regsvr32 wiaaut.dll' in a command line, after copying the DLL in WINDOWS\system32.

WIA cannot be used for videos it seems. For this you'll need a DirectShow wrapper. (Note that the FTP is nicer in the sample code above).

And, if you just need to grab images and send them to an FTP, use Dorgem.

That was my 2 cents on webcams :-)

(I found Scott Hanselman's blog to be a great source of info on this)

Wednesday, April 9, 2008

[code] pure virtual function call

Calling a virtual method from a constructor is a very bad idea. Indeed, this can easily result in the 'pure virtual function call' runtime error. This is well explained here. Worse, if the method is not abstract it will call the method from the parent class, instead of calling the specialized one. It is worse because this will probably not directly trigger an error. Now, this 'issue' does in fact make sense: In the constructor of the parent class, the specialized class is not yet initialized. Hence, how could one of its method be called? Therefore, if you need to call a virtual method from a parent class constructor, you are probably facing a problem in your code design.

Nevertheless, I actually came accross an interesting variant of this issue, involving a thread. My parent class, A, is creating a thread in its constructor. The thread execution later involves calling a virtual method of A, which is of course meant to be implemented by inheritance.

The funny thing is that depending on 'how long it takes' before the thread calls the virtual method, we may - or may not - still be in the constructor of A. So, sometimes, this will produce the 'pure virtual call' error, sometimes not. Needless to say I was a bit puzzled the first time :-)
The solution was simply to implement a lock mechanism to make sure the thread calls the virtual method after the constructor executed.

Tuesday, April 8, 2008

[win32] Ascii, Unicode, Scan code, Virtual key

... and other keyboard nightmares :-)

I found two very useful functions in the Win32 API: ToUnicodeEx and ToAsciiEx. It converts from a virtual key code and a scan code to a unicode or ascii character. It can be used directly from a WM_KEYDOWN (or KEYUP) message.

Here is a quick code snippet:


uint scancode = (lParam >> 16) & 0xFF;
BYTE keyboardState[256];
GetKeyboardState(keyboardState);
char charvalue[2];
if (ToAsciiEx(wParam, scancode, keyboardState, (LPWORD)&charvalue[0], 0, GetKeyboardLayout(0)) == 1) {
  onKeyPressed(charvalue[0]);
}


Also check out this blog for more info.

Saturday, March 29, 2008

[research] SIGcrash

Yet again, like so many others, our work has been rejected. It is not worth it. We won't talk about it. Ouch.

Submitting a paper to SIGGRAPH is a very emotional thing in fact. You put a lot of you in each paper. A lot of ideas. A lot of time. A lot of work. But here it is. It is rejected. Well, well, well. Sometimes it gets in, often not.

Anyway, you won't learn about the cool stuff we did ... but it should not bother you too much since our work was not above the threshold ...

Ouch. It is hard to keep a cold mind :-) Of course you'll learn about our stuff, we'll improve the paper and find a more friendly place for it!

Tonight I just want to have a special thought for all those who put so much in their work and will see it rejected from SIGGRAPH. As a reviewer, I am part of the whole reject / accept process. Giving fair scores is not an easy thing. I know deciding who gets in and who is rejected is not an easy thing for the committee either. But well, it still hurts.

Friday, March 7, 2008

[gpu] G80: The gritty details

Icare3D just released some in-depth tests on the G80 behaviour Read it here!.

Wednesday, March 5, 2008

[game] Zombie gameplay

I just came accross this flash game 'The Last Stand':
http://armorgames.com/play/269/the-last-stand

I like the gameplay. Everytime I thought about doing a zombie game it was something along these lines: Build barricades at day, fight for your life at night. The game asks to choose how to allocate day time (repair, or search for weapons / survivors), rather than having you wander around and search for items. It is a neat idea.

Tuesday, March 4, 2008

[mmorpg] Notes on economy in MMORPG

By the Eternal Lands creator:
http://eternal-lands.blogspot.com/

Friday, February 29, 2008

[gamedev] Don't do it!

I just came accross this 'Why you should not do an MMORPG' page: http://sol.gfxile.net/mmorpg.html. I think it is really worth a read for anybody planning on doing something like a massive online game.

The main reason is that I strongly agree with the bottom line: It is a lot more fun to actually engage in smaller projects that you can hope to finish. My very first game project was very ambitious - of course I did not realize that at the time. Even now I just could not do it unless I stop doing anything else for 4 years :-) (and find some good artists to help! ;-) ). Now, note that I learned *a lot* from it, so I do not regret a single second the time I spent on it. But it would have been even more fun to have a game in the end. I am definitely not saying hobbyists should not engage in crazy projects - it is amazing what someone determined can achieve with a lot of work. So if you feel this is what you should be doing, just do it.

However, if you are beginning in game programming you should definitely start with a first small project. Just to experience how great it feels when your game is finished, when you prepare this final zip that will be available for download on your web site, when you receive first comments from players (typically bug reports ;-) ). Sure, plenty of people will tell you 'your game looks ugly', 'it's been done before', etc ... But it will be your game, your creation, your contribution to the ocean of 'fun time wasters'.

I recall when I did my first game. It was a Breakout game. I worked very hard. I was very proud. Nobody was impressed. The number of time I heard 'Why are you doing that? It's been done before!'. Hell ... not by me! But then, as you make more projects, as you gain experience with your game development skills, you'll start to make more impressive stuff. And then you'll realize it's not about being impressive. It's about making something fun. And this is where it starts to be both easier and more interesting :-)

Anyway, I agree with this web page. I know its right. I know I shouldn't. I am still working on this MMO game project ;-)

Sunday, February 10, 2008

[dev] Tile based world



Here is a screenshot of my 'tile' world editor. Its written in C#. The tiles are Danc's free tile set (many thanks to him!).

I am sort of planning to use this for my next project - which is supposed to be a networked game ...

Anyway, making such an editor is a very good exercise, highly recommended! (I am new to C#)

Thursday, February 7, 2008

[opengl] gluX

After a couple years without any improvements (I had a long DirectX period :-) ) I finally updated gluX with latest extensions (which only required running the perl script on the new header files!). I also added a mechanism to automatically load extensions on first function call (Thanks to Xadec for suggesting the idea a long time ago). This simplifies using gluX, even though it is less 'robust' than declaring used extensions - if an extension is missing the program will exit on the missing function call. But of course both mechanisms are available and can work together!

gluX is here!

Tuesday, February 5, 2008

[dev] CEGUI

I finally took some time to look into CEGUI. This is a great library! Exactly what I was looking for: It provides a very well designed API to build GUIs, using any renderer (and of course OpenGL and DirectX are among them). I did, years ago, spend some time designing a GUI, but I am really happy to take this load of my shoulders now :-)

It really wasn't hard to compile and use it. Let me give a few hints for those who would like to start using CEGUI with Visual C++ under Windows (and with DirectX).

All downloads are on:
http://www.cegui.org.uk/wiki/index.php/CEGUI_Downloads_0.5.0

I had to recompile CEGUI since the precompiled binaries did use a version of DirectX older than the latest available. And anyway, it is good to have the source code on hand, as it acts as a good documentation :-)

  1. Download the zipped source code and the precompiled external dependencies (available for all three versions of VC++ - nice!)
  2. Uncompress everything in a same directory.
  3. Follow instructions on http://www.cegui.org.uk/wiki/index.php/Build_from_Source_for_Win32
    Yes, you need premake, it will generate the "*.sln" projects in makefiles/premake. You have to enable DirectX support by editing "config.lua" and setting "DIRECTX9_RENDERER = true". Then launch "build_vs2005.bat", open the VC++ project and compile. Also generate the samples project with "build_samples_vs2005.bat".
  4. To run the samples, copy the DLLS from lib\ into bin\. I also had to copy datafiles\ into the root of my CEGUI install to be able to directly launch the samples from bin\.

Now a couple links I found handy when doing my first steps with CEGUI:

But of course, the CEGUI Wiki contains a ton of useful information!

Monday, February 4, 2008

[math] Markov Random Fields

A very nice intro to MRFs: http://www.ams.org/online_bks/conm1/. I needed to refresh some notions on MRFs and found the introduction chapter of this book to be extremly clear.

Monday, January 28, 2008

[addon] DoINoU

Now that the SIGGRAPH deadline is over I re-activated my World of Warcraft subscription for a little while. And of course, I took some time to update and improve my addon DoINoU. A brand new website and the ability to write comments on players. Some would think I actually play the game :-)

Blog Archive