Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - TGMG

Pages: 1
1
General ENIGMA / Enigma status
« on: May 27, 2011, 01:38:01 am »
Recently I have been testing enigma to fix common bugs and find out the status of the project. I used all 1092 examples from 64digits.com and converted them to enigma using the new command line interface. Only 970 of the examples tested were actually testable (404, rar files, non game maker examples).
4/970 were too old to be opened by LGM (so should have been ignored) bringing the total possible number of examples to 966


These are the results:
113/966 (11.69%) of games compile without requiring any extra functions
366/966 (37%) of games compile when a header of blank prototype functions is included.


As for the rest of the games which don’t compile, they mainly fall into the following categories:

165/966 fail to no ‘=’ support in expressions such as in if statements (even more fail at runtime due to this problem)

110/966 fail due to resource name errors (such as spaces in resource names)

84/966 fail due to syntax errors (some may not be errors with enigma itself)

77/966 examples have an unknown error which fall into a number of categories but not enough to have a category.

57/966 fail due to no support for switch statements

33/966 examples segfault during the compile phase (tracker link: http://enigma-dev.org/tracker/ticket.php?id=101 )

25/966 fail due to the do until error (tracker link: http://enigma-dev.org/tracker/ticket.php?id=102) Fixed

23/966 fail due to ambiguous functions (tracker link: http://enigma-dev.org/tracker/ticket.php?id=105 )

19/966 fail due to the for ‘;’ error (tracker link: http://enigma-dev.org/tracker/ticket.php?id=106 )

18/966 fail due to direction/speed error (tracker link: http://enigma-dev.org/tracker/ticket.php?id=103 )

10/966 fail due to invalid operands to binary ‘operator%’ error (tracker link: http://enigma-dev.org/tracker/ticket.php?id=104 )




It is worth mentioning that all these games have been processed through a converter before reaching enigma, automatically performing a number of regular expressions to fix common errors (mainly variable names like ‘system’ or ‘fopen’ which are function names).

The database that was created also contains all the functions that are missing in enigma which are required for each game, which may be useful later on to find out which functions are most urgent and which examples only require a few functions to be implemented.

I was thinking of using the database on a website so anyone who was interested could view the list of working enigma examples, or find out about how close an example is to working in enigma (where it fails, which error, functions required). Possibly allowing users to upload there own game and check how far enigma can get with it.

Anyway this post was just to give a little insight into the status of enigma and what are the main issues which need to be fixed.

2
Proposals / Action functions plugin writing
« on: March 01, 2011, 12:08:15 pm »
Currently a few issues are caused by the way the enigma plugin write the actions into gml. Mostly due to the handling of "argument_relative" and possibly the writing of with statements.

Currently the lgm plugin will transform an action that has a relative checkbox into:
argument_relative=true
action_something()

Which causes a problem when the action_if is used without the block actions as it will produce:
if(false)
argument_relative=true
action_something()

So it will always call action_something even when the expression is false.
One way to solve this is to make the plugin automatically put both statements in a block which works fine apart from if statements that use the relative checkbox.
Since some if actions use relative the resulting code for alot of nested if statements would be:
if(action_if())
argument_relative=true
if(action_if_something())
argument_relative=false
if (action_if_something())

Which clearly doesn't work without the block actions.

The action_if_something is just any if action which has a relative checkbox.

So I propose the easiest solution to this would be taking in the argument_relative as an optional parameter for all the action functions, like so:
if(action_if())
if(action_if_something(arguments,true)) //true for relative
if (action_if_something(arguments,false))

You have to implement the action_if actions in order to see this effect otherwise enigma will complain about the functions not existing.

3
Issues Help Desk / Segfalt with enigma compiler
« on: December 29, 2010, 09:44:42 am »
Since I haven't been able to run enigma games on macos or iphone/android recently I decided to test how well the compile process works up to the running stage. I am really impressed with how well the enigma compiler works at the moment, with a small edit to the compiler and a definitions file which contains the empty functions that are needed for the game I was able to almost compile and link all of them. They do require certain modifications (see the errors I posted on tracker recently) such as removing switch statements, editing some of the actions, changing resource names, changing all '=' to '==' in expressions etc

So first the games that I was testing are the top 10 most downloaded on 64D:
1) Platform shooter works (works but have to change = into ==)
2) Online engine works but not server (works but requires commenting switch statements!)
3) gceffects engine (has a variable called write/index! didn't finish replacing all variables)
4) real water (linker error)
5) Jenners platform engine ( works but have to change = into ==,has a variable named free!)
6) Skidmark all (normal and unreg) works (but have to change = into ==)
7) Online highscores (compiles successfully)
8) Dndexample works (drag and drop objects)
9) physics engine v2 (compiles but 2 linker errors sprite_add and _working_directory)
10) segfaults the enigma compiler

I haven't listed all the errors in  the brackets as most have the = to == and require the switch statement removal.

But a few really annoying things kept creeping up, first variable names, alot of game maker games use variables with names like 'index' 'write' 'pow' which won't work in enigma as they have been defined by something else. I gave up replacing all the variable names in the gceffects engine as there was so many.

Another annoying thing is the way people name there resources, some are c++ keywords like 'catch' other contain spaces and more often the sprites have the same name as the objects etc. Which causes a compile error which would be very confusing to new users.

Anyway onto the segfaults, you will need these definitions files to test all of them:
actions: http://enigma.pastebin.com/tBZvy2C6
others: http://enigma.pastebin.com/5JLTHQj8

They also require a change to the enigma compiler:
added to compile.cpp under the rest of them:
Code: [Select]
wto << "enum //font names\n{\n";
    for (int i = 0; i < es->fontCount; i++)
      wto << "  " << es->fonts[i].name << " = " << es->fonts[i].id << ",\n";
    wto << "};\n\n";

    wto << "enum //timeline names\n{\n";
    for (int i = 0; i < es->timelineCount; i++)
      wto << "  " << es->timelines[i].name << " = " << es->timelines[i].id << ",\n";
    wto << "};\n\n";

    wto << "enum //path names\n{\n";
    for (int i = 0; i < es->pathCount; i++)
      wto << "  " << es->paths[i].name << " = " << es->paths[i].id << ",\n";
    wto << "};\n\n";




Now the files:
ackack: http://dl.dropbox.com/u/5072558/segfaulting/ENIGMA_ackackenginev1.7.gm6
server: http://dl.dropbox.com/u/5072558/segfaulting/Enigma_Online%20Engine%20Server.gm6

ackackengine gives:
Quote
Writing modes and settings
Writing object switch
Writing resource names and maxima
Writing events
Checking for default code in ev[2, 0.
Checking for default code in ev[0, 0.
Checking for default code in ev[8, 0.
Checking for default code in ev[6, 50.
Checking for default code in ev[5, 86.
Checking for default code in ev[9, 88.
Checking for default code in ev[6, 4.
Checking for default code in ev[7, 5.
Checking for default code in ev[3, 0.
Checking for default code in ev[7, 10.
Invalid memory access of location 0x28 rip=0x7fff84df19bf

Segmentation fault


online server gives:
Quote
>> Searching for `global` in globj->locals (19 entries)
{ acc_id, argument0, argument1, argument2, argument3, argument4, argument5, argument6, argument7, dll_cdecl, i, keyboard_string, name, pid, servertcp, tcp, ty_real, ty_string, username, end }
Typeless
Invalid memory access of location 0x0 rip=0x7fff84df20aa



Next i'm going to try and look into all the errors that I posted on the tracker and try and fix them if possible, although just the enigma plugin ones related to actions, would have no idea how to implement the parser ones (== and switch statements), and then hopefully do the next 10 which I hope will go much smoother.

4
Proposals / Additions to new platform system
« on: December 24, 2010, 08:22:56 am »
A few things still need to be fixed in the new system in order to get android/iphone/mac to compile and run.
Allowing the platform to specify the output file for the compiler, so that on mac it overrides the file in the mac app file. So basically a parameter in the .ey file which will be the input to the compilers -o parameter. Which is very important for mac as it doesn't output a .app file, it outputs a binary file which needs to be put in a specific location (not in the temp directory).

Also hopefully a setting in the platform for the make target to run when it has finished compiling so that it can run the iphone/android game automatically from the make target.

And the last and most important (as android/mac/iphone/psp can't yet work without it) is specifying the file to write the resources to. On android and mac its at the end of the file just like windows but on iphone and psp its in a .data file, so it would be ideal if this was seperate from the output parameter.

5
Proposals / new Build mode
« on: September 22, 2010, 09:30:01 am »
This is just a suggestion for the future which I think would be quite nice.

The idea is this: click 'play in build mode' it will start the game as a frame in lgm, there will be play pause and stop buttons in lgm toolbar, when 'pause' is clicked it will pause the game and allow it to be edited with lgm. Click play and the changes will be loaded into the game. Also a way to save the game states and load them, so if something doesn't work you can go back and test it again with the changes over and over.

Basically very similar to Unity.

Possible way to implement:

The game can be rendered in an lgm frame fairly easily, Lwjgl does this, and so does the android port of enigma. It just calls the c++ enigma function render() through JNI every frame.
When paused it simply won't call render() so it won't update the game loop, until play is pressed.

Now to allow the changes in lgm to be sent to the enigma game, somehow the enigma plugin needs to be able to execute a function when the save button is pressed for that resource. If that is possible then, simply pass the parameters of that resource (or a bytestream to be read) to a c++ function in enigma through JNI.

Example:
Lets say the user paused the game, opened a sound, loaded a different sound and changed the kind. When they click save it should call a JNI function in enigma to update the data in game.

bool jni_update_sound(index, sounddata, kind, effects, volume, pan, preload) {
// update data for sound index
// could even call sound_replace(index, fname, kind, preload)
}

Now for objects, timelines and scripts or anything else with code.
something similar to: http://www.codeproject.com/KB/cpp/gecko1.aspx?msg=2531522
Where each resource is actually its own dynamic library, when the user clicks save for that resource it will compile it then call a JNI function to reload the dll.

I'm not sure if that would work in practise but it would make it much easier to build games imo.
Just an idea  :)

6
General ENIGMA / Android support
« on: August 14, 2010, 11:04:26 am »
Well after a whole day of headaches I finally managed to get enigma to compile and run on the android :D
It uses the same opengles renderer as the iphone so only need to keep 1 renderer up to date for both of them. I have no idea if it actually runs on the device, I have a feeling that it is using a ton of memory :/
No audio support as android doesn't seem to come with the library, will need to compile it myself I think. Also it needs a special ndk sdk which support the c++ libraries.

Anyway screenshot:


Btw any chance I can get svn commit access and become an enigma developer?

Also what is the best way of passing veriables to the enigma compiler? Atm the target is hard coded in the compiler so it would be nice to have a menu option to select target mac/iphone/ipad/android and various settings such as minimum sdk version and whether to deploy to device.

7
General ENIGMA / MacOSX problems
« on: August 10, 2010, 11:18:36 pm »
I have only made 2 changes to the compiler to get it to compile and run on mac:
OS_Switchboard.h:

Quote
#define TARGET_PLATFORM_NAME "ENIGMA_WS_COCOA"

+  #define TARGET_PLATFORM_ID   OS_MACOSX

Otherwise it will try and look for the windows headers :/
Also:
gcc_backend.cpp:
Quote
-    int failing = better_system(cpath = "cpp", "-dM -x c++ -E blank.txt", ">", "defines.txt");

+    int failing = better_system(cpath = "cpp", "-dM -xc++ -E blank.txt", ">", "defines.txt");

That space makes cpp makes cpp think c++ is a directory :/ Must be an error with cpp on mac as gcc works fine with the space :s

Anyway onto the error..
Enigma finds make/cpp/gcc fine and fills the defines.txt file correctly. But then engima throws out:
Quote
Opening ENIGMA for parse...
ERROR in parsing engine file: this is the worst thing that could have happened within the first few seconds of compile.
             /
            |    |
             \    \
      |       |    |
       \     /    /     \
    \   |   |    |      |
     | /     /\   \    /
    / |     /# \   |  |
   |   \   *    `      \
    \    /   =  # `     |
     |  | #     ___/   /
    /   _`---^^^   `. |
   |  .*     #  =    | \
     |  =   #      __/
    .\____-------^^  `.
   /      #         #  \
  |   =          =     |
  \___    #     #___--^
      ^^^^^^^^^^^

Not found: __GNUC_PREREQ
Not found: __builtin_huge_val
In file included from _types.h: Line 37, position 9: Type definition does not specify a type
code snippet: s, as needed, later.
 */

#ifdef __GNUC__
typedef <<>>__signed char      __int8_t;
#else   /* !__GNUC__ */
typ
------------------------------------------------

Anyway I will continue working on the cocoa part of the engine :)

Pages: 1