Pages: 1 2
  Print  
Author Topic: Where do I find ENIGMA's API?  (Read 5211 times)
Offline (Male) edsquare
Posted on: August 01, 2014, 10:28:11 AM

Member
Location: The throne of ringworld
Joined: Apr 2014
Posts: 402

View Profile
What I mean is this: Is there some place to look and read all the API? Where?

If there isn't, then what files of the source should I look in?
Logged
A child of five would understand this. Send someone to fetch a child of five.
Groucho Marx
Offline (Unknown gender) TheExDeus
Reply #1 Posted on: August 01, 2014, 01:26:01 PM

Developer
Joined: Apr 2008
Posts: 1872

View Profile
What do you mean with API? API usually means using one thing inside another. ENIGMA isn't meant to be used outside ENIGMA.
Logged
Offline (Male) Goombert
Reply #2 Posted on: August 01, 2014, 03:09:23 PM

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 3107

View Profile
Quote from: TheExDeus
ENIGMA isn't meant to be used outside ENIGMA.
Yes but there is no need to limit its capabilities of doing so.

Anyway, here are some places to get started.
http://enigma-dev.org/docs/Wiki/Module_hierarchy
http://enigma-dev.org/docs/Wiki/ENIGMA:Developing
http://enigma-dev.org/docs/Wiki/Graphics_Systems/
http://enigma-dev.org/docs/Wiki/Compilers/

You really just have to use the search functionality of the Wiki, this stuff is all over the place, I haven't really had time to organize it.
« Last Edit: August 01, 2014, 03:41:04 PM by Robert B Colton » Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Male) edsquare
Reply #3 Posted on: August 01, 2014, 04:38:42 PM

Member
Location: The throne of ringworld
Joined: Apr 2014
Posts: 402

View Profile
What do you mean with API? API usually means using one thing inside another. ENIGMA isn't meant to be used outside ENIGMA.

API : Application Programming Inteface ; In computer programming, an application programming interface (API) specifies how some software components should interact with each other.

When you make a program for windows you may need to know several APIs: The API of the software you are using, Windows API, Database API, etc.
so that you can use those applications inside yours, make calls, send files, create, modify, save, delete databases, etc. ; so Enigma's API is not necesary (although it kind of is) for using LGM+ENIGMA but... If you want to call ENIGMA from another IDE and use it then you need to know ENIGMA's API.

What I want to know is how to make enigma work with another IDE, I managed to start the Python one, but I have the same problem as when I start LGM from a desktop shortcut (no way to compile, debug or run a game), also it lacks some buttons that LGM has, since it's made with Python, and since QT changes Python code a lot less than C++ code, I thought I could study it and see if I can finish it at least to the state of LGM (minus bugs and instability I hope). But in order to truly understand the code I need some API reference.


Anyway, here are some places to get started.
http://enigma-dev.org/docs/Wiki/Module_hierarchy
http://enigma-dev.org/docs/Wiki/ENIGMA:Developing
http://enigma-dev.org/docs/Wiki/Graphics_Systems/
http://enigma-dev.org/docs/Wiki/Compilers/

You really just have to use the search functionality of the Wiki, this stuff is all over the place, I haven't really had time to organize it.

Thanks man!
Logged
A child of five would understand this. Send someone to fetch a child of five.
Groucho Marx
Offline (Male) Goombert
Reply #4 Posted on: August 01, 2014, 05:06:10 PM

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 3107

View Profile
edsquare, Harri def. knows what an API is he just didn't know what you meant in context. Using ENIGMA in C++ is pretty easy, just copy and paste ENIGMASystem/SHELL and have your C++ program run make on it and use namespace enigma_user for all GML functions.
Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Male) edsquare
Reply #5 Posted on: August 01, 2014, 05:48:49 PM

Member
Location: The throne of ringworld
Joined: Apr 2014
Posts: 402

View Profile
edsquare, Harri def. knows what an API is he just didn't know what you meant in context. Using ENIGMA in C++ is pretty easy, just copy and paste ENIGMASystem/SHELL and have your C++ program run make on it and use namespace enigma_user for all GML functions.

I know He beats me hands down in programming knowledge, it's just one of those days you know?  :-\

Harri my most sincere apologies if I offended you.  :(

Thanks Robert! a couple more questions: Only gml functions? or any function? So if I want to draw a room the function is in enigmasystem/shell? I just call it draw_room?  ???

Logged
A child of five would understand this. Send someone to fetch a child of five.
Groucho Marx
Offline (Male) Goombert
Reply #6 Posted on: August 01, 2014, 06:31:21 PM

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 3107

View Profile
Haha, don't be hard on yourself he nor I really give a shit, I just like to point out when people misunderstand something, I don't know why I have a phobia of myself or someone else misunderstanding something or anything.

Anyway ed, it requires a tad bit of knowledge of everything. I am not really sure what you mean by draw room, so I presume you mean draw all the instances in the room and clear the background color, and that is handled by screen_redraw which is in Graphics_Systems/OpenGL1/GLscreen.cpp

That function clears the background, the background color, sets the viewport and the default project and runs through every objects draw event. However, for more simpler things such as our variant data type where you can simply include Universal_System/var4.h in your C++ project.
Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Male) edsquare
Reply #7 Posted on: August 01, 2014, 06:42:35 PM

Member
Location: The throne of ringworld
Joined: Apr 2014
Posts: 402

View Profile
Haha, don't be hard on yourself he nor I really give a shit, I just like to point out when people misunderstand something, I don't know why I have a phobia of myself or someone else misunderstanding something or anything.

Anyway ed, it requires a tad bit of knowledge of everything. I am not really sure what you mean by draw room, so I presume you mean draw all the instances in the room and clear the background color, and that is handled by screen_redraw which is in Graphics_Systems/OpenGL1/GLscreen.cpp

That function clears the background, the background color, sets the viewport and the default project and runs through every objects draw event. However, for more simpler things such as our variant data type where you can simply include Universal_System/var4.h in your C++ project.

Lets see if I can explain myself a little better, I want to know how does LGM call to ENIGMA's functions, like to make the room on the ide and how can I search for that in LGM or RadialGM to see if I can understand it and be of some use around here.

Basically what files should I study and what clues tell me if it's a call to enigma or not.
Logged
A child of five would understand this. Send someone to fetch a child of five.
Groucho Marx
Offline (Unknown gender) TheExDeus
Reply #8 Posted on: August 01, 2014, 06:45:50 PM

Developer
Joined: Apr 2008
Posts: 1872

View Profile
Quote
When you make a program for windows you may need to know several APIs: The API of the software you are using, Windows API, Database API, etc.
so that you can use those applications inside yours, make calls, send files, create, modify, save, delete databases, etc. ; so Enigma's API is not necesary (although it kind of is) for using LGM+ENIGMA but... If you want to call ENIGMA from another IDE and use it then you need to know ENIGMA's API.
I know what an API is, but there is no such thing as ENIGMA's API in the usual sense. LGM talks to the .dll via a plugin. I guess you could call the way they talk an API. You should look at compiler source code (\CompilerSource) and the Java plugin source (which is somewhere in Git).
No need to look into \ENIGMAsystem, it's the game engine which has nothing to do with the IDE. The .dll (\CompilerSource) is also technically not connected to the IDE. LGM sends data via the plugin and the .dll sees this data. Then it parsers, writes everything to IDE_EDIT files (which is the generated content) and then calls a makefile so C++ would compile it.

So basically you should look into the Java plugin code and then replicate that, so you know how to send data to the .dll.

Others might help you more on this than I. I have done basically 0 changes for the \CompilerSource in the years I have been here. I have only modified the .exe a little. I work on the game engine.
« Last Edit: August 01, 2014, 06:51:45 PM by TheExDeus » Logged
Offline (Male) edsquare
Reply #9 Posted on: August 01, 2014, 06:54:53 PM

Member
Location: The throne of ringworld
Joined: Apr 2014
Posts: 402

View Profile
Quote
When you make a program for windows you may need to know several APIs: The API of the software you are using, Windows API, Database API, etc.
so that you can use those applications inside yours, make calls, send files, create, modify, save, delete databases, etc. ; so Enigma's API is not necesary (although it kind of is) for using LGM+ENIGMA but... If you want to call ENIGMA from another IDE and use it then you need to know ENIGMA's API.
I know what an API is, but there is no such thing as ENIGMA's API in the usual sense. LGM talks to the .dll via a plugin. I guess you could call the way they talk an API. You should look at compiler source code (\CompilerSource) and the Java plugin source (which is somewhere in Git).
No need to look into \ENIGMAsystem, it's the game engine which has nothing to do with the IDE. The .dll (\CompilerSource) is also technically not connected to the IDE. LGM sends data via the plugin and the .dll sees this data. Then it parsers, writes everything to IDE_EDIT files (which is the generated content) and then calls a makefile so C++ would compile it.

So basically you should look into the Java plugin code and then replicate that, so you know how to send data to the .dll.

Others might help you more on this than I. I have done basically 0 changes for the \CompilerSource in the years I have been here. I have only modified the .exe a little. I work on the game engine.

Well that certainly makes it easier and not  ;D Java? Brrrr! But what can one do? Thanks Harri, this makes it more likely for me to do something for you all (Other than virtual BJobs!  :D ).
Logged
A child of five would understand this. Send someone to fetch a child of five.
Groucho Marx
Offline (Unknown gender) Darkstar2
Reply #10 Posted on: August 01, 2014, 09:06:55 PM
Member
Joined: Jan 2014
Posts: 1244

View Profile Email
This is something I will touch when I get a bit more time, just fooling around with recreating an entire project outside LGM and compiling.  I already know how to generate the EGM file and based on options/system/chosen generate the folder structure and files along with the right source files to be compiled, though certain areas I am clueless about, the structure of RMG files (room files).

I have enough knowledge to help me build a converter which takes an EGM and converts it to a dynamic resource handling, meaning only the resources needed are loaded, meaning you can load projects several GB large and the IDE would be lightning fast and tiny, as the assets are stored externally and called dynamically, my converter would automatically convert an entire project into this, making much smaller files, and games take a fraction amount of memory, where resources are read directly into memory as needed. I plan on writing this entire in C++, and if I'm lucky integrating it to LGM as a plugin (new button / option under build).
But that's far in to the future !  Initially I will be using this for myself, and if all works well, offer it for release.

Also about functions, all the GML/EDL whatever function you use in ENIGMA are actually C++ functions.  Adding your own set of GML/EDL whatever FUNCTIONS to ENIGMA is easy, either as a function or based on  an extension, again, easy to do.

Also, if you are wondering where in the C++ source code you can find a specific function in ENIGMA it is very easy.....

You can use a tool called UltraFileSearch (Lite / FREE for personal use).   Set the starting folder pointing to main ENIGMA folder, search by criteria containing text
and type the function you are looking for,
and hit search.  It will list you all the source
files that contain the function you entered into the search.  So you can immediately know in which header and CPP files are stored the functions you want to modify/fix, saves a lot of time if you don't know where to look.

Also what I am aiming to do is doing like GM Studio does, as opposed to creating a single file, like EGM for example, content of which is passed to the plugin and processed, I would like to eventually be able to have an IDE create the folder structures and files, and have things processed from files stored on disk as opposed to passing along resources by memory.....this will resolve a lot of the stability issues in LGM, and that's how GM Studio does it.  You'd have to save your project first though before compiling or running, that combined with dynamic resource handling and you got yourself a rock solid IDE, smaller, faster, and consuming far less memory.

By your JAVA comment I reckon you are not a fan of JAVA or know JAVA programming ?

Neither do I, but there is apparently an amazing tool that can convert Java to C++ and C++ to JAVA, someone here used it and gave amazing results.  I'd love to get to write an entire IDE to C++ or port it to C++ along with dynamic resource handling and what I talked about above.  One can only dream.

But I thought you knew JAVA !?!?


Logged
Offline (Male) edsquare
Reply #11 Posted on: August 01, 2014, 11:44:11 PM

Member
Location: The throne of ringworld
Joined: Apr 2014
Posts: 402

View Profile
Quote
By your JAVA comment I reckon you are not a fan of JAVA or know JAVA programming ?

Neither do I, but there is apparently an amazing tool that can convert Java to C++ and C++ to JAVA, someone here used it and gave amazing results.  I'd love to get to write an entire IDE to C++ or port it to C++ along with dynamic resource handling and what I talked about above.  One can only dream.

But I thought you knew JAVA !?!?

I'd love to try your converter when LGM works again in my pc.

Me a JAVA fan? No by the stars no and a million times no!  :D

Seriously, I don't know Java, if I wanted to use an interpreted language I would go for Python, tryed reading java code once or twice, and although people say its verbose because its easy to read I much preffer les verbose languages, C++ I'm studying right now so I can't really undertake such an enterprise on said language, Python; dabled on it, it's easy to learn and much more stable than Java (I think), that tool I jave it, as a mather of fact I can convert to and from java to C++, C#, VB, and between those too. so I might take that code and try to use it but... no converter does a full and perfect conversion, there's always some manual labour left, and I don't trust myself with C++, now if we were talking about C#... But someone said they hate C#, or was it .NET languages? If it was the former well there's monodevelop+mono+gtk#  ;D

What I'll likely do is try and finish the Python IDE (GameEditor?) it also needs another name. The other one I'm making (Code name Chimera) in Lazarus-FPC is giving me some problems managing true trasnparency on linux-GTK so I'm redoing part of it and it's not as simple as replacin the controls... Different controls different functions, different calls and so on.  :) Maybe Ill end up doing the python one and rebranding it as Quimera  ;)

If the tool you're talkin is not TSS Java to C++ converter, then I would love to know the name, if only to see if it works better than the one I have.

By the way how can I know in C++ when something is a funtion or a procedure?, you see I also have a C++ to Pascal converter but as already mentioned it doesn't convert everything nor is it perfect, and every time it gets to a piece of code marked as void it leaves the word there so a little help would be apreciated.
Logged
A child of five would understand this. Send someone to fetch a child of five.
Groucho Marx
Offline (Male) Goombert
Reply #12 Posted on: August 01, 2014, 11:50:48 PM

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 3107

View Profile
The reason nobody takes the Java conversion seriously is because you simply can't expect a converter to just take Java code and spit out perfectly optimized C++ they are after all two completely different languages and a lot of the subtleties do make a difference. This is why for us seasoned developers it's easier to just rewrite it correctly from scratch ourselves than to piss around correcting all the issues with generated code. Not to mention if you write it yourself you can take baby steps along the way testing and getting individual features working, instead of just converting a giant 20,000 line project (which is what LGM is) and then trying to figure out how to get all the generated code working. Generators are more work than you are bargaining for is basically what I am saying.


Don't forget, RadialGM I rewrote the GUI components of all of LateralGM's editors in two days. It's not that much work, ENIGMA is just a very large project, and it can't really make progress with so few developers.
« Last Edit: August 01, 2014, 11:52:34 PM by Robert B Colton » Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Unknown gender) Darkstar2
Reply #13 Posted on: August 02, 2014, 12:29:27 AM
Member
Joined: Jan 2014
Posts: 1244

View Profile Email
I'd love to try your converter when LGM works again in my pc.

It's going to be a fully C++ project, at first i'll make it a CLI and later add a GUI if people want to.  That will be a project separate from ENIGMA and I will support only EGM files.

Quote
Me a JAVA fan? No by the stars no and a million times no!  :D
Seriously, I don't know Java, if I wanted to use an interpreted language I would go for

Ok I was confusing you with another user by the name of egofree which contributed lots of fixes and features to LGM....Sorry :D

Quote
Python, tryed reading java code once or twice, and although people say its verbose because its easy to read I much preffer les verbose languages, C++ I'm studying right now so I can't really undertake such an

Only other languages I know are BASIC, ASM6502 - As far as PASCAL I did back in school, but forgot most of it, so I'm settling for C++, OR......a QBASIC version of the LGM lol ! or straight to ASM / binary code even that would be great :D

I'd love to thank YYG**mes for inspiring me to fuel my interesting for programming again without their rubbish I would still be using GM and D&D :P

Quote
different calls and so on.  :) Maybe Ill end up doing the python one and rebranding it as Quimera  ;)

lol.  Nice.

Quote
If the tool you're talkin is not TSS Java to C++ converter, then I would love to know the name, if only to see if it works better than the one I have.

Indeed it's TSS, though I never used it myself so I can't comment on it. From what I heard it does a decent job, and i'm sure nobody here is entering coding contests,
because ENIGMA's code is a mess in some areas and would not win any contest. So i'm ok in using a converter. 

Quote
By the way how can I know in C++ when something is a funtion or a procedure?, you see I also have a C++ to Pascal converter

Difference between function and procedure is very simply.

int addition (int a, int b)
(that's a function - it returns a value)

void decrypt (&bufferFile)
(executes code that will work directly
on bufferFile, nothing gets returned, note
that bufferFile is passed by reference).

Procedures are statements that get executed.  So I can for example code a procedure that will directly decrypt or encrypt a file buffer which was passed by reference, in this case nothing is returned back.  I just ran a procedure.  A function would return something back and usually has stuff that gets evaluated.

You could also run a procedure that executes tasks and passes back whether it was successful or not.  But using VOID, you are not returning any value.  Of course someone will correct me if i'm wrong.

In my upcoming projects I will be using both functions and procedures, :D
Logged
Offline (Unknown gender) Darkstar2
Reply #14 Posted on: August 02, 2014, 12:37:47 AM
Member
Joined: Jan 2014
Posts: 1244

View Profile Email

The reason nobody takes the Java conversion seriously is because you simply can't expect a converter to just take Java code and spit out perfectly optimized C++ they are after all two completely different languages and a lot of the subtleties do make a difference. This is why for us seasoned developers it's easier to just rewrite it correctly from scratch ourselves than to piss around correcting all the issues with generated code. Not to mention if you

yes obviously I am aware of that, but I don't know fuck all about JAVA to even work with LGM's source :D

YET I know enough about C++ to do certain things, to a certain extent, though I am not to your level or Josh's level or Harri's level and so I could not contribute as much as I wanted, and I am NIL in terms of graphics programming so whenever I see stuff like Vertex, gl this Glthat, d3d this and that to me it's Chinese. :P

Where I CAN contribute is optimising LGM and making it more stable and less memory intensive, as it seems the issues are with enigma.jar, frequent testing/running will eventually cause out of memory and other crashes as I mentioned several times with logs etc, and we've established that the problem occurs at the plugin level not LGM itself without the plugin.  So my aim is to get ENIGMA accessing the folders/files directly as opposed to passing shit by memory, which I think is what is causing the issues we talked about in LGM......and besides, that's how Studio does it.

Try opening a really big project in LGM, it can be painfully slow and slow the IDE to a crawl, taking so long to compile, running into errors / crashes ,etc..... That's where I MIGHT, no promises, be able to help.
Imagine opening a multi gigabyte project at the speed of lightning, LGM being lightning fast, not  crashing, compiling being much faster, since it does not have to pack all the resources as they are already packed 1 time and accessed dynamically.  So faster IDE, reduced RAM usage, and being able to make really gigantic games. :D

Logged
Pages: 1 2
  Print