Forum Replies Created
-
AuthorPosts
-
Runs OK in my old PC, great work!
In every drawing application there is only one swatch to draw with, a primary and secondary. My idea is to have a random color every time, that is chosen at random out of a set colors.
P.S. The starting code was this. I did expanded the code with by adding a few more tools like spray dots and such. But now I am ready to build a proper brush engine for more control.
Really great design, I can get many ideas from this.
From what I understand this transition will happen only in the VM part.
(Unless I talk about rubbish -> The only who can explain this properly is Mark)Let’s say that you want to avoid compilations-recompilations so you need a VM, what would you choose? In essence we talk about these technologies: CustomImplementation / Python / V8Javascript / DotNet / Java / Lua.
If you take such a programming language and strip away all of the language-syntax-framework-libraries-parser then the only thing that will be left is the VM (nodejs actually runs on V8 VM). Then you can throw whatever instructions there and have them executed.
https://webassembly.org/docs/non-web/
https://v8.dev/So in essence more or less you all know what goes for all of these programming language VMs, but webassembly has been proven to actually work (actually is the one that achieved “ProgrammingLanguageSingularity” -> eg: compile a g++ program from a Linux environment running in your browser and download it and run it on your Ubuntu desktop).
Such examples make webassembly a safe choice.
Perhaps we could create a time module that contains all of that formatting.
To create a generic function for supporting Float and Double?
I have used them more or less but I was not happy with them in terms of 100% code. But I found strong points in using them when needed.
Unreal -> you can get the best graphics – really cool for seeing how the graphics would look like
Unity -> you can do very quick iterations – this helps in early stage of prototyping
Godot -> I have not used it much but I got the feeling of looking like an open source Unity without the bloatware (but I was not impressed from it having GDScript)The real deal for me is that these programming environments where you attach scripts to game objects simply can’t cut it in terms of software architecture. The only engine I did some serious development for 2 years was Unity. But the projects failed dramatically. What I found, is that you will loose the sense of software architecture. And you won’t know what goes where and why the entire codebase is distributed across the entire universe.
The entire development in such engines, forces you to use the composite pattern. So either you will have extend the GameObject of where you can create customized objects, or attach other GameObjects and make tree like structures. So that’s the composite pattern. But where it fails?
The classic problem that created the development hell for me was dealing with such dumb notions:
- should the bullet update itself?
- should the bullet check for collision with the player and enemies?
- should the enemy check for collisions with player and enemies and bullets?
- or should the player check for collisions with enemies and bullets?
This problem is solved by controlling how you want to update the objects. You can do that in Monkey2 easily, simply and them in a global list and perform the collision checks with a double nested for loop statement. But with the other engines mentioned, you see that by attaching logic to game objects is not a good idea.
OK, you might perform this style of programming in these engines but it does not solves all of the problems. Another development hell problem in Unity is mixing presentation with logic. For example consider this scenario:
- you have created a mesh model (eg: a sword)
- you import it – set it up – and now it works
- after a while you realize that the sword is too big (eg: you have the elf sword in the same size as the barbarian sword) so you want to make it smaller
- you do the modification and re import it back to unity
- but now what would you do? replace the mesh manually or use (or use an automation script)
- what happens if you do that with textures, sounds, resources
- what happens if some one else changes the prefab and breaks your script?
Simply the solution is that presentation and code need to be separated for good, not all mixed up together. In Monkey you can control if you want to make your code a mess or purify it. Simply make everything data driven and avoid hard coding it.
Another development hell is testability. What happens when you want to test specific parts of the software without involving irrelevant bloatware? For example you want to check the collision detection code and you create some functions that do only that without involving any other bloat such as audio-graphics-textures-level-game-logic. In Monkey you can call whatever you want any time you want, just rename Main function to Main2 and create lots of test scenarios, the point is to use existing infrastructure. But with other engines you need to create new scenes for each testing scenario, make sure is init correctly from scratch. Chances are that you won’t be able to keep the tests up to date so either you do them once but is a lost effort, or either you avoid testing at all and test things on the spot.
Well, these annoyances were too much for me. I really don’t know if these techniques lead to successful development, but for me is very complicated process. At least by using Monkey you gain programming experience all the time and control the way you want to do things. The downside is that you need more time but at least you get more sharp on what you do.Something else theoretical, if we had the ability to declare custom operators as in Haskell, we would simply use them in interesting ways.
As for example let’s say we would like to have the initial idea of nerobot to append strings. We would write this pure function, “pure” means that the function is stateless (state-independent).
Monkey123Function AppendString:String(from:String, to:String)Return from + toEndOK, we might consider that this code is dump pointless
. Now taking concept further we would avoid this once and for all and use this instead.
123456789101112This is the type signature.(+++) :: String -> String -> StringAnd now here in MonkeyHaskellhere is the function declaration.
Function (+++) : String(a:String, b:String)Return a + bEndAnd then we would use the custom operator, either as Prefix (before terms) notation or Infix (inbetween terms)(+++) "Hello" "Monkey""Hello" (+++) "Monkey"The general idea of using custom operators is to reduce “verbose” syntax. Instead of having a pumped API that makes you bored to hell to use it. You would cleverly create important domain operations and thus create such shortcuts.
I needed these shortcuts…
I first started creating some DebugActions but soon turned out to become a full fledged refactor. I changed my mind and just added these shortcuts right where the actions are declared.
That help dialog box placed there is only for documentation purposes (to not forget about the shortcuts).
Attachments:
You can grab some pieces of code here to create your own binary writer.
It’s not the perfect way to learn unfortunately, I would like to spend more time and create a nice tutorial, but at this point it will get your job done.
P.S. I don’t consider though that you will to distribute your saved game files among devices (say you saved in Android and you want to load on Windows desktop). You will have to think of fighting endian-ness if so.
I did not know about single quote toggling lines, even by reading the source I did not notice that.
Some considerations about improvements.
Option 1: Add menu item Edit>Comment>…
Option 2: Perhaps you would do Ctrl+SingleQuote=Toggle, Ctrl+Alt+SingleQuote=Append, Ctrl+Shift+SingleQuote=ReduceHere’s an improved way to handle commenting behavior. Looks like is the same as Sublime.
Everything is based only on toggling behavior, however the only last case is where Ctrl+Shift+’ is used which is forced uncomment.
The idea for purchasing assets -seeing from myself- it depends on getting the job done and saving me work. I don’t know what I need until I know I need it. But it would be good to start seeing Monkey2 assets flowing all over the place – perhaps if there are more assets it will help many people kickstart their projects.
As for calling DLLs you can see this one I made here, is so simple that it can be used as a reference (though I think I would make a tutorial as well). You can modify it directly with your own function names.
I think that timelinefx and diddy2 frameworks have. You can find them on github.
Hmm, it’s bad that it does not work.
It seems that for android we would have to interface with Java SDK.
-
AuthorPosts
