Author Topic: preview - possible an 1k intro for TUM2008 (exclusiv captured video)  (Read 12878 times)

0 Members and 1 Guest are viewing this topic.

Offline va!n

  • Pentium
  • *****
  • Posts: 1435
  • Karma: 109
    • View Profile
    • http://www.secretly.de
okay guys... with some help of a very great person i have now a version with full timer, which compiles to 1023 bytes here. Their are still some things where i could need your help to finish the final version.

- Fixing: Drawing more particles without lack of speed. something i thought about but does not fit into 1024 bytes, is to draw the particles on two positions each time... and adding the -400 @ rect.left and rect.top, so the particles looks much better (my opinion):
Code: [Select]
for (int i=0; i<511; i++)
{
rect.left= ((sfrand() + (sfrand()&3) * time) & 1023)-400; // Very cool optimizing tip by mentor! Thanks! <3
rect.top = ((sfrand() + (sfrand()&3) * time) & 1023)-400;          // No more need of array and struct! :D
g_pFont[1]->DrawText(NULL, "n   n n   n  n    n", -1, &rect, DT_LEFT , 0x08ffffff);

rect.left= rect.left - 200
rect.top= rect.top - 200
g_pFont[1]->DrawText(NULL, "n   n n   n  n    n", -1, &rect, DT_LEFT , 0x08ffffff);
}

- Fixing: Speed of showing/changing the MessageText does not really fit (like in the old original version) and it repeats instead stoped at the last messsage.

Else i would say, its nearly done... Thanks to all ppl helped me until now, like mentor, auld, rbz and all the others...! Source is attached... If you think the source must be reformated then let me know and show me whats the best way, since i am still learning.

@Rbz:
maybe their is a way to use again the msvcrts.lib functions for random, but on a way, that the particle fx looks like atm (moving particles instead randomed diplayed particles? ^^)
« Last Edit: December 26, 2008 by va!n »
- hp EliteBook 8540p, 4 GB RAM, Windows 8.1 x64
- Asus P5Q, Intel Q8200, 6 GB DDR2, Radeon 4870, Windows 8.1 x64
http://www.secretly.de
Challenge Trophies Won:

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5301
  • Karma: 402
    • View Profile
Have you tried using D3DXCreateFontIndirect to create your fonts instead of D3DCreateFont?  That might save a little space as the parameters are almost all the same.

Have you tried adding
DT_NOCLIP (ie DT_LEFT|DT_NOCLIP)
to the drawing flags?  From the docs
Quote
ID3DXFont::DrawText is somewhat faster when DT_NOCLIP is used

Jim
Challenge Trophies Won:

Offline va!n

  • Pentium
  • *****
  • Posts: 1435
  • Karma: 109
    • View Profile
    • http://www.secretly.de
@Jim:
Thanks for your feedback ;)
Yes, today i have tried to change the D3DXCreateFont() stuff to this here:

Code: [Select]
D3DXFONT_DESC Font1 = { -400, 0, 0, 0, 0, 1, 0, 0, 0, "webdings" };
D3DXFONT_DESC Font2 = {  -26, 0, 0, 0, 0, 0, 0, 0, 0, "impact" };

D3DXCreateFontIndirect( g_pDevice, &Font1, &g_pFont[0] );

Font1.Height  = -45;
D3DXCreateFontIndirect( g_pDevice, &Font1, &g_pFont[1] );
D3DXCreateFontIndirect( g_pDevice, &Font3, &g_pFont[2] );

But the exe was > 1024 bytes... so i have tried something to use/fill just only one D3DXFONT_DESC for Font1 and chaning the datas at runtime by overwriting/changing them so save possible some bytes... whatever i tried, i was not able to overwrite "webdings" to "impact". So i am not sure if there is any potential to save some bytes or not.

Code: [Select]
D3DXFONT_DESC Font1 = { -400, 0, 0, 0, 0, 1, 0, 0, 0, "webdings" };

D3DXCreateFontIndirect( g_pDevice, &Font1, &g_pFont[0] );

Font1.Height  = -45;
D3DXCreateFontIndirect( g_pDevice, &Font1, &g_pFont[1] );

Font1.Height  = -26;
Font1.FaceName = "impact";                                     
D3DXCreateFontIndirect( g_pDevice, &Font1, &g_pFont[2] );

I have read the DT_NOCLIP on the SDK docs but i think its only ok to use, when dont drawing outside of the screenarea (clipping)... so i have tried this yesterday for this, but exe got bigger and i dont noticed any speed different:

Code: [Select]
rect.left  = rect.top = 20;
g_pFont[2]->DrawText(NULL, TextParts[TextObj], -1, &rect, DT_LEFT|DT_NOCLIP, 0xffFFFFFF);

Two really nice and good modifications would be this for the particle drawings:

Code: [Select]
Original:

for (int i=0; i<1023; i++)
{
rect.left= ((sfrand() + (sfrand()&3) * time) & 1023);        //;-400; // Very cool optimizing tip by mentor! Thanks! <3
rect.top = ((sfrand() + (sfrand()&3) * time) & 1023);        //;-400;       // No more need of array and struct! :D
g_pFont[1]->DrawText(NULL, "n   n n   n  n    n", -1, &rect, DT_LEFT , 0x08ffffff);
}

Step1 - Change to:

for (int i=0; i<511; i++)
{
rect.left= ((sfrand() + (sfrand()&3) * time) & 1023)-400; // Very cool optimizing tip by mentor! Thanks! <3
rect.top = ((sfrand() + (sfrand()&3) * time) & 1023)-400;       // No more need of array and struct! :D
g_pFont[1]->DrawText(NULL, "n   n n   n  n    n", -1, &rect, DT_LEFT , 0x08ffffff);
}


Step2 - Change to:

for (int i=0; i<511; i++)
{
rect.left= ((sfrand() + (sfrand()&3) * time) & 1023)-400; // Very cool optimizing tip by mentor! Thanks! <3
rect.top = ((sfrand() + (sfrand()&3) * time) & 1023)-400;       // No more need of array and struct! :D
g_pFont[1]->DrawText(NULL, "n   n n   n  n    n", -1, &rect, DT_LEFT , 0x08ffffff);

rect.left=rect.left - 200;    // i.e. +200 instead -200
rect.top=rect.top - 200;    // i.e. +200 instead -200
g_pFont[1]->DrawText(NULL, "n   n n   n  n    n", -1, &rect, DT_LEFT , 0x08ffffff);

}

Sadly even when trying Step1 only, the exe is >1024 bytes...  Step2 would result in a much better looking and faster particle drawing, but i have no space to add this, sadly :(

Maybe i could save some bytes when using rand() of msvcrt but not sure how to add and get it work (rbz did it on his version). But the particle drawings should not be displayed randomized... they should move smooth (scroll)... mhhh...

However i thought about splitting the Main() function into three function parts...  Creating the three fonts, The DrawText() block, and the rest of mainloop... maybe this would pack better but just had some small wired problems
- hp EliteBook 8540p, 4 GB RAM, Windows 8.1 x64
- Asus P5Q, Intel Q8200, 6 GB DDR2, Radeon 4870, Windows 8.1 x64
http://www.secretly.de
Challenge Trophies Won:

Offline va!n

  • Pentium
  • *****
  • Posts: 1435
  • Karma: 109
    • View Profile
    • http://www.secretly.de
I got the version down to 1022 bytes... sadly without the modifications/wishes i posted before... here is actually version:
- hp EliteBook 8540p, 4 GB RAM, Windows 8.1 x64
- Asus P5Q, Intel Q8200, 6 GB DDR2, Radeon 4870, Windows 8.1 x64
http://www.secretly.de
Challenge Trophies Won:

Offline benny!

  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4384
  • Karma: 228
  • in this place forever!
    • View Profile
    • bennyschuetz.com - mycroBlog
Cool. Good luck at TUM with it, va!n.
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

Offline va!n

  • Pentium
  • *****
  • Posts: 1435
  • Karma: 109
    • View Profile
    • http://www.secretly.de
@benny:
thanks... would be cool if someone has one or more tips/trick to add the last two wishes, so its really perfect ;)
- hp EliteBook 8540p, 4 GB RAM, Windows 8.1 x64
- Asus P5Q, Intel Q8200, 6 GB DDR2, Radeon 4870, Windows 8.1 x64
http://www.secretly.de
Challenge Trophies Won:

Offline va!n

  • Pentium
  • *****
  • Posts: 1435
  • Karma: 109
    • View Profile
    • http://www.secretly.de
mhhhh... nobody? its really very quiet on this forum atm...
- hp EliteBook 8540p, 4 GB RAM, Windows 8.1 x64
- Asus P5Q, Intel Q8200, 6 GB DDR2, Radeon 4870, Windows 8.1 x64
http://www.secretly.de
Challenge Trophies Won:

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5301
  • Karma: 402
    • View Profile
The bits you want to add must come to 100s of bytes.  There's possibly no way to do it without totally changing how you draw those things.

Jim

Challenge Trophies Won:

Offline va!n

  • Pentium
  • *****
  • Posts: 1435
  • Karma: 109
    • View Profile
    • http://www.secretly.de
@all:
Vista problem:
Someone tested it on Vista? A friend told me that he gets always IMAs (illegal memory access) when running on Vista and so it dont work for him O.O (the needed DLLS are available on his vista system)

Size optimizing:
I have checked all my versions and i come up with the result that only following two changes are needed:

a) Adding -400 for x and y position of particles (looks much better)

b) MessageText should work like the first source i posted (and should not repeat)... or dou guys think, its better when it repeats ever and ever? If so, the text should changed not so fast as atm...

The idea to draw the particles two times is just stupid... so this idea was yesterday and is no longer up 2 date...

- hp EliteBook 8540p, 4 GB RAM, Windows 8.1 x64
- Asus P5Q, Intel Q8200, 6 GB DDR2, Radeon 4870, Windows 8.1 x64
http://www.secretly.de
Challenge Trophies Won:

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5301
  • Karma: 402
    • View Profile
The exe in the zip from a few posts back works for me on Vista (after I grabbed the latest DirectX update), of course you've changed it since then.:)

Jim
Challenge Trophies Won:

Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2757
  • Karma: 493
    • View Profile
    • https://www.rbraz.com/
Now I can only wish you good luck on the compo
Challenge Trophies Won:

Offline va!n

  • Pentium
  • *****
  • Posts: 1435
  • Karma: 109
    • View Profile
    • http://www.secretly.de
1k Intro "Start the journey" has been released at TUM  8)
It will come with full VS2005 source! Thanks to everybody who helped me to finish this 1k intro! Thanks!  :cheers:
- hp EliteBook 8540p, 4 GB RAM, Windows 8.1 x64
- Asus P5Q, Intel Q8200, 6 GB DDR2, Radeon 4870, Windows 8.1 x64
http://www.secretly.de
Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17414
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Best of luck :)
Shockwave ^ Codigos
Challenge Trophies Won:

Offline bikerboy

  • Amiga 1200
  • ****
  • Posts: 349
  • Karma: 12
    • View Profile
g/luck man ;D