ENIGMA Forums

General fluff => Announcements => Topic started by: Josh @ Dreamland on March 25, 2010, 10:11:28 pm

Title: Summary
Post by: Josh @ Dreamland on March 25, 2010, 10:11:28 pm
Perfect summary of the project today as I tested serp's optimization fix (which was quite full of linker errors):

Game Maker
(http://dl.dropbox.com/u/1052740/GMflame.png)
Can't do anything fast.

ENIGMA
(http://dl.dropbox.com/u/1052740/ENIGMAflames.png)
Can't do anything right.


So.

...Fix'd
(http://dl.dropbox.com/u/1052740/ENIGMAflames2.png)

Today's lessons: Always remember to use unsigned chars when the situation calls for them, and don't be afraid to use an equation that makes sense when calculating framerate. Even when Linux won't let you use clock().
...I'll probably end up externalizing a function that uses clock() on Windows and gettimeofday() on Linux.


Technical blah:
They're actually geometric curves and trig: GM's nightmare, really. I used 20 lines each curve.

Draw
Code: [Select]
draw_set_color(merge_color(c_red,c_yellow,.3));
draw_set_blend_mode(bm_add);

for (i=0; i<cc; i+=1) {
 draw_set_alpha(min(.1,alpha[i]));
 for (ii=0; ii<ic; ii+=1) {
    draw_line(xo[i]+lengthdir_x(ii,ang[i]),yo[i]+lengthdir_y(ii,ang[i]),xo[i]+lengthdir_x(ic-ii,ang[i]+90),yo[i]+lengthdir_y(ic-ii,ang[i]+90));
  }
  yo[i] -= vs[i];
  ang[i] += rot[i];
  alpha[i] -= .001;
  if (alpha[i] < 0)
  cci = i;
}
room_caption = "Number of particles: " + string(cc) + "  FPS: " + string(fps) + "  ... Sad, really.";

Step
Code: [Select]
repeat (2)
{
  xo[cci] = mouse_x - 16 + random(32);
  yo[cci] = mouse_y - 16 + random(32);
  ang[cci] = random(90);
  alpha[cci] = .12;
  rot[cci] = random(10) - 5;
  vs[cci] = .5 + random(2);
  cci += 1;
  if (cci > cc)
    cc = cci;
}

Create
Code: [Select]
cc = 20;
cci = cc;
ic = 20;

for (i=0; i<cc; i+=1)
{
  xo[i] = mouse_x - 16 + random(32);
  yo[i] = mouse_y - 16 + random(32);
  ang[i] = random(90);
  alpha[i] = .12;
  rot[i] = random(10) - 5;
  vs[i] = .5 + random(1);
}


LGM can't actually pass that to ENIGMA yet, so I copy-pasted the code manually. Crude but effective.
The difference between ENIGMA's and GM's was (in addition to the caption) the repeat() value, which was 8 in ENIGMA.

I allocated like, 60 values more than I seemed to ever need, but you never know.

Anyway, thanks much to serp, who is the reason the game is like 288 KB. As opposed to like 420, which it has been before. He's probably also the reason it runs smoothly, and is certainly the problem I ran into five linker errors copy-pasting code. <3
Title: Re: Summary
Post by: Josh @ Dreamland on March 25, 2010, 10:26:00 pm
Also, for your consideration, what happens if you don't use var for fucking everything (I revised to use int and double):
(http://dl.dropbox.com/u/1052740/ENIGMAflame3.png)

I'd up the room speed, but I know that if my framerate limiter doesn't get it, the vsync will. So...
(http://dl.dropbox.com/u/1052740/ENIGMAflame4.png)


*Realizes he's being a dumbass*
*uploads executables*
http://dl.dropbox.com/u/1052740/GMflames.zip (Over 9000 sets of at least 100 bytes; estimated forever on dial-up)
http://dl.dropbox.com/u/1052740/SHELL.zip (Three versions included; 300 KB)

Broken old version:
http://dl.dropbox.com/u/1052740/ENIGMAflames.zip (at least a hundred kilobytes, but barely. Like, 30 seconds on dial-up.)

So yes, do feel free to run those. And if for some reason the ENIGMA one doesn't work, errors, segfaults, or by some miracle runs more slowly than Game Maker's, do let me know.



And in conclusion, no, tr0ll, this really never does get old.
Title: Re: Summary
Post by: freezway on March 25, 2010, 10:55:14 pm
GNU/linux executables?
EDIT: also GOOD JOB!
Title: Re: Summary
Post by: Josh @ Dreamland on March 25, 2010, 10:57:16 pm
FACK.

My Linux box is presently sleeping off a headache. Ehhh... I'd tell you to download serp's GIT repo, but I don't have the link and wouldn't wish it on anyone. *shrug*

WINE should be kind to ENIGMA... It doesn't use very much...

*Fumbles a liveCD into nearby computer*
Title: Re: Summary
Post by: freezway on March 25, 2010, 10:59:26 pm
OOOH it does work... i get ~33fps at ~2k particles
EDIT: does this mean R4 is coming soon, also i need to think out my post more before i post 'em.
Title: Re: Summary
Post by: Josh @ Dreamland on March 25, 2010, 11:00:32 pm
Good, that liveCD was 64Bit. >_<
And yes, it does. Ism gave me some structures I needed, and I'll be returning one to her tomorrow.
Title: Re: Summary
Post by: MrJackSparrow2 on March 25, 2010, 11:01:25 pm
That was absolutely gorgeous.
Title: Re: Summary
Post by: Josh @ Dreamland on March 25, 2010, 11:04:37 pm
Grazie. I was pretty pleased Vista didn't bite me. And neither did my odd texture-binding checks; there was no speed difference with or without them.
Title: Re: Summary
Post by: MrJackSparrow2 on March 25, 2010, 11:06:56 pm
I ran it on Windows 7, so I had no Vista issues. I knew Enigma would dominate GM, I just didn't know the true extent of it's rapage until now. I am thoroughly impressed! I can't wait to get my hands on R4.
Title: Re: Summary
Post by: freezway on March 26, 2010, 12:29:55 am
so what does this mean in terms of R4 release date?  :clap: < for all ur hard work.
Title: Re: Summary
Post by: kkg on March 26, 2010, 04:40:24 am
Game maker: 271 particles at 24 fps
ENIGMA: 2033 particles at 29.44 fps

Fuck haha, nice work man :)

Really looking forward to all the work you're all putting in. I'll be sure to contribute in any way I can when it comes to testing time. I've been following this site every day ^_^

EDIT: Those results were on Win7 Pro 64-bit on the system in my sig. Also, If the ENIGMA window went out of focus for a while, once I opened it back up the particles would disappear straight away instead of fading away. The particle number did not change though. D:!
Title: Re: Summary
Post by: The 11th plague of Egypt on March 26, 2010, 04:46:43 am
20.5 fps with 1955 particles for Enigma
16-17 fps with 260 particles for GM

on my Win 7 laptop with an Ati 4570 card.

Why do you need 2 different cc and cci variables?

BTW I see you just bought GM8.
Title: Re: Summary
Post by: Josh @ Dreamland on March 26, 2010, 08:01:09 am
> so what does this mean in terms of R4 release date?
Every time I set a release date, something goes wrong and I end up needing more time.

> Why do you need 2 different cc and cci variables?
One tells me how many objects I'm drawing. The other recycles the array to prevent reallocation.
Title: Re: Summary
Post by: retep998 on March 26, 2010, 08:09:36 am
30 fps with 2000 particles on a college computer.
Win xp pro loaded with antivirus and other college shit
Intel core 2 duo 2.2GHz
ATI FireGL v5200
I'll test it at home eventually.

GM can only hit 19 fps with 260 particles...

Um yeah, enigma is amazing.
Title: Re: Summary
Post by: RetroX on March 26, 2010, 09:51:43 am
clock() is accurate for me.

Code: [Select]
#include <iostream>
#include <cstdlib>
#include <ctime>
#include <cmath>

int main()
  {
  clock_t current=0,previous=0;
  std::cout << 10 << std::endl;
  while (true)
    {
    previous=current;
    current=clock();
    if (floor(current/CLOCKS_PER_SEC)!=floor(previous/CLOCKS_PER_SEC))
      {
      std::cout << 10-(double)current/CLOCKS_PER_SEC << std::endl;
      }
    if (current/CLOCKS_PER_SEC>=10)
      {
      return EXIT_SUCCESS;
      }
    }
  return EXIT_SUCCESS;
  }
Title: Re: Summary
Post by: Game_boy on March 26, 2010, 11:52:39 am
GM: 260, 5-6 fps
Enigma: 1940, 11.13 fps

Fantastic work, Josh. Are we expecting more speedups in future (not that it needs it) from other work?

I was also impressed by the loading time vs. GM.
Title: Re: Summary
Post by: Josh @ Dreamland on March 26, 2010, 12:19:23 pm
I'm hoping to improve var's speed from R3's. Have a newer version lying around somewhere. Other than that, not that I can tell. I ran a best-case version of this with beyond-perfect general-purpose optimization, and it ran the same speed. So, I think this is as good as we're getting from lines.

Loading time will increase slightly with sprites, but it shouldn't require a "Loading" form.

I'm just glad it consistently performs faster than GM, with some seven times the particles. XD
Title: Re: Summary
Post by: polygone on March 26, 2010, 01:09:46 pm
Looks like R4 is certainly set to silence a few critics/sceptics.

My view is once a collision system is fully integrated (if I was Josh I would personally work on this myself), then the Enigma community base will start to grow considerably. When it reaches that stage I believe peeps from the GMC will finally stand up and notice, and I see it causing a few waves over there.
Title: Re: Summary
Post by: RetroX on March 26, 2010, 01:56:44 pm
Also, I am going to start correcting you every single time that you say "Linux" and not "GNU/Linux" when you're not referring to the kernel.
Title: Re: Summary
Post by: Game_boy on March 26, 2010, 02:20:53 pm
Retro, it's not a requirement. You can choose either term, and no one's yet 'proved' you have to use one over the other.

RMS is an outspoken idiot. He could use his high profile to actually push Linux adoption rather than petty naming conflicts.
Title: Re: Summary
Post by: TheExDeus on March 26, 2010, 03:13:08 pm
Nice. I got a LARGE speed increase compared to GM.
Thou when I launched Enigma for about 1-2minutes (not sure, how long I played with it :D), it crashed. It would be nice if you implemented some logging or something. :P
Here is the not-so-explanatory general purpose Windows useless error:
(http://img340.imageshack.us/img340/9068/crashb.png)

edit: Ou, and my specs (which could help with the diagnostic) are: Core2Duo 2.66ghz E6750, Geforce 8800 GTS 512mb and 2gb ram.

edit2: Here is what that error says when I click the "see what data this error contains" button:
Quote
AppName: enigmaengine.exe    AppVer: 0.0.0.0    ModName: enigmaengine.exe
ModVer: 0.0.0.0    Offset: 0000e73c
I replicated the error with launching the exe for about 3-4 minutes now. Thou both times I had vlc player showing a video (I doubt thats the cause, but I don't have the patience to run the exe for 4minutes without doing anything else :D).
Title: Re: Summary
Post by: freezway on March 26, 2010, 03:44:33 pm
i get the wine equiviland of that if i run it for a while
Title: Re: Summary
Post by: MrJackSparrow2 on March 26, 2010, 04:53:18 pm
I can replicate that as well. Running for a portion of time will indeed crash the game.
(http://img13.imageshack.us/img13/4026/enigmak.png)
Title: Re: Summary
Post by: Josh @ Dreamland on March 26, 2010, 07:43:43 pm
Heh, don't worry, guys, it wasn't an ENIGMA bug. Just an error with how the particle system was designed (specifically when I started using double instead of var).

Those who are interested can download the fix (and some extra-hoursepower builds, three total):
http://dl.dropbox.com/u/1052740/SHELL.zip
Title: Re: Summary
Post by: freezway on March 26, 2010, 08:21:40 pm
woooo it works.... i get like 20 fps on floor, 15 on 4096 and 30-33 on 2048
Title: Re: Summary
Post by: IsmAvatar on March 26, 2010, 08:36:38 pm
Just curious, but shouldn't an error like that be reported in a more typical fashion, rather than crashing to hell?
Title: Re: Summary
Post by: RetroX on March 26, 2010, 08:45:44 pm
Retro, it's not a requirement. You can choose either term, and no one's yet 'proved' you have to use one over the other.
People think that tomatoes are a vegetable but they're really a fruit.

Does the fact that most people say the first make it correct?
Title: Re: Summary
Post by: freezway on March 26, 2010, 08:48:57 pm
seriously guys? are we really gunna argue over this?

EDIT: dammit, anyone know a good image host. Photobucket is bloated and imageshack is slow.
Title: Re: Summary
Post by: Josh @ Dreamland on March 26, 2010, 08:59:08 pm
> Just curious, but shouldn't an error like that be reported in a more typical fashion, rather than crashing to hell?
We can have a debate over this if we need, but basically I think it's best to leave errors for the testing phase and let the fast code be fast on its own.
The goal is to incorporate some sort of tracker for bounds overflows, but that can be difficult when a scalar type is used. Also, that's really something for debug mode. :P
Title: Re: Summary
Post by: freezway on March 26, 2010, 09:07:08 pm
i was talking about the argument of the correct way to refer to (GNU/Linux)/linux
Title: Re: Summary
Post by: RetroX on March 26, 2010, 09:37:24 pm
seriously guys? are we really gunna argue over this?
wer gunna

No, really, it's annoying.  You don't name your car "engine," yet calling GNU/Linux is essentially doing just that.  People don't seem to understand that aspect of it.  Not to mention that ChromeOS uses Linux, but it is not GNU/Linux.

Either way, I suppose that I'll drop it, because I'm obviously changing nobody's opinion.
Title: Re: Summary
Post by: Josh @ Dreamland on March 26, 2010, 09:51:38 pm
Car is significantly easier to type than engine...
Title: Re: Summary
Post by: freezway on March 26, 2010, 10:00:10 pm
+1 for that comment!

anyway, what all is left for R4? also, are there gunna be any native binaries of this example?
Title: Re: Summary
Post by: RetroX on March 26, 2010, 10:04:43 pm
Car is significantly easier to type than engine...
I like car.  The car in car is fast and I love how wonderfully fast that car is.

Too bad that there are so many variations of car that it's difficult to decide the balance between which car is the best.
Title: Re: Summary
Post by: Josh @ Dreamland on March 26, 2010, 10:16:13 pm
> anyway, what all is left for R4? also, are there gunna be any native binaries of this example?
Finishing scopes in the GML formatter and syntax checker; not imperative but still desirable. Formatting with() and implementing improved switch().

That's enough work until Sunday.

Then all that's left is setting up communications between LGM and ENIGMA, including better resource translation and error reporting/lookup.
Title: Re: Summary
Post by: freezway on March 26, 2010, 10:57:28 pm
sweet. cant wait!
Title: Re: Summary
Post by: KaBob799 on March 27, 2010, 12:47:26 am
Very impressive =]
Title: Re: Summary
Post by: Noodle on March 27, 2010, 05:09:06 pm
Very nice. ENIGMA is about 14 times faster, assuming time period is directly proportional to number of particles. ^_^