Archive for January, 2008

ToeTag Quick Look

Tuesday, January 29th, 2008

As I thought yesterday, the texture browser in ToeTag really benefits from this new Quick Look capability! It was a little more hassle than in Phorg since the Quake textures are read from a WAD file and then held in memory - they aren’t sitting on the hard drive. What this means is that before I call the Quick Look window in ToeTag, I write the selected texture out to the temp directory as a JPG file and then the Quick Look panel shows you that file. It’s seamless from the user’s point of view and that’s all that really matters.

Here’s a look at it in action. This will be in the next version of ToeTag:

toetag_quicklook_thumb.jpg
.: Watch It! :.

Phorg

Monday, January 28th, 2008

Another project I have on the go is a picture viewer. I know, not that exciting, but it’s entire purpose in life is to allow me to learn more about Mac programming. It loads the picture thumbnails using multithreading and it allows dynamic resizing of the window and the thumbnails.

Here’s a look at the window so far:

phorg_1.jpg

I was starting to code up a zoom window for it yesterday - so you could double click thumbnails and see the picture in a larger window - but then I got to wondering if it was possible to use the Quick Look window that comes with Leopard. It turns out, it IS possible! It’s a bit of a hack but the code I found to do it wasn’t that bad to look at and it’s contained in a small area of the code base so I can replace it later if the hack breaks. I found the info here.

So I changed the code to behave like Quick Look does in the Finder. Pressing SPACE will zoom the selected pictures into the Quick Look window and pressing it again will close the window. It works!

phorg_2.jpg

Quick Look is great. Imagine the possibilities this opens up for the ToeTag texture browser. Muhaha.

In closing, here’s a movie of the pictures loading using multithreading. Why? Why not? You’re at work and you’re bored.

.: Watch it! :.

Multithreaded LIGHT & VIS

Saturday, January 26th, 2008

I decided to take a look at the LIGHT and VIS source today and see what would be involved with getting them to work multithreaded. I knew that id had put the code in there for their Alpha machines but that it was disabled for everyone else. It turns out the code was almost fine for OSX except for some function names I had to fix up and a tiny bit of code refactoring.

But the end result is awesome! It works!

Some sample timings I took:

DM4
Before:
LIGHT = 1 second
VIS = 8 seconds

After:
LIGHT= 1 second
VIS = 5 seconds

Cool, but not really all that exciting right? Look at this:

START
Before:
LIGHT = 14 seconds
VIS = 49 seconds

After:
LIGHT = 7 seconds
VIS = 35 seconds

That’s a 50% speed up for LIGHT and a 29% speed up for VIS!

Another one:

E1M2
Before:
LIGHT = 25 seconds
VIS = 37 seconds

After:
LIGHT = 13 seconds
VIS = 25 seconds

About the same gains. So it looks fairly linear in nature. Awesome!

One thing to note here is that this is with 2 threads. I have code in the utilities to detect how many CPUs or Cores you have and it uses that number of threads. Using more than that number would be inefficient and using less would be silly. For example, I have a dual core processor so I get 2 threads. If you had one of those new 8 core monstrosities, you would get 8 threads! I would love to see some numbers on those machines.

At any rate, this will be in the 0.8 release of ToeTag which will be along pretty soon. I want to add a few more things before I call it a new version.

You’ll know when you have the multithreaded tools because your output log will have some new lines in it:

==========================================
LIGHT
==========================================

—– LightFaces —-
extra sampling enabled
74 entities read
Using multithreading (2 threads)
lightdatasize: 60932
0 switchable light styles
1.0 seconds elapsed

==========================================
VIS
==========================================

—- vis —-
testlevel = 4
661 portalleafs
1900 numportals
Using multithreading (2 threads)
average leafs visible: 157
c_chains: 3088511
visdatasize:27319 compressed from 54863
30.0 seconds elapsed

Soon!

EDIT: Interested in the source code for these utilities? Click here!

Movers and Triggerable Monsters

Thursday, January 24th, 2008

It’s official - QuakeC is fun!

I created my own class called a “func_mover”. This will move along a chain of “path_corner” entities when you trigger it. If a “path_corner” has a wait time of -1, the mover will wait there until triggered again. At that point, it will continue on to the next “path_corner” and so on. This will be critical for a level idea that I’m working on.

I then stole an idea from the Quoth mod and made all monsters have a new spawn flag called “Spawn via Trigger”. If that is checked, the monster will add itself into the total monster count but will not actually spawn into the world until you trigger it. This is HELLA useful because now, instead of putting the monsters you want to warp into the level off in those annoying little spawn closets outside the level you can just place them as normal and spawn them in when you’re ready. SO NICE.

I’m probably not going to do a ton more coding because the requirements for the level I’m doing are pretty small but I’ll likely roll these changes forward into the next level and the next one and keep adding snow to it over time until it’s an avalanche of awesome.

QuakeC

Wednesday, January 23rd, 2008

Oh now this is interesting! I never played with QuakeC back in the day but now that I’ve dabbled in it, I think I’m hooked. I now have a bunch of level ideas that I could do considering that I can write my own behaviors for things and create entirely new kinds of entities.

If you’re on Mac and want to play with QuakeC download the eQuake Utils from here:

http://developer.chaoticbox.com/quake.php?tab=mactools

The FrikQCC compiler inside of there works great and you’ll be up and running in no time!

Time to play…

MacHeist

Tuesday, January 22nd, 2008

Just a public service announcement here. I just bought this so I can confirm that it is legit:

https://www.macheist.com/

You can get almost $500 worth of apps and games for $49! And 25% of that goes to charity. It’s a fantastic promotion and the apps they offer are pretty cool. I already had a few of them and it’s still worth buying for that price.

It’s only going to last another day and a bit though, so get over there if you’re interested!

Adding Movies To Documentation

Sunday, January 20th, 2008

I’ve started adding movies into the tutorials now. These are nice since you can see what should be happening on your screen when you follow what the text says. I added some to the 2-Point Clipping tutorial to start with. More to come!

ToeTag Sample Level

Sunday, January 20th, 2008

This is the sample level that will be included with all future versions of ToeTag. It’s a small level that lets you chose your skill level and then throws you into E1M1 afterwards. Straightforward and simple but it shows that ToeTag works!

Download BSP and MAP

Screen shots:

Shot01

Shot02

Shot03

Shot04

Shot05

ToeTag 0.6 - PowerPC Support

Saturday, January 19th, 2008

I released a new version today because I believe I’ve got all of the endian madness sorted out with PowerPC machines. Definitely lucky that I have an old iBook G4 laying around here that I could test on! If you’ve had trouble running ToeTag on your machine, try the latest version:

http://www.wantonhubris.com/toetag/Download.html

It still requires Leopard but it should be processor agnostic now. Let me know if it isn’t!

As a side note, the development of this version was interesting. I, of course, had to learn about byte swapping and such to make it work on PowerPC but I had to figure out how to work on the code on the little iBook.

The screen blows on that laptop, limited to 1024×768, so working on it directly was not realistic. So what I ended up doing was I set up the new Screen Sharing feature in Leopard and was able to work on the iBook through a window on my Macbook Pro. Sure, the window was still 1024×768 in size but at least I could use my good screen and my good keyboard to work on the code.

It’s not super fast to work through a network connection but it DID work, and far better than what I was expecting.

So I copied the code over to that machine, worked out the byte swapping and other issues, then copied the code back to my main development machine. Pretty painless and I never had to try and develop code on that little 13″ screen.

Rock on, Apple!

Endians Hurt Me

Friday, January 18th, 2008

I think … think, mind you … the reason some people can’t run the editor on Leopard is that I didn’t account for PowerPC processor and endian byte order issues. I thought that building a Universal Binary automagically took care of all of that junk but evidently that isn’t the case.

I have a PowerPC iBook here and I will get ToeTag running on it this weekend. So if you can’t run ToeTag at this point, hang in there! If this is the problem, it’ll be sorted out over the weekend.