Iceland 2008 - Part 3 - Jökulsárlón

July 20th, 2008

The Jökulsárlón is a glacial lagoon located to the south-east of the Vatnajökull. This is a beautiful, amazing place, very quiet, full of serenity. The floating ice has extraordinary colors and shades of blue. The pictures below may look good. But it’s a lot better in real.

It is possible to take a “boat” to cruise on the lagoon. Those boats are actually recycled army vehicles that can both drive on the ground and in water.

Iceland 2008 - Part 2 - The South Coast

July 20th, 2008

For many people, the South Coast has Iceland’s best features and sites. I don’t know if I fully agree with this, but it’s certainly worth the trip!

The Skogafoss waterfall. This was the first “big” waterfall we saw, and I made a stupid mistake here: I went nearby. I ended up completely wet, as if the weather had suddenly turned to hell.

The beach nearby the small town of Vik is famous for its black sand. I gathered some of it in a bottle and took it back as a souvenir. Much better than what they sell in the numerous tourist traps nearby :)

The amazing Seljalandsfoss, probably my favorite in Iceland. I don’t like the big waterfalls like Dettifoss / Gullfoss, they all look the same to me. This one however, has its own identity. You can walk behind it if you don’t fear getting wet. The rainbow seems to be permanently there, as it appears on numerous postcards and pictures from Seljalandsfoss.

Iceland 2008 - Part 1 - Reykjavik & Landmannalaugar

July 20th, 2008

I was in Iceland for a week, and it was bloody fantastic. Before I left, some clueless people asked me why the hell I would want to spend my holiday in a place called Iceland, since I’m living in a “far better place to begin with” - i.e. Barcelona.

Uh… Sigh.

A picture is worth a thousand words, so let me share with you a small subset of the (let me check…) 1170 pictures I took out there.

In July, there is no night in Iceland. It is always bright, looking like a late european afternoon. The sun is very low on the horizon, creating dramatic shadows.

The following pictures were taken in Reykjavik, around 11 PM. This is my girlfriend Jasmina, enjoying the midnight sun.

The sky was on fire this day, with amazing shades of orange and blue. The picture below was taken from the shore, nearby the hotel.

Further away along the shore, one can see the “Solfar” sculpture from Jon Gunar Arnason. I already mentioned it in my previous report from Iceland.

For the first excursion out of the city we went walking in the Landmannalaugar. Words fail to describe the “emotional landscapes” that Björk sang about a while back. You just have to be there to believe it.

Spam hell

July 20th, 2008

I go away one week, and then I get 485 comments to moderate. All spam, save for 2 of them. I should just ban comments alltogether, would make my life a lot simpler :(

Keyboard troubles in 2008

July 7th, 2008

Bug reported in KP :

“I can’t jump while moving backward + left or right! However the jump works when moving forward +left or right”.

Well, change your keyboard. After investigation, this is neither a DirectInput nor a Win32 problem: it’s a low-level keyboard issue. Some keyboards don’t support the key combination, period. Others, USB keyboard in particular, seem more friendly (and the bug doesn’t happen with them).

Quick test to see if your keyboard is “bad”:

  • run this exe from the DirectX SDK: \Program Files\Microsoft DirectX SDK (August 2007)\Samples\C++\DirectInput\Bin\x86\Keyboard.exe
  • create an Exclusive, Foreground, Immediate device
  • press keys S, D and Space simultaneously.

If it says: “Data 0×1f 0×20 0×39″ you’re good, go play KP. If 0×39 is missing, you’re screwed. Like me.

…I seem to remember this wasn’t an issue on an ST, but I’ll shut up.

EDIT: this is really a low-level keyboard issue

Debug console for Win32 app

July 7th, 2008

I keep forgetting this one so let me post it once and for all. Adding a debug console to a Win32 app takes 4 lines of code.

if(AllocConsole())
{
freopen(”CONOUT$”, “wt”, stdout);

SetConsoleTitle(L”Debug Console”);

SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_RED);
}

You can then printf your way out of trouble.

Blast from the past

July 6th, 2008

My old Atari ST has been locked in a box for years. Today, out of the blue, I decided to open the box again and check the machine was still working. My first surprise was that its color changed. I don’t know what happened but the light grey disappeared and got replaced by a dirty, sick-looking, brownish yellow. I have no idea how it happened, but it looks nasty.

The second surprise is that everything works like a charm - machine and disks. I expected both to be dead by now. But no, more than 20 years after I bought it, the Atari ST still works flawlessly. I watched a few of our old demos and I now realize one thing: our taste sucked. Check out those beautiful RGB colors in “Inverted Landscapes”, one of our first screens…

Mesh granularity

July 1st, 2008

Idea to try: one region = one mesh.

Current system:
- a level is made of different regions connected by portals
- a portal is a convex polygon
- a region is a collection of meshes
- a mesh is a collection of “subsets”. Each mesh has a single PRS transform and is a single object in 3DS MAX.
- a subset is a collection of triangles sharing the same render states (same material).

Currently, things are exported as-is from 3DS MAX, and each region contains several meshes, depending on whatever is in the MAX scene. Visible objects are batched, and sorted to minimize the number of render state changes. However this may not be necessary: we could use the “static batching” that happens for each individual mesh instead, the one creating subsets. We just have to merge all the meshes of a given region together, ending up with a single mesh per region.

If the regions are quite small, i.e. if it is possible to see “all” meshes of a region from a particular viewpoint, this looks like a good idea (following the “optimize your worst case” strategy). We save memory by reducing the number of “meshes” in the system, we save CPU time on culling, batching, etc.

If the engine creates one physics mesh for each render mesh, it might also have some benefits. It certainly saves memory, minimizing the cost associated with each “object” within the physics engine. It also reduces the stress on the broad phase. However it puts it on the midphase (basically OPCODE), since the whole region is now a huge AABB-tree. The old “RAPID vs OPCODE” tests showed that AABB-trees are not too great when a small object is fully contained within a big scene, but on the other hand temporal caches helped a lot for this case, so it might be ok in the end.

Now the only issue with this is probably when you have a room with several open doors, each of them being a portal connected to a different region. If you stand in the middle of the room looking at those doors, you end up rendering all the regions even though a small part of them is visible, whereas before only the first meshes of each region would have been rendered. So you made your worst case worse, in a way.

——–

Not merging meshes at all and keeping the same organization and the same number of objects as in MAX does work, but it puts the burden on the artists, and on the batcher. But even if the batcher does a perfect job, you still waste memory associated with individual meshes. In ICE, sizeof(Mesh) is something like 500 bytes or more, which I know is too much, but that’s how it is now, and a lot of professional engines have worse than this. With ~1000 meshes in a single region,that’s ~500 Kb lost per region: not good. Plus, the batcher is never “perfect” anyway, i.e. it has a runtime cost.

Merging meshes by material regardless of spatial considerations doesn’t work. It makes things easier for the batcher but it kills the physics.

A good alternative is just to cover the region with a fixed-size grid, assign triangles to grid cell (regardless of their original mesh), and create one mesh per cell. It keeps the number of meshes under control, it’s physics-friendly, and also culling-friendly. The main drawback is when the physics does a convex decomposition and relies on it to have good collision response. You can end up with a perfectly flat plane cut to N different, unconnected physics meshes - and bad collision response when an object slides from one part of the mesh to the other.

You can always completely decouple the physics & graphics representations, but it’s a pain to manage. Probably the best option though.

Wheel mark texture

June 24th, 2008

Hmmm. I need a “wheel mark” “skidmark” texture (”trace de pneu” in french!) for my small level. Anybody knows where to find a free one? Else I’ll try to generate one procedurally.

Edit: ok, I found one…

More fun with MAX…

June 24th, 2008

I continued creating a new level for KP in 3DS MAX. Nothing extraordinary so far but it’s refreshing to get away from programming, from time to time. If only MAX wasn’t crashing on me all the time, I would almost enjoy it.

Anyway, here’s a depot, where the player arrives after leaving the helipad scene:

Then the first pass for a shaft connected to the depot above:

So nothing special here, but not so bad for “programmer’s art”.

Better, later.

 

shopfr.org cialis