RapaNui: a new, open-source, high-level programming framework for Moai

A place for developers to promote games they have created with Moai

Re: RapaNui: a new, open-source, high-level programming fram

Postby Sergeyka » Wed May 02, 2012 5:32 am

Mattia, touch works even when the cockroach is under the newspaper.
http://www.box.com/s/c4aeebe02e2ae1c8d907

How to do so when the cockroach was hiding under the newspaper, touch did not work? In this case, the newspaper is not a rectangular shape and a cockroach will move randomly. It may need to consider a collision the cockroach with a newspaper ?

Help me please :D
Sometimes I use google translate. For example now =)
Sergeyka
 
Posts: 37
Joined: Mon Feb 13, 2012 12:51 pm
Location: Russia

Re: RapaNui: a new, open-source, high-level programming fram

Postby mattfortunati » Wed May 02, 2012 7:26 am

Hi,

@Sergeyka
I've checked the demo, thanks for adding the source.
We implemented the touch ignore for images,but I think you are looking for a sort of "per pixel precise touch".
Mh...
At the moment there is nothing like this in Moai or RapaNui, so, Yes, you may consider to remove the cockroach when it collides with the newspaper.
However I head Moai is going to add a feature like a "precise collision check" to help us in this (and maybe after this we'll implement a "precise touch collision" into RapaNui.

@fderudder
>So far, RapaNui supports only plain XML .tmx files
You are right,we weren't considering isometric maps. Sorry.

>Would you be interested on getting the code when i'll be done with that ?
A parser for isometric maps? Why not! We weren't planning to do this at the moment.
Thanks for this and good luck for your work! Let us know!


Thanks to you guys for using RapaNui. Keep us informed for any news.
Have Fun!

Mattia
User avatar
mattfortunati
 
Posts: 86
Joined: Sat Apr 23, 2011 6:30 am
Location: Rome

Re: RapaNui: a new, open-source, high-level programming fram

Postby fderudder » Wed May 02, 2012 10:42 am

Actually that's 2 different problems

The isometric one is mainly because MOAI doesnt support isometric maps (see that previous post). Paxton hare made a patch. Now combined with RapaNui, it gives results, but it's not perfect. I'll work more on that.

The second part is coming directly from the TMX map format page. Tiled, the software i used to generate those maps (which is widely recommended around here) allows different way to store the map infos (full xml, which you are parsing, csv-based, the one i illustrate in this post, and base64, which encodes the whole stuff in a base64 hash).

Which means that even for a 2d side scrolling level, you can have a csv or a base64 map. You can use a plain xml file, but, even if it's text, this creates ridiculously long files, which are a pain to read as a human being (for instance, my 10*10 iso map writes 100 lines per layer because each tiles must be written, even empty ones), and of course, increases the file size (even if it's not an enormous size, it's still bigger in plain xml - for example, my reference map is 11KB in plain xml, and 2KB in csv format. I let you imagine how it scales on bigger maps, for a 2d side scroller, where you can have very long levels ;) ).
User avatar
fderudder
 
Posts: 7
Joined: Thu Apr 12, 2012 1:35 am
Location: Paris, France

Re: RapaNui: a new, open-source, high-level programming fram

Postby makotok1123 » Mon May 07, 2012 9:18 am

Hello.
I think that I can not so difficult even analysis also base64 CSV.
By using the functionality of the MOAI and lua, can be analyzed without difficulty.

https://github.com/makotok/Hanappe/blob ... Loader.lua
makotok1123
 
Posts: 178
Joined: Fri Jan 06, 2012 11:31 am

Re: RapaNui: a new, open-source, high-level programming fram

Postby anddrewscott » Mon May 07, 2012 11:32 am

anddrewscott
 
Posts: 153
Joined: Fri Sep 02, 2011 7:39 am

Re: RapaNui: a new, open-source, high-level programming fram

Postby mattfortunati » Mon May 07, 2012 2:58 pm

Wow! Thank you for the link andrew! Great!
I'm really happy to see that new people are discovering and enjoying Moai and Rapanui!
User avatar
mattfortunati
 
Posts: 86
Joined: Sat Apr 23, 2011 6:30 am
Location: Rome

Re: RapaNui: a new, open-source, high-level programming fram

Postby zengardenapps » Wed May 09, 2012 8:36 am

Hi everyone!

Is any way to apply a transition to a RNGroup? I've searched around the code of Rapa Nui but I've found any approach, I thought those groups had a transform attached but it seems they don't.

How do you handle transitions to a large group of images?

At this time we're doing this:

local transition = RNTransition:new()

function goToPointA()
for i = 1,myGroup.numChildren do
local PosY = myGroup.displayObjects[i].y + 1500;
transition:run(myGroup.displayObjects[i], { type = "move", delay, time = 3500, alpha = 0, y = PosY})
end
end

But we're sure there is a better (and more elegant) way to do this with Moai & Rapa Nui

Thank you and best regards
zengardenapps
 
Posts: 5
Joined: Sun Feb 12, 2012 4:37 pm

Re: RapaNui: a new, open-source, high-level programming fram

Postby anddrewscott » Wed May 09, 2012 12:49 pm

The reason moving a group won't work is because Rapanui uses MOAIs transition manager (instead of:
(example) group.x = group.x + 1)
to transit:
Code: Select all
  1.  target:getProp():moveLoc(deltax, deltay, time)




zengardenapps wrote:
Code: Select all
  1. for i = 1,myGroup.numChildren do

  2.                 local PosY = myGroup.displayObjects[i].y + 1500;

  3.                 transition:run(myGroup.displayObjects[i], { type = "move", delay, time = 3500, alpha = 0, y = PosY})

  4.         end

  5. end




The code above could be put into RNTransition for when a group is transitioned.
anddrewscott
 
Posts: 153
Joined: Fri Sep 02, 2011 7:39 am

Re: RapaNui: a new, open-source, high-level programming fram

Postby mattfortunati » Wed May 09, 2012 2:54 pm

@andrewscott @zengardenapps
Hi guys, you are right!
Like the RNDirector already does, a good way of applying a transition to all objects in a RNGroup is to iterate all of them and apply them a transition one by one.
The code above could be put into RNTransition for when a group is transitioned.

Yes, it should work fine.
Else you can check RNDirector at line 134 for an example of this already embedded in RapaNui.

Have Fun!
User avatar
mattfortunati
 
Posts: 86
Joined: Sat Apr 23, 2011 6:30 am
Location: Rome

Re: RapaNui: a new, open-source, high-level programming fram

Postby zengardenapps » Thu May 10, 2012 1:11 am

@anddrewscott @mattfortunati

Thank you very much, we're modifying RNTransition to handle this automatically.

Thank you again!
zengardenapps
 
Posts: 5
Joined: Sun Feb 12, 2012 4:37 pm

Re: RapaNui: a new, open-source, high-level programming fram

Postby J. A. Whye » Thu May 10, 2012 5:04 am

I've read all the threads I can find on RapaNui and looked at hundreds (thousands) of lines of code and decided maybe in a few minutes time someone could jump start me and I can stop banging my head against the wall... :)

I modified the Moai SDK pathfinding-hex example to use RNMainThread.addTimedAction() and it worked great, so I know my host works and RapaNui works.

Except I can't get the RN samples themselves to work. And when I tried to start completely from scratch and put an image on the screen I'm not having success.

Let's say I take the RN folder and change main.lua to look like this:

Code: Select all
  1.  

  2. require("rapanui-sdk/rapanui")

  3. local background = RNFactory.createImage("images/background-blue.png")

  4.  



Do I need anything else?

I know in the Moai SDK samples they open a window and create a viewport but looking at the Angry Dogs code I don't see that happening, so assumed RN took care of that.

I'm trying to run this example from the command line, not from inside Xcode. I've changed the directory to my test folder and then try to launch it like this: ../moai/moai main.lua

I did a print("foo") in the code and that gets shown, so I know something's happening, but no window opens, no image is shown, etc.

Could someone head me down the right path? :)

Thanks.

Jay
User avatar
J. A. Whye
 
Posts: 27
Joined: Thu May 03, 2012 4:16 pm
Location: Wasilla, AK

Re: RapaNui: a new, open-source, high-level programming fram

Postby Sergeyka » Fri May 11, 2012 7:38 am

Jay, i execute it:
"E:\moai-sdk 1.0 R3\bin\win32\moai.exe" "E:\moai-sdk 1.0 R3\samples\config\config.lua" E:\MyMoai\Galaxy\main.lua

If the path has spaces, you need to take in quotes. In the test folder must be "rapanui-sdk" folder.

Look at my sample:
http://www.box.com/s/c4aeebe02e2ae1c8d907

p.s. It for windows. I have not macos =)
Sometimes I use google translate. For example now =)
Sergeyka
 
Posts: 37
Joined: Mon Feb 13, 2012 12:51 pm
Location: Russia

Re: RapaNui: a new, open-source, high-level programming fram

Postby J. A. Whye » Fri May 11, 2012 6:47 pm

Thanks for sending that sample code -- at first glance I didn't think you actually answered my question, but then I ran your code and compared it to mine and was very confused, because you and I were doing the (basic) things the same but yours worked and mine didn't.

Then I swapped out the rapanui-sdk folder and discovered when I use the one in your project, my project works. So I must have had an old rapanui download? Or messed it up some how. :)

So thank you!

To anyone following along, no, you don't have to have more than those two lines of code I posted in my original query -- as long as you have a working copy of rapanui-sdk along with it. :)

Jay
User avatar
J. A. Whye
 
Posts: 27
Joined: Thu May 03, 2012 4:16 pm
Location: Wasilla, AK

Re: RapaNui: a new, open-source, high-level programming fram

Postby fderudder » Sat May 12, 2012 12:11 am

To make RapaNui read csv-encoded.tmx, you go in RNTiledMapParser.lua, line #140 and you change the { if .. end } block by the following code.

Code: Select all
  1.  

  2. if node.children.data then

  3.     for key, value in pairs(node.children.data) do

  4.         -- if  we find an attribute here, it's more likely that we are

  5.         -- dealing with a csv or base64 encoded tmx map

  6.         if value.attributes then

  7.             if value.attributes.encoding == "csv" then  

  8.                 -- tmx map is encoded in csv, with layer's tiles' id returned as a string

  9.                 local rowTiles = splitString( value.value, ", " )

  10.                 for i, row in ipairs(rowTiles) do

  11.                     local tiles = splitString(row, ",")

  12.                     for j, tile in ipairs(tiles) do

  13.                         index = ((i -1) *10) + (j-1)  -- 0-based array !

  14.                         map.layers[map.layersSize].tiles[index] = tonumber(tile)

  15.                     end

  16.                 end

  17.             end

  18.         else

  19.             -- full xml based .tmx files

  20.             for key, value in pairs(value) do

  21.                 -- check for all tile nodes

  22.                 if type(value) == "table" then

  23.                     for key, value in pairs(value) do

  24.                         for key, value in pairs(value) do

  25.                             map.layers[map.layersSize].tiles[map.layers[map.layersSize].tilesnumber] = tonumber(value.attributes.gid)

  26.                             map.layers[map.layersSize].tilesnumber = map.layers[map.layersSize].tilesnumber + 1

  27.                         end

  28.                     end

  29.                 end

  30.             end

  31.         end

  32.     end

  33. end

  34.  



I have not worked yet on the base-64, since i had a lot of stuff to do not Lua/Moai/RapaNui related
User avatar
fderudder
 
Posts: 7
Joined: Thu Apr 12, 2012 1:35 am
Location: Paris, France

Re: RapaNui: a new, open-source, high-level programming fram

Postby Sergeyka » Sat May 12, 2012 4:57 am

Jay, in moai 1.0 something changed.

Moai 1.0 r3 + Rapanui(last version of master or dev branch ) = OK :)

If you use the Moai 0.9x then you need the old Rapanui.
Sometimes I use google translate. For example now =)
Sergeyka
 
Posts: 37
Joined: Mon Feb 13, 2012 12:51 pm
Location: Russia

Panning/scrolling smoothness

Postby 01010001 » Sun Jun 03, 2012 2:48 pm

First off, I think RapaNui is GREAT! Thank you for starting such an awesome free project! :)

I'm new to both RapaNui and Moai, so I'm a bit unfamiliar with both of them. My only gripe so far is the smoothness of panning/scrolling. For example, the included Angry Dogs sample game has jerky panning on both my PC (Windows 7) and my Android phone (Samsung Galaxy S II). Is this an issue with RapaNui code being slow or with Moai in general, or my own ignorance? Is there anything I can do to greatly improve panning/scrolling smoothness? It's a pretty critical part of the game I'm planning on making.

Thanks! :)
01010001
 
Posts: 5
Joined: Sun Jun 03, 2012 2:39 pm

Re: RapaNui: a new, open-source, high-level programming fram

Postby ibisum » Mon Jun 04, 2012 1:01 am

Smoothness on Android depends a lot on the phone - and there are tweaks you can make that will improve jitter considerably on Android as well:

Code: Select all
  1.  

  2.     -- fixes for judder on Android

  3.     MOAISim.setStep ( 1 / 60 )

  4.     MOAISim.clearLoopFlags ()

  5.     MOAISim.setLoopFlags ( MOAISim.SIM_LOOP_ALLOW_BOOST )

  6.     MOAISim.setLoopFlags ( MOAISim.SIM_LOOP_LONG_DELAY )

  7.     MOAISim.setBoostThreshold ( 0 )

  8.  



.. this isn't done in every demo/sample.
;
--
ibisum@gmail.com
Got a MOAI snippet? Please consider adding it to http://moaisnippets.info
User avatar
ibisum
 
Posts: 1026
Joined: Mon Oct 17, 2011 1:11 am
Location: Vienna, Austria

Re: RapaNui: a new, open-source, high-level programming fram

Postby 01010001 » Tue Jun 05, 2012 8:56 pm

ibisum wrote:Smoothness on Android depends a lot on the phone - and there are tweaks you can make that will improve jitter considerably on Android as well:
.. this isn't done in every demo/sample.


Thanks. Hmm, I haven't noticed that this has made much of a difference though. I see pretty much the exact same looking jitter on both my PC and my Android phone. I don't think it's my phone since other games (e.g. Angry Birds) works smoothly. Oh, also I did a search inside all of the demo/example files and didn't find any of this code in any of them.
01010001
 
Posts: 5
Joined: Sun Jun 03, 2012 2:39 pm

Re: RapaNui: a new, open-source, high-level programming fram

Postby ^Ben » Sun Jun 10, 2012 11:50 am

Hi guys,

I'm having real trouble getting anything working for Android - I am using MoaiNoa to get my app onto my phone(Samsung Ace) and all I see is a black screen.

Does anyone have any experience with deploying RapaNui based apps to Android that could maybe write a quick guide :)?

Also note that I can deploy other projects to Android using MoaiNoa just fine, it's just RapaNui samples that I'm having trouble with.
^Ben
 
Posts: 1
Joined: Thu Jun 07, 2012 7:56 am

Re: RapaNui: a new, open-source, high-level programming fram

Postby BlueByLiquid » Tue Jun 12, 2012 6:16 pm

Anyone know if the dev branch is stable for larger projects? Is there a roadmap for RapaNui or is it meant as more of an example framework so you can make your own? It is very easy to use that is for sure!
BlueByLiquid
 
Posts: 105
Joined: Fri May 11, 2012 8:54 pm

PreviousNext

Return to Made With Moai

Who is online

Users browsing this forum: No registered users and 0 guests

x