Josh @ Dreamland
Prince of all Goldfish
 Joined: Feb 2008
Posts: 2,950
|
 |
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
|
|
|
Josh @ Dreamland
Prince of all Goldfish
 Joined: Feb 2008
Posts: 2,950
|
 |
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: h ttp://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.
|
|
|
freezway
 Joined: Jan 2010
Posts: 220
|
 |
Reply #2 Posted on: March 26, 2010, 03:55:14 AM |
|
|
|
GNU/linux executables? EDIT: also GOOD JOB!
|
|
|
Josh @ Dreamland
Prince of all Goldfish
 Joined: Feb 2008
Posts: 2,950
|
 |
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*
|
|
|
freezway
 Joined: Jan 2010
Posts: 220
|
 |
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.
|
|
|
Josh @ Dreamland
Prince of all Goldfish
 Joined: Feb 2008
Posts: 2,950
|
 |
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.
|
|
|
MrJackSparrow2
 Joined: Apr 2008
Posts: 35
|
 |
Reply #6 Posted on: March 26, 2010, 04:01:25 AM |
|
|
|
That was absolutely gorgeous.
|
|
|
Josh @ Dreamland
Prince of all Goldfish
 Joined: Feb 2008
Posts: 2,950
|
 |
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.
|
|
|
MrJackSparrow2
 Joined: Apr 2008
Posts: 35
|
 |
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.
|
|
|
freezway
 Joined: Jan 2010
Posts: 220
|
 |
Reply #9 Posted on: March 26, 2010, 05:29:55 AM |
|
|
so what does this mean in terms of R4 release date?  < for all ur hard work.
|
|
|
kkg
 Joined: Nov 2009
Posts: 84
|
 |
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:!
|
|
|
The 11th plague of Egypt
 Joined: Dec 2009
Posts: 274
|
 |
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.
|
|
|
Josh @ Dreamland
Prince of all Goldfish
 Joined: Feb 2008
Posts: 2,950
|
 |
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.
|
|
|
retep998
 Joined: Jan 2010
Posts: 248
|
 |
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.
|
|
|
RetroX
Master of all things Linux
 Joined: Apr 2008
Posts: 1,055
|
 |
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; }
|
|
|
|