ggibson1's Forum Posts

  • It is rarely true that logic can only be coded one way. So if I know that I can get larger performance gains by architecting the events so that they start off with picking by cell then doing other picking down below then that is how I would do it.

  • The C2 Manual describes calling Javascript using the Browser plugin.

  • After reading the beta post for r155 about Collision Cells it seems to me this would also make a very useful Picker Condition... for example if I have a very large level / layout as is described in that post I would also like to do AI logic less often the further away an NPC is from the player cell without doing a distance check on every single NPC in the layout... there are probably other such things where game devs could reduce work based on these cells.

  • If C2 had an "Extensions Store" then it would happen automatically via simple capitalism. Just like with FLStudio you can go buy a VST plugin (or download a free one) right now correct? That would add an all new synth sound or drum compression or whatever right? Well that required a software developer to make that... and FLStudio didn't have to pay them anything. The VST plugin system allows developers to make money selling them so developers on their own make them.

    You can make plugins right now for C2, but there is no marketplace to make it easy to buy/sell and know that the items in the store has been vetted by Scirra to be of a certain level of quality.

    I have seen some plugins from the RexRainbow plugin / behavior developer I would have paid money for... how many developers would be building things for C2 if they knew there was potential money to be made? And that library of high quality items would attract more game makers willing to spend money because they are intending to make money.

    Scirra can sell their base product super cheap for the hobby game builders like they do today AND make money from a store for people who are wanting to go beyond the hobby phase.

  • When I started writing web apps (1995) No one used CSS... there was no need for it...JavaScript and HTML attributes took care of everything (IE FX and HTML + Time). CSS is basically just an easy mode for doing things without needing JavaScript. C2 is a much more advanced engine than CSS for doing things without JavaScript (unless writing a plugin).

  • 1) The original poster made well thought out and valid comments. Composable modularity is extremely import and leads to many other side benefits... for example Scirra would do well looking into a company called Propellerhead that makes music software called Reason and the Rack Extensions store they made about a year and a half ago... it really helped them make a lot more money because it encouraged REAL developers to get involved (to make money themselves) and it greatly expanded the power of the entire system.

    2) The Scirra people have done a really good job building this development environment. Companies such as Microsoft (and many others) have been trying to reduce the cost to develop software for decades and I have never seen anyone come as close as C2.

    3) I have been coding for over 30 years (Basic, Assembly, C++, VB, C#, SQL, JavaScript, others)

    I took a few weeks vacation during December 2013 and bought C2 so I could take another shot at my childhood dream (making games) that I gave up once I became a young father many years ago. I have been sitting here everyday as if I was going to work (seven days a week and 9AM-11PM)during this vacation.

    So I do not have near the experience with it most of you have, but I have crammed in quite a bit and it is fresh on my mind.

    I will say that I can certainly do just about everything that would be expected from a logic perspective in software without having to resort to JavaScript plugins. That was my #1 concern with C2. I figured they had dumbed it down so much to make it easy enough for beginners that advanced developers would be hindered.

    Even though I can code in my sleep I still bought C2 because I wanted to get something real done without having to dedicate years to it. By time I get home from work my mind is already tired. After these three weeks I can hardly believe how much of a complete "game" I have done as far as functionality goes.

    I spent almost all of my time figuring out how to make my functions and events generic so they are reusable. 99% of this code now can be used for making many different types of games. I am making extensive use of the Family feature and Functions. I also have several arrays for storing all the metadata driving this code (this allows me to customize the code into a specific type of game just by changing the data in the arrays).

    What C2 does NOT give you and neither does Unity or anything else is a replacement for experience in abstract thinking and problem solving.

    I have read several posts in the forums where people were asking questions that made it seem like they did not even try to figure out how to use the tools at hand to solve a problem. It was as if they thought they could click, click, click, click ,drag drop, click, click, click, and then have Metroid or Castlevania.

    The original poster sounded like a pretty smart guy to me, but I bet he just does not have the coding experience to see how Families can be used like Class inheritance and Interfaces. How to abstract out all the logic into data driven functions... and is hoping that using Unity will somehow make his efforts pay off since it is paying off for so many others... and in a sense it will because doing REAL coding will teach him abstract thinking and problem solving... how to effectively use data driven systems instead of hard coding logic... how to use Families to create libraries of reusable Functions.

    Everyone using C2 would do themselves a favor learning how to code JavaScript not INSTEAD Of using C2, but to give themselves better insight into what C2 actually is doing for them and how to use it more effectively... and to see how much time C2 is really saving them.

    Ultimately C2 might not be the right tool for all situations (3D and maybe publishing to XBOX One for example)... however from my meager experience so far the limiting factor seems to be more on the users end (expecting magic and very little effort instead of a tool and hard work).

  • I read that adding new obstacles after a layout loads requires recalcing the obstacle map. I thought this meant that paths would just be calced incorrectly until the map gets regenerated.

    Is it also true that when adding new obstacles that are solids and telling a sprite to follow a path using the old obstacle map that the sprites just ignore the new solids and walk right through them?

    I was trying to have my map get calced with its obstacles at startup and then adding destructible walls on a timer (once) after the layout loads so that once those destructible walls are destroyed the enemies could walk through the space they once occupied... but the enemies pretend they are not there at all and just walk through them before they are destroyed.

    It is as if the solid behavior has no real effect on sprites that are "following a path".

  • If I am using the pathfinding behavior does the obstacle map get regenerated every time I call "Go to layout"? Or do I need to do that manually after going to a new layout?

    Also does "Go to layout" unload the previous layout automatically?

  • LittleStain

    I just converted my app (I wouldn't call it a game yet... more of a test to see how far I can push the Construct2 engine) so now I have a slicker version of the New function that does both Sync and Async and it all seems to be working well.

    I wanted to point out one example of where in JavaScript in the past I have taken advantage of Async callbacks. I am a principal engineer at a large Internet company that has nothing to do with gaming so my experience is with a data analytics app, but still I did some JavaScript coding on it.

    When you make remote calls back to a server such as with JQuery $.ajax calls they are actually async calls. The browser completes that call on a background thread and then does an async callback to a JavaScript function you provide when the Internet server has responded to your request.

    You can certainly mix sync and async methods. However a growing trend in software engineering is building most functionality to be async. This allows future advancement like distributing computing across cores (with threads) or across machines. For example look at the technology from Microsoft called Rx (Reactive Extensions) which has a JavaScript version... Netflix made a Java version to run the code that puts together the lists of suggested videos they show you in their UI...

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • My understanding of how Construct2 creates objects (async vs sync) is largely based on this post (http://www.scirra.com/forum/wait-next-tick_topic65424.html).

    You two bringing up the question (and after everything I have learn in the past few days) I decided to create a new test capx which seems to show that I can call a general purpose function that accepts a string and returns a UID and it can be immediately picked by a Family. So I am not sure what it is they were talking about in that post above.

    Obviously this new capx is just a quick test I did so I am going to start using this new method that is SYNCHRONOUS and see if everything works correctly with it. If so I will change the tutorial (and this post) to not claim that objects are created asynchronously. Async method calls with callbacks (which is commonly used in JavaScript and other languages) is still useful so I will leave the tutorial either way and modify it to show the Sync method as well.

    <img src="https://cwcdfw.bn1302.livefilestore.com/y2pHSSo_OgySsvNt1Qh0kj1_52XJaliqX9BcI_zWL_kUz-0XCwesVEZpwfVcevJlvwwbIaOP-fn87ZB_LjnlHMJ7k9sF0hoZ7q0XpuRNNv5Zz8/CreateSpriteByNameSync.JPG" border="0" />

  • Another point I would like to make for those interested is how nice the idea of Family feature is in Construct 2 once you have decoupled your type from your logic... This gives you the equivalent of "multiple inheritance" in the OOP world. Many languages do not support multiple inheritance, but get around that with the ability to define multiple interfaces on your class and the ability to inherit from one parent class.

    You can have a single object type inherit from several different Families and then "cast" it from one family type to another to reuse the functionality that is available in each family. In the capx you can see an example of this where one of the objects inherits the flash behavior when it is treated as one kind of Family type and then is "cast" to the fade family type and is faded... all without knowing which specific sprite type was being referenced at that moment.

    Lots of opportunity there for code reuse.

  • It definitely is not the same thing. Instead of putting switches all over your code and writing the same code over and over with slight variations with this method you have a single switch which acts as the object table you would normally have made for you automatically when you compile your application.

    To add a new type you copy and paste one of the other switch cases (2 lines) and change the type to the new type... that is it... you do not need to do anything specific to that type else where.

    From then on you can refer to the instance via Family (like is shown in the capx) ... at that point you have decoupled your type from your code so you can start making abstraction layers and reusable functions.

    I really cannot teach 30 years of coding in a forum post, but if you learn OOP programming and go through the experience of making a few large applications that you have to maintain, upgrade, and reuse code across project to avoid bugs and wasted time then you will see the benefits of decoupling your types from your logic... this is why in OOP languages like C++ and C# you have things like Interfaces and Inheritance trees... It is an old problem that professional software engineers deal with all the time... it is something that new developers that are just working on small project never have to consider... this is why I added the tutorial to the "advanced" category ... it is not for new developers or hobbyists.

  • And if the name of the type you want to create is stored as a string of text in an Instance Variable or read in from JSON?

    What you are talking about only works if you HARD CODE the type into the event... look through the forums and you will see many people asking how to do this exact thing.

  • Good idea you two...

    Tutorial:

    (https://www.scirra.com/tutorials/788/asynchronous-callback-object-creation)

  • If I am doing a For Each across all objects in a family how do I get the Name property you can see in the designer property window for each object type?

    I want to log these to the browser console.