Giter Club home page Giter Club logo

Comments (8)

NyxCode avatar NyxCode commented on August 17, 2024

Just stumbled over this project, looks awesome! I thought i'd try to play around with this a bit to learn about spec.

What about a System which goes through all BlockUpdateEvents and recalculates lighting in every chunk which has been updated?

from feather.

caelunshun avatar caelunshun commented on August 17, 2024

Just stumbled over this project, looks awesome! I thought i'd try to play around with this a bit to learn about spec.

What about a System which goes through all BlockUpdateEvents and recalculates lighting in every chunk which has been updated?

Lighting would be stored in the Chunk, as it is in vanilla, in two compact arrays. See https://wiki.vg/index.php?title=Chunk_Format&diff=14678&oldid=14646#Chunk_Section_structure.

As a starting point, going through BlockUpdateEvents and recalculating the entire chunk would be fine. We would want to optimize the algorithm so that only blocks affected by light updates are recalculated, and not the entire chunk.

from feather.

NyxCode avatar NyxCode commented on August 17, 2024

that sounds reasonable.
I think a good approach would be to store all light sources in each chunk. When a light source is placed/destroyed, we just increase/decrease the light-level of surrounding blocks. When a normal block is placed/broken though, we'll have to go through all light sources (which are close) and recalculate their light. What do you think?
For this it'd be nice to create a struct similar to ChunkMap which just stores the light sources, soemthing like HashMap<ChunkPosition, Vec<(BlockPosition, LightLevel)>>.

from feather.

caelunshun avatar caelunshun commented on August 17, 2024

@NyxCode Yes, that will work. To start, we should probably resolve #103 so that existing lighting data is loaded. This will also involve adding the light storage in Chunk.

Glad to see some interest in this project!

from feather.

NyxCode avatar NyxCode commented on August 17, 2024

yeah, i'll look at that first! I don't have a lot of time, but this project looks great!
Is there a place for discussions/questions except github issues? maybe a discord server?

from feather.

caelunshun avatar caelunshun commented on August 17, 2024

Is there a place for discussions/questions except github issues? maybe a discord server?

Well, the project didn't have any publicity until it ballooned yesterday, so we don't really have a community or discussion place. I could make a Discord server, but given the early state of the project, I'm not sure if there's a need yet.

from feather.

NyxCode avatar NyxCode commented on August 17, 2024

:D the post on the rust subreddit, huh?
I mean, it's your call, but I could imagine that a place for discussion on the development would be usefull.

from feather.

caelunshun avatar caelunshun commented on August 17, 2024

I mean, it's your call, but I could imagine that a place for discussion on the development would be usefull.

I guess I agree; here's the Discord server. https://discord.gg/4eYmK69

from feather.

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.