Jump to content


margoose

Member Since 02 Nov 2003
Offline Last Active Apr 30 2013 01:06 AM

Topics I've Started

ANNIE

06 September 2010 - 09:14 PM

GMC meet ANNIE (download)...ANNIE meet GMC...


Ok now that we're all acquainted let me describe who ANNIE is:

ANNIE is exactly what her name stands for, an artificial neural network intelligence engine. For those not familiar with the concept basically its a form of fuzzy AI in which takes in input and generates output. ('Ok thats great so does a script, so what...?'). The cool thing about a ANN is that it learns, and in this case when it gives the wrong output you can tell it what the output should have been and it will adjust its calculations. An ANN is not good for coming up with exact,optimal solutions. Instead it is best used for pattern recognition when the pattern isn't exactly clear. So for example you can use it to recognize a number or letter with different fonts, or make predictions based on fuzzy or inexact information. For more information on ANNs visit: http://en.wikipedia...._neural_network and http://en.wikipedia....Neural_networks

Ok, now that we all know what a neural network is let me continue to describe ANNIE. She is a supervised feed-forward ANN that uses backpropagation as the teaching method. She also enjoys long walks on the beach and watching the sunrise over the cit-ay.

Basically she is a set of scripts which allows you to create many different ANNs. You can also connect different ANNs together using the the annie_send_input() function by sending the output of one ANN as another's input. She also currently only accepts binary input and only outputs binary.

'Alright, I really feel like I'm getting to know ANNIE now, but what does she need to have looked at?' Long story short, everything. I started this project simply to understand the basic concepts of how ANNs work. I thought I'd post my work on here in the hopes of the community making it that much better. ANNIE is completely functional as-is, but I don't like the exact algorithm I used in the backpropagation and she doesn't get as accurate as I would have hoped, right now she seems to output quite randomly no matter how many iterations you train her. She needs a save and load function (the current save function is only for human readability). Overall, I am happy with her skeleton, but the details need to be worked out, and I think the community would do a better job than me. Plus, there are many different types of input and outputs that could be possible (integer, decimal, strings, etc) instead of just binary, which requires a completely different algorithm for each one in terms of running and training the network.

Welp, I think thats pretty much it. Have fun ;)

draw sierpinski triangles

10 August 2010 - 10:36 PM

I found an example in a java book and thought it was cool enough to convert it to GML, check it out. I decided to convert it from recursive to formal for the heck of it. There is no zoom function yet though. Also, note that order 7 is about as far as you can go and it look decent and thats if its a large triangle.

Recursive Version:
/*
Prototype: drawSierpinskiTriangle(x1, y1, x2, y2, x3, y3, depth, color);

Parameters:
x1,y1 - first point of main triangle
x2,y2 - second point of main triangle
x3,y3 - third point of main triangle
depth - positive integer number describing how deep or to which order
to draw the fractal

Purpose:
    The purpose of this script is to draw the Sierpinski Triangle
fractal at a specified depth.

Author: Marcus 'Margoose' Winslow
Date: July 28, 2010
*/
var x1,y1,x2,y2,x3,y3, mx1, my1, mx2, my2, mx3, my3, order, color, old_color;

x1 = argument0;
y1 = argument1;
x2 = argument2;
y2 = argument3;
x3 = argument4;
y3 = argument5;
order = argument6;
color = argument7;

if (order < 0) {order = 0;}

//set color//
old_color = draw_get_color();
draw_set_color(color);

//draw zeroth order//
draw_triangle(x1, y1, x2, y2, x3, y3, true);

order -= 1;

if (order >= 0)
{
    //draw all other orders//
    mx1 = (x1 + x2) / 2;
    my1 = (y1 + y2) / 2;    
    mx2 = (x2 + x3) / 2;
    my2 = (y2 + y3) / 2;
    mx3 = (x3 + x1) / 2;
    my3 = (y3 + y1) / 2;
    
    drawSierpinskiTriangle(x1, y1, mx1, my1, mx3, my3, order, color);
    drawSierpinskiTriangle(x2, y2, mx1, my1, mx2, my2, order, color);
    drawSierpinskiTriangle(x3, y3, mx2, my2, mx3, my3, order, color);
}
draw_set_color(old_color)


Formal Version:
/*
Prototype: drawSierpinskiTriangle(x1, y1, x2, y2, x3, y3, depth, color);

Parameters:
x1,y1 - first point of main triangle
x2,y2 - second point of main triangle
x3,y3 - third point of main triangle
depth - positive integer number describing how deep or to which order
to draw the fractal

Purpose:
    The purpose of this script is to draw the Sierpinski Triangle
fractal at a specified depth.

Author: Marcus 'Margoose' Winslow
Date: July 28, 2010
*/
var x1,y1,x2,y2,x3,y3, mx1, my1, mx2, my2, mx3, my3, order, color,
q, old_color;

x1 = argument0;
y1 = argument1;
x2 = argument2;
y2 = argument3;
x3 = argument4;
y3 = argument5;
order = argument6;
color = argument7;
q = ds_queue_create();

if (order < 0) {order = 0;}

old_color = draw_get_color();
draw_set_color(color);

//enqueue zeroth order//
ds_queue_enqueue(q,x1);
ds_queue_enqueue(q,y1);
ds_queue_enqueue(q,x2);
ds_queue_enqueue(q,y2);
ds_queue_enqueue(q,x3);
ds_queue_enqueue(q,y3);
ds_queue_enqueue(q,order);

while (!ds_queue_empty(q))
{    
    //enqueue all other orders//
    x1 = ds_queue_dequeue(q);
    y1 = ds_queue_dequeue(q);
    x2 = ds_queue_dequeue(q);
    y2 = ds_queue_dequeue(q);
    x3 = ds_queue_dequeue(q);
    y3 = ds_queue_dequeue(q);
    order = ds_queue_dequeue(q)-1;
    
    draw_triangle(x1,y1,x2,y2,x3,y3,true);
    
    if (order >= 0)
    {
        mx1 = (x1 + x2) / 2;
        my1 = (y1 + y2) / 2;    
        mx2 = (x2 + x3) / 2;
        my2 = (y2 + y3) / 2;
        mx3 = (x3 + x1) / 2;
        my3 = (y3 + y1) / 2;
        
        ds_queue_enqueue(q,x1);
        ds_queue_enqueue(q,y1);
        ds_queue_enqueue(q,mx1);
        ds_queue_enqueue(q,my1);
        ds_queue_enqueue(q,mx3);
        ds_queue_enqueue(q,my3);
        ds_queue_enqueue(q,order);
        
        ds_queue_enqueue(q,x2);
        ds_queue_enqueue(q,y2);
        ds_queue_enqueue(q,mx1);
        ds_queue_enqueue(q,my1);
        ds_queue_enqueue(q,mx2);
        ds_queue_enqueue(q,my2);
        ds_queue_enqueue(q,order);
        
        ds_queue_enqueue(q,x3);
        ds_queue_enqueue(q,y3);
        ds_queue_enqueue(q,mx2);
        ds_queue_enqueue(q,my2);
        ds_queue_enqueue(q,mx3);
        ds_queue_enqueue(q,my3);
        ds_queue_enqueue(q,order);
    }
}
ds_queue_destroy(q);//prevent memory leaks
draw_set_color(old_color);

Osg Templates

18 February 2010 - 06:02 AM

OSG Templates

Download Here


This is a set of three templates [or engines?] that can be used to create an one script game
without the hassle of dealing with things such as screen refreshing, io handling, and error
handling. With these templates you can immediately start coding your game. A Registered
Version of Game Maker is required to use these templates. Credit is required for .exes.
Credit is also required in .gmks if you remove my name from the comments. In either case
give credit to Marcus 'Margoose' Winslow. For more information view the
README file in the .zip file.

Features

* A simple "snake" game example has been included for each template (created by me) for learning purposes
* Uses surfaces for screen refreshing
* Each template varies on OSG strictness
* Uses game exit error handling techniques
* Code is well commented and very expandable based on varying needs

Enjoy!

Atom Catcher

23 January 2010 - 11:45 PM

Atom Catcher
An Improvement to Jezzball

See YoYoGames download links for screenshots!


YoYoGames Download Links:

Download Atom Catcher

Download Atom Catcher: HandHeld Edition!
(Entered in Competition05)


Would like feedback! Thanks in advance!

My highest score is 9384, see if you can beat it!

Extending Gm

09 December 2009 - 12:35 AM

Hello everyone! I have been here a long time, and over the years MANY scripts and dlls have been created, most not usable by many, and few usable by most. So I wanted to start a topic all about generating ideas of what the community wants to see, that does not need to be done by YoYoGames. After all, if there were no more need for us to create scripts, dlls, etc, then we might as well tell YoYoGames to delete it off the forum so we don't waste any space! Post your ideas and thoughts or build off someone else's. And remember, this is the ideas and design forum, so keep it as general as possible...don't submit anything that would classify as WIP.