About Monkey 2 › Forums › Monkey 2 Projects › Alien Phoenix
This topic contains 97 replies, has 14 voices, and was last updated by
Richard Betson
1 month, 1 week ago.
-
AuthorPosts
-
July 26, 2017 at 8:08 pm #9523
Hi,
I have setup a repository for the Alien Phoenix gaming framework on Github located here. I hope to have code posted in a week or so. More information soon.
Rich
July 26, 2017 at 9:00 pm #9524Awesome stuff!
July 29, 2017 at 6:50 am #9585Attached is an image of mojox running with Alien Phoenix’s GUI. Pretty cool that both can exist within the same app instance. Alien Phoenix’s GUI is based on canvas as the anchor but perhaps I can somehow modify things to support a View. It might be possible through some kind of View z-order to then have mojox components like the tree view seen below work within an Alien Phoenix window.
Fun with Monkey 2!
Attachments:
July 31, 2017 at 9:20 am #9611Attached is an image of Alien Phoenix running in the Chromium web browser at 60 FPS! With full support of Alien Phoenix’s windows based GUI. I’m sort of blown away that it is running so well and it is pretty cool to have a window based GUI in a web browser. I’m using the same test bed application with a lighted map as before. Amazing!
Is there anything Monkey 2 can’t do?
Attachments:
December 6, 2017 at 4:41 am #12167Hi,
I’ve been recovering from surgery but have managed to get a demo featuring Alien Phoenix nearly ready for release. It’s just a simple tech demo but should give users a good early glimpse of what the framework is capable of. I’ll be releasing it for Linux and HTML5 in a few weeks.
Check out the video.
December 6, 2017 at 6:18 am #12168Very cool!
December 7, 2017 at 3:01 pm #12191Looks great
December 15, 2017 at 11:33 am #12306^Thanks!
Checkout Phoenix USC/Alien Phoenix running (in 1080p) on the Chromium web browser! This video shows off most of the latest features, ships and lighting. It even fully supports the window based GUI. Even with video capture software overhead it all runs awesomely. Demo soon!
December 16, 2017 at 7:36 am #12322Nice!
December 16, 2017 at 1:04 pm #12326That looks pretty cool Richard. Did you face any problems optimizing it to run that well?
December 17, 2017 at 9:57 am #12331^Thanks.
Did you face any problems optimizing it to run that well?
The map (world) code was a tough one. Designing a map (world) framework that could uber efficiently and quickly manage potentially hundreds of thousands of objects. object collision, lighting and render it in layered 2D planes was a challenge. I found nothing that could do the job quickly and efficiently enough so I came up with my own design. But it’s important to note monkey is the enabler for sure.
The demo in the video is in a huge layered map with ten’s of thousands of objects. Running the demo (1080) native desktop my Phenom II X4 shows a 9-10% process usage. That is with the entire gaming framework in action including the GUI. Efficiency has been my overarching goal in designing Alien Phoenix.
December 17, 2017 at 11:12 am #12332December 19, 2017 at 8:13 am #12370Wow, that’s looking so good :)! I’m happy to hear that monkey could handle such an intensive looking game!
January 23, 2018 at 5:42 pm #13179Alien Phoenix now supports mojo3d. OMG! Shown here with one window in 3D and another window with 2D lighting effects and both running real-time.
Attachments:
January 26, 2018 at 12:02 pm #13257
Alien Phoenix will be available to all under the same license as Monkey. Coming Soon!Try this demo!
Alien Phoenix 2D / 3D example (WASM).Hi, I have posted a web assembly demo compiled with Emscipten. Featuring Mark’s simple light demo (with canvas scale, rotation) and a 3D demo all running real-time in my window based GUI. If you have ever wondered what Alien Phoenix can do this demo will give you a good look.
You may have to wait for all data to be downloaded before it will run. The download data counter will hit it’s max before everything is downloaded, especially on slower connections. If you have any issues try reloading. Left-click and hold in a window to move it. Windows resize.
I have posted the source code for this demo below (plus screen shot) for those curious.
Rock on.
Monkey123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301'-------------------------------------------------------------------------'Title: Alien Phoenix 2D / 3D example'Author: Richard R Betson'-------------------------------------------------------------------------Namespace phoenixusc#Import "demo_assets/"#Import "<sdl2>"#Import "<std>"#Import "<mojo>"#Import "<mojo3d>"#Import "phoenixbutton"#Import "phoenixwindow"Using std..Using mojo..Using mojo3d..Using sdl2..Using phoenixbuttonUsing phoenixwindowClass PPhoenixWeb Extends WindowField virtualRes:=New Vec2i( 1920, 1080 )Field current_window:=New PWindowField generic_window:=New PWindowField my3d_window:=New PWindowField my2d_window:=New PWindowField about_window:=New PWindowField generic_button:PButtonField install:Bool 'Flag intitail setup'3D window - 3D setupField _scene:SceneField _camera:CameraField _light:LightField _ground:ModelField _donut:ModelField _bloom:BloomEffectField _fog:FogEffect'Simple lightField _floor:ImageField _2d_light:ImageField _logo:ImageField ap_logo:ImageMethod New( title:String,width:Int,height:Int,flags:WindowFlags=WindowFlags.Resizable )Super.New( title, width, height, flags)Layout="Fill"ClearColor=Color.DarkGreyStyle.BackgroundColor=Color.DarkGreySelf.ap_logo=Image.Load( "asset::logo_ap.png" )Self.ap_logo.Scale=New Vec2f( 1,1)Init3D()Init2D()End MethodMethod Init3D()SetConfig( "MOJO_TEXTURE_MAX_ANISOTROPY",16 )Self._scene=Scene.GetCurrent()Self._scene.EnvColor=Color.BlackSelf._scene.ClearColor=Color.BlackSelf._scene.AmbientLight=Color.BlackSelf._camera=New CameraSelf._camera.Near=1Self._camera.Far=1000Self._camera.Move( 0,2,0 )Self._light=New LightSelf._light.RotateX( 100 )Self._light.Range=20Self._light.Move(0,10,0)Self._light.CastsShadow=True'Local pixmap:=New Pixmap( 16,16 )pixmap.Clear( Color.Black )For Local i:=0 Until 16pixmap.SetPixelARGB( i,0,~0 )pixmap.SetPixelARGB( 0,i,~0 )NextLocal texture:=New Texture( pixmap,TextureFlags.FilterMipmap|TextureFlags.WrapST )Local material:=New PbrMaterial( Color.Black )material.EmissiveTexture=texturematerial.EmissiveFactor=Color.Redmaterial.ScaleTextureMatrix( 500,500 )Self._ground=Model.CreateBox( New Boxf( -500,-1,-500,500,0,500 ),10,10,10,material )Self._bloom=New BloomEffectSelf._scene.AddPostEffect( _bloom )Self._fog=New FogEffectSelf._fog.Near=-15Self._fog.Far=12Self._fog.Color=New Color(0,0,.3)Self._scene.AddPostEffect( _fog )Local materiala:=New PbrMaterial( Color.Silver ,0)materiala.EmissiveFactor=New Color( 1,0,.5 )materiala.MetalnessFactor=0Self._donut=Model.CreateTorus( 2,.5,48,24,materiala )Self._donut.Move( 0,3,6 )End MethodMethod Init2D()Self._floor=Image.LoadBump( "asset::Slate Tiles II_D.png","asset::Slate Tiles II_N.png","asset::Slate Tiles II_S.png",.75,True )Self._2d_light=Image.LoadLight( "asset::cone_orange.png" )Self._2d_light.Handle=New Vec2f( .5,0 )Self._2d_light.Scale=New Vec2f( 1,1)Self._logo=Image.Load( "asset::Monkey2-logo-48.png" )Self._logo.Handle=New Vec2f( .5 )Self._logo.ShadowCaster=New ShadowCaster( _logo.Width/2,20 )End MethodMethod OnMeasure:Vec2i() OverrideReturn virtualResEnd MethodMethod OnRender( canvas:Canvas ) OverrideIf Self.install=False'Load GUI resourcesInitMainGUI()'Setup windowsSelf.my2d_window=Init2DWindow(canvas,Rect,300,200,1280,720)Self.my3d_window=Init3DWindow(canvas,Rect,100,100,1280,720)Self.about_window=InitAboutWindow(canvas,Rect,600,300,600,350)'Setup a generic window with canvas onlySelf.generic_window=New PWindow(canvas)canvas.AmbientLight=New Color(.25,.25,.25)Self.install=TrueEndif'Update 3D objectsSelf._donut.Rotate( .2,.2,.3 )Self._ground.RotateY( Sin(Millisecs()*.0001),True )'update 3D scene to windowmy3d_window.RenderWindowCamera(_scene,_camera)'Draw about window assetsRenderAboutWindow()'Draw 2D asstetsRender2DExample(my2d_window)'Update all windowsgeneric_window.UpdateWindow()App.RequestRender()End MethodMethod RenderAboutWindow()Self.about_window.DrawImage(Self.ap_logo,120,35)Self.about_window.DrawText("Alien Phoenix 2D / 3D Example",200,200)Self.about_window.DrawText("Powered by Alien Phoenix",220,220)Self.about_window.DrawText("Alien Phoenix copyright (c) 2018 Richard Betson",135,240)End MethodMethod Render2DExample:Void(window:PWindow)Local offsetx:Float=window.GetWindowWidth()/2Local offsety:Float=window.GetWindowHeight()/2Global viewRot:=0.0viewRot+=.001window.TranslateCanvas( offsetx, offsety )window.ScaleCanvas( Sin( viewRot*3 )*.25+1.25,Cos( viewRot*5 )*.25+1.25 )window.RotateCanvas( viewRot )Global lightRot:=0.0lightRot+=.02window.BeginLighting()Local mx:Float, my:FloatIf window.WindowActive()mx=(Mouse.X )-window.GetWindowX()my=(Mouse.Y )-window.GetWindowY()Elsemx=window.GetWindowWidth()/2my=window.GetWindowHeight()/2Endifwindow.AddLight( Self._2d_light, mx, my,4,4,8,8,8,lightRot )window.AddLight( Self._2d_light, mx, my,4,4,8,8,8,lightRot+Pi )window.AddLight( Self._2d_light, mx, my,4,4,8,8,8,lightRot+Pi/2 )window.AddLight( Self._2d_light, mx, my,4,4,8,8,8,lightRot+Pi+Pi/2 )For Local x:=0 Until window.GetWindowWidth() Step Self._floor.WidthFor Local y:=0 Until window.GetWindowHeight() Step _floor.Heightwindow.DrawImage( Self._floor,x-window.GetWindowWidth()/2,y-window.GetWindowHeight()/2 )NextNextFor Local an:=0.0 Until TwoPi Step TwoPi/8.0window.DrawImage( _logo,(window.GetWindowWidth()/2+Cos( an ) * window.GetWindowWidth()/4) -offsetx, (window.GetWindowHeight()/2 + Sin( an ) * window.GetWindowHeight()/4)-offsety )Nextwindow.EndLighting()End MethodMethod InitMainGUI:Void()Self.generic_window.LoadResources("system_resources/client_skin/window_skin.txt")Self.generic_window.SetScreenSize(1920,1080)Self.generic_button.LoadImages("system_resources/client_skin/client_skin.txt")End MethodMethod InitMenuWindow:PWindow(canvas:Canvas,rect:Recti,x:Float,y:Float,w:Float,h:Float)Local window:PWindow=New PWindow(canvas,rect,x,y,w,h)window.SetBorderStyle(BlendMode.Additive,.4,.4,.6,.8)window.SetResizable(True)window.SetMinWindowSize(150,150)window.SetCLS(False)window.SetWindowControls(New String[]("close","maximize","cast"),True)window.SetBackgroundImage(Null)Return windowEnd MethodMethod Init3DWindow:PWindow(canvas:Canvas,rect:Recti,x:Float,y:Float,w:Float,h:Float)Local window:PWindow=New PWindow(canvas,rect,x,y,w,h)window.SetBorderStyle(BlendMode.Additive,.4,.4,.6,.8)window.SetResizable(True)window.SetMinWindowSize(150,150)',5760+210,1080)window.SetCLS(False)window.SetWindowControls(New String[]("maximize","cast"),True)window.SetBackgroundImage(Null)Return windowEnd MethodMethod Init2DWindow:PWindow(canvas:Canvas,rect:Recti,x:Float,y:Float,w:Float,h:Float)Local window:PWindow=New PWindow(canvas,rect,x,y,w,h)window.SetBorderStyle(BlendMode.Additive,.4,.4,.6,.8)window.SetResizable(True)window.SetMinWindowSize(150,150)',5760+210,1080)window.SetCLS(True)window.SetWindowControls(New String[]("maximize","cast"),True)window.SetBackgroundImage(Null)Return windowEnd MethodMethod InitAboutWindow:PWindow(canvas:Canvas,rect:Recti,x:Float,y:Float,w:Float,h:Float)Local window:PWindow=New PWindow(canvas,rect,x,y,w,h)window.SetBorderStyle(BlendMode.Additive,.4,.4,.6,.8)window.SetResizable(False)window.SetMinWindowSize(150,150)window.SetCLS(True)window.SetBackgroundImage(Null)window.SetWindowOnTop()Return windowEnd MethodEnd ClassFunction Main()New AppInstanceNew PPhoenixWeb("Alien Phoenix 2D / 3D Example - Powered by Alien Phoenix",1920,1080)'device_width,device_height )App.Run()EndAttachments:
-
AuthorPosts
You must be logged in to reply to this topic.






