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.


Messages - Josh @ Dreamland

1441
Announcements / Re: Happenings
« on: January 29, 2011, 04:09:07 PM »
You can also put them in the Code::Blocks project or wherever else; there are a number of ways to add functions.

1442
Proposals / Re: ENIGMA Game Format
« on: January 29, 2011, 04:02:40 PM »
I feel the same way about XML, and I felt the same way about INI before I saw it was basically GNOME's .desktop format.

YAML is actually pretty easy to parse, but parsers do backflips and are relatively gross in concept. @Rusky I didn't consider offering multiple formats; I think we should have the specification call for it, but I personally don't want to include multiple parsers. Are you suggesting that the file should give a doctype, or that (1) the reader will be expecting the same format the writer uses and (2) an intervening human would be able to tell which format it was? I'm thinking the latter; doctypes are gross.

As for JSON, I recall that it was very similar to YAML. In fact, looking at sample JSON, it seems that YAML is just an ugly mix between Python and JSON (it uses Python's indentation grouping instead of {} like most of everything else).

So basically,
XML is out of the question unless the specification is to allow flexible formats (in which case ENIGMA will =NOT= be using XML anyway),
JSON is just better-known and more stable YAML and would be a practical consideration (I'll have to modify my YAML parser or strap on a standard one).
INI is an older format and would require compromise on both ends.
YAML makes Ism's skin crawl (the full spec makes my skin crawl) and would involve sizey compromise on either end to support fully, and
eYAML is a concise implementation of YAML that makes only Ism's skin crawl but would be too specific for a general format, thus requiring formats to be optional as per Rusky's proposal.

I am, in general, all for having the text format be up to the extension. However, it seems messy to specify that there is no specified format for these text files, and messier to constrain it to four or so well-known formats without having some doctype, which are nasty.
Should we settle on some means of allowing multiple formats, we still have to choose one for LGM extensions to use (I personally doubt we'll use more than one for just ENIGMA, though we should leave it open for future users to do so).

1443
Proposals / Re: ENIGMA Game Format
« on: January 29, 2011, 05:46:13 AM »
Same as my plans for image formats. Each resource has a text file with the name and any other information that can be left text, and a reference to a binary file in the same directory. I don't have a problem with resources that would use only a binary file and a name simply having such info glued onto the beginning (we could standardize a format for that).

I won't defend YAML. Some of it is glued together. But it's much easier to parse than XML, and it's much easier to read and much harder to fuck up. Assuming INI is the format used in GNOME .desktop files, that is my secondary proposal.

Besides, I think that if the format is to earn the OGF extension, it should utilize a format that every language has a parser for, not just Python. So yeah, how's INI sound?

1444
Proposals / LateralGM extensions; official proposal
« on: January 28, 2011, 10:42:56 PM »
Once ENIGMA has its own format, it will finally be possible for it to include its own resources in outputted game files. That being the case, it is time, as Luis indicated earlier, that LGM offers a less painful method of defining custom resources.

Notice: I am in no way an expert on Java. I speak in this thread solely on authority of designing the C++ backend to potential extensions, which here is not much authority at all. My suggestions are to be taken not as a suggestion for the Java code behind the mechanism, but as the overall concept of the goals thereof.

That said, I think we should first define the goals simply in terms of what has been shown to be needed thus far (namely, by Luis's "Panes" extension proposal and my "Libraries" proposal which will conclude this message).

Before that, terms. For the purpose of this message (feel free to adopt them for your own), the following lexicons will be used:
"Loader" refers to the mechanism which will load extensions to the LateralGM interface.
"Extension" refers to a single unspecified object the Loader is loading.
"Component" refers to an interface element, such as a button or a graphic.
"Node" refers to a resource tree Component.
"MDI" refers to whatever the fuck that Java thing is that houses all the other editor windows.

  • The Loader must allow the addition of a Node or group of Nodes (represented by a folder) into the resource tree.
  • The Plugin must be informed when a tree Node under its control is double clicked. (original proposal said this job was the Loader's)
  • Each extension will be responsible for tracking its own data and creating its own UI elements in the passed MDI context.
  • Each Extension will be given the opportunity to save or load its data when the rest of the game is doing so.
  • Extensions will be given a method of identifying themselves as being instantiable in other resources
     
    • Take, for example, a 3D mesh resource. It would inherit from a class that can be assigned to a GM object as one assigns a sprite or mask.
    • An Extension that can be instantiated in room will be allowed to be placed multiple times, visually.
         
      • Such an Extension should provide a method to obtain bounding box information for placement and clipping, as well as a method to render itself in the room.
      • Extensions that can be instantiated in GM objects should provide a method of obtaining an iconic preview, as sprites do.
  • Extensions must be able to supply a unique ID and a C-structured or easily restructured dump of relevant data to the output executable. If the ID is not unique, backend plugins (Namely, ENIGMA) will be unable to determine what structure they are looking at, resulting in undefined behavior (like segfault). The data must obviously be easily structured per the C spec (like POD) so that ENIGMA can work with them.
  • A method must be provided of accessing any complicated UI Components to the Extensions (Namely, the JEdit class and the GML syntax highlighting context, which should be easily extended or swapped out in a specific JEdit instance). (original proposal said this job was the Loader's)

I have not decided how the C++ backend should be extended, aside from that it must share a list of extension IDs.

What I have decided on is a new resource that will be added, in addition to Panes. R4's introduction called for a resource dubbed "Whitespace" and renamed to "Definitions." Both names suck. I now propose that this be a tabbed, C-code resource, basically offering what simple C IDE's offer (tabs and a code editing pane with simple features).

This proposal is likely incomplete, but I have work tomorrow and should be sleeping. Comments welcome. Comments from Java programmers especially welcome.

1445
Proposals / ENIGMA Game Format
« on: January 28, 2011, 10:19:02 PM »
ENIGMA needs its own format for game storage. GM takes far too long to load and store some executables; I was thinking it would be best to use a format allowing for quick addition, subtraction, and modification of contained resources.

With that in mind, and with the interests of picking a format that works well with Java, I believe our best bet is to use ZIP.

Essentially, .ogf or .egm files would be a compressed directory containing a subdirectory for each resource, which would be in its own format. I was thinking that the format could be largely eYAML; for instance, a sprite would be given a file name reflecting its ID (sprite0000.ey), and would contain a name: and file: attribute indicating, of course, the actual name of the resource and the image file it contains. This way, the format would basically document itself.

Just as easily, however, individual resources could be kept in separate binary files with their own unique formats.

As an option, a manifest file could be kept, but I think it'd be nicer if users could open and manipulate the resources in any zip-capable file browser and text editor. ZIP also reduces the likelihood for total corruption, and there are many tools around which can repair damaged zip files. Plus, since ZIP is he medium of choice for Java, it is unlikely we will encounter such an issue if we are using Java's own ZIP functions for the same purpose.

Any other settings would be stored in the trunk of the Zip, along with the game information and other important metrics.

This concludes my proposal for the egm (ENIGMA) or ogf (Open Game-) format. If you believe you have a better idea, post it here, and I'll call you a trollwe'll have a reasonable debate.

1446
Proposals / Re: Static object variables
« on: January 28, 2011, 03:17:00 PM »
Frankly, I kind of like it better as ::, too. I'll see about supporting all three ( . -> and :: ) for their C++ purposes.

1447
Proposals / Re: do-until
« on: January 28, 2011, 02:10:12 PM »
...

1448
Function Peer Review / Re: move_towards_point
« on: January 28, 2011, 09:50:29 AM »
Correct. Game Maker will complain, hence, ENIGMA is backwards-compatible.

1449
Proposals / Re: unable to parse (obj.variable) = value;
« on: January 28, 2011, 08:26:46 AM »
Neither does C++. But C++ lets you do this:

Code: (C) [Select]
function() = script(); //GM doesn't have references
(double&)varname = 10; //GM doesnt have types
++varname = 12; //GM doesn't have ++
(expression1,expression2,varname) = 10; // GM doesn't allow coma separation in expressions
var + 1; // Error: Assignment operator expected
cout << 1; //Error: Assignment operator expected

So it became a question of how messed up I wanted to allow the syntax to be.

1450
Function Peer Review / Re: move_towards_point
« on: January 28, 2011, 08:21:07 AM »
Indeed. I've managed to make variant work as fast as double, but double is still slower than int. Granted, they are hundreds (int thousands) of times faster than Game Maker, but best practice is to declare them. local int varname; will take care of all your woes.

You can stick a cast anywhere in an expression you like in ENIGMA. Just like ++, or !. Casts are just another unary operator.

1451
Announcements / Re: Happenings
« on: January 28, 2011, 08:15:02 AM »
Yeah, I still need to run that, but I'm afraid it'll gripe that it's not privileged. I'll add that now.

1452
Proposals / Re: mask_index
« on: January 28, 2011, 12:54:53 AM »
I only bothered to set it when Colligma was hooked up. It wouldn't have gone unnoticed for long if it was needed. And hell, Ism's capable of adding it, now. She's done so in the past.

1453
Function Peer Review / Re: move_towards_point
« on: January 28, 2011, 12:54:16 AM »
with (obj) direction=dir, speed=spd; isn't worth porting, considering the corresponding C++ is completely different.

1454
Proposals / Re: Static object variables
« on: January 28, 2011, 12:52:43 AM »
As it stands, ENIGMA uses . for all other access. A single dot will represent the correct choice of GM access (integer.variable), instance access (inst.member), or pointer access ((&inst)->member). I was considering having it resolve scopes as well, but it may require a special flag on results from the type resolver or before the call to it, depending on how I have it structured (An actual 'int' keyword should be distinguishable from an int variable).

1455
Proposals / Re: Multiple Theads, are they a possibillity?
« on: January 28, 2011, 12:48:07 AM »
What I was thinking about doing is adding threading by the same mechanism that I can add instance deactivation. Basically, I would keep a new tree and shit for each thread (deactivated instances get placed in thread -1, which is never processed).

Threading an object would be as simple as saying instance_thread(inst,thread).
Users would be allowed to figure out for themselves that sometimes life isn't as easy as putting everything in its own thread and hoping depth and shit stay in order.