by k__ · 6y ago · 0 comments
I know a bunch of JS game engines, but they all have no tooling.
Mix of events/Javascript in it's simplest form looks like:
https://s1.construct.net/images/v777/refresh/features/learn-...
Documentation for Javascript in Construct 3 can be found here:
https://www.construct.net/en/make-games/manuals/construct-3/...
We're doing special offers for education due to the pandemic:
https://www.construct.net/en/education-support
A key feature for schools is granting access to Construct 3's full features with access codes, meaning students do not need to proivde us with any login details/emails etc which is popular in educational institutes:
I was a bit put off by the subscription model, but that includes a backend service for multiplayer games? Nice.
What are the limits?
https://www.construct.net/en/make-games/manuals/construct-3/...
We also have a build service for paid plans that allows for easy building of your games into deployable signed APKs.
If the subscription is a deal breaker, a lot of users do use our free edition which has a 50 event limit if you use it logged in to a Construct.net account (and a few other limits).
Can I simply check-in a project into GitHub? Are there any special file-types (beside sounds and graphics) that would make this problematic?
Can I use my favorite editor to write the code?
[0] https://assetstore.unity.com/packages/tools/visual-scripting...
[1] https://assetstore.unity.com/packages/tools/visual-scripting...
But thanks for the suggestions!
That not only slows down and locks up both Unity and your entire computer and spins up the cooling fan like a 747 taking off while it's compiling for so long, but it also wastes orders of magnitude more time than what everyone is used to from interactively reloading and debugging JavaScript code, and it totally destroys the flow of getting into the "groove" and iterating extremely quickly and interactively like you can do with web development.
The whole point of UnityJS is to enable you to instantly reload your app and see your changes without recompiling, and use the modern high-quality off-the-shelf JavaScript debuggers built into every web browser to debug your WebGL apps live in a web browser, and your iOS and Android apps live while actually running on the device. And also to benefit from the gargantuan ecosystem of standard JavaScript libraries and the communities and companies that support them, instead of rolling your own half-assed bastard stepchild C# imitation libraries that require constant maintenance and quickly go out of date because nobody else uses them.
There are many application domains, especially AR and VR and accelerometers and cameras, that are impossible to simulate in the Unity editor, and developing them requires quick turn-around and interactive debugging. That's where UnityJS really shines!
Here's a demo of an earlier version of UnityJS integrated with ARKit on iOS for Pantomime:
WovenAR Tools with ARKit and Pantomime
You can't possibly be serious here. You are comparing an ecosystem where the package manager can be gamed to includes malware in your code, where a small project need includes 1000+ libraries some having just one function in them, where core projects used by GAFAM can become unmaintained because of lack of funding, where most modules are created by random developers and will break your code on update to an ecosystem with a two decade old battle-tested extensive base class library made entirely by professionals, maintained by one of the biggest tech corp with a safe package manager. Also breaking API change from third party library are easily detected thanks to the type system.
The existence of bad unmaintained npm modules doesn't detract from the quality and popularity of the many decent JavaScript modules that exist and are widely used and supported.
Take d3, for example. It's excellent, well maintained code, that splendidly solves many practical problems. There is nothing anywhere near as powerful and flexible and well documented and maintained (and free!) as d3 for Unity.
UnityJS lets you use that JavaScript d3 library directly.
Now tell me which C# SocketIO library you use for Unity, and how it compares to the latest greatest version of the standard JavaScript SocketIO library? How many people are actively maintaining it, and how up to date and actively maintained is it? A github link, please?
UnityJS lets you use that JavaScript SocketIO library directly.
A 2gig mobile game should take 20 minutes to build to device tops and that's all from asset compression anyway. Recompiling the code should take no more than a minute unless you're using a potato.
The part of the compilation that actually eats your machine because its the only multithreaded part is the shader compilation, again not C#.
I don't know what kind of toy games you're compiling that take no more than a minute to completely compile and deploy with Unity3D: "2gig" of what, code or just video?
I'm not talking about pressing "Play" in the editor or deploying on Windows or Mac with Mono, I'm talking running it in the browser with the WebGL back-end, or on an iPad with the iOS back-end, using il2cpp and Emscripten or XCode, which are enormously slow and complex.
It certainly does take a long time on my Mid 2014 MacBook Pro (which while not new, is certainly not a potato), and it makes it useless for doing anything else while it's compiling, and spins the fan up to its highest speed and pins the CPU all that time.
A large complex multi player networked AR/VR iOS app like Pantomime with a lot of content including code and libraries and resources and plugins and shaders regularly took me a good part of an hour to compile, build and deploy. Developing UnityJS was my response to that problem, so I could rapidly iterate by changing code and JSON data and other resources, without recompiling.
WebGL and iOS builds are especially slow, because they go through layer after layer of cross-compilers, from C# to CIL with the Mono compiler, and then from CIL to C++ with il2cpp, then the XCode/CLang/Assembler/Linker or Emscripten/WebAssembly chains do their own ridiculously complex things, and there's also a significant amount of time spent packaging and compressing resources and data in various formats and wrappers.
You have to wait not just for the C# code to compile, and for the shaders and the resources to be processed, but for the entire multi-level Rube-Goldbergesque translation and packaging process to finish, then that build must be deployed on your web server or mobile device.
I'm talking about the actual turn-around time between when you make a change to the code, and see the results. You know, the thing you have to do again, and again, and again, and again, and again. So it adds up quickly.
UnityJS drastically slashes that time, however long it takes (and I have a hard time believing it takes no more than a minute for you, unless your app is trivially simple), to just a few seconds of refreshing the web page or quitting and restarting the iOS app.
For fast debugging turn-around, you can tell it to load the JavaScript code, JSON configurations, and other resources from a web server, and edit the code and content live on the server, so the app downloads the fresh JavaScript code, in mere seconds, each time you run it, without any recompiling.
I'm a big three.js fan, but if I was building something where I could get a lot of benefit from placing/configuring objects through a visual editor I'd definitely use PlayCanvas for it.
Finally, old versions of unity had some js support. You could maybe track down one of them, but the support was removed eventually
Not only that, but it's also a compiled language, so has none of the advantages of being able to reload instantly without recompiling for half an hour, or using the excellent JavaScript debuggers built into every web browser to debug and interacting with the code with the console in real time while it runs on the actual device.
It's a very good thing that Unity took UnityScript out back behind the woodshed and shot it (along with "Boo", which was to Python as UnityScript was to JavaScript). It wasn't doing anyone any good, and it was a huge burden for Unity to maintain. People who already knew JavaScript but didn't want to learn C# were screwed because it wasn't really JavaScript so their knowledge didn't apply and their time learning it was wasted, and it prevented or delayed them from learning an excellent language like C#, which they should have done in the first place.
C# has its place, but it's never going to be as quick to reload and run, and as easy to debug and use interactively, as JavaScript.
Another enormous advantage to using off-the-shelf honest-for-goodness authentic JavaScript instead of almost-but-not-quite-entirely-unlike-JavaScript, is that you can easily use all the latest and greatest JavaScript libraries off-the-shelf without any modification. Then you can actually hire somebody who already knows how to use those libraries, too.
A great example is SocketIO (but there are MANY other examples). You can just use the latest standard JavaScript library without modification, instead of desperately shopping around for an adequate C# imitation, finding it only runs on Windows, trying and failing to port it to Unity, finding three different attempts by other people to port or reimplement the same library in Unity that failed and aren't maintained or don't work in the current version of Unity or are incompatible with the WebGL/WebAssembly runtime, and finally spending the time to roll your own, which quickly goes obsolete because you're the only one supporting it.
It's MUCH better to be able to simply drop in the latest version of SocketIO, or the Stripe API, or D3, or whatever you need, and go to town drawing all kinds of graphs and diagrams by copying and elaborating the great examples on observablehq.com, then use those html canvas images on Unity3D textures of 3D objects and user interface overlays, instead of foolishly trying to reimplement D3 in C#.
UnityJS also makes it very convenient to develop hybrid wen apps that are partly Unity3D/WebAssembly/WebGL, but deeply integrated with HTML/JavaScript, so they can send structured messages and data back and forth (including bit-blitting images and buffers of numbers across instead of serializing/deserializing them), and do the text and user interface in HTML/CSS/SVC along side or in overlays, using Angular or React or whatever you like.
Hybrid Unity/Web apps are useful, because Unity doesn't have a decent immediate mode 2D drawing API like canvas or D3, or a decent text/graphics layout engine like HTML/CSS/SVG. (I love TextMeshPro, but it just isn't capable of everything that's so easy to do in HTML, or able to leverage higher level HTML templating or formatting or graphics libraries, or even form inputs. And writing a Unity shader or constructing a dynamic 3D mesh to draw a pie chart is such a silly overkill, when you can do it so easily with canvas or D3.)
Do you want to write code in JavaScript? That’s deprecated.
Do you want to target WebGL? It works but it’s less than ideal. If you want to make a WebGL app, Unity would not be my choice. The tooling used to fall into the “that works, but it’s cursed” category, because it would compile the C# to CIL with Mono, then compile CIL to C++ with il2cpp, and the C++ to JS with Emscripten. I think. If you think this pipeline is “extremely cursed”, well, you’re not alone.
If you want to make a browser game with tooling, there are some better options. Different options for 2D and 3D. You’re going to have to accept some kind of compromise and the ecosystem is a bit difficult to navigate.
And yeah, agreed, it's probably pretty clunky compared to what some WebGL-specific frameworks might give you. I don't know if anything out there has quite the UI setup or polish as Unity though. Do you know of any?
Edit: Saw your edit. That sounds super cursed.
If you’re looking for something with good UI and polish, maybe GameMaker Studio fits the bill? I don’t keep tabs on this space. I use Unity when I’m collaborating with people, and use simpler frameworks when I’m working alone.
Unity also had another language called Boo, which was fake Python which also compiled to the CLR, and we're happy that's dead too.
There's some packages like MoonSharp which will let you write Lua for Unity (modulo some bindings), and a few visual scripting tools too. There's also going to be a native visual scripting tool coming out in the next year or so.
You can't dynamically download and interpret UnityScript code at runtime, or include it in downloadable asset packages.
If you make any changes to your app, you have to release a new version of it, and convince users to upgrade, and you can't just push an update out over the web, like you can with JavaScript.
This comes into play on the Apple app store.
Even if you implemented, say, a Scheme interpreter in C# that could interpret s-expressions at runtime, Apple would not let you publish an iOS app on their app store that downloaded Scheme code and interpreted it. It's not impossible or hard to do, but it's simply against their rules.
On Apple's app store, the ONLY language you're allowed to do that with is JavaScript, running in Apple's own Safari web browser's JavaScript engine.
That is a hard non-technical constraint that there is no way of programming or negotiating your way out of, and it's not going to change any time soon.
The old version of the iOS Safari component, UIWebView, runs in-process, and allows you to call back and forth with native code (it has a nice native Objective C bridge), but it did not have a JIT so it was slow. (Sandboxed iOS apps developed outside of Apple aren't allowed to write to code memory, so JIT compilers are prohibited.)
https://steamclock.com/blog/2013/05/apple-objective-c-javasc...
But the new iOS Safari component, WKWebView, runs in a separate process that Apple trusts, and it has the JIT enabled, so its JavaScript engine is extremely fast and robust, and fully compatible with most modern JavaScript libraries.
But you can't call native code, because it's running in another process, and doesn't support an Objective C bridge.
But you can send messages back and forth (tell it to execute JavaScript code, receive JSON or text messages back from JavaScript, but no directly passing pointers or calling functions).
So instead of using a platform specific Objective C <=> JavaScript bridge like the one Apple deprecated, UnityJS has a cross platform C# <=> JavaScript bridge with a JSON protocol, so it works fine with WKWebKit, without breaking Apple's app store rules.
I love to "actually code" games, but some graphic stuff is a pain to do without GUI.
https://news.ycombinator.com/item?id=19804242
Email: don@donhopkins.com
Goals:
Developing and applying UnityJS, an open source Unity3D C#/JavaScript bridge for rapidly developing and deploying dynamically extensible cross platform Unity3D apps programmed in JavaScript, and efficiently integrating Unity3D with off-the-shelf and bespoke web technologies and services.
Seeking to collaborate with people who can see and benefit from the obvious and subtle applications to rapid prototyping, exploratory iterative development, interactive debugging, live programming, deeply integrating web technologies and JSON with Unity3D, scriptable VR and AR platforms, and delivering open-ended extensible 3D browser-like applications on WebGL, mobile and desktop platforms.
I've been developing and supporting the open source UnityJS core by integrating both popular free Unity and JavaScript libraries (i.e. JSONDotNet, LeanTween, TextMesh Pro, UnityGLTF, SocketIO networking, Ace code editor, d3 visualization library, etc) and proprietary libraries and extensions (i.e. JauntVR SDK, MapBox SDK, your own SDK, or bespoke code that I develop), so they can all be easily and efficiently scripted and orchestrated together in JavaScript.
So far I've applied UnityJS to JauntVR's panoramic VR video player on Android, WovenAR's scriptable AR platform on iOS, and ReasonStreet's interactive financial data driven visualization system on WebGL, and I'm looking for other interesting people to work with on exciting and fitting applications for UnityJS!
https://github.com/SimHacker/UnityJS
https://github.com/SimHacker/UnityJS/blob/master/doc/Anatomy...
Here are some other things I've written about it on HN (in chronological order):
https://news.ycombinator.com/item?id=17309132
https://news.ycombinator.com/item?id=17384078
https://news.ycombinator.com/item?id=18171571
https://news.ycombinator.com/item?id=18860467
https://news.ycombinator.com/item?id=19748582
https://news.ycombinator.com/item?id=20313751
https://news.ycombinator.com/item?id=20744552
"UnityJS", as you call it, is rife with landmines only discovered at run-time, as one would expect from a typeless language.
UnityJS seamlessly supports TypeScript and all the standard JavaScript based libraries, languages, development tools, and linters, just like any browser or node.js server does, while UnityScript is nowhere near compatible enough with standard JavaScript to compile the output of the TypeScript compiler, it's not well supported by many IDEs, it's way behind the latest version of JavaScript, has non-standard half-baked extensions, and it is not capable of running any of the millions of standard JavaScript library, like UnityJS can.
So how do you like the C# and UnityScript debugging tools on the iOS, Android, and WebGL Unity3D platforms?
How does MonoDevelop compare to the standard JavaScript debuggers built into all web browsers, and their interactive consoles and data structure browsers, which support remote debugging of code running on mobile devices?
Can you set a source level breakpoint on your C# or UnityScript code that's running on an iOS device in a WebGL/WebAssembly based browser?
And how long does your typical Unity3D application take to compile and deploy, before you can see the changes you made to your code?
(I know the answers, I'm just asking rhetorically, because you know the answers too: Debugging Unity C# or UnityScript code totally sucks, especially on mobile devices and web browsers, and recompiling it is glacially slow. The MonoDevelop debugger is terrible, and it doesn't even support the il2cpp back-end, which includes iOS and WebGL, and it barely supports the deprecated Mono back-end, and crashes all the time if you can even get it to connect for a few seconds. Those are extremely painful problems that UnityJS solves.)
https://stackoverflow.com/questions/38796203/cant-attach-uni...