[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 583: sizeof(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 639: sizeof(): Parameter must be an array or an object that implements Countable
Alliance From Hell • Seeking programming/modding advice
Page 1 of 1

Seeking programming/modding advice

Posted: Sun May 20, 2012 3:27 pm
by Hoopity
A friend and I are looking to embark on a project to create room lighting controlled by the light level in a 3D computer game environment. Before digging in, we're trying to learn a little more about the scope and difficulty of the project.

We think Minecraft is the right direction to go. For one, minecraft already has light discretely quantized as part of the game mechanics. I could be wrong, but my gut tells me that this makes things significantly easier. Secondly, Minecraft has a fairly deep community of folks dedicated to modding the game up and down, though it is not open source. Unfortunately, I'm not part of that community, and I haven't been able to make much headway there.

To create what we intend, we need to read live light level values from minecraft (a value already native to the game) into a separate program of our design.

The real meat of the project that we are excited about is the design and control of the lighting, not so much modding minecraft. For those with java experience, modding experience, or even just programming experience at this level, how complicated would you rate this task? Are we barking up a very large and thorny tree?

Thanks :o

Re: Seeking programming/modding advice

Posted: Sun May 20, 2012 4:02 pm
by Fred Nefler
The first complicating factor that comes to mind is that the location, intensity range, and light distribution (sources can be partially encased in reflecting or opaque materials to make them shed a cone of light instead of a sphere, light can be blocked by objects, walls and ceilings may have different colors and lighting relevant properties, etc.) of the physical rooms light sources can be wildly different from the virtual room. So trying to convert between the two sets could be difficult, and probably impossible in general (within even fairly generous deviations). I'm thinking you might have to make certain assumptions about similarities of the rooms or something like that. Which you might already be making, but I don't see that specified in your post.

Re: Seeking programming/modding advice

Posted: Mon May 21, 2012 9:45 am
by lotsofphil
Two pieces, right?

1) Get the values from Minecraft (at whatever frequency/refresh rate you need/want)
2) Translate those values to whatever controls your lights and change your lighting.

You didn't ask about #2, so that is covered?

For #1 it depends on minecraft. If there is some kind of API where all you have to do is
MinecraftObject mco = currentMinecraftInstance.getEnvironmentVariables();
LightingObject lo = mco.getLightingParameters();
...
HoopitysRoomLighting hrl = new HoopitysRoomLighting(lo);
hrl.changeLights();

Then it looks pretty simple.

But if minecraft doesn't have something like that and you've got to set it up to dump hex to a file, parse that file, etc, then it will be tougher.
However, if there is an active community that does this stuff in minecraft I am almost certain you won't need to redo the work. So, my advice is to stop if you find yourself reproducing basic minecraft/mod interfaces.