Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Block networks and Signalling #521

Merged
merged 31 commits into from Jun 4, 2013
Merged

Block networks and Signalling #521

merged 31 commits into from Jun 4, 2013

Conversation

MarcinSc
Copy link
Member

@MarcinSc MarcinSc commented Jun 3, 2013

blockNetwork library mod - support for networks of blocks for conducting power, fluids, signals, etc.
signalling mod - support for sending signals between blocks, based on producer/consumer model

Marcin Sciesinski and others added 30 commits May 30, 2013 10:44
…n of Direction objects to reduce memory footprint, as well as performance.
…the topology of its networks. Network is now an interface with read only methods as any changes to Network should be done via BlockNetwork class, which guards consistency of networks topology.
…ed they have different connecting sides. For example logical gates act as both producer and consumer and can end up in the same network.
@Cervator
Copy link
Member

Cervator commented Jun 3, 2013

Tested this already (well, before pressure plates were added!) and it works great :-)

Made a video: http://www.youtube.com/watch?v=KZcRc9oCJP8

Leaving PR open for just a bit for any feedback. @immortius ?

I know it could use a quick round of checkstyle fixes (ifs) sometime and maybe some commit squashing :-)

@Override
public void update(float delta) {
// Mark all networks affected by the producer signal change
for (Vector3i producerChanges : producersSignalsChanged)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should avoid bracerless constructs (see the Sun Java style guide).

@immortius
Copy link
Member

Given that it is wholly modules (I appreciate this a lot) I don't feel a need to review in great detail. I had a quick glance over it and it looks well done - makes good use of the entity system and event features.

Commented on one style matter but it isn't a big deal.

@MrBarsack
Copy link
Member

Great! 👍

Only one thing, had a crash while testing it:

16:52:18.142 [main] INFO o.t.s.componentSystem.SignalSystem - Producer added to network
16:52:18.152 [main] ERROR org.terasology.game.Terasology - Uncaught Exception
java.lang.NullPointerException: null
at org.terasology.signalling.componentSystem.SignalSystem.update(SignalSystem.java:85) ~[na:na]
at org.terasology.game.modes.StateSinglePlayer.update(StateSinglePlayer.java:114) ~[Terasology.jar:14, blockNetwork, 2013-06-03_03-28-24, prealpha]
at org.terasology.game.TerasologyEngine.mainLoop(TerasologyEngine.java:437) ~[Terasology.jar:14, blockNetwork, 2013-06-03_03-28-24, prealpha]
at org.terasology.game.TerasologyEngine.run(TerasologyEngine.java:184) ~[Terasology.jar:14, blockNetwork, 2013-06-03_03-28-24, prealpha]
at org.terasology.game.Terasology.main(Terasology.java:39) ~[Terasology.jar:14, blockNetwork, 2013-06-03_03-28-24, prealpha]

Hope it helps. :)

Cervator added a commit that referenced this pull request Jun 4, 2013
Block networks and Signalling
@Cervator Cervator merged commit fea4c33 into MovingBlocks:develop Jun 4, 2013
@Cervator
Copy link
Member

Cervator commented Jun 4, 2013

Merged! I moved @MrBarsack's bug report to new issue #523 :-)

It being this early any sort of rework will probably invalidate that bug but I wanted to keep it around just in case.

@MarcinSc - thanks again! I didn't run checkstyle after all since you had asked how to set it up, so if you want to apply some tweaks sometime soon feel free. I didn't want to cause conflicts. If nothing else we'll catch it in a general checkstyle overhaul come the restructuring :-)

Idea for next small thing (if you haven't done it already): Outright switch block, which is simply a transformer with two settings - either range 0 or range x. Could just be the existing switches made clickable, really. Could make the texture change too for a "real" switch :-)

Sometime big thing challenge: Make an arrow turret out of the combat branch (if you can get it to work ...) that shoots arrows when powered :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants