by date
TGB Crowd Test pt. 1
TGB Crowd Test pt. 1
| Name: | Brian Wilson | ![]() |
|---|---|---|
| Date Posted: | May 10, 2008 | |
| Rating: | 4.0 out of 5 | |
| Public: | YES | |
| Comments: | YES | |
| RSS Feed: | or Subscribe with . | |
| Profile Page: | View profile page for Brian Wilson |
Blog post
On the advice of Kevin James from this blog discussion, I've decided to start posting the various toys/tools/PoCs that I create when toying with the Torque engines.
I was an early adoptor of TGB(then T2D) and find myself coming back to it regulary with intent of pulling a game together, but I just have too much fun using it as a toy to make silly concepts come true.
So here it is in all of its Youtube FLV artifact-riddled glory:
www.youtube.com/watch?v=MD3_S1CWlgM
What started out as a quite nice 720p capture of a 1400x768 TGB window got utterly pixelated by its business no matter how many knobs I twisted on my various FLV converts. So I gave up and here's what you have. Enough of the video survived to show the concept at work.

Basically, what I've made is a crowd generator. Each runner is a 5-layer chain of mounted objects that are spawned randomly on the Y-axis off-screen in the -100< land then run toward the Happy Kill Box in the >100 Y-axis land. The following matrices are used in each generation:
- 3 different skin tones
- 2 different shirts with 5 colors each
- 2 different pants with 5 colors each
- 1 set of shoes with 5 colors each
- Height baseline with a +/- 20% modifier
- Width baseline with a +/- 20% modifier
- VelocityX with a +/- 20% modifier
- Y-axis picker
- %this.setLayer(getRandom(5,25)
- sexy streaker probability algorithm
The runners are put together with the stick-figure outline as the parent and the rest of the components are mounted to that with a layer offset, inheritting position, velocity, height offset, width offset.
On my system I can run aproximately 6000 objects (~1250 runners) onscreen and hover at around ~45-55 FPS both in fullscreen at 1600x1050 or windowed at 1400x768. Certainly performance would be better with less background stuff running and a built project without all the editing tools enabled.
Current Issues:
The only real issue I have so far is an obvious clash between 5-layer runners and TGB's 30-layer limit. I may look into a solution later
Moving Forward:
I want to work in the RGBtoHSV and rotateHue resource to give my runners unlimited clothing colors as well as a broad spectrum of skin tones. But fear not, the streaker code remains in tact at all costs!
I also still need to put in widgets for benchmarking, currently I have just setDebugOn(0) bound to a key, but I will put gui controls in for adjusting variables real-time as well as to provide performance and statistical feedback.
Once I've beat this horse to death, I'll post the code either in a blog or as a TDN article.
EDIT: Just to add a couple of Images:
Close-up cross-cut of the scene:

And an exploded view of the 2-5 runner objects, depending on how "free" he wants to be ;p

I was an early adoptor of TGB(then T2D) and find myself coming back to it regulary with intent of pulling a game together, but I just have too much fun using it as a toy to make silly concepts come true.
So here it is in all of its Youtube FLV artifact-riddled glory:
www.youtube.com/watch?v=MD3_S1CWlgM
What started out as a quite nice 720p capture of a 1400x768 TGB window got utterly pixelated by its business no matter how many knobs I twisted on my various FLV converts. So I gave up and here's what you have. Enough of the video survived to show the concept at work.

Basically, what I've made is a crowd generator. Each runner is a 5-layer chain of mounted objects that are spawned randomly on the Y-axis off-screen in the -100< land then run toward the Happy Kill Box in the >100 Y-axis land. The following matrices are used in each generation:
- 3 different skin tones
- 2 different shirts with 5 colors each
- 2 different pants with 5 colors each
- 1 set of shoes with 5 colors each
- Height baseline with a +/- 20% modifier
- Width baseline with a +/- 20% modifier
- VelocityX with a +/- 20% modifier
- Y-axis picker
- %this.setLayer(getRandom(5,25)
- sexy streaker probability algorithm
The runners are put together with the stick-figure outline as the parent and the rest of the components are mounted to that with a layer offset, inheritting position, velocity, height offset, width offset.
On my system I can run aproximately 6000 objects (~1250 runners) onscreen and hover at around ~45-55 FPS both in fullscreen at 1600x1050 or windowed at 1400x768. Certainly performance would be better with less background stuff running and a built project without all the editing tools enabled.
Current Issues:
The only real issue I have so far is an obvious clash between 5-layer runners and TGB's 30-layer limit. I may look into a solution later
Moving Forward:
I want to work in the RGBtoHSV and rotateHue resource to give my runners unlimited clothing colors as well as a broad spectrum of skin tones. But fear not, the streaker code remains in tact at all costs!
I also still need to put in widgets for benchmarking, currently I have just setDebugOn(0) bound to a key, but I will put gui controls in for adjusting variables real-time as well as to provide performance and statistical feedback.
Once I've beat this horse to death, I'll post the code either in a blog or as a TDN article.
EDIT: Just to add a couple of Images:
Close-up cross-cut of the scene:

And an exploded view of the 2-5 runner objects, depending on how "free" he wants to be ;p

Recent Blog Posts
| List: | 05/19/08 - TGB Crowd Test pt. 2 05/10/08 - TGB Crowd Test pt. 1 |
|---|
Submit your own resources!| Rene Damm (May 10, 2008 at 18:14 GMT) |
| David J Weaver (May 10, 2008 at 19:17 GMT) |
I would love to play around with that, too bad i dont have TGB
Awsome music choice in the video too
| Stephen Zepp (May 10, 2008 at 20:07 GMT) Resource Rating: 5 |
Any chance you would be willing to submit your project to GG so we can use it for performance regressing testing? Would love to have such an object intensive project that we can continue to optimize against, as well as have in our repository for future testing!
| Kevin James (May 10, 2008 at 23:29 GMT) |
| Steve YorkshireRifles Acaster (May 10, 2008 at 23:50 GMT) |
| Hokuto (May 11, 2008 at 05:47 GMT) |
| Brian Wilson (May 11, 2008 at 07:42 GMT) |
The current demo that I show uses only 7 art assets (using 3-5 assets per runner) with 5 hue shifted copies of each clothing item and 3 lightness shifted skins for a total of 29 .png's that generate:
(3 skins)*(2 shirt types *(5 colors+naked))*(2 pant types *(5 colors+naked))*(1 shoe type * (5 colors + naked)) = genating 2592 unique runners. That doesn't include height and width variants, which ups the number to over 4 mil.
Now, once I get the HSV/RGB shifting figured out, the we are talking 10 mil variants without height/wieght variant and over 16 bil with.
Granted a full 360 degree shift in Hue with a +/- 30 degree Lightness generates a healthy variation of clothing color, 10800 colors per article. Plus, if I go that route, technically I can reduce my art asset count to 7 from 29. The skin variation obviously would require a smaller spectrum of HSV shifting to remain skin-like. So +/- 20 Hue, and +/- 50 Lightness for 400 skin tones.
I have guests in from the states for the next two weeks so not sure how much time I can dedicate, but hopefully I can get this wrapped up in that time for release.
I think I'll post the system/code to my GG blog, then follow up with just the crowd generator component as a TDN article with a little more generic purpose for those that just want concepts on how to generate layered objects for game variation.
| Brian Wilson (May 11, 2008 at 07:43 GMT) |
Hehe, yeah, the music of choice was my wife's idea. I had a different piece in mind, but I'm saving it for the demo for the final release.
| Daniel Buckmaster (May 11, 2008 at 07:50 GMT) |
| David Montgomery-Blake (May 13, 2008 at 18:00 GMT) |
You must be a member and be logged in to either append comments or rate this resource.



4.0 out of 5


