Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Tor (torbuntu)
@Torbuntu
Is there any plan to make Mini2DX a modular project to take advantage of the java 9+ module system for smaller deployments?
Thomas Cashman
@tomcashman
No plan at the moment. Need to learn the module system still XD
Tor (torbuntu)
@Torbuntu
Haha gotcha 🤣 I keep putting it off myself but reading about it gets me kind of excited for the implications.
But you've got so much on your plate already 😣
I'm super hyped about Mini2DX 2 though. The extended platform support highly peaks my interest.
Thomas Cashman
@tomcashman
I’ve so much work to do 😥
Tor (torbuntu)
@Torbuntu
You're still the only one working on this? (And alchemic cutie code besides)?
Thomas Cashman
@tomcashman
Yup. Though applied for a bank loan to get extra money to hire interns. Hopefully it gets approved
Tor (torbuntu)
@Torbuntu
Interns for the game or for Mini2DX?
Thomas Cashman
@tomcashman
Probably for the game so that I can focus on the Nintendo Switch port.
Since engine is mostly done
Tor (torbuntu)
@Torbuntu
That makes sense! I probably already asked but is the custom switch port stuff going to be in the main Mini2DX code too? So future users of Mini2DX could potentially also build for consoles?
Thomas Cashman
@tomcashman
Some of it will but the rest will be in a private repo due to NDAs
Tor (torbuntu)
@Torbuntu
That's right, I remember that now 😀
Thomas Cashman
@tomcashman
But I’m hoping to speak to Nintendo after launch to automatically grant access to Nintendo developers
Basically same set up as monogame
Tor (torbuntu)
@Torbuntu
That would be amazing.
Have you thought about making a community group on discord? It seems that has pretty good attraction for community members. At least from the ones I've found.
Like LibGDX and various linux and java groups. Constant activity there.
Thomas Cashman
@tomcashman
Hmmmm good idea
I’ll set one up later :)
Tor (torbuntu)
@Torbuntu
:D great!!
Thomas Cashman
@tomcashman
hey @/all I've set up a Discord server now for mini2Dx :) https://discord.gg/XfCutsH
Mateus Bandeira
@mateusbandeiraa

Hey guys, good evening!
I'm getting a weird behaviour trying to render a TiledMap. If I try to render it before anything else, it doesn't show up on the screen. I need to render something in advance for it to work. In example,

public void render(GameContainer gc, Graphics g) {
        tiledMap.draw(g, 32, 32);
    }

Shows a black screen.

But,

public void render(GameContainer gc, Graphics g) {
        g.drawCircle(0, 0, 5);
        tiledMap.draw(g, 32, 32);
    }

renders the circle and the map.

Is this a known issue?

Thomas Cashman
@tomcashman
Very strange. Can you paste the code where you create the map?
Mateus Bandeira
@mateusbandeiraa

I made some changes since my last message, but the issue persists. Actually, my code is very simple yet.

The main screen:

public class IndoorScreen extends BasicGameScreen {
    private GameMap tiledMap;

    // ...
    @Override
    public void initialise(GameContainer gc) {
        try {
            tiledMap = new GameMap(Gdx.files.internal("Maps/sample_indoor.tmx"));
        } catch (IOException ex) {
            ex.printStackTrace();
        }
    }

    @Override
    public void render(GameContainer gc, Graphics g) {
        g.drawCircle(0, 0, 5); // tiledMap won't render if this line is not present.
        tiledMap.render(gc, g);
    }
}

The GameMap class:

public class GameMap extends TiledMap {
    private int positionX = 0;
    private int positionY = 0;
    private float renderScale = 1.2f;

    // ...
    public void render(GameContainer gc, Graphics g) {
        g.scale(renderScale, renderScale);

        this.draw(g, positionX, positionY);

        g.scale(1, 1);
    }
}

Later I discovered that rendering something after tiledMap.draw() will make it work on the next render() call. In other words:

    // IndoorScreen class
    private int renderCalls = 0;
    @Override
    public void render(GameContainer gc, Graphics g) {
        tiledMap.render(gc, g);
        g.drawCircle(0, 0, 5); 
        System.out.println("renderCall: " + ++renderCalls);
    }
renderCall: 1 -> Just the circle.
renderCall: 2 -> Both circle and map.

This is not a huge problem for me, as I indeed need to render other objects. But It gave me a headache when the first thing I was trying to do was make the map show up on the screen.

Thomas Cashman
@tomcashman
hmm there must be a bug in the graphics flushing. I will investigate. Sorry for the issue, I'll let you know when fixed!
also, you can manually force a flush using g.flush() if needed though in general it's best not to do this since we try to batch everything
Mateus Bandeira
@mateusbandeiraa

I forgot to mention: I tried to flush() before and after the tiledMap.draw() call. Still no luck.

Sorry for the issue, I'll let you know when fixed!

No need to apologize. Your work is already amazing.

Thomas Cashman
@tomcashman
that's very bizarre! I'll investigate and try fix in a 1.9.1 update :)
Tor (torbuntu)
@Torbuntu
If it helps at all, I can in draw a map right after viewport.apply(g);
Not sure if useful, but I was curious. And my maps draw without having to actually draw something else.
acuilab
@acuilab
:)
@tomcashman n When 2.0 will be released?
Thomas Cashman
@tomcashman
First beta will be in August
Final release probably in September or October
acuilab
@acuilab
In mini2Dx you redesigned the ui, why not use scene 2d ui directly?
Thomas Cashman
@tomcashman
2.0 will de-couple from LibGDX so UI needed to be independent to allow for portability to consoles
I’m not 100% happy with current UI implementation, want to try simplify it in 2.0
acuilab
@acuilab
But what is the consoles?
Thomas Cashman
@tomcashman
First console being targeted is Nintendo Switch
acuilab
@acuilab
Got it!
Tor (torbuntu)
@Torbuntu
Will Pixmap from libgdx be supported going into Mini2Dx 2.0? With the separation from libgdx will there be something similar anyway? Using Graphics to draw raw shapes is pretty poor performance on lower devices. I managed to get some pretty decent performance using a texture and pixmap to do the same thing (drawing line and hit box outlines or just doodle shapes with maths).
Thomas Cashman
@tomcashman
I’m not 100% sure yet
Tor (torbuntu)
@Torbuntu
I saw a while ago an issue on github about poor rect performance and had a similar trouble. Would you imagine that drawing with graphics would improve in the future version to where I wouldn't need the pixmap? (Though I do like drawing individual pixels)
Oh wait what the heck. Mini2Dx
Has a pixmap already 😂 I'll try switching my libgdx one to that.
Tor (torbuntu)
@Torbuntu
or is that not in the most recent version
nope, that isn't in the newest version. Never mind then xD
Tor (torbuntu)
@Torbuntu
Not sure how beneficial it would be to the majority of users. But I find using a pixmap to be an extremely nice feature for performant custom drawing during runtime.