3D Library Adventure

mdotedot

  • Posts: 1654
Especially for NobodyX!

2D SpriteSheets  in 3D World.


Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

NobodyX

  • *
  • Posts: 1228
haha nice! :D

The shader effects look cool too, I like the motion blur a lot.

I'm curious about something, so let's say your game is 320 pixels wide and stencyl is scaling it up 2x. Are the 3D graphics drawn at a 640 pixel resolution? or is it still drawn at 320 but each pixel becomes two pixels wide?
I think the latter would be the coolest to fit in with pixel art games (and probably run a lot faster too for fullscreen, I assume)

mdotedot

  • Posts: 1654
Since you asked I published an Android version. I've put it on all these devices:



The game is made in 480x320.
The Buttons are 'regular stencyl' actors and imported at 4x.
Scale to fit LetterBox .

In the 3D Extension I never use SCALE setting. The only part where I scale is in the binding of the meshes to Stencyl Actors/Tiles.
I use the method: 1 pixel in Stencyl = 1 unit in Away3D.

So if an actor is 32x32 pixels I set the scale to 32 height and 32 width.
I position the camera to align the 2D objects with the 3D objects.

The example I'm showing doesn't use actor binding and the floor is 1000 units by 1000 units. On the Galaxy S2 (480x800 pixels) it roughly 'occupies'  the same amount of room/space as on the other devices.

Is this the answer you are looking for?  Do you have a specific example you want me to test?!

There is a post on the Away3D Forum where someone said this:
"
Okay, so it seems that scaling an object that is 1 metre high in Blender by .02 makes it 1 unit high in away3D
"
I'm not familiar enough with Blender to know what this means...   .02 of 1 metre = 20 cm = 1 unit?!? But how many pixels is that?!

I assume that if I have a cube and I position the camera so that it overlaps a Stencyl actor that has 32 pixels on the device then the scaled cube will be using the same number of pixels?! Or is that a dumb idea?!

If you want to have the .apk file to test on an android device you have, please let me know, and I send you the current apk file.
I noticed some errors in some parts of the demo application  so I need to investigate that!




Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

NobodyX

  • *
  • Posts: 1228
I always use desktop target so I sometimes forget the 2x,3x,4x actors are a thing. I just meant purely about making the entire game bigger on your monitor (like when going into fullscreen). Sorry I guess I should have said to ignore about actor scales!! (tho I guess someone else might want to know)

I'm almost certain you answered my question and that I understand. I made a picture anyway. So if you go into fullscreen on desktop it'll look more like "B", correct?

(and B is definitely what I prefer, even tho the example makes it look ugly lol)

mdotedot

  • Posts: 1654
Hello NobodyX,

Ah, I see now. Thanks for the example.

There are two major differences:
* Sprite Sheet/Bitmap objects
* 'True' 3D objects

What happens with a true 3D object is that scaling multiplies the numbers. Depending on the platform (Android -and I believe native and ios-) there is anti-aliassing procedure
done on the lines/shapes so that the edges look smooth.
This can be altered with filters/methods.

And there is the Spritesheet/Bitmap approach. This allows 2d spritesheets/bitmaps to be used as a kind of skin on top of those 3D objects.
The number of pixels in that skin determines how good it can be used to be 'projected' on top of the 3D model. If you scale the shape it will scale the bitmap as well.
So 1 pixel becomes 4 pixels (square).


when you move the camera to this 3D model


it becomes this:

The more triangles this 3D model has the smoother the curves are.

When you move the camera to the SpriteSheet this is shown:



Hopefully this is a better answer?!?

Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

NobodyX

  • *
  • Posts: 1228
No that's further from what I meant. =p I'm not talking about the camera at all.

I'm talking about where you make the game fill more of your monitor. Either under "Game Settings" or going into fullscreen mode.

mdotedot

  • Posts: 1654
At the risk of still giving the wrong information I hereby post more screenshots.

Mac Publishing (Stencyl 9842)
* Settings: Desktop
* Scale : 2X
* Scale Mode: Scale to Fit (Letterbox)
* Scales All Scales
* Start in FullScreen


This results in this FullScreen image (taken from a VNC session)



When pressing Ctr+Apple+F:


(This is the entire canvas that it shows. It is clipped! and the Stencyl Buttons are incorrectly placed)

Not sure why ' out of full screen'  will not give a good working game.

This is the version when I start in 2x instead of FullScreen:


And then into Full:


Then I did a test-game on the same machine with the same Desktop Settings with also a 480x320 Display.
I couldn't reproduce the going out of fullscreen issue.. So it has to do with something I do and/or use.

At least you can see the full screen image and how it looks when it isn't full screen.
Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

mdotedot

  • Posts: 1654
Fixed the Out Of Fullscreen problem with the 3D engine. (For a previous test I commented out onResize : duh !)



But 'Stencyl scaling' still does something strange with the button-actors. (Drawing text?!?!)


Yeah it is an issue with Stencyl drawing text.


*I'm Downloading Latest Build to verify if it is fixed; if not : file an Issue*

« Last Edit: April 19, 2018, 07:25:18 pm by mdotedot »
Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

NobodyX

  • *
  • Posts: 1228
Ok, so it does increase the resolution of the 3d objects. Thanks!!!!!

And I've been having problems with text being the wrong size when switching in and out of fullscreen. I posted about it here http://community.stencyl.com/index.php?issue=1156.0

mdotedot

  • Posts: 1654
Last week I was sick so I haven't done as much as I would like to have done.

Currently I have some particle demonstrations done but I am debating if this particle system should have its own extension?!?
I would like to have a minimal number of extension blocks but this would need at least two extra. I might come back to this
when I have used all the Away3D library (core) functionality. I have decided not to do every little thing that the library
supplies since some of it can't really be integrated into Stencyl.

I've worked on:
  • Resource Loader HTTP(s) loading
  • Lenses
  • Camera Controllers
  • Particles

Particle demonstration is the most interesting to see I guess:



Image explode:



Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

merrak

  • *
  • Posts: 2738
Currently I have some particle demonstrations done but I am debating if this particle system should have its own extension?!?

If everything depends on Away3D, then it makes more sense to me to roll it up into one large extension... but I could see a good argument either way. One large extension would eliminate potential dependency issues.

It'd be nice to be able to separate extension blocks into our own palettes. Many of my own extensions have a large number of blocks. Palettes would make organization a lot easier.

Particle effect looks really cool. I could see that being popular just on its own. I don't know how modular Away3D or your own code is. How do the byRobin extensions handle dependencies?

mdotedot

  • Posts: 1654
Thanks for your thoughts.

I might be going for the two-extra-blocks. It could also be dependent on some other Library implementations.  Maybe those would require similar blocks and I can use dropdown boxes to re-use the block. That would be a reason to definitely have it all-in-one.

The particle system might be holding some more gems in the way the library could be used. So I also might want to add some extra demonstrations on that as well.


Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

squeeb

  • Posts: 1617
Last week I was sick so I haven't done as much as I would like to have done.

Currently I have some particle demonstrations done but I am debating if this particle system should have its own extension?!?
I would like to have a minimal number of extension blocks but this would need at least two extra. I might come back to this
when I have used all the Away3D library (core) functionality. I have decided not to do every little thing that the library
supplies since some of it can't really be integrated into Stencyl.

I've worked on:
  • Resource Loader HTTP(s) loading
  • Lenses
  • Camera Controllers
  • Particles

Particle demonstration is the most interesting to see I guess:



Image explode:





It would be amazing to have 3d particles in 2d games!  Great job!  Is there anything in there for 3d water ;)  metaballs perhaps?

mdotedot

  • Posts: 1654
@Squeeb: I might make some more water demos using the particle system and/or other blocks.

This week I've worked on an archive of all Liberado's stencyl files.
I've gotten permission to create this archive and to port (some of) them to 3D.

When the time comes that the extension will be published this archive will be visible and the ported .stencyl files as well so you can see how to migrate from a 2D to a 3D version of your games.

Also I've done work on:
  • Shadows
  • Removed a Resource block
  • Simplified Stencyl-binding

Since I could combine the Get Object block with the Get Resource block it meant that I have to visit all 31 behaviors with
multiple events in them to replace the block. That is one of the problems with an active extension development.
This probably will take me a few days to change, but I will revisit previous examples and maybe do some housecleaning while I'm there.

This grinds down all the unnecessary things and hopefully ends up in a cleaner and easier to use block-system.

Currently the extension has 12 blocks and I probably add at least 2 more for the particle system.

I'm on version 72 of the Demo :D

Here is one of the results of LIBERADO's examples ported to 3D. It has one scene behavior that does all the work:
  • Camera move:  8 blocks (4 if-statements and 4 actual movement blocks)
  • Switch animation on the crates: 2 blocks
  • For each unique actor/tile you need about 12-14 blocks to create materials,shadows and bind to Stencyl actors
Original LIBERADO 2D version



3D







Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

merrak

  • *
  • Posts: 2738
Impressive work so far!

I'd be interested in seeing how the 3D version of these games performs rendering-wise compared to the 2D versions. How many actors can you have in the scene before average FPS dips below 50?