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.
Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 »
736
Programming Help / Re: How to declare variables in ENIGMA?
« on: April 29, 2014, 06:28:37 pm »Quote
In C++ it would be (int)variable right ?Yes, same as ENIGMA. You can also write int(variable) and it is also valid. But I think that can cause more ambiguity problems, so it's usually (int)variable instead.
737
Programming Help / Re: How to do conditional branching in C++ ?
« on: April 29, 2014, 06:25:24 pm »Code: [Select]
not_in_range = true;
while (not_in_range){
if ( in_range_check ) not_in_range = false;
}
Or a while(true) with a break.
738
General ENIGMA / Re: Variable performance
« on: April 29, 2014, 06:23:30 pm »
I know that YYC yields better results than non-YYC. It's actually in the topic I linked to and I mentioned that it's more proper to compare ENIGMA to YYC.
739
General ENIGMA / Variable performance
« on: April 29, 2014, 03:16:02 pm »
Found a GM topic here: http://gmc.yoyogames.com/index.php?showtopic=604444
Some users basically tried to measure several different variable read/write performances. So I though I could compare to ENIGMA. Sadly I don't have YYC so I can't test it, and comparing to regular GM wouldn't really be fair. So this is YYC from the topic:
So here is ENIGMA:
It does seems we are faster at few and slower at others. Comparing the two isn't correct though, as the YYC result wasn't done on my PC. But I do believe some of the iterative methods we have now are indeed slower than YYC could have (as theirs could be coded better, as it is few years newer as well). Just for comparison here is what happens when the "var" is replaced by "int" (so when we declare the type):
We can see that all of the ones which previously used "var" and were slow are now A LOT faster. Some went from 3000us to 0us (to it was not even measurable) while others went from 115000us to 7000us (16x speedup).
Many others didn't change because I can't override things like built-in variables to use int. So I changed only the ones having specific "var" declaration. I also changed the string, so you can actually see which ones were changed. So look for the ones having "int" in the name.
So while there are things we should improve engine wise, we still have the ability to define variables that give a massive speedup. And I encourage people to use them.
This topic was created in the "series" of the other topics involving variables.
Some users basically tried to measure several different variable read/write performances. So I though I could compare to ENIGMA. Sadly I don't have YYC so I can't test it, and comparing to regular GM wouldn't really be fair. So this is YYC from the topic:
So here is ENIGMA:
It does seems we are faster at few and slower at others. Comparing the two isn't correct though, as the YYC result wasn't done on my PC. But I do believe some of the iterative methods we have now are indeed slower than YYC could have (as theirs could be coded better, as it is few years newer as well). Just for comparison here is what happens when the "var" is replaced by "int" (so when we declare the type):
We can see that all of the ones which previously used "var" and were slow are now A LOT faster. Some went from 3000us to 0us (to it was not even measurable) while others went from 115000us to 7000us (16x speedup).
Many others didn't change because I can't override things like built-in variables to use int. So I changed only the ones having specific "var" declaration. I also changed the string, so you can actually see which ones were changed. So look for the ones having "int" in the name.
So while there are things we should improve engine wise, we still have the ability to define variables that give a massive speedup. And I encourage people to use them.
This topic was created in the "series" of the other topics involving variables.
740
Issues Help Desk / Re: IDE tranparency flag issue
« on: April 29, 2014, 01:56:30 pm »
I think EGM should be the default formar. Or gmk (even though it doesn't support many options), because caveats in GMX can hurt new users.
Also, why can't you just create a folder when the user saves GMX? Like if the user types "mygame.gmx" you create a folder mygame (if it doesn't exist) and put everything in it? Or just show a pop-up for the user saying that it will write many discrete files to the selected folder.
Also, why can't you just create a folder when the user saves GMX? Like if the user types "mygame.gmx" you create a folder mygame (if it doesn't exist) and put everything in it? Or just show a pop-up for the user saying that it will write many discrete files to the selected folder.
741
Programming Help / Re: How to declare variables in ENIGMA?
« on: April 29, 2014, 01:50:47 pm »Quote
I took this simple example from http://enigma-dev.org/docs/Wiki/GlobalThat example is wrong. It probably was meant to be "global var" instead of just "global". So this is how it's right now:
1) Use "global.variable;" or "global var variable;" to create a global variable (if you use the version with the dot you will have to write it everywhere).
2) Use "global int variable;" to define a global integer, or any other type (so the template is "global type variable;").
3) Use "int variable;" to declare TEMPORARY (just like "var") integer variable (so the template is "type variable;").
4) Use "local int variable;" to declare an integer variable in the local object scope (so the template is "local type variable;").
So basically "var" is a type, not a keyword. So wherever you use "var" you instead can use another type. So "global var" turns into "global double" for example. Or "global string" or "global unsigned". And just like "var" it will create a temporary variable (limited to the scope of the script) if the "local" keyword is not used.
Quote
Very strange, i tried to modify my variable declaration to do some tests. In the end, i tested again my code :That is one of a million parser bugs. That's just because you have declared the same global twice and in the object it tries to use the local one. Just comment out or delete the duplicate code either in the script or the object.
Quote
Does it mean if I decrease a variable and i goes below 0 it will not be negative?No it wouldn't be. In ENIGMA for some reason this returns 0:
Code: [Select]
unsigned int myvar = -100;
But that is a bug in assignment. If you do any arithmetic on it then it works fine. Meaning usually in all programming languages variables can overflow (http://en.wikipedia.org/wiki/Integer_overflow). So if a char can hold 255 values, then 256 would equal 0 and so on. So in ENIGMA this prints 255:Code: [Select]
unsigned char myvar = 255;
show_message(string(myvar));
But this prints 4:Code: [Select]
unsigned char myvar = 255;
myvar += 5;
show_message(string(myvar));
Even though I just added 5 to 255. That is because "(255+5) mod 256 = 4". So it "wraps around" the maximum value. The same with integers. Like an unsigned integer cannot be negative, so this results in a very large number:Code: [Select]
unsigned int myvar = 10;
myvar -= 20;
show_message(string(myvar));
This will print INTEGER_MAX_VALUE-20 (which is more than 4.2 billion).Quote
int unsigned myvar;Usually the "unsigned" is before the data type. So it's "unsigned int".
Quote
it would be by default signed ?Yes.
All the regular C/C++ stuff applies in ENIGMA and its variables. So I suggest googling like a beginners tutorial in C++ and learn about variables. ENIGMA is only different because we have scopes like "global" and "local", but those don't change the variables. Only from where they can be accessed.
Quote
Ok, but I'm still pretty sure 4.5 integer would not make sense in any BASIC compiler that I know of, I think you're just remembering wrong.Casting float to an integer is usually valid in any language. That is usually done constantly (and we do that all the time in ENIGMA).
742
General ENIGMA / Re: Inheritance Fixes
« on: April 29, 2014, 07:07:16 am »Quote
As objects inheritance should work without any problems right now, i think we should remove this option, and have objects inheritance always activated. Otherwise new comers (usually they are already GM users), will try to load their projects and think objects inheritance is not working.There are many, like me for example, that don't use inheritance EVER. So removing the possibility to disable useless functionality isn't a good idea. Especially if the option works. So default behavior could be changed, but I doubt this should be removed.
I have used GM since about 2002 and I have actually used inheritance once, when I was following a tutorial.
743
Programming Help / Re: function error
« on: April 28, 2014, 04:30:49 am »Quote
the solution is to set it to -1 in the create event and check that in the script or whatever.But then if I try to make it a "system" (or something akin to a "class"), then I shouldn't make the user set some random inner data structures in their create event. The whole point was that a user includes the scripts and calls button_add(...) in create and buttons_draw(...) in draw. In this case it is better to either set up everything in button_add() (which requires checking if something exists) or to create a button_init() script.
Maybe a better way would be to create a new object like obj_buttons that works like a class. And then when calling button_add() you check whether the object exists and if doesn't, then create it. If it does then add a button to it. But I wanted my scripts to allow adding buttons to many objects (so for each menu I would have a controller object having the buttons).
If we implement C++ classes, then I would probably use those.
Quote
var ass = 4;That shouldn't even work in C++. You have to use (or in fact only CAN use) delete if you use "new". If you never used new, then using delete is a good way to segfault. It should be something like this:
delete ass;
Code: [Select]
var* ass = new var();
delete ass;
744
Programming Help / Re: Not able to set or get userdefined variables with unique values for instances.
« on: April 27, 2014, 11:56:12 am »Quote
You can keep lists of instances, as you are doing. But if you already have the ID of some instance, then looking that ID up in the list is probably not what you want to do. Instead of un = ds_list_find_value(t0_list,up); un.image_index = 1;, try just using up.image_index = 1;. In your code, un is the index of the instance in your list, which is local to your list, while up is how ENIGMA refers to the instance.He doesn't hold instance ID in up. He holds an integer from 0 to ds_list_size(t0_list). So up.image_index won't work. So what he is doing now should theoretically work. And it works in the example I made.
I think he should give an example, because the code he has given is basically the "Object information" and changed it to show several objects. If that is not the case and that really is object information for obj_unit, then the problem is that he has a list in every obj_unit. And then he somehow tries to access it from other obj_units even though only one had it. So he implemented both the unit object and the unit controller object in one object. So I think there is something wrong with the way he implemented the whole thing in just one object.
745
Programming Help / Re: Does ENIGMA support command-line args ?
« on: April 27, 2014, 05:45:55 am »Quote
GAME.EXE /cheat /secretsThat will return two parameters, so parameter_count() will return 2. Then parameter_string(0) will return "/cheat" and parameter_string(1) will return "/secrets".
746
Programming Help / Re: Not able to set or get userdefined variables with unique values for instances.
« on: April 27, 2014, 05:43:06 am »Quote
if I have to access it outside the object that created it I would add prefix object_name.instance_id.variable?You never add object_name. Instance_id is unique to each instance no matter what object they are. So instance_id.variable will work. object_name usually returns the oldest existing instance, so object_name.instance_id.variable would be like id.someotherid.variable, which is pretty much undefined.
Can you maybe post an example? I just tried adding instances to lists and changing them and it works fine for me.
Try this: https://www.dropbox.com/s/oaiuuppj2htmvnw/unit_test.gmk
747
General ENIGMA / Re: LateralGM 1.8.5
« on: April 27, 2014, 05:34:15 am »
In Event Selector I cannot add Key Pressed -> press <Enter> event. Same with Key Released.
748
Programming Help / Re: How do I do AI path finding in ENIGMA ? A*
« on: April 24, 2014, 03:05:18 am »
There was an example in the EDC. You can get it here: https://dl.dropboxusercontent.com/u/21117924/Enigma_Examples/MotionPlanning/motion_plan.gm6
I just tested it and it works, but debug drawing is a little off right now. Like draw_path() doesn't work, but that is also because of total rewrite of several systems. Maybe I will fix that later.
But the pathfinding itself works.
edit: It doesn't work for you because you use path_start, which has never worked (because of technical reasons). That has also mentioned many times.
Second thing is that your grid was too large. The blocks ended up being too fat. To make it work I had to reduce grid size by 2. You could probably fix it by offsetting as well. There is possibility a grid populating bug (as in it populates more cells than required), but I cannot see that until I fix debug. I don't have time to do any of that right now.
You example fixed: https://dl.dropboxusercontent.com/u/21117924/Enigma_Examples/MotionPlanning/MPTest1.egm
I just tested it and it works, but debug drawing is a little off right now. Like draw_path() doesn't work, but that is also because of total rewrite of several systems. Maybe I will fix that later.
But the pathfinding itself works.
edit: It doesn't work for you because you use path_start, which has never worked (because of technical reasons). That has also mentioned many times.
Second thing is that your grid was too large. The blocks ended up being too fat. To make it work I had to reduce grid size by 2. You could probably fix it by offsetting as well. There is possibility a grid populating bug (as in it populates more cells than required), but I cannot see that until I fix debug. I don't have time to do any of that right now.
You example fixed: https://dl.dropboxusercontent.com/u/21117924/Enigma_Examples/MotionPlanning/MPTest1.egm
749
Issues Help Desk / Re: Are particles working in ENIGMA? Not for me !
« on: April 23, 2014, 04:38:03 am »Quote
Was I right to add draw_self(); in draw event after the draw_text ? That's the onlyYes, you need to draw the sprite when using the draw event. This has been true since the very beginning of GM (I guess version 1.0) and is clearly documented. http://docs.yoyogames.com/source/dadiospice/000_using%20gamemaker/events/draw%20event.html
thing that allows the sprite to display properly, otherwise only the text gets drawn and no sprite, and yes even without the draw self the text still exhibits the bug.
Also draw_self() is not listed on your wiki.
Quote
the default draw, which is when you define the sprite in the object properties and place no actions or code in the normal draw event, in which case GameMaker: Studio will draw that sprite, but note that any transforms you perform in other events to change the image scale, index, blending etc... will be reflected too as long as the draw event is empty.It even describes exactly your example in the "Custom draw" part.
the custom draw, which is when you place code or actions in the draw event. This is telling GameMaker: Studio "I want to control what you draw for instances of this object" and it completely over-rides the default draw. This means that you can have an object with a sprite assigned, then set the draw event to draw text and the sprite will not be drawn as you have not told GameMaker: Studio to draw it.
Also, a lot of things are not documented in ENIGMA wiki.
Quote
Blank screen, so does DX11.We already determined that blank screen is all you will ever get in DX11. It just doesn't have any code associated with drawing. It cannot load textures, it cannot draw sprites. So you just hallucinated previously. So testing with DX11 is not required as you will not ever see anything until it's properly finished (which can be in a time frame from "a month" to "never").
Robert, can you test DX9 in the newest master? I cannot replicate his blank screen in the particle example. I can replicate it in 3D examples, but that was like that before I touched anything.
750
Issues Help Desk / Re: Are particles working in ENIGMA? Not for me !
« on: April 22, 2014, 06:41:40 pm »Quote
BTW, wouldn't a person need GL3 compliant hardware to run GL3 ? I'm assuming most people can run OGL1While for some reason this project is some kind of magnet for bad hardware, usually in the wild you will not be able to find anything that cannot run GL3. If you try reading stuff on Stackoverflow, then even back in 2011 people were suggesting targeting GL3.1. So in 3 years I guess there is virtually no reason to. All Intel (the only culprit) GPU's that are built into CPU's also support GL3 just fine. Just like AMD CPU's do. They even support GL4 since about 2012. So there is really no reason not to use GL3. But if you don't do anything GL3 specific (like shaders), then you can run with GL1 and it might even be faster. On Windows you can use DX as well. I just mentioned that because GL is usually better maintained here.
Quote
Also, Harri, I want to take a second to mention, we are not going to drop support for the collision detection with particles, we can very easily optimize it out, colliding particles is actually a new feature of Unreal Engine 4 they do it in hardware though using OpenCL.We have deflectors and attractors now (I think) and I don't plan to remove anything. I don't think they have general purpose collision detection though. If we want to make GPU based particle system then I suggest it to be a different extension (also for compatibility). UE4 thing is cool, but I am not sure they use OpenCL though. I do know they have a clever use of depth buffer for collisions as seen in this video (https://www.youtube.com/watch?v=RURQSR788Dg), but I think they use the buffer in shaders to update particles.
Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 »