Comments (10)
Ooh that's a really good idea. I haven't looked closely at gamepad APIs but if they work as advertised this would be very straightforward to implement.
I can't get to this right away, but I'm adding a tracking issue (#175) and I'd like to support it. Or if you want to work on it, I'm happy to answer questions and take PRs.
For mobile controls, all the required APIs are there but a game client would need to create its own button overlays or thumb button, etc, and issue its own events. The specifics would change from game to game so I'm not sure if there's anything the engine should do here. But now that I think about it, if there's a UI library somewhere for gamepad-like controls on mobile, supporting that library by default would be a good first step..
from noa.
Hi!
For the es6 module, that's a great idea and it would be good to support. However noa uses the 3D engine Babylon.js as a peer dependency, and I don't think it publishes prebuilt e6 modules. If I'm wrong about that then I think the same should be doable here (but I haven't looked closely yet).
For changing player controls - yes! The engine uses an ECS internally, and handles player inputs/controls/movements by attaching components to the entity noa.playerEntity
. So changing things just means removing the default components and adding different ones.
For example, here is the default movement component (that applies physics forces for moving/jumping/etc), and here is the engine code that adds that component to the player. So the easiest way to change stuff is to make a copy of the movement component, change whatever, and then do something like:
noa.entities.createComponent( myComponentDef )
noa.entities.removeComponent(noa.playerEntity, noa.entities.comps.movement.name)
noa.entities.addComponent(noa.playerEntity, myComponentDef.name)
The engine also adds components to do stuff like make the camera follow the player, consume key presses to cause movement, etc., so in general you can change any behavior by removing the default components from the playerEntity and adding new ones.
from noa.
Thanks! Yes, the theory is that this engine should be abstract enough that it doesn't know whether it's part of a single player or a multiplayer game. Basically it's a dumb client that renders voxels and entities, but it doesn't know whether you're generating the voxel data and entity locations locally, or receiving them from a server, etc. So there's nothing multiplayer-related in this repo, but the engine tries to do everything necessary to support it.
If you check the demo apps in the readme one or two of them support multiplayer, but I don't know a lot about specifically what other libraries they use (or whether they're FOSS).
from noa.
Hmm interesting. With that said do you think it would be possible to implement other control methods such as touch, game pad, and vr? As for es6 modules I believe babylonjs cdn files can be used as modules https://www.npmjs.com/package/babylonjs you c read about their cdns at the top of the description. However I may be wrong
from noa.
Hi, yes alternate input systems aren't in place at the moment but they'd be relatively straightforward to implement. Feel free to ask any questions!
from noa.
Awesome thanks! I'm very interested in expanding noa to be more of a game base(like minetest if you know that project) than a framework for voxel rendering. I might look into making a library on top of noa that allows for some things like universal controls(vr, mobile, controller), multiplayer, mods, etc. Does noa have a discord server or something?
from noa.
Would you consider upstream making this movement code
noa/src/components/receivesInputs.js
Line 49 in d9fe5d1
from noa.
Awesome to the tracking issue. As for gamepad api it is really simple to implement I may make a pr. One last question would you ever be interested in multiplayer support built into this library? Or maybe as an official separate addon library such as noa-networking?
from noa.
Is it possible to use this engine with Vite bundler? The require.context in entities.js seems to be webpack specific and I can't figure out how to properly use this as dependency in a Vite Vue/Svelte project.
Temporarily using it in Webpack Vue project but the HMR is slow.
from noa.
@lknlknim Hi, there is an issue for this that I forgot about - I'll pop over and fix it now. Should be fixed in #develop in a few minutes.
Also I'll close this since several topics have been touched, but feel free to open new issues for anything else.
from noa.
Related Issues (20)
- render single cube HOT 3
- raycast using touch event page x/y instead of camera position HOT 5
- Changing the world results in chunks being loaded in a bad way HOT 7
- able to add shadow to a specific chunk but not a particular face??? HOT 10
- Is there a way to draw on the gaming canvas HOT 1
- voxels.index is undefined HOT 5
- Using a texture atlas for block materials HOT 12
- Support gamepad input
- Outdated comment + note on blockMesh registration HOT 2
- Alpha blended mesh ordering issue HOT 2
- Terrain remeshing bug when block is neither solid nor opaque HOT 3
- Custom voxel occasionally leaves one side after removal. HOT 4
- UV offsets wrapping at edges of blocks HOT 2
- object meshing bug HOT 6
- Meshing with non-opaque blocks is incredibly slow + block textures with alpha dont work HOT 4
- custom renderMaterial performance (for animated textures) HOT 2
- Supporting noa HOT 2
- Does NOA support child meshes? HOT 3
- webgpu? HOT 2
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 noa.