Coder Social home page Coder Social logo

Feature Request: Menu about engo HOT 14 CLOSED

EtienneBruines avatar EtienneBruines commented on August 19, 2024
Feature Request: Menu

from engo.

Comments (14)

paked avatar paked commented on August 19, 2024

Awesome. We definitely need some sort of pause/menu feature. My only concern would be making the menu too specific and not flexible enough for general use. IMO we should view the pause menu as a group of Entitys which represent a UI + pause logic.

Regarding your second proposal, I don't quite understand why you wouldnt just use an interface?

type XYZ interface {
   Continue()
   Save()
   Exit()
}

Also, perhaps implementing Save logic into the engine is going a bit too far. I'm happy for a discussion on this though.

from engo.

EtienneBruines avatar EtienneBruines commented on August 19, 2024

So it should have some kind of PauseSystem, which some Entity would require?

w.r.t. the second proposal:
The idea was the map, not those specific entries of the map. It would create a menu with the strings as buttons (or w/e), and execute the function on select.

from engo.

paked avatar paked commented on August 19, 2024

Yes. A PauseSystem would be good. We could make use of the Message-ing features, to summon the PauseSystem.

@EtienneBruines I think it would be best to allow each Entity to handle its own behaviours.

from engo.

EtienneBruines avatar EtienneBruines commented on August 19, 2024

A PauseSystem with the Message-ing features would work.

Thinking about what might be the best idea on how to stop "everything" - since we still want the menu to work. We still need (most of) the systems: RenderSystem, AnimationSystem, and possibly some other systems as well. We could use the PriorityLevel for this; the downside is that it's only attached to RenderComponents, and not to everything existing.

What if we used some UnpauseComponent or something? One could add those components to stuff that shouldn't be affected by the system-wide pause.

The current World-loop, is this:

for _, system := range w.Systems() {
        system.Pre()
        for _, entity := range system.Entities() {
            if entity.Exists {
                system.Update(entity, dt)
            }
        }
        system.Post()
    }

And it needs to be modified in such a way, that it skips everything that doesn't have an UnpauseComponent - if the system is paused.

I'll make a PR so you can see it in action.

from engo.

EtienneBruines avatar EtienneBruines commented on August 19, 2024

Is there anything else we want to implement from this Issue?

from engo.

matiwinnetou avatar matiwinnetou commented on August 19, 2024

Would this be pluggable by a developer or would this be core engine feature like CameraSystem?

from engo.

EtienneBruines avatar EtienneBruines commented on August 19, 2024

Well, the PauseSystem has been implemented, and is completely pluggable.

I'm not sure what else we want to implement, because the other stuff probably is up to the developer, and it wouldn't be anything useful if we did it. We are busy with building-blocks though, such as #59.

from engo.

SeanTolstoyevski avatar SeanTolstoyevski commented on August 19, 2024

hey @EtienneBruines and @paked
I do not know what happened to this issue.

I did not find this feature in any Golang game engine. And it is very difficult to create this alone.

  • Don't you want the engine to do this?

I think you support this right now.

Can you add a little example?

from engo.

EtienneBruines avatar EtienneBruines commented on August 19, 2024

@SeanTolstoyevski I think it was decided that we did as much as we could as a game engine, because every main menu is different.

There's an example here:
https://github.com/EngoEngine/engo/tree/a8276ad380704822182b58ec79f3618c751a2d93/demos/adventure#a-pause-menu

Basically upon entering the main menu (can be a keypress, like ESC), you remove all Entitys from all System to prevent them from being rendered. That is, if you want to remove sight of the game. It's also become quite common to keep the game rendered in the background. If that is what you want, you'll need to figure out something to make it "pause aware", meaning that you don't move your character by pressing WASD while in the main menu -- nor should the time keep ticking.

But because every menu is different (some want buttons, some want text, some want animations), it's difficult to create a one-size-fits-all feature.

============

Even though I haven't been active on this project for years, I think I can go ahead and reopen this issue for further discussion (if you have any additional thoughts on the matter or ideas that the game engine could/should offer).

from engo.

SeanTolstoyevski avatar SeanTolstoyevski commented on August 19, 2024

Hi, thank you very much for your attention and thinks. This community is active. It's beautiful.

It's hard to design a menu in general. Because it is necessary to establish an event-based system.

from engo.

otraore avatar otraore commented on August 19, 2024

I think handling a main menu is out of scope for a game engine to handle. There's too many variances and possible combinations and some projects that might not even use one.

I think what we can do is show a good example of a menu in one of the demos (maybe improve the one in adventure) or it's own separate demo depending on how important it is.

Thoughts?

from engo.

Noofbiz avatar Noofbiz commented on August 19, 2024

If you'd like an example of a main menu, including a start menu, you can check out my game hypnic. That scene is the main menu, and it even has an options menu with sliders to control things like volume and input. I'm actually participating in the Game-Off 2020 and I'm planning on attempting a pause menu type system for that as well.

from engo.

Noofbiz avatar Noofbiz commented on August 19, 2024

That said, I don't think something like that would work as part of the systems in common. Common should be more general-purpose, so maybe a system for gui tools such as buttons that you can use in a menu, but the menu itself should be up to the end user

from engo.

Noofbiz avatar Noofbiz commented on August 19, 2024

I added a system to the adventure demo that can pause all the entities it tracks by removing them from the systems and re-adding them when it's unpaused. Another way of handling this would be to turn off the system's update when the system is paused. This is now part of the adventure demo.

from engo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.