Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Oomek

Pages: 1 ... 17 18 [19] 20 21
271
Themes / SILKY Theme v0.6.9 beta
« on: March 13, 2017, 01:00:34 PM »
SILKY Theme v0.6.9 beta


Features:
- silky smooth animation ( stuttering on the video is caused by the recording software )
- adapts to all horizontal resolutions with pixel perfect positioning
- configurable number of snaps in Layout Options
- rewritten animation module from scratch
- rewritten conveyor from scratch ( I use my carrier.nut module )
- custom dialogs
- configurable colour scheme in Layout Options
- colour randomizer ( assign a button to "Custom1" in AM Controls )
- I used genre icons from Game Station theme. I hope the autor doesn't mind. I was inspired by his work anyway. Only the genre displaying function was taken from his code.

Note: Colour randomizer scheme is overriden on launching AM by the colours set in Layout Options. If you want the scheme to be permanent, leave Colours blank in Options, or copy the values given by the randomizer to Layout Options.

REQUIREMENTS:

- the latest Attract Mode nightly build
- snaps and videos on the SSD for smooth scrolling
- set selection_speed_ms  51 in attract.cfg












YOUTUBE DEMO VIDEO:

https://youtu.be/qs49MDNx5wY


CHANGELOG:

18/04/2017
 - Fixed a bug causing layout error in colour randomizer

17/04/2017
 - Improved readability of small fonts in resolutions 800x600 and below
 - Added ability to set a delay in seconds after which the game list autohides. Setting it to 0 disables autohiding.
 - Further speed optimizations

13/04/2017
 - Game List Rows added to Layout Options
 - Snap list show/hide added to Layout Options
 - Fixed flyer trigger so it does not slow down animation

21/03/2017
 - Initial Release


Please download the latest nightly build of Attract Mode
https://build.btolab.com/project/attractmode/

In case of a "502 Bad Gateway" error here is an alternative link to the Windows build from 07/04/17
https://mega.nz/#!DoFTmLyI!_qm79iHXoSQSwveyO9XYzdiGPyyPqQAfASpINNrlgQk


DOWNLOAD:

272
Scripting / Re: text alignment in AM is completely off
« on: March 12, 2017, 12:30:52 PM »
I'm aware of that wiki page. Unfortunately it doesn't explain how to overcome the misalignment of text in relation to the text box

273
Scripting / Text alignment in AM is completely off [SOLUTION]
« on: March 12, 2017, 07:51:49 AM »
Is there any way to make text alignment in AM more coder friendly?
Setting Align.Left does not make the text to be aligned to the left. The y offset is wrong too. What's even worse the gap changes depending on the font type used, so it's practicaly impossible in AM to make a neat theme which scales to various resolutions. I need to compensate the gap and vertical alignment manually in pixels which destroys scalability.


274
I've uploaded the first version to github. Ready for grabs in the first post.

275
Scripting / Subpixel positioning
« on: March 05, 2017, 08:05:23 AM »
How to make AM to position object with subpixel accuracy?
When I move an image the content moves with subpixel filtering, but the frame of a picture is snapping to pixels.
The same happens with text boxes

Run this code and see. It will jump in 1 pixel increments instead smoothly transitioning across the X axis.

Code: [Select]
local test = fe.add_text( "", 0, 0, 32, 1080)
test.set_bg_rgb( 200, 200, 200 )

fe.add_ticks_callback( "tick" )
function tick( tick_time ) {
    test.x += 0.01
}

276
I found a bug in Attract Mode causing snaps updates to be late by 1 frame when using nested surfaces. That mans I'll have to unfortunately postpone the Carrier development until it's resolved.

277
I'm working on a new conveyor like module which is very simple but optimized for speed and animation smoothness. What's forced me to write it? Conveyor freezes all other animations while transiting, which was unacceptable for me. I need your advise first. I went with type 2
It will look like this:



What padding works for you best of those 3? Or shall I make paddings configurable like: tile padding, carrier padding, selector padding?

UPDATE:

First beta version released https://github.com/oomek/AttractMode-Carrier

278
Scripting / Re: Animate module BUG: linear tween not so linear
« on: March 03, 2017, 01:27:42 PM »
Here is another version of my smooth conveyour:
- optimized for speed
- videos are now supported

Read my previous post for details

Code: [Select]
const tilesCount = 5 //keep it odd number
const tilesOffscreen = 3
const tileWidth = 300
const tilePadding = 8
const tileKeepAspect = false
const surfacePosSmoothing = 0.85
local videoFlags = Vid.ImagesOnly // Vid.NoAudio for videos



local flw = fe.layout.width;
local flh = fe.layout.height;
local tilesTable = []
local tilesTableOffset = 0
local tilesTotal = tilesCount + tilesOffscreen * 2
local tileHeight = flh / tilesCount
local surfaceWidth = tileWidth + 4  // frame.png is 304x220
local surfaceHeight = tilesTotal * tileHeight
local surfacePosY = 0
local surfacePosYOffset = tilesOffscreen * tileHeight

local surface = fe.add_surface( surfaceWidth, surfaceHeight )

local index = -floor( tilesTotal / 2 )
for( local i = 0; i < tilesTotal; i++ ) {
    local obj = surface.add_artwork( "snap" )
    obj.set_pos( 2, tileHeight * i + ( tilePadding / 2 ), tileWidth, tileHeight - tilePadding )
    obj.preserve_aspect_ratio = tileKeepAspect
    obj.index_offset = index
    obj.video_flags = videoFlags
    tilesTable.push( obj )
    index++
}

local frame = surface.add_image( "frame.png", 0, tilesTotal / 2 * tileHeight - 10, 304, tileHeight + 20 )

fe.add_transition_callback( this, "on_transition" )

function on_transition( ttype, var, ttime ) {
  if ( ttype == Transition.ToNewSelection ) {
      local index = -floor( tilesTotal / 2 )
      tilesTableOffset += var
      for ( local i = 0; i < tilesTable.len(); i++ ) {
          local indexTemp = wrap( i + tilesTableOffset, tilesTable.len() )
          tilesTable[ indexTemp ].rawset_index_offset( index );
          tilesTable[ indexTemp ].y = i * tileHeight + tilePadding / 2
          index++
      }
      surfacePosY += var * tileHeight
  }
}

fe.add_ticks_callback( "tick" )

function tick( tick_time ) {
   surfacePosY = surfacePosY * surfacePosSmoothing
   if ( surfacePosY > surfacePosYOffset) surfacePosY = surfacePosYOffset
   if ( surfacePosY < -surfacePosYOffset) surfacePosY = -surfacePosYOffset
   surface.set_pos( 200, surfacePosY - surfacePosYOffset )
}

// wrap around value witin range 0 - N
function wrap( i, N ) {
  while ( i < 0 ) { i += N }
  while ( i >= N ) { i -= N }
  return i
}

279
Scripting / Re: Animate module BUG: linear tween not so linear
« on: March 03, 2017, 08:09:09 AM »
I've checked, it does work nicely with "accelerate_selection yes"

280
Scripting / Re: Animate module BUG: linear tween not so linear
« on: March 03, 2017, 07:50:18 AM »
Here is a rough example of my idea of a smooth conveyor, no fancy classes or anything. It's unoptimised as haven't implemented rawset_index_offset() yet. As you can see I'm animating surface y offset instead of tiles position.

You have to set 2 variables in attract.cfg as follows
Code: [Select]
accelerate_selection no
selection_speed_ms   51
selection_speed_ms  is 51 for 60Hz refresh rate. That is 16.6666 * 3 frames + 1 to avoid sporadical stuttering


https://s4.postimg.org/rfgzrz8m5/frame.png

Code: [Select]
local flw = fe.layout.width;
local flh = fe.layout.height;

local tilesTable = []
local tilesCount = 5
local tilesOffscreen = 3
local tilesTotal = tilesCount + tilesOffscreen * 2
local tileWidth = 300
local tilePadding = 8
local tileKeepAspect = false
local tileHeight = flh / tilesCount
local surfaceWidth = tileWidth + 4  // frame.png is 304x220
local surfaceHeight = tilesTotal * tileHeight
local surfacePosY = 0;
local surfacePosYOffset = tilesOffscreen * tileHeight
local surfacePosSmoothing = 0.9;

local surface = fe.add_surface(surfaceWidth,surfaceHeight)

local index = -floor( tilesTotal / 2 )
for( local i = 0; i < tilesTotal; i++) {
    local obj = surface.add_artwork("snap")
    obj.set_pos( 2, tileHeight * i + (tilePadding / 2), tileWidth, tileHeight - tilePadding )
    obj.preserve_aspect_ratio = tileKeepAspect
    obj.index_offset = index
    obj.video_flags = Vid.ImagesOnly;
    tilesTable.push( obj )
    index++
}
local frame = surface.add_image("frame.png", 0, tilesTotal / 2 * tileHeight - 10, 304, tileHeight + 20)

fe.add_transition_callback(this, "on_transition")

function on_transition(ttype, var, ttime) {
  if ( ttype == Transition.FromOldSelection ){
      local index = -floor( tilesTotal / 2 )
      for ( local i = 0; i < tilesTable.len(); i++ ) {
          tilesTable[i].index_offset  = index
          index++
      }
      surfacePosY -= var * tileHeight;
  }
}

fe.add_ticks_callback( "tick" )

function tick( tick_time )
{
   surfacePosY = surfacePosY * surfacePosSmoothing
   if ( surfacePosY > surfacePosYOffset) surfacePosY = surfacePosYOffset
   if ( surfacePosY < -surfacePosYOffset) surfacePosY = -surfacePosYOffset
   surface.set_pos(200, surfacePosY - surfacePosYOffset)
}

edit1: fixed padding offset
edit2: combined both FromOldSelection if() statements

281
I need some detailed information of those two callbacks. Apart from the negated var value are there any other differencies? What is the purpose of separating them? What is the order of those calls?

282
Scripting / Re: Conveyor transition is freezing other animations?
« on: February 28, 2017, 08:04:40 PM »
Thanks for clarifying that. I have an idea how to animate the snaps in tick and still use FromOldSelection.  Instead tweens I'm planning to use 1pole lowpass filter for the position. Will test it tomorrow, as I'm in bed now.

283
Scripting / Re: Animate module BUG: linear tween not so linear
« on: February 28, 2017, 07:50:56 PM »
My machine is fine, i ve got 2 pcs and 3 gpus, same on all of them.  The graph is showing correct data, it corelates with the high speed recording. Tick is called in the beginning of each frame and once per 2 frames when you do not update any objects in it. I can animate smoothly a lot of objects from the tick callback and all of them are buttery smooth, no frame drops or speed inconsistencies.

284
Scripting / Re: Animate module BUG: linear tween not so linear
« on: February 28, 2017, 04:45:21 PM »
Don't get me wrong, I would love to use your module, but I think I'll stick everything into tick callback, as it's the only way to do what I want to achieve. I come from c++ and I'm new to Squirrel, so that will be a good excercise. The conveyour module is a total crap, as it's freezing all other animations while it's running.

285
Scripting / Re: Animate module BUG: linear tween not so linear
« on: February 28, 2017, 04:32:14 PM »
It's the same unfortunately even for alpha

Code: [Select]
local move_rect_a = {
    when = Transition.ToNewSelection, property = "alpha", start = 0, end = 255, time = frameTime * frames, tween = "linear"
}


Pages: 1 ... 17 18 [19] 20 21