Jump to content


iam1me

Member Since 02 Feb 2012
Offline Last Active Mar 12 2013 01:56 AM

Posts I've Made

In Topic: GUI API Version 1.05 (Updated)

12 March 2013 - 01:54 AM

Are you still working on this iam1me?

I've just come across it and will be giving it a good lppk for my current project...


No, sorry. I'm far too busy now that I'm working full time + taking Masters courses. Plus after working 8hrs as a programmer, I don't want to come back and do more programming haha. However, feel free to use it and modify it to your needs.

I may continue this project in the summer though, when I won't have classes. Will have to wait and see.

In Topic: Massive Pre-Computed ALU Tables for "Gaming Mode"

04 March 2012 - 08:53 AM

Attaching such a memory device to an ALU seems like it would be a horrible idea to me, no offense. It would dramatically increase the minimum latency for the CPU, and since most CPUs today implement a RISC architecture the result would be the slowing down of the entire CPU. Thus, in order to provide the marginal speed up for simple calculations you would be slowing down all functions of the CPU - the result being an overall slower computer/game.

In Topic: Inline Script Converter (Algorithm Project)

02 March 2012 - 08:45 AM

Which is why I suggested an array. :)

__inline[0-...]


You could... I try to avoid GM arrays though - I don't like their uncontrolled size. A ds_list would be more preferable. Or better yet - a ds_stack or ds_queue, since you only need to use each argument 1x and then it can disappear.

****

As far as the possibility of implementing the inline feature, you would need to essentially make a preprocessor which could pipe its output to the GM compiler. Is the GM compiler a separate .exe?

In Topic: Inline Script Converter (Algorithm Project)

02 March 2012 - 02:42 AM

Yes but it was an example. The functions could be much more complex than just an equation.

function move(x,y) {
    move_towards_point(x,y,5)
    return point_distance(x,y,xprevious,yprevious) }

Now inline that into this:

move(move(4,5),move(6,4))

The code makes no logical sense here, but you can see how it can not be inlined without a stack (which is what my previous array was).


Ah ok, I see your point :thumbsup:

In that case the resulting code should be something like so:

move_towards_point(4,5,5)
var v1;
v1 = point_distance(4,5,xprevious,yprevious)

move_towards_point(6,4,5)
var v2;
v2 = point_distance(6,4,xprevious,yprevious)

move_towards_point(v1,v2,5)
ret = point_distance(v1,v2,xprevious,yprevious) //ret is whatever variable was specified by the user

The trick would then be coming up with a naming convention for the variables so that they don't overlap with user variables and don't overlap each other

In Topic: Inline Script Converter (Algorithm Project)

01 March 2012 - 06:55 PM

The hard part is nesting.

This is a function add(a,B)

return a+b

This is a function multi(a,B)
return a*b

Now what happens when I do this:
x = add( multi( 4,3 ), add( 2, 3 ) )

It's very hard to convert that to inline when they're nested. Doable, but a lot harder.
_inline[0] = 4*3
_inline[1] = 2+3
_inline[2] = _inline[0] + _inline[1]
x = _inline[2]


All you would do is evaluate and replace the innermost inline functions first. So your example would go like so:

x = add(multi(4,3),add(2,3));
x = add(4*3,add(2,3));
x = add(4*3,2+3);
x = 4*3+2+3;

You wouldn't need to use an array for this - you could simply use the replace string function.