Comments (14)
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 Entity
s 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.
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.
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.
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 RenderComponent
s, 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.
Is there anything else we want to implement from this Issue?
from engo.
Would this be pluggable by a developer or would this be core engine feature like CameraSystem?
from engo.
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.
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.
@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 Entity
s 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.
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.
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.
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.
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.
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)
- Update isometric demo to use tiles of different sizes
- WSL to build on windows
- Shape drawing problem HOT 7
- Circle fill transparency HOT 6
- About performance HOT 7
- Scale operation seems to move the entity to the wrong position
- shader
- Support WebGL and Android HOT 11
- TMX resources cannot handle tile sets that leave a rest at end of rows HOT 2
- TMX resources don't respect transformations when loading tiles
- Build on macos M1 / Apple Silicon fails (GL/mobile-related) HOT 2
- AudioSystem's Pause and Restart aren't working
- Question: Can you draw upon a transparent window/canvas? HOT 1
- Cannot Compile on m1 mac HOT 3
- Release v1.0.7 appears to be tagged incorrectly HOT 1
- Properly handle gifs
- Add function to disable cursor HOT 1
- quadtree to fast
- Do not use icon.png as default image.
- MacOS 11 removed from test runners
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from engo.