Thursday, July 24, 2014

Just let me code.

I just read Dr Dobb's post Just Let Me Code! and it reminded me why I started using Unity.  When I first started using unity it pretty much was just code and design in a nice IDE. Select a platform and run build.  Even now that still is true for simple projects.  Of course if you want an iPhone app you have to jump through Apple's registration and key management hoops, not so bad for  Android and still simple for web or stand alone apps. Of course if you happen to working on a project for a large Japanese company to run on a niche platform ( as I am) your back to tool chain management and process control for most of your day. The Unity work seems to disappear, partly because it generally works.

Monday, June 16, 2014

Unity C# AOT error on 4 dimensional arrays

When building for iOS with unity I found a new (to me) AOT error. Creating  4 dimensional array like

bool[,,,] combos = new bool[2,2,2,2];

works on no iOS platforms but will throw a runtime error on iOS.

bool [][][][] combos = new bool[2][][][];

works fine although you will need to initialise it in a messy set of loops

combos = new bool[2][][][];
for(int i = 0;i<;2;i++){
 combos[i] = new bool[2][][];
 for(int j =0;j<2;j++){
  combos[i][j] = new bool[2][];
  for(int k =0;k<2;k++){
   combos[i][j][k] = new bool[2];
  }
 }
}

Thursday, April 26, 2012

More transition Ui

I added lots of stuff over last few days.

  • Resizing handles on start and end position.
  • Easing drop down works
  • the slide between start and end is working
  • editing of Delay and Time works.

I need to add a rotation handle, this will be a fair amount of work because I did ot consider what rotations would do to resizing handle code. Unfortunately just putting the resizing handles on an object and letting rotation and resing be handles by rotating and moving underlying object did not work because, the images of the handles go messed up even when I tried applying inverse scaling on them. After the rotation code I need to change the slider to handle delay and duration effects.

The panel is looking fuzzy nee to find out why. Maybe need to start with larger font/

v0_0_7

Thursday, April 19, 2012

UI for transitions - positions

I attached the drag code for start and end position markers and hooked it all up the display panel and the first art panel. To test it moved the green and red markers around then hit the first then second button and it should move from green to red. Need to hook delay, time and easing. Then scale and rotate.

Also aligned xyz between GUI and art frames so I can use same mouse click/finger touch code for both. Switched to using FingerGestures asset. It has nice finger gestures and well designed code so I think it will be easy to to twisting and resizing with it. Did some Gimp work so the start and end position markers can show orientation and made them boldier so the still show after being reshaped. Need to something similar for frame that show screen size.

v0_0_6

Wednesday, April 18, 2012

More UI for transitions

Found my bug with NGui, the atlas for images also needs to include fonts. Although NGui works with fonts in a separate atlas using two atlases causes Z level drawing problems.

Working on UI helped me realize a better way handling transitions, that will be flexible enough for rest of prototyping I think, hopefully even into the product. I played with the base orientation along xyz axis.(which is why everything is upside down) This will take a bit more work. I want NGui, user expectations and rotating through angles along multiple dimension to all work together. The user expectation is most flexible because I can swap axis letters when displaying co-ordinates to users. If I have to I may be able to swap co-ordinates for NGui but then I won't be compatible for upgrades so need to do it in extension, could be pretty messy. When rotating an object in 3D rotating about X then Y is not the same as Y then X . I want user to be able to twist an object on screen and only change one axis angle value. I think if I lay my object out "flat" correctly this will work, but need to test this. I see in the demo that the way the 4th panel moves has changed when I changed global orientation. How to let the user control this will be a UI problem.

Green and red frames represent start and end of transition. Moving them changes panel numbers, but this can only be done in editor. i have to write the drag, resize and twist code for run time still.

Almost finished refactoring transitions.


V0_0_5

UI for transition panel

UI for transition panel is almost done for first draft. Tested in browser instead of editor and found a display problem fixed it, did some more work on panel and it broke again. I though I had found the cause but more testing of NGui today.

Last night I went to an entrepreneur talk and networking event. Talked a bit about the project with people and realized this morning I am over geeking the design. I do not plan on removing any of the features I planned but I will need a new dead simple setting automatically does transitions with user only placing art work in final position. The simplest one will let users give a single size and import artwork as all whole pages and produce the manga. Probably 80%~90% of artists will use the two simplest setting. The manga produced by the simple settings will be same as by advance setting so artist can use simple settings and then tweak with advanced settings.

v_0_04

Sunday, April 15, 2012

Seperating UI for touch and mouse.

Have played a little with the UI with fingers and mouse. I think the multi coloured gizmos will work good on computer with mouse. Fine control and no twisting make them a good fit. although for 2D placement drag and drop instead of gizmo will be my first option. For touch the multi finger twist and pinch means the gizmos are not needed. so that means using #ifdef compiler directives to separate the two interfaces, and "Finger gestures" packge by fatalfrog.com on unity.

The FPS counter showed 30 FPS on iPad and iPhone 4 which is max frame rate on those devices. on a iPhone 3G with iOS 4.x the frame rate dropped to 20 FPS for the mesh deformation in panel 3. That would be too slow for general performance but for worst case on 3 year old phone that is fine. I am not going to worry until frame rate gets down to 25 on iPhone 4.

I think I know how I want to do the popup panes for control position and transitions of panels, from UI point of view, but first I have to change the animation system. Currently there is no central control of animations so I can not stop them all anytime. I need to do this when reseting or moving all frames to final position in composer. This is exactly what JobManager.cs what meant for.

Started on pane for editing transitions but need to do some more work in gimp first making some graphics.

v0_0_3