ENIGMA Progress Report

Posted by JoshDreamland on Jan. 6, 2008, 3:09 p.m.

Didn't think I gave up JUST yet, did you?

Hell no. ENIGMA's still going.

I NEED SOME TEAM MEMBERS. IS THAT UNDERSTOOD?

I need some people who are skilled with C++ to GIVE ME A FUCKING HAND WITH THIS PROJECT.

I CAN _*NOT*_ DO IT ALONE. OK?

If you have ANY talent that you think would benefit ENIGMA, please speak up.

Anyway, onto progress.

I never updated you guys on my last big creations, so you are in for a hell of a surprise, I think.

As you may have noticed, 64D has no parser. Deal with it for me, and click these links yourself. I'm hoping the parser will be back up soon. JUST DO IT.

Not Very Interactive Game

That's mostly a show of power. In case you can't or would rather not download, that shows 3000 triangles forming a lava flow, with something or other moving under it.

Feel free to edit the sprite, just DON'T RUN THE GAME WITHOUT UNZIPPING.

I'll fix the bug involved later. For now, just unzip it.

So Josh, what's the code behind that?

Here you go. Don't run it in GM or it'll freeze your whole system.

Create event:

[pre]

for (i=0; i<PCOUNT; i+=1)

{

prcolor=make_color_rgb(255,random_integer(255),0);

prx=room_width/2+random(128)-64;

pry=-random(520);

prdir=random_integer(360);

}

proto_object.x=64;

proto_object.hspeed=1;

[/pre]

Draw event:

[pre]

for (i=0; i<PCOUNT; i+=1)

{

draw_set_color(prcolor);

draw_set_alpha(.5);

draw_primitive_begin(pr_trianglestrip);

draw_vertex(prx+8,pry/*,c_red,.5*/);

draw_vertex(prx,pry+16/*,c_green,.5*/);

draw_vertex(prx+16,pry+16/*,c_blue,.5*/);

draw_primitive_end();

pry+=8;

dist=point_distance(prx,pry,proto_object.x,312);

if (dist<64 && pry<312)

{

dirt=point_direction(proto_object.x,312,prx,pry);

dirt+=(dirt-90)/12;

prx=proto_object.x+lengthdir_x(min(64,dist*2),dirt);

pry=312+lengthdir_y(min(64,dist*2),dirt);

}

if (pry>room_height)

{

prx=room_width/2+random(128)-64;

pry=-16-random_integer(32);

int rn=random_integer(10);

if (rn==1)

prx-=16;

else if (rn==2)

prx+=16;

}

}

dirt=point_direction(64,64,mouse_x,mouse_y);

draw_line(64,64,64+lengthdir_x(32,dirt),64+lengthdir_y(32,dirt));

draw_sprite(sprite0,0,proto_object.x,312);

proto_object.x+=proto_object.hspeed;

if (proto_object.x<64)

{

proto_object.hspeed+=.01;

if (proto_object.hspeed>1)

proto_object.hspeed=1;

}

if (proto_object.x>room_width-64)

{

proto_object.hspeed-=.01;

if (proto_object.hspeed<-1)

proto_object.hspeed=-1;

}

[/pre]

Keep in mind:

ENIGMA has random_integer() as well as casting. GM doesn't.

So, where does that put us with completed functions?

/**Bare minumum functions******************************************************

void dispstr(char* str, double value)

int show_error(ARG errortext, ARG2 fatal)

double point_direction(ARG x1,ARG2 y1,ARG3 x2,ARG4 y2)

double point_distance(ARG x1, ARG2 y1, ARG3 x2, ARG4 y2)

******************************************************************************/

/**Standard drawing functions**************************************************

c_aqua, c_black, c_blue, c_dkgray, c_fuchsia, c_gray, c_green,

c_lime, c_ltgray, c_maroon, c_navy, c_olive, c_purple, c_red,

c_silver, c_teal, c_white, c_yellow

void draw_clear(ARG color)

void draw_set_color(ARG color)

void draw_set_color_rgb(ARG red, ARG2 green, ARG3 blue)

int draw_set_alpha(ARG alpha)

void draw_set_color_rgba(ARG red, ARG2 green, ARG3 blue, ARG4 alpha)

int draw_get_color()

int make_color_rgb(ARG red, ARG2 green, ARG3 blue)

int color_get_red(ARG color)

int color_get_green(ARG color)

int color_get_blue(ARG color)

******************************************************************************/

/**Standard math functions*****************************************************

double random(ARG n)

int random_set_seed(ARG seed)

int random_get_seed()

int randomize()

int random_integer(ARG x)

double abs(ARG x)

double ceil(ARG x)

double floor(ARG x)

double round(ARG x)

double sqr(ARG x)

double sqrt(ARG x)

double exp(ARG x)

double power(ARG x,ARG2 power)

double ln(ARG x)

double logn(ARG n,ARG2 x)

double log2(ARG x)

double log10(ARG x)

double sin(ARG x)

double cos(ARG x)

double tan(ARG x)

double arcsin(ARG x)

double arccos(ARG x)

double arctan(ARG x)

double arctan2(ARG y,ARG2 x)

double min(ARG value1, ARG2 value2)

double max(ARG value1, ARG2 value2)

int sign(ARG x)

double frac(ARG x)

double degtorad(ARG x)

double radtodeg(ARG x)

double lengthdir_x(ARG len,ARG2 dir)

double lengthdir_y(ARG len,ARG2 dir)

//Note:

///Both point_direction and point_distance are declared in EGMstd.h

******************************************************************************/

/**Primitive functions*****************************************************

pr_pointlist, pr_linelist, pr_linestrip, pr_trianglelist, pr_trianglestrip

pr_trianglefan, pr_lineloop, pr_quadlist, pr_quadstrip, pr_polygon

int draw_primitive_begin(ARG kind)

int draw_vertex(ARG x, ARG2 y)

int draw_vertex_color(ARG x, ARG2 y, ARG3 color, ARG4 alpha)

int draw_primitive_end()

******************************************************************************/

/**Standard drawing functions**************************************************

int draw_line(ARG x1,ARG2 y1,ARG3 x2,ARG4 y2)

int draw_line_width(ARG x1,ARG2 y1,ARG3 x2,ARG4 y2,ARG5 width)

int draw_line_color(ARG x1,ARG2 y1,ARG3 x2,ARG4 y2,ARG5 color1,ARG6 color2)

int draw_line_width_color(ARG x1,ARG2 y1,ARG3 x2,ARG4 y2,ARG5 width,ARG6 color1,ARG7 color2)

int draw_rectangle(ARG x1,ARG2 y1,ARG3 x2,ARG4 y2,ARG5 outline)

int draw_rectangle_angle(ARG x1,ARG2 y1,ARG3 x2,ARG4 y2,ARG5 outline,ARG6 angle)

int draw_rectangle_color(ARG x1,ARG2 y1,ARG3 x2,ARG4 y2,ARG5 color1,ARG6 color2,ARG7 color3,ARG8 color4,ARG9 outline)

******************************************************************************/

/**Window functions**************************************************

cr_default, cr_none, cr_arrow, cr_cross, cr_beam, cr_size_nesw, cr_size_ns, cr_size_nwse,

cr_size_we, cr_uparrow, cr_hourglass, cr_drag, cr_nodrop, cr_hsplit, cr_vsplit,

cr_multidrag, cr_sqlwait, cr_no, cr_appstart, cr_help, cr_handpoint, cr_size_all

int window_set_cursor(ARG cursor)

int fps;

int window_set_caption(ARG caption)

int window_get_x()

int window_get_y()

int window_set_position(ARG x, ARG2 y)

int window_set_visible(ARG visible)

int window_get_visible()

int window_minimize()

int window_show()

******************************************************************************/

Also: A couple of those functions are completely or semi untested, or just don't work. Those include the basic math functions such as min(), sqr(), logn(), etc. (Things that should just work), draw_rectangle_angle() (Haven't tested since I fixed some other bugs that may have led to it not working), window_set_cursor() (Glut doesn't like me for some reason there.) Window_set_visible works, but cannot be undone in the draw event for obvious reasons.

Other than that, make your own conclusions.

AND HELP ME OUT, SOMEONE. Gary and Dave can only do so much, they aren't dedicating their time to this like I have. And Dylan left me for a game. =[

END

Comments

gtvg 16 years, 12 months ago

Yay! I have an idea…. for a new function.

draw_text(x,y,x,y,string here)

This would be a better version of the draw_text() function in Game Maker. It can allow you to set the corners where the text is drawn. This would also allow you to draw the text stretched or skewed.

For example:

draw_text(x,y,size,size,"Hello!")

Would return:

Hello!

Putting 'size' in the place of 'x' and 'y' would make the text the correct size.

draw_text(x,y,x+50,y+90,"Hello!")

Would return:

__H

________E

______________L

___________________L

_________________________O

______________________________!

It wouldn't actually be spaced like that, but stretched.

You could also use this to draw sprites.

If you don't understand please pm me.

sirxemic 16 years, 12 months ago

It's already possible to draw transformed text in GM…

draw_text_transformed anyone?

JoshDreamland 16 years, 12 months ago

lol @ noodle

wow @ Myth

@ Serpy–

If I told you guys, I'd have to kill you.

…fine

I'm actually just setting up a framework that will allow ENIGMA's kickass parser, once extended a bit more, to… Well, I better make a list.

Scripts will be declared with an even more flexible template than the one we're using now, to allow variant return values. The arguments will also be casted accordingly.

Events will be scoped into their object classes. Local variables will be declared VAR and thrown in also. With statements will be relocated following the classes, and scoped into each, possibly depending on the object specified, if it is an object name. Otherwise it will be scoped into all of them regardless.

I will be adding calls to each object's events into ENIGMA's callback areas. It'll be up to my work on the parser later to define which objects must be specified.

JoshDreamland 16 years, 12 months ago

Kindarkous–

I think C-Ator is right.

gtvg 16 years, 12 months ago

Yes but it can't be … I don't know how to describe it.

Nuther example:

draw_text(x-5,y-2,x+3,y+4,"Hello")

Would give you:

__________________o

________________________+

___________________________o

The (+) is the center of the text and the (o) are the corners of the text. Better?

Maybe you could add an angle argument to help describe what I am saying. So in the example above the text could be drawn at a 1o angle or 274o angle.

s 16 years, 12 months ago

I think what Kinda means more is setting the coordinates to fit in instead of figuring what value to scale with. Scaling would be a matter of comparing ratios with string_width and string_height and so on forth

JoshDreamland 16 years, 12 months ago

Kindarkous–

You mean cascade the letters? I'll see about it soon enough.

gtvg 16 years, 12 months ago

Sure

s 16 years, 12 months ago

&#931;

DFortun81 16 years, 12 months ago

That's Sigma.