Pages: 1 2 3
Author Topic: Summary  (174,768 Views)
Offline (Unknown gender) Josh @ Dreamland

Prince of all Goldfish
Developer
Joined: Feb 2008
Posts: 2,950
View profile
Posted on: March 26, 2010, 03:11:28 AM
Perfect summary of the project today as I tested serp's optimization fix (which was quite full of linker errors):

Game Maker

Can't do anything fast.

ENIGMA

Can't do anything right.


So.

...Fix'd


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
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
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
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
Offline (Unknown gender) Josh @ Dreamland

Prince of all Goldfish
Developer
Joined: Feb 2008
Posts: 2,950
View profile
Reply #1 Posted on: March 26, 2010, 03:26:00 AM
Also, for your consideration, what happens if you don't use var for fucking everything (I revised to use int and double):


I'd up the room speed, but I know that if my framerate limiter doesn't get it, the vsync will. So...



*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.
Offline (Unknown gender) freezway

Member
Joined: Jan 2010
Posts: 220
View profile
Reply #2 Posted on: March 26, 2010, 03:55:14 AM
GNU/linux executables?
EDIT: also GOOD JOB!
Offline (Unknown gender) Josh @ Dreamland

Prince of all Goldfish
Developer
Joined: Feb 2008
Posts: 2,950
View profile
Reply #3 Posted on: March 26, 2010, 03:57:16 AM
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*
Offline (Unknown gender) freezway

Member
Joined: Jan 2010
Posts: 220
View profile
Reply #4 Posted on: March 26, 2010, 03:59:26 AM
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.
Offline (Unknown gender) Josh @ Dreamland

Prince of all Goldfish
Developer
Joined: Feb 2008
Posts: 2,950
View profile
Reply #5 Posted on: March 26, 2010, 04:00:32 AM
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.
Offline (Unknown gender) MrJackSparrow2

Member
Joined: Apr 2008
Posts: 35
View profile
Reply #6 Posted on: March 26, 2010, 04:01:25 AM
That was absolutely gorgeous.
Offline (Unknown gender) Josh @ Dreamland

Prince of all Goldfish
Developer
Joined: Feb 2008
Posts: 2,950
View profile
Reply #7 Posted on: March 26, 2010, 04:04:37 AM
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.
Offline (Unknown gender) MrJackSparrow2

Member
Joined: Apr 2008
Posts: 35
View profile
Reply #8 Posted on: March 26, 2010, 04:06:56 AM
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.
Offline (Unknown gender) freezway

Member
Joined: Jan 2010
Posts: 220
View profile
Reply #9 Posted on: March 26, 2010, 05:29:55 AM
so what does this mean in terms of R4 release date?  :clap: < for all ur hard work.
Offline (Unknown gender) kkg

Member
Joined: Nov 2009
Posts: 84
View profile
Reply #10 Posted on: March 26, 2010, 09: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:!
Offline (Unknown gender) The 11th plague of Egypt

Member
Joined: Dec 2009
Posts: 274
View profile
Reply #11 Posted on: March 26, 2010, 09: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.
Offline (Unknown gender) Josh @ Dreamland

Prince of all Goldfish
Developer
Joined: Feb 2008
Posts: 2,950
View profile
Reply #12 Posted on: March 26, 2010, 01:01:09 PM
> 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.
Offline (Unknown gender) retep998

Member
Joined: Jan 2010
Posts: 248
View profile
Reply #13 Posted on: March 26, 2010, 01:09:36 PM
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.
Offline (Unknown gender) RetroX

Master of all things Linux
Contributor
Joined: Apr 2008
Posts: 1,055
View profile
Reply #14 Posted on: March 26, 2010, 02:51:43 PM
clock() is accurate for me.

#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;
  }
Pages: 1 2 3