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 »
751
Issues Help Desk / Re: Errors when using git-bash update
« on: April 22, 2014, 05:19:04 pm »Quote
lol. isn't it what I was supposed to do ? You mentioned using download zip, and I did,Well you were supposed to because I did fixes for you that weren't in the ENIGMA master at that time, but in a separate branch. This causes a "divergence" of sorts as shown in the branch graph (https://github.com/enigma-dev/enigma-dev/network) (the blue line was the particle fixing we did). This means that we basically created 2 separate ENIGMA's and you cannot update one ENIGMA with changes from the other. So what you did was allow me to test changes and I am thankful for that. And after the changes are merged back in into master (they are now), then you will be able to download ENIGMA from zip again from here https://github.com/enigma-dev/enigma-dev and everything should work. Or even better use an updated installer.
752
Issues Help Desk / Re: Are particles working in ENIGMA? Not for me !
« on: April 22, 2014, 05:10:50 pm »
I even suggest using GL1 or GL3 instead of DX, as most people can run those just fine.
Anyway, with all the changes merged DX11 should compile (although without rendering anything just like before). Also Robert will probably update the installer later and all will be good with the world. Or we just broke the whole thing *flips table*.
Anyway, with all the changes merged DX11 should compile (although without rendering anything just like before). Also Robert will probably update the installer later and all will be good with the world. Or we just broke the whole thing *flips table*.
753
Issues Help Desk / Re: Errors when using git-bash update
« on: April 22, 2014, 03:35:14 pm »
The errors are because you overwritten the files with my changes while those changes aren't in the master (they are a separate branch). So you created conflicts this way. Deleting ENIGMA and reinstalling with the installer should have fixed the issue though.
754
Issues Help Desk / Re: Are particles working in ENIGMA? Not for me !
« on: April 22, 2014, 03:32:44 pm »
So it shouldn't have drawn particles right?
Right now I get "graphics_get_texture_pixeldata" which might be because the particle system tries to create a sprite, but DX11 doesn't have this capability right now. So I guess I will commit even these changes, as broken DX11 isn't a tragedy (as it cannot even draw a sprite). At least when you continue to work on it the particle system would work as well.
Right now I get "graphics_get_texture_pixeldata" which might be because the particle system tries to create a sprite, but DX11 doesn't have this capability right now. So I guess I will commit even these changes, as broken DX11 isn't a tragedy (as it cannot even draw a sprite). At least when you continue to work on it the particle system would work as well.
755
Programming Help / Re: iOS/android
« on: April 22, 2014, 03:18:21 pm »
You can't. It's not only about Android SDK/NDK but our code as well. The graphics system Android uses is GLES (GL for Embeded Systems) and that is a graphics system that is not done for ENIGMA right now. We would also need to code platform code like windowing and IO (even though with "windows" I mean something different in Android). On top of that we would need custom functions just to return multi-touch, work with Android interrupts and so on. So there are additions needed to ENIGMA's code and Android NDK cannot compile any C++ to Android.
756
Issues Help Desk / Re: Are particles working in ENIGMA? Not for me !
« on: April 22, 2014, 03:08:16 pm »
Are you 100% sure DX11 worked for you before? Because that system lacks VERY important code to actually run. Even after I did the changes I couldn't compile it because it lacks functions like "graphics_get_texture_pixeldata" which is important for the engine. DX11 was never finished as I know, so I don't see how it even ran for you. Maybe even if it did ran, it should of just showed a blank screen.
Robert, was DX11 operational?
Robert, was DX11 operational?
757
Programming Help / Re: iOS/android
« on: April 22, 2014, 02:52:33 pm »
The big changes with GL3 made it a lot easier to support it in the future (as GLES is a lot closer to GL3 than it is to GL1), but we just don't have the manpower to do it now.
Quote
Mac is completely brokenThose fixes should be quite trivial. Mac in essence is Linux. If you support one you support the other. So the thing broke because we don't have Mac developers or even a lot of Mac users, so testing on that platform is rarely done. But Windows, Linux and Mac should be the three platforms ENIGMA runs on always. And we can technically guarantee that.
758
Programming Help / Re: Using C++ and GML in same project. Why?
« on: April 22, 2014, 02:30:34 pm »Quote
Thanks for the explanations, so in this example if I use the for / loop to read bytes from a big file, it would be much faster ?Yes. There the I/O could be a bottleneck, but you should still see some kind of improvement. So you should declare types whenever you can. The general purpose "var" is very big (can be any size - from 1byte to n bytes, but maybe Josh could say more precisely) and slow (I guess because the compiler cannot easily optimize it like it would basic data types).
Quote
I thought that was the usual way of using FOR with int, it's even documented that way in GM.Where in the GM documentation? I think you missed the point on what I did there. I changed "var" into "int". GM doesn't allow that. It only has "var". I could of changed it into "double" or "char" or "size_t" or anything else if I wanted to. But those types are what makes it so fast.
Quote
Actually you want unsigned int, because it is never negative, or size_t.I personally think using unsigned variables are becoming a bad practice quite rapidly. They generate A LOT of errors, especially for newbies, and so they are not encouraged. They were required when you actually needed the extra "size" (like when int was only 65536), but now when int's are +-2,147,483,647 which is usually "enough". Soon it will be better to just use double everywhere. Like if you wanted the loop to work in reverse:
Code: [Select]
int counter;
counter = 0;
for (unsigned int i=1000000; i>=0; --i){
counter+=1;
}
This is would end up as infinite loop. And most newbies wouldn't even figure out why. I guess this is why there are no unsigned types in Java. Speed wise unsigned and signed is more complex. unsigned can be optimized in some interesting ways (like http://stackoverflow.com/a/12225693) but they can be slower to cast to float (http://plog.sesse.net/blog/tech/2011-07-27-10-37_the_micro_optimization_corner_unsigned_to_float.html).But I guess if you make a forward going loop you should use size_t, as it usually also gives you a good indication on what the loop is doing (that it accesses arrays usually).
Another reason is because you would have to explicitly cast unsigned to signed for comparison. Like if you run ENIGMA the first time (when engine is compiled) the majority of warnings (and there are A LOT of them.. we should probably get on that) is because we compare signed and unsigned variables. If we used signed everywhere we wouldn't have that problem and yet the code would usually run the same (as we don't really go over 2.1 billion mark in resources, instance count, text glyphs (even with Unicode ranges) and so on).
edit:
Quote
for (int counter=0; counter<1000000; ++counter)You could. The reason why I didn't is because an empty for loop sometimes could be just optimized out. Read this: http://punchlet.wordpress.com/2011/07/01/letter-the-eighth-bedevilling-benchmarks/
So while it probably wouldn't do it in Run mode (which isn't optimized) it maybe would do it Compile mode. So for illustrating a point I made it so the loop wouldn't be optimized out.
759
Programming Help / Re: function error
« on: April 22, 2014, 01:31:42 pm »Quote
No, Harri; what he's presented is the number one use case for execute_string.I am aware. But that wasn't the original intention for it. Mark would of just made a custom function for that if he thought it was needed.
Quote
We ought to have functions to look up a resource ID by name. It would require eight bytes of memory by default until first call, at which point it'd build a tree for later use, then use it to look up the sprite.I guess we could. We already store resource names in the exe.
Quote
Variables always exist, legendarysnake. In ENIGMA, the instance creation event is performed after the object creation event, so you can override variables set in create from the instance creation code in rooms. That's the only reason people ever need to use variable_local_exists. Otherwise, use a ds_map.Do variables also exist if the variables are actually used only in step event for example? Like in step you add "a = 0" and in create you add "if (variable_exists("a") .."? Because that should logically return false. The use case for variable_exists() was to check in other scripts if the object had a specific attribute. Like if I had scripts for buttons, I would make a button_add() script and in it the first line would be (if variable_exists("button_grid")==false button_grid = ds_grid_create(0,0)). So by doing this I wouldn't need to have a button_init() script. And while I did that in GM, I find it a bad thing now. And so in ENIGMA I just add _init() scripts instead.
760
Programming Help / Re: Using C++ and GML in same project. Why?
« on: April 22, 2014, 06:20:51 am »
C++ doesn't really differ much from GML syntax wise. So while techincally you can use pure C++ (which as far as I know you still cannot, because the current parser would go insane) there is really no need. You should use EDL though, which is a combination of GML and C++. EDL supports things like specified types which can greatly increase the speed of a game. For example this code:
EDL in the future will also things like structs and classes, but I personally don't miss them in ENIGMA, so I don't really care.
That is why I also often say how you can do whatever you want in ENIGMA and lacking of some single feature doesn't make it unusable or worse. Because in C++ you either write your own or find someone who already has done so, but you don't go to C++ standard committee and tell them how you really want a shader library. So we would like users to write extensions that implement a lot of functionality, not directly needed in the engine. That also allows different implementations by different people. Like the particle system is an extension right now. So it would be possible for another person to write a particle system that uses only GPU and then you would just Enable it and Disable the old one. And whola, without changing anything in your code (or code of the base engine) you got a particle system working in a totally different way.
Code: [Select]
var counter;
counter = 0;
for (var i=0; i<1000000; ++i){
counter+=1;
}
If I put that in step event I only get 74FPS. But if I change "var" to a real type like "int" by doing this:Code: [Select]
int counter;
counter = 0;
for (int i=0; i<1000000; ++i){
counter+=1;
}
I get 2250FPS. That is a performance increase of 30x. In GM you cannot do this as it has only generic variant type (which is the default one in ENIGMA as well). But in EDL by assigning a specific type C++ style you can greatly speed up the code. But then you are in C++ territory and can no longer type 'int counter = 0; counter = "Foobar"' as that would be a compilation error (only generic type "var" can be changed from real to string and string to real).EDL in the future will also things like structs and classes, but I personally don't miss them in ENIGMA, so I don't really care.
Quote
Could someone give me some examples of how C++ code in my projects would benefit me when I have all the GML functions to use?Also, C++ isn't really about "functions". It doesn't have any. It is a programming language, so all it provides is you with syntax and semantic to write something. It does come with some basic functionality (called STL or Standart Template Library) which include data structures like lists, maps, vectors and so on. But usually you either write everything by yourself or you use something others have written (including API's). So imagine C++ basically as ENIGMA without any built-in functions, but only support for Extensions.
That is why I also often say how you can do whatever you want in ENIGMA and lacking of some single feature doesn't make it unusable or worse. Because in C++ you either write your own or find someone who already has done so, but you don't go to C++ standard committee and tell them how you really want a shader library. So we would like users to write extensions that implement a lot of functionality, not directly needed in the engine. That also allows different implementations by different people. Like the particle system is an extension right now. So it would be possible for another person to write a particle system that uses only GPU and then you would just Enable it and Disable the old one. And whola, without changing anything in your code (or code of the base engine) you got a particle system working in a totally different way.
761
Programming Help / Re: function error
« on: April 22, 2014, 05:50:24 am »
Right now nothing. You shouldn't even use it. If you use it just for finding out if something is enabled (like if a unit has "attack"), then make a grid, a list or even better - a map - having all these parameters. Just like you would do in any other compiled language like C++ or bytecode Java. Code like "if (variable_exists("variable") == false) variable = 0;" is bad design and shouldn't be used. That is why GM:S also no longer supports execute_string and variable_exists. They made people do bad stuff with it. Especially when things like execute_string ended up being used for sprite index, which was far from what Mark Overmars made it for.
762
Issues Help Desk / Re: Are particles working in ENIGMA? Not for me !
« on: April 22, 2014, 05:18:02 am »
Well DX11 was never finished (or even close to being finished) so it doesn't even have code for basic drawing. So you shouldn't try to use it.
But DX9 should work. Try deleting /ProgramDATA/ENIGMA/.eobj folder. So it's a clean build. You can also try Build>Rebuild All, which should technically do the same.
When doing a clean build the particle example works for me in DX9. The "undefined reference to" basically means something hasn't been recompiled. If the clean build doesn't work, then try searching for "DX9primitives.o" or any other DX9 .o file it errors about. I had this some time ago, that Windows7 puts files into subfolders and then links them back. So the program finds the files, while the user has an empty directory at that folder. It's some kind of "Security"/Compatibility feature apparently.
But DX9 should work. Try deleting /ProgramDATA/ENIGMA/.eobj folder. So it's a clean build. You can also try Build>Rebuild All, which should technically do the same.
When doing a clean build the particle example works for me in DX9. The "undefined reference to" basically means something hasn't been recompiled. If the clean build doesn't work, then try searching for "DX9primitives.o" or any other DX9 .o file it errors about. I had this some time ago, that Windows7 puts files into subfolders and then links them back. So the program finds the files, while the user has an empty directory at that folder. It's some kind of "Security"/Compatibility feature apparently.
763
Issues Help Desk / Re: Are particles working in ENIGMA? Not for me !
« on: April 21, 2014, 05:14:40 pm »Quote
BTW, DX11 and DX9 does not work anymore with particles I would get a blank screen but initially before a re-install, I would get this:Yes, sorry, apparently I missed something. I fixed it now. The problem is that I didn't see the error before, because I didn't delete the ProgramData/ENIGMA/ folder. So sometimes changes I make to the code aren't actually showing up, so these kinds of bugs can happen. When I asked for a clean build I got the same error and I fixed it. (https://github.com/enigma-dev/enigma-dev/commits/particle_fix) But the bug was only in GL1.
So GL1 and GL3 should work now. DX9 also works for me in that example and several others. But I have noticed that 3D examples like Minecraft doesn't work in DX9. It just loads for a while (a lot longer than it does in GL) and then doesn't draw anything. But I don't think I did that, because that is something I didn't really touch. I also tried current Master (so unrelated to the changes I did in my branch) and I still don't see anything. Robert should look into that. The slow load might be because of a slower getpixel() call (used in the Minecraft example to create the world), but I cannot explain the lack of drawing.
764
Programming Help / Re: function error
« on: April 21, 2014, 03:47:05 pm »Quote
Harri execute_string does return a value, I just tested the following in GM8.1I know it returns a value.
Quote
spr_head = 0 (execute_string() by default return 0)Assignment on the other hand shouldn't. This should "return spr_head=spr_some_head".
765
Programming Help / Re: function error
« on: April 21, 2014, 01:08:40 pm »Quote
var xch,spr_frame,spr_head,spr_body;That code doesn't even make sense, because "spr_head = execute_string('spr_head='+spr_head);" would make spr_head = 0 (execute_string() by default return 0). But why can't you just do this?:
if (image_xscale == 1) xch = floor(x);
if (image_xscale == -1) xch = ceil(x);
spr_frame = sprite_get_name(sprite_index)+'_frame';
spr_head = sprite_get_name(sprite_index)+'_head';
spr_body = sprite_get_name(sprite_index)+'_body';
spr_frame = execute_string('spr_frame='+spr_frame);
spr_head = execute_string('spr_head='+spr_head);
spr_body = execute_string('spr_body='+spr_body);
how it would be replacing execute_string?
Code: [Select]
spr_frame = spr_image_frame;
spr_head = spr_image_head;
spr_body = spr_image_body;
There are many ways you could do this better. Like create a script for each different "model" and on init just run a specific script (which can be dependent on sprite_index if you want), like:Code: [Select]
//scr_init_alien - Script for sprite_index = "alien"
spr_frame = spr_alien_frame;
spr_head = spr_alien_head;
spr_body = spr_alien_body;
And in create event:Code: [Select]
switch (sprite_index){
case spr_alien: spr_init_alien; break;
}
Another method if you really want to do it this way is using sprite_get_name() in a loop. Like:
Code: [Select]
//scr_find_sprite_from_string(sname) - I love very long function names like these :D
var i;
i=1;
while (true){
var sprite;
sprite = sprite_get_name(i);
if (sprite == "<undefined>") return -1;
if (sprite == argument0){
return i;
}
i+=1;
}
Then you can do scr_find_sprite_from_string(sprite_get_name(sprite_index)+'_head'). You should be fine if you use this only when loading or on create. But doing this per-step would be quite slow. And there is no valid reason you should do it per step.
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 »