Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411423 Posts in 69363 Topics- by 58416 Members - Latest Member: JamesAGreen

April 18, 2024, 04:52:27 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)Yae - Game engine for MoonScript, in MoonScript
Pages: [1]
Print
Author Topic: Yae - Game engine for MoonScript, in MoonScript  (Read 7369 times)
deathbeam
Level 0
**


Master Devil Cyborg


View Profile WWW
« on: February 16, 2015, 08:50:38 AM »

Yet Another Engine



Quote
Kaizo: Oh! Even someone with a tender face like yours has a great weapon like that! It doesn’t fit someone like you!
Yae: Eh? This bazooka?
Kaizo: Yeah! If I had that weapon, I could have the power of a million people! Well, give it to me! Give it to me!

An engine you can use to make games in MoonScript. It’s free, open-source, and works on Windows, Mac OS X, Linux, Android, iOS and Ouya.

Installation
Code:
luarocks install --server=http://luarocks.org/dev yae

Getting Started
Documentation
The Wiki contains all the information you’ll need to write game. You can contribute to the Wiki directly here on GitHub! Also, you can view online documentation generated right from the source code.

Reporting Issues
Use the issue tracker here on GitHub to report issues.
« Last Edit: August 18, 2015, 11:24:28 AM by deathbeam » Logged
deathbeam
Level 0
**


Master Devil Cyborg


View Profile WWW
« Reply #1 on: February 16, 2015, 08:51:19 AM »

Update and some demonstration:

So, first thing I need to say that now I am very very close to start adding support for web platform. I made some big changes in source code structure what will enable me to do it without much pain.

GUI module

So first thing on what I was working on in this update was GUI system. I decided to use immediate mode GUI system, because for simple 2D games retained GUIs are overkill imo. New GUI module currently supports only few widgets:
  • Button
  • Label
  • Text area
  • Horizontal scroll bar
  • Vertical scroll bar
Also, for simplicity, new GUI module do not ships with ANY default renderer, you need to create yourown one or use renderer from GUI example project what can be found on GitHub or using gen:gui task. You can for example create label renderer like this:
Code:
this.label = function(id, text, x, y) {
    var color = graphics.getTint();
    graphics.tint('white');
    graphics.print({text: text, position: [x, y]});
    graphics.tint(color);
};

Here is small GIF demonstrating new GUI module:



New example projects

Many people asked me how to do that and how to do this in Non, so I decided I need to create more example projects. Creating example project is simple, you can do it via Nide:



or via gen:<project> task. Current samples included in Non are:
  • require - demonstrates "require" method and modules system
  • GUI - demonstrates GUI system and widgets, comes with nice renderer (you can see it in GUI GIF what I posted above)
  • network - demonstrates networking engine with simple client/server connection
  • physics - demonstrates physics and lights engine
  • pong - demonstrates input and shape rendering
Here is bigger GIF of physics sample:



So, for now it is all.You can download new update from official site or browse the source code.
Logged
deathbeam
Level 0
**


Master Devil Cyborg


View Profile WWW
« Reply #2 on: February 19, 2015, 08:41:08 AM »

So, again, I worked hard on new update. At first, I was working on particle engine, what is feature I promised to make long time ago. So, I decided to use built-in LibGDX particle engine and wrap it around to be usable in Non and in JavaScript. Here is final result:



Then I tried to optimize engine a bit, so I replaced getting globals from JavaScript each frame with storing them in Java backend. This increased the performance a lot. Soon or later I will be moving to V8 anyways, but first I need natives for it and I am lazy to make them and I do not have Mac so I cannot make them for Mac and iOS users :/ Hate you Apple.

I also added few small features and fixed one or two bugs. The biggest feature of small features is threading addition. To create a new thread in JavaScript, you can simply do this:

Code:
var thread = non.thread(function() {
    // Do some asynchronous work here
});

thread.start();

Changelog:

[4.1.0]
- renamed setGraphics(..) method from GUI and particles module to link(..) method
- renamed particleLoader from particles module to effectLoader
- renamed load(..) method from particles module to effect(..)
- added particles sample (usage gen:particles)
- added non.time module
- added threading (usage in scripts: "non.thread(function);" )
- added contacts() method to physics module
- now desktop window title is changed correctly

[4.0.0]
- added self variable to classes
- added particles module (non.particles)
- last API changes for Joints in physics module
- fixed lights module API to match new physics and graphics API introduced in 3.9.0 update
- updated physics example to match new API changes
- removed graphics parameter from gui renderer and added setGraphics(..) method to GUI module
- loading screen resources are now properly cleared after game is loaded
- optimized game rendering code
- now not only assets loading but also game core loading (scripts, configuration) is shown on loading screen
- changed non.getPlatform() method to non.platform variable
- added non.config variable
- optimized rhino engine
Logged
harkme
Level 1
*


Surprise!


View Profile
« Reply #3 on: February 21, 2015, 09:39:35 AM »

When I click the link for the official site it says: "There isn't a GitHub Pages site here."
Logged
deathbeam
Level 0
**


Master Devil Cyborg


View Profile WWW
« Reply #4 on: February 25, 2015, 04:58:27 PM »

Sorry for that, I was updating site. Updated links and info in OP.
Logged
deathbeam
Level 0
**


Master Devil Cyborg


View Profile WWW
« Reply #5 on: February 26, 2015, 09:26:27 AM »

I was working on NON and I moved from JavaScript to Ruby. Also, NON is now available via RubyGems:

Code: (ruby)
gem install non

Above code will install NON command line, so after installing it you can use non like this:

Code: (ruby)
non hello

to generate Hello World project in current directory.

Also, updated website: http://non2d.github.io/
Logged
deathbeam
Level 0
**


Master Devil Cyborg


View Profile WWW
« Reply #6 on: March 13, 2015, 07:07:12 AM »

Hello everyone Smiley New update is finally here.I updated website (again). You can check it here: http://non2d.github.io/. Also, new logo:



So, stop talking, start showcasing.I created new super awesome splash screen which now also logs progress.



Here is example of old method of drawing images and text (with resource loading displayed on splash screen):

Code: (ruby)
require "non/graphics"

def init(assets)
  assets.add :image, "nokia_logo.png"
end

def ready
  @image = Graphics.image "nokia_logo.png"
end

def render(dt)
  Graphics.print "What hath Matz wrought?", position: [10, 10]
  Graphics.draw @image, position: [50, 50]
end

And here is same functionality with new API:

Code: (ruby)
@image = NON.graphics.image "nokia_logo.png"

def draw
  NON.graphics.print "What hath Matz wrought?", position: [10, 10]
  NON.graphics.draw @image, position: [50, 50]
end

Awesome right? Same applies to rest of NÖN functionality. Also, added new file API. Reading from files:

Code: (ruby)
file = NON.files.internal "myfile.txt"
text = file.read_string

Writing to files:

Code: (ruby)
file = NON.files.local "myfile.txt"
file.write_string "My god, it's full of stars"

Also, added support for parsing YAML, JSON and XML files. Small example of parsing YAML:

Code: (ruby)
@file = NON.files.internal "non/config.yml"
@config = NON.files.parse_yaml @file.read_string
puts @config["name"]
Logged
deathbeam
Level 0
**


Master Devil Cyborg


View Profile WWW
« Reply #7 on: March 21, 2015, 04:49:42 PM »

Hey everyone again. I finished API finally so I was able to add back Lua support. Now NÖN can be also installed with LuaRocks:

Code: (lua)
luarocks install non
Logged
deathbeam
Level 0
**


Master Devil Cyborg


View Profile WWW
« Reply #8 on: March 29, 2015, 07:17:24 AM »

Hey everyone!

I released version 0.6.2 of engine. Some major updates are
* updated LibGDX backend to v1.5.5
* updated RoboVM backend to v1.0.0
* updated and optimized Lua backend
* fully documented entire API
* new non.system module
* speeded up engine (a lot)
* fixed all known (and unknown) bugs

To see full changelog, navigate here.

New documentation is uploaded to official site.
You can see full documentation here.

Also, engine have new icon (looks great mainly on mobile devices):

Logged
deathbeam
Level 0
**


Master Devil Cyborg


View Profile WWW
« Reply #9 on: March 30, 2015, 09:19:11 AM »

Hello again Smiley

I finished new version of the engine, v0.6.3. It includes
* new non.system.getSize(), non.system.getWidth() and non.system.getHeight() methods
* new non.graphics.setSize() method what can be usefull for screen cropping
* launcher and splash screen optimizations

Also, I updated documentation with MoonScript examples. Check it here.

Click here to see full changelog
Logged
Fayer
Level 0
**



View Profile WWW
« Reply #10 on: March 30, 2015, 10:40:12 AM »

This is interesting, replying to follow the post.
Logged

deathbeam
Level 0
**


Master Devil Cyborg


View Profile WWW
« Reply #11 on: March 31, 2015, 11:50:26 AM »

Thank you.


Right now I finished new version (v0.6.4). It includes one awesome feature what is unique to every other Lua game engine, and that is direct interoperability with Java. Small example on how to use Apache Commons IO (popular Java library with many IO utilities).

1. We will add dependency to config.yml
Code: (yaml)
  libs:
    - "commons-io:commons-io:2.4"

2. Now, we can use it:

Code: (lua)
function non.ready()
  fsu = non.java.bind("org.apache.commons.io.FileSystemUtils")
  freeSpace = fsu:freeSpaceKb()
end

Code: (moonscript)
non.ready = ->
  fsu = non.java.bind "org.apache.commons.io.FileSystemUtils"
  freeSpace = fsu\freeSpaceKb!

Also, I added documentation for new non.java module here.

Click here to see full changelog
Logged
gianmichele
Level 0
*


View Profile
« Reply #12 on: April 02, 2015, 12:30:58 PM »

Your java binding is really elegant!
Can you get access to all the libGDX API and let's say Spine from that?

I love lua, but how fast is the java VM running it?

Logged
deathbeam
Level 0
**


Master Devil Cyborg


View Profile WWW
« Reply #13 on: April 05, 2015, 10:38:28 AM »

Yes, it is totally possible. And of course it is slower than native Java, but not that much (i had test running 1000 different physics objects interacting with eachother with some lights included on my old Toshiba notebook I experienced only minor FPS drop).
Logged
deathbeam
Level 0
**


Master Devil Cyborg


View Profile WWW
« Reply #14 on: May 10, 2015, 08:15:39 AM »

Hello everyone.

I just wanted to tell that this project is not dead yet (and still under active development). I just do not had time to post updates here. I changed API totatlly to match Love2D API.

Here are some images of running random Love2D games in NON:

[spoiler]







[/spoiler]

Also, here is image of IDE for NON called NIDE what is WIP:

[spoiler]

[/spoiler]

Love2D Passing clouds demo on

- my Android x86 quad-core 2GHz, 1GB ram tablet:
[spoiler]

[/spoiler]

- my Android arm-v7 single-core 1GHz, 512MB ram phone
[spoiler]

[/spoiler]

I want to replace LuaJ with luajava for big performance boost. I just need pre-compiled luajava (along with latest Lua for iOS and for rest of platforms with latest LuaJIT) natives for

* android32
* ios32
* linux32
* linux64
* macosx32
* macosx64
* windows32
* windows64

If anyone is able to cross-compile natives for any of that platforms (for Android it must be for both ARM and x86) it would be great and will save me tons of work. Maybe we can use something like libGDX is doing here but as I do not own Mac I cannot make natives for iOS and Mac OS X.
Logged
deathbeam
Level 0
**


Master Devil Cyborg


View Profile WWW
« Reply #15 on: July 02, 2015, 03:33:11 AM »

Hello again.

I rewrote entire engine in MoonScript. Why? Because now source code can be really familiar to users who want to use this engine, because they will actually understand what is going on.

Also, I created plugin for Sublime Text, which adds support for entire NON build system and API autocompletion. It looks like this:



Also, website got new design again, now it looks awesome, is more clear, lists all important features and shows some more info about engine: http://nondev.io/

It also contains new section, with full NON documentation: http://nondev.io/doc

If you have any questions, post a reply here or come and visit us in our Gitter chatroom Smiley
Logged
hsnabn
Level 0
***


View Profile WWW
« Reply #16 on: August 02, 2015, 02:28:19 AM »

Hey deathbeam.
I really like what I'm seeing here. I'm looking to expand into other programming languages in the future, and seeing how as your engine is basically MoonScript, Java and Lua, it's a healthy way to start learning other languages.
Keep working!
Logged

deathbeam
Level 0
**


Master Devil Cyborg


View Profile WWW
« Reply #17 on: August 02, 2015, 02:55:29 AM »

Thank you Smiley

MoonScript is super simple and awesome language and that is why I choosed it as main engine language. Feel free to visit gitter chatroom or post here if you will have any more questions or ideas how to improve the engine.
Logged
deathbeam
Level 0
**


Master Devil Cyborg


View Profile WWW
« Reply #18 on: August 18, 2015, 11:24:52 AM »

Hello again guys Smiley

I renamed engine to Yae. You can visit new website here. Also, engine now supports LuaRocks, so in project.ml, you can just add

Code:
rocks:
  - luassert

To add dependency for leaser etc.

Stay tuned for new updates and do not forget to join our Gitter chatroom.
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic