Nez: free, open source 2D framework

That’s exactly what I told you in my previous comment :wink:

No pull request necessary. Nez purposely does not enable the depth buffer because it does the sorting itself. The Material system is there so that you can then do whatever you want with your Materials. Likewise, Renderers are all overridable so that you can render exactly how you want to if you choose to not use Nez’s sorting.

Hey guys!

I just started tinkering with Nez and I like what it has to offer. Unfortunately I’m having a problem getting it working in an Android project and I was hoping I could get a push in the right direction.

I’ve got a solution with a Shared Project, then a DesktopGL project and an Android project with references to the shared. I’m able to get a simple scene with a single sprite running in the desktop version, but I’m getting a runtime error while debugging the Android project, right after the MonoGame splash:

Unhandled Exception:

Microsoft.Xna.Framework.Content.ContentLoadException: Could not find ContentTypeReader Type. Please ensure the name of the Assembly that contains the Type matches the assembly in the full type name: Nez.BitmapFonts.BitmapFontReader, Nez, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null (Nez.BitmapFonts.BitmapFontReader, Nez) occurred

Results are the same when referencing the .dll directly.

Anyone experienced something like this?

I pulled the latest commit for the follow camera, but I’m still getting the jittering issue others have reported when using it at low resolutions (480x270, 640x360) it isn’t until I get to about 960x540 that it starts to smooth itself out. The lag is still there at the higher resolutions, it’s just not nearly as noticeable

After digging into this for much of the morning, I’ve narrowed it down to being present when using TiledMapMover. Using a regular mover results in super smooth camera movement, using the TiledMapMover is very jerky. I see a commit to TiledMapMover a few days ago that was to address adding subpixel movement, but it was reverted a few days later… not sure what that’s about.

I’ve been unable to narrow down the problem further, or fix it… I’m giving up for now and hoping someone else can at least chime with with ideas.

Just wondering… Is Nez considered “completed”?

Don’t misunderstand me, I think it’s an incredibly complete and amazing framework that has a plethora of features, functions and helpers and I’m by no means implying anything is missing, lacking or in any way incomplete and it’s definitely being maintained… but I am wondering if there are plans or ideas to make it even more awesome in the future with additions, improvements or new features (not that I even know what those would be…)

The core of Nez is fairly complete. I don’t think it will ever be 100% complete, but at this point it’s pretty solid and very flexible. For example: out of the box, the renderer can be used in standard forward rendering, deferred rendering, multi-render target blends and pretty much anything else you would want to do. This was all added with no changes to Nez code.

As for Components to build on the framework itself, there are always more that can be added. Anything that is not game-specific for example would be a good candidate. Most Components are usually game-specific though so they wouldn’t work as building blocks in the engine proper.

For anyone interested, Nez now has a dedicated Discord channel. It’d be awesome to get some participation there to discuss the framework in detail, cover different implementations and problem solutions, show off work, help each other work through problems and discover some of the more “hidden” features and maybe discuss how we as a community might able to help contribute to the project.

Hello, could someone help me fix this problem I posted here ?

Hello, can XMLTemplateMaker write the data to the xml file?

It does exactly the opposite: it reads the XML into a strongly typed object at runtime.

In other words, I can’t use it to save the runtime data. If so, how do I save the data to xml using nez.

The same way you would any C# program: use any of the various XML classes in the .NET framework or a third party XML lib.

Thanks for your reply.

Hello, I have a problem about Nez.UI. I create a entity as my player and I add the CameraFollow to the player.The problem is that when my player moved and the camera followed,but Nez.ui is not working.For example, button.onclick is not working.

I got it. I change the inputpos.The button is working.But I don’t know that if so, are there other bug about nez.ui.

Does NEZ have support a on screen virtual joystick and buttons? I want to create a game for android and I need to draw a buttons and joystick on screen.
I can not find this feature in NEZ.
I don’t want to make a job that already has done by others.

Virtual joysticks and buttons are very game specific features (and not very difficult to make). If you are looking for anything that game-specific Nez isn’t for you. It is a framework meant to be built upon, not just parts you glue together randomly to make a game.

2 Likes

Hey @prime31, fantastic framework from what I’ve seen so far and I’m thinking of moving my current project over!

Can I just ask what would you do if you needed one entity (or entity system) to have access to another entity?

I’m struggling to see how I would write a game where entities wouldn’t need direct access to other entities at some point yet with ECS I don’t see many examples.

Two examples I did see in the Nez Samples was calling a method on the scene to launch missiles or using an Entities access to it’s parent scene as a way to then get access to another entity. Is that the preferred way or should I be looking at design pasterns that avoid this completely?

Sounds like skipping the ECS is a good idea if you already have code you are moving over. Just use the standard EC, which is really how Nez works best. You can then find other Entities and Components via the Scene.

Cool! So you think Nez works best as per your samples of having components contain logic and not just data?

If a component wants to update the property of a component on another entity you would happily do something like this in a ShipComponent:

((GameScene).entity.Scene).PlayerEntity.getComponent().Score += 100;
or
entity.scene.findentity(“player”).getComponent().Score += 100;

I actually have a bunch of “manager” classes for things like generating planets, which I thought may lend itself quite well to Systems but will probably work fine as EC’s on the scene themselves.

I wouldn’t go that route. Just use findEntity at Scene start and cache your Entities