Forums - Open Redstone Engineers
MCsim (pre-alpha release) - Printable Version

+- Forums - Open Redstone Engineers (https://forum.openredstone.org)
+-- Forum: Off-Topic (https://forum.openredstone.org/forum-4.html)
+--- Forum: Programming (https://forum.openredstone.org/forum-8.html)
+--- Thread: MCsim (pre-alpha release) (/thread-1606.html)



MCsim (pre-alpha release) - CX gamer - 12-16-2013

OPEN SOURCE: https://github.com/CXgamer/MCsim

Hey guys! This turned a bit into a ramble. If anything, please look at the screenshot. Smile

Back in the old days there was Baezon's redstone simulator, then there was Mordritch's JavaScript Redstone Simulator. (EDIT: There's also Rek's Circiut Simulator.) But the major problem with simulators is that they're never 100% accurate, or fail to stay updated with the game.

So back in 2011, I started working on my own. I've only been working on it off and off, coïncidently, only in the months december and january (and once in february in 2012). But this last time I feel like I've made some good progress (and also removed large portions of bad code that dumb old me made years ago).

Here's a screenshot:
[Image: AJIxM9w.png]

Notice you're able to open more than one perspective, and you've got 3 perspectives in total. Visually this is pretty much the same as what I had years ago, but I've made major leaps in performance (I learned not to re-instantiate hundreds of objects every layer switch). Also note not all blocks are drawn yet, just air, wires, torches, repeaters and wooden and stone buttons.

But the difference with this simulator is that it uses Reflection to run actual parts of the original game. Of course minecraft.jar is obfuscated, so I'm also requiring some files out of MCP's /conf folder, parsing its deobfuscated names and then just grabbing the correct classes out of the .jar. The same applies to anything I want to do inside those classes. Had some minor trouble with duplicate entries but that's all sorted out.

With that, I'm down to doing the actual implementation (but all parsing and loading is already done). I heard there were major changes in the code since 1.7, so I'm kinda waiting on MCP's 1.7 update. But there's plenty of stuff I can work on in the meantime, of course.

If you have not already figured out, this whole reflection thing means I'll be using Java. My apologies to anyone who is disappointed in hearing this.

Rambling starts here...

Oh what also might be interesting is that I'm drawing each tile exactly once, and then use every tile's unique identifiers to generate a hash which is then used to store a BufferedImage into a HashMap. This achieved a great speedup in rendering. But it also limits the number of unique blocks to 64.

The reason being is that a hash is made out of 16 bit integers, and these are the unique identifiers that make up a piece of redstone wire:
  • 4 bits for all connections
  • 2 bits to indicate from which side you're looking (and thus how it should be rendered)
  • 4 bit power level
And that leaves me with 6 bits to use to indicate that it's actually a redstone wire. But that's not ever a problem, and there's plenty of ways around this.

But apart from that, the plan is to incorporate lots of tools for redstone engineering in this. Like automated testing, block update plotter, useful logic tooltips, ... But since we're using the original minecraft code anyway, we should be able to pretty much build anything that's possible in minecraft. I'm aware this is not the place for survival minecraft, but I'm thinking item entities, mobs, hoppers, ...

If I decide to do it by sending packets to the internal server, I might as well be able to connect to an existing creative server. But that's probably not for now. Anyway I hope some of you share my enthusiasm, and I hope that I'll get past february next year, then it might actually be something release-worthy.

Thanks for the read guys! Smile

EDIT: I noticed a small bug in the screenshot causing the off-torches to float on a grey block (which means it isn't drawn yet). It's probably got to do with the fact that block ID's are unsigned bytes and java's bytes are signed, and that block happens to be newly coloured quartz, so it's > 127. At some point, I had fixed it, but seems like I undid too much or broke it again in another way. Cheers!


RE: Redstone simulator anyone? - Somepotato - 12-16-2013

Cool but the main issue with all these redstone simulators is that it's hard to get a grasp on the layout. Very good job though


RE: Redstone simulator anyone? - CX gamer - 12-16-2013

I agree it may take some time before it becomes intuitive. However the advantage is that you always maintain your overview and don't have to fly around to build stuff.

EDIT: So sexy...
[Image: F7KBOWY.png]

EDIT2: Now supporting scaling once again!
[Image: 5PKBL5l.png]


RE: Redstone simulator anyone? - Frontrider - 12-19-2013

Make it to run on android, and everyone is happy.


RE: Redstone simulator anyone? - EDevil - 12-19-2013

(12-19-2013, 11:34 AM)Frontrider Wrote: Make it to run on android, and everyone is happy.

I approve this awesome feedback.


RE: Redstone simulator anyone? - CX gamer - 12-19-2013

(12-19-2013, 11:34 AM)Frontrider Wrote: Make it to run on android, and everyone is happy.

Hmm that would be quite hard. I certainly wouldn't be able to fit the features in it that I'm having planned now. It'd have some major performance issues, besides it requires the minecraft.jar, and I don't think it's got the memory available to run on Android, specially in the unoptimized parts of Reflection.

I am working on a chat client for Android for school. It will use encryption and has the possibility to send one GPS data if proper permission is given. But it's for school so that will probably be half-assed.

Anyway, here's another screenshot of more blocks being drawn. Also cleaned up more of the 2 year old code.

[Image: 6n13e6L.png]


RE: Redstone simulator anyone? - EDevil - 12-19-2013

The android thingy was kind of a joke Tongue You've been working so hard at this, and then we demand you to code it for android?!? Naah, just continue with this epic project on PC Big Grin


RE: Redstone simulator anyone? - redstonewarrior - 12-19-2013

In theory, if you get really into it, you could spend an evening stripping away at the block classes (and remove most others), until you arrive at a relatively small thing that could be put on android. Have fuuuuun.


RE: Redstone simulator anyone? - CX gamer - 12-19-2013

Haha alright both of you got me. xD


RE: Redstone simulator anyone? - Neogreenyew - 12-19-2013

Why wouldn't you just build the device in minecraft..? It would be easier and faster imo.


RE: Redstone simulator anyone? - CX gamer - 12-19-2013

(12-19-2013, 07:33 PM)Neogreenyew Wrote: Why wouldn't you just build the device in minecraft..? It would be easier and faster imo.

Because an external simulator would have more control on the passing of gameticks, tools to wire up one point to another, tools to automatically test inputs to outputs, ... Way easier copy and pasting of certain parts. Auto-tiling of parts of a build. More graphing on the amount of block updates (because more than 1000 planned block next tick will just invisibly cut them off). It's not about building one device, but rather making a platform that makes making devices easier in the long run.

EDIT: The next couple of weeks, I have way too much work to do for school. So don't expect any updates. If you do see me posting updates however, you know I'm screwing myself over. Just to have another screenshot, here's all my backups. xD

[Image: JVClwyo.png]


RE: Redstone simulator anyone? - redstonewarrior - 12-20-2013

What? No tar.*! This is an outrage!


RE: Redstone simulator anyone? - CX gamer - 12-20-2013

Technically not tar.*, but the best I could do given the current setup.

[Image: X9hvwqb.png]

I do plan on setting up linux when I don't need my computer to do stuff for school though. (I've been using VM's for now)


RE: Redstone simulator anyone? - Neogreenyew - 12-21-2013

(12-19-2013, 08:51 PM)CX gamer Wrote:
(12-19-2013, 07:33 PM)Neogreenyew Wrote: Why wouldn't you just build the device in minecraft..? It would be easier and faster imo.

Because an external simulator would have more control on the passing of gameticks, tools to wire up one point to another, tools to automatically test inputs to outputs, ... Way easier copy and pasting of certain parts. Auto-tiling of parts of a build. More graphing on the amount of block updates (because more than 1000 planned block next tick will just invisibly cut them off). It's not about building one device, but rather making a platform that makes making devices easier in the long run.

EDIT: The next couple of weeks, I have way too much work to do for school. So don't expect any updates. If you do see me posting updates however, you know I'm screwing myself over. Just to have another screenshot, here's all my backups. xD

[Image: JVClwyo.png]

Fair Enough.
Now will you be adding a function to this app that takes the creation you made and imports it into a world so that you don't have to rebuild everything? If anything, that is what would make your app stand out.


RE: Redstone simulator anyone? - CX gamer - 12-23-2013

(12-21-2013, 04:14 PM)Neogreenyew Wrote: Fair Enough.
Now will you be adding a function to this app that takes the creation you made and imports it into a world so that you don't have to rebuild everything? If anything, that is what would make your app stand out.

Right now I'm importing from .schematics, and of course I'm planning to save to .schematic as well. Since we're using parts of the minecraft code anyway, it should be pretty doable to import and edit a world. But not right at the start, so don't get to enthusiastic just yet. Wink


RE: Redstone simulator anyone? - CX gamer - 12-28-2013

Damnit I let myself go again..

[Image: zlNZH2t.png]

I tested it with the ZipKrowd's storageroom prototype...

Real nice results!

http://i.imgur.com/oyIqB9T.gif
http://i.imgur.com/U7ixiMQ.gif
EDIT: Hahaha
http://i.imgur.com/2KnOquw.gif


RE: Redstone simulator anyone? - Jmking80 - 12-28-2013

Looks fancy


RE: Redstone simulator anyone? - Chibill - 12-28-2013

Can you export shematic yet?


RE: Redstone simulator anyone? - CX gamer - 12-28-2013

(12-28-2013, 06:18 PM)Chibill Wrote: Can you export shematic yet?

There's no editing feature yet, so so far there's no point in loading and saving schematics. But I'll make it the next thing I'll do for sure. I'll work on it on sunday. Smile


RE: Redstone simulator anyone? - Chibill - 12-28-2013

Also there is beta MCP out for 1.7.2


RE: Redstone simulator anyone? - CX gamer - 12-29-2013

(12-28-2013, 10:14 PM)Chibill Wrote: Also there is beta MCP out for 1.7.2

Ooooh! That's great news! Thanks for letting me know!

EDIT: From the first looks of it, they renamed client.srg to joined.srg, while fields.csv and methods.csv remained the same. The internal syntax hasn't changed so no compatibility issues will arise (but they may merge fields and methods into joined in the future since there used to be a classes.csv as well). Anyway, I'm off to check if my implementation plan is still viable for this build.

EDIT2: Wow! :o

EDIT3: So by the looks of it, the implementation I had in mind changed a bit. The instancing of new blocks works entirely differently, but if I'm not 100% sure if the behind the scenes part are instanced correctly or not, yet. Anyway, I'm going to experiment bits of simulating here and there, but I won't completely finish it until it's out of beta, since I don't want to be referencing to func_149634_a and then forget what it was when its name is updated by MCP. But mostly I'll be preparing and taking notes now. But first I'll make it save to schematics (and possibly add extra tags to be used by the sim only, just like MCedit has/had some extra tags).

EDIT4: Slight update. Haven't really started simulation yet because I was too excited for other things. Instead, with publish you can now also upload your images to imgur. Also we can now save to schematic! Yaaay! Big Grin
On a more serious note though, I was thinking of publishing imgur albums as a reddit thread on a dedicated subreddit. Could be awesome or just too gimmicky, can't really tell.


RE: Redstone simulator anyone? - CX gamer - 02-21-2014

Alright we're back. The last week of school is done and we're cruising onwards toward the exams, which is a very relaxed period. This means that I can finally can get fun stuff one, like the simulator.

About the sim itself, I'm stepping away from doing the GUI in Java, since I eventually want to do fancy things to generate circuits, and there's no way I'll use Java for that.

My current plan is to make only the simulator part in Java, and the GUI in C++ using Qt. They'll communicate using RPC, namely Messagepack. Had a little trouble on the C++ side with that (because I don't have much experience with C++, but I've got a wizard buddy that will always pull me through).

Sorry for leaving you guys without an update for so long, but there was a little bit of progress on the simulator side (I can tickUpdates(), but it does nothing since there there are no planned updates, nor is there a chunkProvider yet). And now that I have time, you might see me in-game again maybe.

EDIT: Swapped 2 alineas.

EDIT2: This isn't a very informative edit, but a lot of progress has been done since last edit. Problems are getting solved quickly and I keep getting surprised to see my "success" console message with no errors. Right now, I can get any Block object, fill up a chunk with them and I implemented IChunkProvider, which is all working. Exciting! Big Grin


RE: Redstone simulator anyone? - Iceglade - 02-21-2014

Awesome! Good luck to you :3


RE: Redstone simulator anyone? - CX gamer - 02-23-2014

Today I've written the function to load in a world from a byte array. I was very content to write this function, since I've been building up to this point for a while.

[Image: Zk7Tr0W.png]

This function was written in one go, so I was a bit nervous to test it, but after fixing a small typo, it worked without errors. This came as a pleasant surprise to me, so I sighed relief pretty deeply. rChunkProvider is an implementation of IChunkProvider, so it will still have to be seen if tickUpdates agrees with it. But yeah, apologies if this isn't a very informative post, but I wanted to share my enthusiasm while at the same time giving you guys an update. I feel like it also helps to keep myself active on the project.

There's still quite a bit of work, but I'm finding my drive. The next steps are to do the other way around (pulling blocks and data from chunks) and the non-trivial tickUpdates (which works now, but I still need to add NextTickListEntries).


RE: Redstone simulator anyone? - Chibill - 02-24-2014

Then is the problem of updating to 1.7's Crazy not id system. other then like an id table in the world some how.


RE: Redstone simulator anyone? - CX gamer - 02-24-2014

There's a static method in Block called func_149729_e which takes an integer and returns a Block object. The prerequisite is that func_149671_p is called once during loading to load up registryNamespaced with all the Block objects, block ids and block names. So no, I don't think it's a problem at all. I'm also buffering the Block objects by their id in a HashMap after the first time they're called, to avoid reflection as much as possible.

In other news, my crazy genius friend believes it is possible to make the sim on Android. Possible or not, we're going for it. This is also brilliant timing, since I haven't started on the Qt GUI yet anyway.

EDIT: Damn I'm excited. Big Grin


RE: Redstone simulator anyone? - Iceglade - 02-24-2014

Oh my god. func_149729_e and that whole naming scheme makes me want to murder innocent little bunnies.

But sounds awesome dude!


RE: Redstone simulator anyone? - Nuuppanaani - 02-24-2014

Android <3 <3 <3


RE: Redstone simulator anyone? - Chibill - 02-25-2014

(02-24-2014, 11:21 AM)CX gamer Wrote: There's a static method in Block called func_149729_e which takes an integer and returns a Block object. The prerequisite is that func_149671_p is called once during loading to load up registryNamespaced with all the Block objects, block ids and block names. So no, I don't think it's a problem at all. I'm also buffering the Block objects by their id in a HashMap after the first time they're called, to avoid reflection as much as possible.

In other news, my crazy genius friend believes it is possible to make the sim on Android. Possible or not, we're going for it. This is also brilliant timing, since I haven't started on the Qt GUI yet anyway.

EDIT: Damn I'm excited. Big Grin

You do know MCP updated more mapping and now those have names.


RE: Redstone simulator anyone? - CX gamer - 02-25-2014

(02-25-2014, 12:15 AM)Chibill Wrote: You do know MCP updated more mapping and now those have names.

Awesome man, thanks for letting me know once more. <3

EDIT: Now they're called appropriately called registerBlocks and getBlockById. Big Grin


RE: Redstone simulator anyone? - CX gamer - 02-25-2014

Alright once more progress has occurred. We can now load up schematics into the world and save the world as schematic back again. Also I wrote a little profiler to have a look to how fast stuff goes in ms:

Code:
Program start                 1393366106562
Parsing and linking           410
World                         396
Block                         149
Chunk                         1

Loaded schematic              316
Set world                     81
Get world                     132
Saved schematic               28

Up until the gap are constant times, but the remaining ones suffer greatly because of the big (61x42x59) schematic. This is how fast a player's statue would be:

Code:
Loaded schematic              4
Loaded world                  21
Get world                     57
Saved schematic               2

Note this does not yet contain tickUpdates, which will use reflection far more extensively, yet I'm pleased with these times.


RE: Redstone simulator anyone? - CX gamer - 02-26-2014

Big GrinBig GrinBig GrinBig GrinBig Grin

Now to explain the abundance of overly joyous emotions. Basically, the first block updates have happened! The very first update was caused by a redstone torch in this circuit:

[Image: qnsxlxZ.png]

I was testing with setBlock and eventually got it working, there's a flag you can use to update blocks after setting it. I turned it to 0 while trying to get it working. When it did, I tried it with updating and got this.

Note that this isn't actually attached to any GUI yet, I just saved to schematic and loaded that up with the deprecated Java GUI. I've also attached minecraft's own Profiler while trying to get setBlock working, so now my output looks like this;

Code:
SIM PROFILER:
Program start                 1393428289252
Parsing and linking           401
Minecraft profiler            266
Block                         207
Chunk                         6
World                         53
Loaded schematic              5
Set world                     7
Set block                     6
Get world                     3
Saved schematic               1


MINECRAFT PROFILER:
Profiler test                 4597
checkLight                    115296



RE: Redstone simulator anyone? - CX gamer - 02-27-2014

HURRAY once more! Big GrinBig Grin Glory to all! Rejoice! Big Grin
MILESTONE ACHIEVED!!!

[Image: Jt0A7Yd.png]

So it works for redstone! Big Grin The green edges are my cursor selection that has a bug in it I'm not bothering to fix. Here's water flowing around the ORE logo:

[Image: V4DnDqh.png]

Apologies that the water doesn't make much sense, it shouldn't be upside down, but I made the schematic without thinking about orientation and ended up flipping it with photoshop (and also enlarging it a bit).

For those interested, he's what's happening in MC's profiler:

Code:
MINECRAFT PROFILER:
cleaning                      347415
ticking                       28734790
ticking.checkLight            795187
checkLight                    93462

Right now it crashes when I think entities are created, but for the majority of its use, tickUpdates works perfectly. I might later also use tick itself (it crashes atm) if I ever want to simulate almost all farms. Not sure what I'll do next now, so many options.. Big Grin


RE: Redstone simulator anyone? - Iceglade - 02-28-2014

Looks amazing dude!


RE: Redstone simulator anyone? - redstonewarrior - 02-28-2014

Not an underwater level!


RE: Redstone simulator anyone? - CX gamer - 03-07-2014

Alright, busyness was had and a little progress has been made. But first a little background. The way the world used to be loaded was first the schematic is parsed and put into a World object containing the byte arrays for block ids and data, that is passed to the actual loader.

That was working fine until I thought about how I'd do TileEntities and Entities, as I didn't want to make a ton of objects for all the different kinds and load them separately.. bah. So my plan now is to load in the schematic itself, rather than converting to an object. The reasoning is that I might be able to use (I really hope so) the NBT tags of every TileEntity, convert them to NBTTagCompound objects inside minecraft and use the games own loading methods to add them to the world. There's a function readily available for that.

Other than that, there was this odd bug that would sometimes scramble a loaded schematic. I hopped on the server today to clear my head, and I had a moment of clarity. See if you can spot the pattern:

[Image: FHoSVyI.png]

After fixing it, I immediately went to see if the storage room would work. Go see for yourself:

http://i.imgur.com/kji3p0f.gif

EDIT: Just to clarify, it did this before as well, so hereby I've discovered a new bug. For tomorrow.


RE: Redstone simulator anyone? - Chibill - 03-07-2014

If you want to look there may be a bit better way of loading the schematic I can give you a like to a mod API for forge (should be simple to get it to work with out it) the allows importing or schematic at run time of the mod it's in which in this case at schematic load load it. But to really see if its better I would have to see your code and I don't really want too. I have so much code to work on right now as it is. (Recoding Additional Crafting from scratch.)


RE: Redstone simulator anyone? - CX gamer - 03-07-2014

Well Chibill, I've already thought about what you suggested. This whole project would be a lot easier if I would use or make a mod that contains relevant functions. But then, all the users would have to install that mod, and the simulation wouldn't be completely vanilla. Further, I've been designing it as such that when MCP updates, the Sim works (currently there's still a couple obfuscated things), can't wait until the mods update. Currently the loading in schematic code is fine and runs in well under a millisecond, I'm using a Tag-class that I found on the wiki years ago.

[Image: DO8Gl8Y.png]

EDIT:

Geez the errors I get.. xD
[Image: Lqqc6kq.png]


RE: Redstone simulator anyone? - Chibill - 03-07-2014

Okay.


RE: Redstone simulator anyone? - CX gamer - 03-12-2014

I was asked to produce the simulator because it would be helpful in a project. So here's the download:

https://www.dropbox.com/s/j6mpv1r795qqhot/RSsim.jar

This is only the GUI, the actual simulating is not implemented. I was in the middle of refactoring when this jar was compiled, so the layer markers wouldn't work. Not everything is drawn yet, but it works for these:
  • Buttons
  • Comparators
  • Glass
  • Hoppers
  • Pressure plates
  • Repeaters
  • Redstone torches
  • Wires
  • Slabs (green)
  • Water

You can export png's and gifs. The checkbox will upload all of them to imgur, but the links are discarded.

Just to be clear again, I might integrate basic simulating into this GUI, however the plan is to move to a C++ GUI environment, because I need it to be able to do fancy stuff. So have fun with it guys. Smile

EDIT: Oh I forgot, it will also ask you for minecraft.jar and some MCP files. Those is not really needed, so you can just cancel those. If you do happen to have the latest version of MCP and the correct minecraft.jar, it will load up a world in the background and do nothing with it (since I branched the simulator part from there).


RE: Redstone simulator anyone? - Legofreak - 03-13-2014

every time i see you post here im like "OOOOO did he release it?!?!"
it looks like you're getting there... i cant wait to see the final product.


RE: Redstone simulator anyone? - CX gamer - 03-22-2014

I made a video on the simulator for those interested:

https://www.youtube.com/watch?v=6Eouiydm0r8

Best part starts at 3:09. Have a good day. Smile


RE: Redstone simulator anyone? - Iceglade - 03-25-2014

Wow, looks extremely fancy!


RE: Redstone simulator anyone? - CX gamer - 04-04-2014

Apologies for the lack of updates, been kinda busy, but I've also been playing Oblivion, so there's really no excuse. Regardless, I've squatted a bug that I've been struggling with. What it eventually was, was what I was thinking, but didn't really think it could be, until I debugged:

Code:
-119: air
-118: air
-112: air
-105: air
-102: air
-107: air
-116: air
52: mobSpawner
25: musicBlock
33: pistonBase
29: pistonStickyBase
117: brewingStand
116: enchantmentTable
68: sign
61: furnace
54: chest
-126: air
84: jukebox
23: dispenser
-98: air
63: sign

All of these should be not air, but some are, so that's the problem. So then I did this:

[Image: M2TEhO1.png]

And then the predictable happens:

Code:
-119: commandBlock
-118: beacon
-112: skull
-105: daylightDetector
-102: hopper
-107: comparator
-116: flowerPot
52: mobSpawner
25: musicBlock
33: pistonBase
29: pistonStickyBase
117: brewingStand
116: enchantmentTable
68: sign
61: furnace
54: chest
-126: enderChest
84: jukebox
23: dispenser
-98: dropper
63: sign

One of the reasons the update took to long is because of many hours of scratching my head about this. Gonna test this now right away and if it works, I'll start integrating it within the GUI. Smile

EDIT: Oh I forgot to add, exporting schematics from ORE doesn't export non-inventory TileEntities at all, sadly.


RE: Redstone simulator anyone? - Iceglade - 04-04-2014

[Image: M2TEhO1.png]
^ I very nearly died laughing


RE: Redstone simulator anyone? - CX gamer - 04-04-2014

Oh to follow up, TileEntities do work now:

[Image: JMBCPVX.png]

Ignore the graphical glitch in the middle image now. After I refactor it a bit to work with multiple worlds, I can integrate it into the GUI and have it working there (though you can't edit blocks there yet, and you need to have a block update to get it started, but it should be soon enough).

EDIT: Alright the refactoring is done. Which means all I will be doing until release is merging the GUI with the Simulator and providing some basic editing functionality (because nothing will happen otherwise).


RE: Redstone simulator anyone? - Chibill - 04-05-2014

Looking good.


RE: Redstone simulator anyone? - CX gamer - 04-11-2014

Big Grin Big Grin Big Grin

It is time!

This version will let you simulate everything besides entities: those aren't implemented yet so their behavior is undefined. There are a couple graphical issues because there are still a lot of leftovers from 3 year old crap code, so ignore those. Oh and I've also started calling it "Redstone lab", since there's plenty of "Redstone Simulator"'s and I don't want my name in the title.

One last note on this GUI: it's very rushed to get a functional prototype out. I'd like to hear if it works for you guys.

After downloading, please do read the readme.

Download link:
https://www.dropbox.com/s/uli6qttj35d17r3/Redstone%20lab.zip

Apologies for the awkward compression format.


RE: Redstone lab (Functional release) - Chibill - 04-11-2014

Zips are not awkward .rar is an awkward one.


RE: Redstone lab (Functional release) - AFtExploision - 04-11-2014

.tar.gz FTW! So, I have to have a schematic to load?


RE: Redstone lab (Functional release) - CX gamer - 04-11-2014

(04-11-2014, 01:11 AM)AFtExploision Wrote: .tar.gz FTW! So, I have to have a schematic to load?

Yes, I have included some in the .zip if you want, or you can also make your own. Smile

EDIT: I've made entities kinda work. The simulator won't crash when they are created (so water will wash things away), but the entities themselves aren't saved yet, so pistons won't work just yet.


RE: Redstone lab (Functional release) - CX gamer - 05-02-2014

Hello again!

When I previously said that tile entities were working, I said it because they didn't crash the sim anymore and comparators appeared to be working. However though there was still a bug, so I'll explain the timeline taking off from my last post. That bug is that there were tileEntities getting duplicated when going to the sim and back.

First, comparators work, hoppers don't, why? They weren't loaded properly, I loaded them in the chunk and in the world. So it disregarded my imported tileEntities and created new ones when they were updated. I noticed they would be put into world by chunk, so I removed the part of putting them into the world.

Then, when debugging I noticed no tile entities were sent back at all. I commented out the tickEntities of World, which would remove tileEntities is they were invalid. Same result still. At this time I was at a pause and needed some time to think, whilst also casually reading through the ins and outs of the minecraft code, after which I stumbled upon onChunkLoad. So then I called it when loading it in my own ChunkProvider class.

After doing so, still got the same effect. I noticed that Chunk would just store TileEntities in a chunkTileEntityMap and a few things can do wrong. Instead, I just run onChunkLoad right after instancing.

Now, I believe that the tileEntities that are loaded, are loaded in properly, that because TileEntities don't duplicate anymore. However, not all of them are loaded, as you can see here in this simple hopper clock:

Going into the Sim

Code:
TAG_Compound("Schematic"): 9 entries
{
   TAG_Short("Height"): 3
   TAG_Short("Length"): 2
   TAG_Short("Width"): 3
   TAG_List("Entities"): 0 entries of type TAG_Byte
   }
   TAG_List("TileEntities"): 4 entries of type TAG_Compound
      TAG_Compound: 5 entries
      {
         TAG_String("id"): Comparator
         TAG_Int("OutputSignal"): 1
         TAG_Int("x"): 1
         TAG_Int("y"): 1
         TAG_Int("z"): 1
      }
      TAG_Compound: 6 entries
      {
         TAG_List("Items"): 1 entries of type TAG_Compound
            TAG_Compound: 4 entries
            {
               TAG_String("id"): minecraft:redstone_torch
               TAG_Short("Damage"): 0
               TAG_Byte("Count"): 1
               TAG_Byte("Slot"): 0
            }
         }
         TAG_String("id"): Hopper
         TAG_Int("TransferCooldown"): 6
         TAG_Int("x"): 2
         TAG_Int("y"): 1
         TAG_Int("z"): 1
      }
      TAG_Compound: 6 entries
      {
         TAG_List("Items"): 0 entries of type TAG_Byte
         }
         TAG_String("id"): Hopper
         TAG_Int("TransferCooldown"): 6
         TAG_Int("x"): 2
         TAG_Int("y"): 1
         TAG_Int("z"): 0
      }
      TAG_Compound: 5 entries
      {
         TAG_String("id"): Comparator
         TAG_Int("OutputSignal"): 0
         TAG_Int("x"): 1
         TAG_Int("y"): 1
         TAG_Int("z"): 0
      }
   }
   TAG_String("Materials"): Alpha
   TAG_Byte_Array("Data"): [18 bytes]
   TAG_Byte_Array("Biomes"): [6 bytes]
   TAG_Byte_Array("Blocks"): [18 bytes]
}

Coming back from the Sim:

Code:
TAG_Compound("Schematic"): 7 entries
{
   TAG_Short("Height"): 3
   TAG_Short("Length"): 2
   TAG_Short("Width"): 3
   TAG_String("Materials"): Alpha
   TAG_Byte_Array("Data"): [18 bytes]
   TAG_Byte_Array("Blocks"): [18 bytes]
   TAG_List("TileEntities"): 4 entries of type TAG_Compound
      TAG_Compound: 5 entries
      {
         TAG_String("id"): Comparator
         TAG_Int("OutputSignal"): 1
         TAG_Int("z"): 1
         TAG_Int("y"): 1
         TAG_Int("x"): 1
      }
      TAG_Compound: 6 entries
      {
         TAG_List("Items"): 0 entries of type TAG_End
         }
         TAG_String("id"): Hopper
         TAG_Int("TransferCooldown"): 5
         TAG_Int("z"): 1
         TAG_Int("y"): 1
         TAG_Int("x"): 2
      }
      TAG_Compound: 6 entries
      {
         TAG_List("Items"): 0 entries of type TAG_End
         }
         TAG_String("id"): Hopper
         TAG_Int("TransferCooldown"): 5
         TAG_Int("z"): 0
         TAG_Int("y"): 1
         TAG_Int("x"): 2
      }
      TAG_Compound: 5 entries
      {
         TAG_String("id"): Comparator
         TAG_Int("OutputSignal"): 0
         TAG_Int("z"): 0
         TAG_Int("y"): 1
         TAG_Int("x"): 1
      }
   }
}

As you may notice, the item disappears from into the hoppers. So that's the next problem to tackle. Anyway, some progress has been made, so just wanted to let that know for the ones following this. Smile


RE: Redstone lab (Functional release) - CX gamer - 05-21-2014

I had a little pause from the sim and worked on the GUI for a bit to get new ideas. The idea is to map images with XML and load them in at run time like that instead of drawing them manually. So it should then be possible to add your own graphics to provide alternatives or draw modded blocks.

As for the simulator itself, my mind has been refreshed and I started looking at Item, because that's what's wrong. I noticed it had some kind of register function, so I executed it, but the problem was not fixed yet. I went a level higher and found the Bootstrap class, which takes care of registering all that needs to be registered in one go (i.e. burnable blocks, statistics list, blocks and items and apparently dispenser behavior). So up next is trying that instead of doing it manually for everything, then the sim will be even more resilient against updates as well.

I need to go now, but I can try it in a couple of hours. Looking forward to that.

EDIT: Nope that did not fix it, continuing searching for new clues.


RE: Redstone lab (Functional release) - Chibill - 05-21-2014

I would look in the NBT saving system in the minecraft code for clues to fix it. Because to me its running a function that you are not.


RE: Redstone lab (Functional release) - CX gamer - 05-26-2014

Alright here goes rubber duck problem solving. I have been debugging for way too long.

I have printed all items which were inside the containers...

Code:
{id:"Chest",Items:[0:{id:"minecraft:redstone_torch",Damage:0s,Count:1b,Slot:1b,},],Lock:"",z:0,y:0,x:0,}
Inventory: container.chest
Size:      27
{id:"Hopper",Items:[0:{id:"minecraft:repeater",Damage:0s,Count:1b,Slot:0b,},],TransferCooldown:0,Lock:"",z:0,y:0,x:1,}
Inventory: container.hopper
Size:      5
{id:"Trap",Items:[0:{id:"minecraft:comparator",Damage:0s,Count:1b,Slot:4b,},1:{id:"minecraft:comparator",Damage:0s,Count:1b,Slot:7b,},],Lock:"",z:0,y:0,x:3,}
Inventory: container.dispenser
Size:      9
{id:"Dropper",Items:[0:{id:"minecraft:wooden_button",Damage:0s,Count:1b,Slot:4b,},],Lock:"",z:0,y:0,x:4,}
Inventory: container.dropper
Size:      9
{id:"Furnace",Items:[0:{id:"minecraft:comparator",Damage:0s,Count:1b,Slot:0b,},],BurnTime:0s,CookTimeTotal:200s,Lock:"",z:0,y:0,CookTime:0s,x:5,}
Inventory: container.furnace
Size:      3

...to learn that there are no items in the said container. The NBT tags you see here are just loaded as NBTTagCompound. So I can say for a definite fact that the items get lost between these, which means everything inside the TileEntity.createAndLoadEntity method.

The TileEntity itself gets loaded succesfully, because we get it back and it doesn't print a stack trace. So we know that we can reach the method readFromNBT for each subclasses of TileEntity. I look at TileEntityChest's method in particular, since it's the most stripped down version of my problem, as its only function is to contain items.
  • The super.readFromNBT works, because we get those back.
  • Minecraft's NBT classes all seem to work, because I've pulled the item compound tags out that way.
  • Nothing is wrong with the size of the array of ItemStack, because I have debugged it up above.
  • CustomName is not present so we can skip it safely.

I've tried loading items from the working item NBT's, but they return nulls, which means the bug is contained within ItemStack.loadItemStackFromNBT. I try to call readFromNBT, but it returns nulls as well.

Code:
{id:"Chest",Items:[0:{id:"minecraft:redstone_torch",Damage:0s,Count:1b,Slot:1b,},],Lock:"",z:0,y:0,x:0,}
Loading item: {id:"minecraft:redstone_torch",Damage:0s,Count:1b,Slot:1b,}
Loaded item:  null
{id:"Hopper",Items:[0:{id:"minecraft:repeater",Damage:0s,Count:1b,Slot:0b,},],TransferCooldown:0,Lock:"",z:0,y:0,x:1,}
Loading item: {id:"minecraft:repeater",Damage:0s,Count:1b,Slot:0b,}
Loaded item:  null
{id:"Trap",Items:[0:{id:"minecraft:comparator",Damage:0s,Count:1b,Slot:4b,},1:{id:"minecraft:comparator",Damage:0s,Count:1b,Slot:7b,},],Lock:"",z:0,y:0,x:3,}
Loading item: {id:"minecraft:comparator",Damage:0s,Count:1b,Slot:4b,}
Loaded item:  null
{id:"Dropper",Items:[0:{id:"minecraft:wooden_button",Damage:0s,Count:1b,Slot:4b,},],Lock:"",z:0,y:0,x:4,}
Loading item: {id:"minecraft:wooden_button",Damage:0s,Count:1b,Slot:4b,}
Loaded item:  null
{id:"Furnace",Items:[0:{id:"minecraft:comparator",Damage:0s,Count:1b,Slot:0b,},],BurnTime:0s,CookTimeTotal:200s,Lock:"",z:0,y:0,CookTime:0s,x:5,}
Loading item: {id:"minecraft:comparator",Damage:0s,Count:1b,Slot:0b,}
Loaded item:  null

And this is where I had rubber duck's "aha" moment. Inside readFromNBT we see:

Code:
Item.getItemById(par1NBTTagCompound.getShort("id"));

And as far as I know, "minecraft:redstone_torch" is not a short value. I guess the tools are more up to date than MCP, therefore this discrepency. Either way, I'm going to remove this mountain of debugging code and just waiting for MCP to update, rather than make a fragile workaround.


RE: Redstone lab (Functional release) - Chibill - 05-27-2014

It's upto date for 1.7.2 or at lest with its stable release. But I am working on a program to map the classes myself so I can debug and find things in snapshots.

Also Ids are still in the save files of the game because it uses them internally for everything except a few spots but in 1.8 that might change.

Also if they were removed the save files of snapshots and 1.7 would not work on 1.6


RE: Redstone lab (Functional release) - CX gamer - 05-27-2014

Quote:I am working on a program to map the classes myself so I can debug and find things in snapshots.

That would be immensely helpful! How will it work? Big Grin


RE: Redstone lab (Functional release) - Chibill - 05-27-2014

It's looking for key strings in some classes that will not change.


RE: Redstone lab (Functional release) - CX gamer - 06-03-2014

So when attempting to make entities load properly, I noticed that I had a similar situation with ids vs names, so I decided to work on the GUI for a bit.

Here's a preview of the new icons along with the way to map them in XML:

[Image: NSsMkmV.png]

So now it's easily extendable and allows for replacement graphics and graphics for mods. I still have only draw a small bit, but most technical blocks are in it, except for weighted plates. Those, I will draw dead last.

It should be noted that I based some designs off mordritch's simulator. He doesn't have comparators, so my version is a stab in the dark. Still some work to get the export fixed, otherwise I'd have shown a nice gif of it.


RE: Redstone lab (Functional release) - CX gamer - 06-05-2014

Have been drawing some more graphics, enjoy this view of the storage room:

[Image: rvyf4jK.gif]

Also layer markers are mostly working once more. I'm also entering a period of having much free time, so that's looking good for the sim. Big Grin


RE: Redstone lab (Functional release) - Chibill - 06-05-2014

Cool!


RE: Redstone lab (Functional release) - CX gamer - 06-09-2014

Today, I made the block selection window, also controlled by an XML:

[Image: i7pJVTn.png]

It also contains information about rotating components and right clicking components. The reason that the wire is "..." is because it's the only block that's drawn procedurally. This is because I did not want to draw and load 80 images.


RE: Redstone lab (Functional release) - jxu - 06-29-2014

No idea if CXGamer still updates this, but do you mind making this open source? I (and probably other users) would like to check out the code and maybe fork and contribute ;D


RE: Redstone lab (Functional release) - CX gamer - 07-02-2014

Yeah man still here, have been gaming quite a bit, so not much more progress has been done. The last thing I was working on was the time controls with rewind functionality.

Now that in the latest snapshot the metadata is completely gone, a lot of aspects of the simulator are currently out of date. I also don't think there's much point in updating to the snapshots before MCP updates, since pretty much everything is linked to it, so it would mean double work. So for now, it's mainly GUI.

To respond to your question, yes! I was planning to make this open-source. The reason it isn't yet, is because the simulation required minecraft's libraries for some reason, and rather than dynamically linking them or so, I just copied those. So in its current state, I can't legally make it open-source. But now I'm smarted than I was when I did that, so I'll try again. Since you asked, I'll put that right at the top of my pile.


RE: Redstone lab (Functional release) - Chibill - 07-03-2014

I am working on a program to find the class obusfcation of most classesofthe snap shots or anything past 1.7.

It can help you update.


RE: Redstone lab (Functional release) - CX gamer - 07-03-2014

Yes, I knew that, that would be really awesome. How does its usage work exactly, though? The most useful way would be to generate MCP(-like) conf files, I think. If I would statically bind every method, class and field, then the sim would become version dependent, so it needs to be some kind of hotswappable file.


RE: Redstone lab (Functional release) - Chibill - 07-04-2014

Mine has its own conf files it uses to discover the files when i run it to get the MCP(-like) Mappings but my problem is that i have not yet worked on the Function discovery or Field discovery systems. I all so have a second program that i am working on that fines the Functions and classes mappings based on the differences using python's ndiff function.


RE: Redstone lab (Functional release) - CX gamer - 07-04-2014

Alright cool! I'm fine with using 2 different formats, but I would like them to have the same names, at least. Still, if your works with future releases and MCP doesn't, I would prefer your system above MCP, if it had everything I needed.

For reference, here's what I'm using: http://pastebin.com/n9bz3awv

Its weakness is that can't distinguish between methods of the same name. For example there are 2 methods called "load" in methods.csv, one with comments for MCP and one that doesn't. I use that to call a specific method. Sometimes, though, there are multiple methods with the same name with no comment, like readFromNBT. In those cases, I may need to call them manually like with the 3 within the link above.

The problem is that MCP is made to translate from obfuscated to deobfuscated, and what I'm doing is the other way around. So if your format doesn't have that problem, it will be superior for my cause. Big Grin


RE: Redstone lab (Functional release) - Chibill - 07-04-2014

Well my program used to make MCP like mappings. the mappings that I have to manually make to discover the files are MCP names like readNBT not the srg names like func020002a. So about the format the mappings that are MCP like follow there Same system. But I would suggest using MCP till I can get mine to find methods and variables. As of right now it only supports finding the classes.


RE: Redstone lab (Functional release) - CX gamer - 07-05-2014

Well alright, thanks for the heads up! Smile Prepping everything up to go open source. Big Grin


RE: Redstone lab (Functional release) - jxu - 07-05-2014

You should hold off on updating your program by removing metadata. This change has not been confirmed and is still very buggy in the snapshots.


RE: Redstone lab (Functional release) - Chibill - 07-05-2014

also CX MCP for 1.7.10 is out. And as the snapshots continue I can map more classes faster to make my auto mapper.


RE: Redstone lab (Functional release) - CX gamer - 07-06-2014

Alright, ͟ ͜ -, I'll follow your advice. I'll continue keep working on the current version.

Thanks for letting me know again, Chibill. Big Grin And sounds like you're making something amazing, sounds awesome!

Oh and now it will link every library that minecraft uses, so that problem is solved. I also asked MCP if it's okay to bundle their data files with my source, or if I should make it part of the install process.


RE: Redstone lab (Functional release) - Chibill - 07-07-2014

I just hope they keep adding UUIDs to stuff makes finding it faster.


RE: Redstone lab (Functional release) - CX gamer - 07-11-2014

OPEN SOURCE!
https://github.com/CXgamer/MCsim

HeartHeartHeart


RE: Redstone lab (Open source) - jxu - 07-12-2014

Wow, MCP 9.03 was hard to find. It would be much better if this could be done automatically - most people aren't willing to go through this process.

I'm confused by what I have to compile. I assume it's StartSim.java (which code::blocks refuses to), but why you left it as a java source file instead of creating a .jar is beyond me.

The entire purpose of this simulator also confuses me. If it's to basically run minecraft in a controlled environment, I think an in-game combination of noclip, gametickediting and GUI tools would do the trick better.


RE: Redstone lab (Open source) - CX gamer - 07-12-2014

(07-12-2014, 12:55 AM)͝ ͟ ͜ Wrote: Wow, MCP 9.03 was hard to find. It would be much better if this could be done automatically - most people aren't willing to go through this process.

Welp sorry about that, I just updated it to 9.08. :3 And yes you're right, I don't expect end-users to do so. MCP's licence requires written permission to use their data files, so for now I cannot redistribute them together with the source. But ways of not even relying on MCP will be fun with a Chibill or Chibill-like system.

(07-12-2014, 12:55 AM)͝ ͟ ͜ Wrote: I'm confused by what I have to compile. I assume it's StartSim.java (which code::blocks refuses to), but why you left it as a java source file instead of creating a .jar is beyond me.

Isn't code::blocks for C/C++? xD But alright, as soon as I have time controls working, I'll create a .jar. Which will be at least a few days, as I won't be home much. I just rushed to get open-source asap, didn't focus on end-users at all yet. If you're only interested in the .jar, you can download an older version here:
http://forum.openredstone.org/showthread.php?tid=1606&pid=20359#pid20359

(07-12-2014, 12:55 AM)͝ ͟ ͜ Wrote: The entire purpose of this simulator also confuses me. If it's to basically run minecraft in a controlled environment, I think an in-game combination of noclip, gametickediting and GUI tools would do the trick better.
I'll defend my case! In game editing is a whole other experience than in the simulator, here's some planned features to show you what's possible:
  • An overview of as many layers as you want at once, as opposed to a single viewport.
  • Practical time controls; tick, play forwards, forwards asap, backwards, ...
  • The ability to share images of your creation.
  • Tools built in python, compatible with MCedit filters but with specific functions for the sim too.
  • Much more direct copy/paste capabilities.
  • Importing other user's schematics and use it in your own. Think building computers by just dragging components and using some autobussing tool.
  • Eventually I'll build a website with an API to create a repository of schematics, cataloged and documented. For example an option to select how big you want it for tileable circuits and also persistent labels.
  • The simulator part will become a library, so it can be used for other projects as well.
  • Slightly dreamy idea, but it would be awesome to generate command blocks compiled from a command-block scripting language.

Also because of this setup, as opposed to a very invasive mod, is that I can nit-pick the things I want to load and just do that. A mod would work the other way around and disable most systems, plus it would mean a new mod for every update, and I may be gone for months. The whole purpose of the MCP thing and the extensible xml files is to keep it working even without dev intervention. Sure there can be architectural changes which require fixing, but at least this has a window of working versions as opposed to only the ones that I release.

I'm sure that this one is better than all redstone simulators that have been, because I've got the best of both worlds (everything can be simulated and a self-defined interface).


RE: Redstone lab (Open source) - CX gamer - 07-20-2014

Well I rambled again..

The time controls are getting there, but sometimes crashes yet. You can now tick forward and go back and all. But I also realized I forgot something that I'll need before simulation can begin properly. Schematics are used to get and set MC's state, but I haven't implemented the tag that keeps track of blocks to update. So you can update one block and move forward, but if you place another one, it will forget about the updates of the former block.

This marks a key point in development that I was foreseeing: expanding the schematic format. If you grab a schematic from the server, for example, only tile entities of inventory-blocks are created, not comparators. Also if I recall correctly, WorldEdit puts extra tags to track where a player was when he copied it (to paste it relative to him again). I think it's important to not clutter the schematic with too many custom things, so I plan to keep the simulator's future's tags (like for example schematic name, creator, comments, named inputs/outputs) inside one dedicated tag on the root of the schematic.

However, for TileTicks, I'll put it on the root tag as well, since it's stored native in MC as well. It's required for clocks to keep working when loading a schematic. Because it's non-standard, unexpected things may happen when using them with other application, which would mean they did a bad job.

On making a .jar release, I want to do that when I think it's usable for an end-user, which means safe crashes (because of entities) and on overall no weird behavior.

Hope you guys don't mind me taking my time, lots of things on my head; 8 more days of work, 4 re-exams, nabbing around with python and entering dorm-life in either 0.5 month or 1.5 month.


RE: Redstone lab (Open source) - Chibill - 07-20-2014

I have forked this and will work on making a way to load my mappings to see how it works. And also I am going to start. Working on my deobusfcator again.


RE: Redstone lab (Open source) - CX gamer - 07-20-2014

Awesome to hear that! Big Grin No pressure, take all time you want. Hope I wrote my classes properly for you.


RE: Redstone lab (Open source) - CX gamer - 07-21-2014

Made a video showing off the state of the time controls:

https://www.youtube.com/watch?v=K73J2niPMQk

There's still a weird bug happening:

[Image: DMF1Rmf.png]

Thinking that the correct order of updates may not be properly preserved when saving and loading them.


RE: Redstone lab (Open source) - Chibill - 07-21-2014

It might be a actual minecraft bug...... The Directional stuff.


RE: Redstone lab (Open source) - CX gamer - 07-21-2014

Partly. If works consistently if I activate them with the same block:

[Image: DlpgkNK.png]

But when I first place a block, it generates a timeline until it finds no changes any more after ticking. When placing another block, the schematic of that point in the timeline is loaded, with that, also the planned ticks. I think that when loading them that way doesn't preserve the order/directionality, as you say.

So I must now find out the extra stuff I need to do to load the state exactly as at that time. But it should work consistently when it's fixed on my end.


RE: Redstone lab (Open source) - Chibill - 07-21-2014

Okay. And I am working on a hot loading system so it can load any MC version maybe with a selector on my Fork. Because that would be cool.


RE: Redstone lab (Open source) - CX gamer - 07-24-2014

Yes that would be sweet indeed! Big Grin

In the meantime, I found the bug, and it was entirely on my end. I want to make an interface to highlight the blocks that are planned for updating, but for now I mapped them out manually. Enjoy the info graphic!

[Image: 1CmozJr.png]

EDIT: I'm not sure if I measured the block updates in the previous graphic wrong, that it's random, or if I fixed it by testing, but this is the case at the moment:

[Image: LMBRtyh.png]

So I'm loading them back in in the bad order. Oh and please ignore the actual schematic, I just drew it as reference, the redstone blocks aren't there in the good version.


RE: Redstone lab (Open source) - Chibill - 07-25-2014

Okay. And also my deobusfactor no longer works as of the latest snapshot so yeah.... I have to fix that too. I should make a thread for my deobusfactor.


RE: Redstone lab (Open source) - CX gamer - 07-25-2014

Yes you should! Got some ideas of my own that I will post there. Big Grin


RE: Redstone lab (Open source) - jxu - 07-25-2014

(07-24-2014, 07:55 PM)CX gamer Wrote: Yes that would be sweet indeed! Big Grin

In the meantime, I found the bug, and it was entirely on my end. I want to make an interface to highlight the blocks that are planned for updating, but for now I mapped them out manually. Enjoy the info graphic!

[Image: 1CmozJr.png]

EDIT: I'm not sure if I measured the block updates in the previous graphic wrong, that it's random, or if I fixed it by testing, but this is the case at the moment:

[Image: LMBRtyh.png]

So I'm loading them back in in the bad order. Oh and please ignore the actual schematic, I just drew it as reference, the redstone blocks aren't there in the good version.

10/10 visuals

amazing graphics you should do this for a living


RE: Redstone lab (Open source) - CX gamer - 07-25-2014

Thanks! Now I should note that I tested it some more, and it appears that even when nothing is ticked, the same problem occurs. So now the blame shifts once more. Also reworking the timeline a bit and the end button is going to disappear, since it's hard to define.


RE: Redstone lab (Open source) - Chibill - 07-27-2014

Cx I can get it so it does not need you to copy the stuff from .minecraft by using the way MC gets the .json file for library and then downloading them. And using a simple check you can stop it from redownloading every time.


RE: Redstone lab (Open source) - Chibill - 07-27-2014

Also you should add to the readme about needing to download objenesis-2.1.jar.


RE: Redstone lab (Open source) - CX gamer - 07-27-2014

(07-27-2014, 12:36 AM)Chibill Wrote: Cx I can get it so it does not need you to copy the stuff from .minecraft by using the way MC gets the .json file for library and then downloading them. And using a simple check you can stop it from redownloading every time.

I may be misunderstanding, but is that really better than just getting it from the already downloaded files? Now, if it finds the default windows path first, and then checks if it's in its own directory. The plan was to just to add the paths for linux and mac as well, and then ask the user where it is if it doesn't find it.
If the MC launcher downloads a version of minecraft, it will get the libraries as well. So I don't really see the advantage of downloading them separately?

(07-27-2014, 03:57 AM)Chibill Wrote: Also you should add to the readme about needing to download objenesis-2.1.jar.

Oh sorry about that, I was ignoring .jar without thinking much about it. It's now included.


RE: Redstone lab (Open source) - Chibill - 07-27-2014

Thanks and also if you want to use it with Eclipse you need to make your own project right now because the .gitignore ignores the .project file. So you can't just sellect you github folder as a workspace.


RE: Redstone lab (Open source) - CX gamer - 07-27-2014

In retrospect, that does not seem very smart indeed, I thought it was best-practice or something. I think at some point I was going to develop in IntelliJ IDEA, but since MCP generates eclipse, I'll keep using 1 IDE for sake of simplicity.

Oh I also made a new vid, basically doing the same but all buttons do what they need to do now.

https://www.youtube.com/watch?v=uU7N_U7h72E


RE: Redstone lab (Open source) - CX gamer - 08-02-2014

I think I just figured something out. There's still the problem that updating tileEntities causes it to create new ones, rather than finding the existing ones that were loaded in. My idea is that because I'm loading new instances in, a generic list's .contains method won't find the old ones. So the solution should be to instead of using a schematic for it, just keeping the objects, and use the schematic's Entities, TileEntities and TickTicks for saving and loading.

At this time, my studying is intensifying, so work on the sim will be limited until 2/3rd august.


RE: Redstone lab (Open source) - jxu - 08-06-2014

I don't want to discourage you, but I feel like all this time spent essentially recreating minecraft could've been spent creating something entirely new.


RE: Redstone lab (Open source) - Chibill - 08-06-2014

He is using minecraft .


RE: Redstone lab (Open source) - CX gamer - 08-08-2014

(08-06-2014, 12:43 AM)͝ ͟ ͜ Wrote: recreating minecraft

Yeah, as Chibill said, I am using MC to perform the mechanics. What I'm doing is take a schematic, convert its data into what's readable for minecraft, then use minecraft.jar to load it as a world, tick it, get data back and display what has happened.

When I'm working on improving the simulation, it means just importing and exporting more things. Like right now, I can use the game to simulate basically any block behavior that does not use entities or tileEntities. When those are finished as well, it'll simulate most of the game's mechanics.

After that, improvements will be made in smaller steps, like configuration options for time of day, biomes, world loading, world type, ... However in doing so, it will use MC once again. So if the code for loading a world is changed, the simulator will update with it. In the best case scenario, no new release is needed even. But I will probably need to fix a couple things here and there every new version, as with any mod (but this is not a mod, to avoid confusion).

As for progress, I'm not discouraged at all. But the next couple of weeks decide if I waste a year of my life and lose a lot of money, or if I graduate. It's very important that I don't fuck up. That's why there hasn't been any progress lately.


RE: Redstone lab (Open source) - CX gamer - 08-14-2014

Alright I'm finding some time in the evenings that I'm not studying. So now the simulator has a new state saving mechanism. Rather than converting everything to a schematic to unpack it again, it's saving the exact instances of the objects created by MC. The result is that now the racing condition of page 9 is fixed. The downside is that the tileTick-, entity- and tileEntity-objects are manipulable by themselves, so it serves no other purpose than going back in time correctly. Schematics will now only be used while saving and loading (though I broke that functionality in the latest commit).

EDIT: Had some fun and tried another theme with a custom background:

[Image: bYb7UPK.png]

The image was made by iWithered. I like the image, but I'm not too sure to keep the look and feel. But the alternative would be system default.

EDIT2: Also just found out that MC will handle placing torches on walls, that saves some work. Big Grin

EDIT3: The look and feel is called Nimbus and is causing way too much lag, so now it's back to system default again. Sad

EDIT4: EDIT2 only applies to torches for some reason.

EDIT5: I made a video showing the start of the toolbar:

https://www.youtube.com/v/m7sizpfWR0

Activate is basically "right click" (linked with the XML of page 7), but doesn't properly update as it should, as a button won't pop back up. So I'll search for either a cleaner method of "right clicking" or some workaround. Lots of bugs in the XML also (can't right click activated repeaters for example), and there's no way of knowing if a rotation is correct, making torches pop off, for example. For the latter, I'll just try all options until I find one that doesn't make it pop off.


RE: Redstone lab (Open source) - CX gamer - 08-18-2014

I investigated the right click problem of last post more thoroughly, and I think it will be advantageous to use Block's OnBlockActivated, rather than manually modifying blocks. To my demise, I noticed that that method required a player entity to be passed on, for things such as opening an inventory window, starting a sound at the player's location, buffs, ... I haven't created a player yet, and it's definitely not trivial to do so. But luckily, most interesting blocks can be right clicked whilst nulling the player:
  • Button
  • Noteblock
  • PistonMoving
  • RedstoneComparator
  • RedstoneRepeater
  • RedstoneOre
  • DragonEgg
  • Lever
  • PistonBase
  • Stairs

So if I update to use the method, right clicking these will work (but some probably won't do anything useful). However, for the rest I'll have to create a dummy player that will ignore things like opening a gui and such, not even sure if that's possible (I've done it with interfaces, not with classes yet). There may be a way to generalize editing the inventory blocks. Either way, it's back to puzzling for that part.


RE: Redstone lab (Open source) - Chibill - 08-18-2014

CX look at Forge's github they have a fake player for people how mod to pass to stuff when we don't have a player entity to pass you can look at that for ways to over come the problem.

This is the fake playerhttps://github.com/MinecraftForge/MinecraftForge/blob/master/src/main/java/net/minecraftforge/common/util/FakePlayer.java

This is the factory forge made for it so modders could make them this can help you make your fake player for this.https://github.com/MinecraftForge/MinecraftForge/blob/master/src/main/java/net/minecraftforge/common/util/FakePlayerFactory.java


RE: Redstone lab (Open source) - CX gamer - 08-20-2014

Brilliant find, that will definitely be useful! Definitely a relief after scouring through the class to see what needed to be done. The catch is that I will need to extend a dynamically loaded reflection class, so it's not something I can just copy/paste. If I have an interface, I can dynamically implement it using the Proxy API; I did so for the chunkloader already.

But EntityPlayerMP doesn't have an interface to implement, so I can't do it with proxies. Apparently, I'll have to use CGLIB to generate the java byecode that extends EntityPlayer. Looking forward to using that. Big Grin And that's great, because it will work for any right clicking, so it may be possible to open item containers as well, for example.

That's for right clicking stuff. For rotating it, I'll just cycle through possible orientations and check if a torch pops off until a valid orientation is found.


RE: Redstone lab (Open source) - Chibill - 08-20-2014

If you don't import or use the class the if the fake player (warp it) you can ext and the entityplayermp I think. At lest from my work. But I might be wrong.


RE: Redstone lab (Open source) - CX gamer - 08-21-2014

On my laptop right now so can't confirm from the code, but I get what you're saying. Extending EntityPlayerMP will need to happen at runtime, because before, it doesn't know what to extend yet. Doing so is definitely non-trivial, but should definitely be doable.


RE: Redstone lab (Open source) - Chibill - 09-02-2014

I am working on using FML's RuntimeDeobufcation to make a class to run before running any of your other code that will deobfuscated it to Normal Class names (that why the only thing obfuscated in mods are the functions and variables to srg names). That way you can extend any MC class that exists that the target MC version.

If this will help I will make a PR for you when I am finished.


RE: Redstone lab (Open source) - Chibill - 09-03-2014

This will use a mix of the Launchers Loading Code as a dynamicly loaded lybaray and also FML's tweakers.


RE: Redstone lab (Open source) - CX gamer - 09-03-2014

Sounds very interesting! That would make life easier if I understand everything correctly. If everything can easily be extended, I have much more freedom in what parts of code I want to run. Big Grin


RE: Redstone lab (Open source) - Chibill - 09-03-2014

I need to make my own version of LaunchClassLoader.java and also IClassNameTransformer.java and IClassTransformer.java. Thats to get it to load the class transformer. Then I need to make a version of DeobfuscationTransformer.java and then all the classes in deobf.Then I need to call the methods that activate the Transformers then load the rest of MC-Sim.


RE: Redstone lab (Open source) - CX gamer - 09-04-2014

Sorry for the late reply, but things are a little bit hectic seeing as I am preparing to switch to dorm-life in the near future. I have now educated myself a bit in ClassLoaders. Just to confirm that what I think I understand is correct:

Current system
  • The JAR is located and in a single pass, all required classes are loaded using reflection.
  • The translator is further used to call get method and field names of those classes.
  • All libraries are linked in a hacky way (sim.loading.ClassPathHack).
  • Only run-time linking is possible, so no extending classes without bytecode manipulation.

New system
  • The MC source is added to the project (but ofc git ignored) so that we can use its class names and have proper imports.
  • A ClassLoader will translate and load classes out of the JAR when needed.
  • Using MC's classes is trivial and automatic.

But I'm still wondering on how extending classes would work exactly. Your methods and fields need to be obfuscated, as you said is the case with mods, because otherwise it won't override the class'. But if it is obfuscated, how would you avoid compile-time errors? Also if they're obfuscated, it would require updating every release?


RE: Redstone lab (Open source) - Chibill - 09-04-2014

Yes, plus I am hoping to set it up so you run the function main in the "loader" which is in the actual code library the launcher uses that contains the two classes I was going to rewrite. I can write a Tweaker with the Sims main class as it what it says to run but include FML's deobf transformer and the patcher (so if you want you can patch normal mc code at run time to call your own functions.). I will be working on this to day and trying to get it to run using it.

Its obfuscated to srgnames after its compiled with a deobfed version of Minecraft. And they don't change every minor version they do every major version but there is a new MCP config every version that forge uses.


RE: Redstone lab (Open source) - CX gamer - 09-04-2014

Oh wow, a runtime patcher! That's pretty sweet man! Big Grin That will greatly isolate the parts of the code that I want to run, for disabling certain parts and calling back in others. Definitely a leap forward if that works.


RE: Redstone lab (Open source) - Chibill - 09-04-2014

Forge uses it so they don't ship and of MC's code with forge it just installs its own tweaker for MC to load with. But yeah if it works.....


RE: Redstone lab (Open source) - Chibill - 09-05-2014

Okay this is a pain in the a** to get it to load MC and then your code..... But I will keep working.


RE: Redstone lab (Open source) - CX gamer - 09-05-2014

What are the problems? Can I help?


RE: Redstone lab (Open source) - Chibill - 09-05-2014

It's loading your code before Minecrafts

Figure it out I need to tell it to load minecrafts...


RE: Redstone lab (Open source) - CX gamer - 09-06-2014

You're setting up the classloader right? Isn't your code then invoked at runtime during execution of the sim?


RE: Redstone lab (Open source) - Chibill - 09-06-2014

Mine just loads minecraft then transforms the names to deobf ones then loads mc-sim and calls main. I am also replacing all calls to your class loader that it uses to get classes and method with the actual call. Also you need to use a deobf to srg names minecraft jar to link in as a library so you can launch it in eclipse.


RE: Redstone lab (Open source) - CX gamer - 09-06-2014

Oh I get it. Big Grin I shall give it a try as well after I'm done with the tools. Right clicking is working for the cases I mentioned on the previous page, now doing rotations click. I underestimated how much work this would be. Take these blocks that are dependent on their surrounding blocks:

[Image: wjjPoGM.png]

There's a whole range of different checks for different components:
  • Torches check for isBlockNormalCubeDefault at the sides and doesBlockHaveSolidTopSurface with added cases for fences, glass and walls.
  • Trapdoors can stick to anything that is opaque and renders as normal block, or glowstone, slabs or stairs.
  • Buttons are the most sane ones which only check for isBlockNormalCube.
  • Levers on the other hand can be placed on doesBlockHaveSolidTopSurface as well.

So there isn't one system that works for all of them. I also don't want to hard-code these kinds of things, because I want the XML files to have all control. The plan I'm going to go with is just checking for isBlockNormalCube and ignoring all edge cases (mostly aesthetic anyway). If a user wants to have these cases, I'll let him just select the id and data they want.


RE: Redstone lab (Open source) - Chibill - 09-13-2014

I am finishing my test of class loading it byte a custom class loader with a transforming system.


RE: Redstone lab (Open source) - CX gamer - 09-16-2014

Nice! Big Grin Still don't have internet at dorm, but should be fixed soon.


RE: Redstone lab (Open source) - Chibill - 09-16-2014

That's okay I have been pvping to much and need to actually finish the system.


RE: Redstone lab (Open source) - Xray_Doc - 09-18-2014

(12-19-2013, 11:34 AM)Frontrider Wrote: Make it to run on android, and everyone is happy.

There already is and has been one. For almost 2 years. Yay for extreme late respones!


RE: Redstone lab (Open source) - CX gamer - 09-21-2014

Still no internet for work computer, modem should be installed next tuesday. Did a bunch of refactoring offline, and when I have internet I'm going to look into writing a classloader as well to see if I can get it working.


RE: Redstone lab (Open source) - greatgamer34 - 09-23-2014

Quite impressive work CX!


RE: Redstone lab (Open source) - Chibill - 09-30-2014

MCP 9.10 pre release is out for 1.8 http://www.mediafire.com/?56xoalz89957n7o


RE: Redstone lab (Open source) - CX gamer - 10-02-2014

Sweet! Thanks for posting the link. I'll get on it asap. My dorm room isn't completely set up, so my development computer isn't plugged in yet, but I plan on programming on my laptop for the while being. The reason there haven't been any commits yet is because my repos is on the computer that isn't plugged in yet, but internet is available here now, so that's no problem.


RE: Redstone lab (Open source) - Chibill - 10-02-2014

I am going to try and stop PVPing and get my new project called The Obfuscating Loader that will load a program only after loading and runtime deobfing Minecraft.


RE: Redstone lab (Open source) - CX gamer - 10-03-2014

Sounds awesome and useful! Big Grin

There's a lot of change and I'm figuring out my strategy. After I've got everything working again, I'll finally tackle TileEntities and Entities for good.


RE: Redstone lab (Open source) - Chibill - 10-03-2014

I might get the loader to work over the week end. And I might have a dev Bukkit 1.8 build working too.


RE: Redstone lab (Open source) - CX gamer - 10-09-2014

Did some work porting it all over, but still lots of work to do. The Bootloader wouldn't load for a strange reason. MC saves the log4j library at

Code:
org\apache\commons\commons-lang3\3.3.2

whilst it seems to use instead

Code:
org\apache\commons\lang3\3.3.2

Hoping that this bug is not in my end, and that it will go away in future MC / MCP updates.

EDIT: Oh and I'll set up git on my lap so I can commit again after the refactor.


RE: Redstone lab (Open source) - Chibill - 10-09-2014

I will finally get some time to work on my loader for you.


RE: Redstone lab (Open source) - CX gamer - 10-10-2014

Awesome! Big Grin Take your time man, no rush.


RE: Redstone lab (Open source) - Chibill - 10-11-2014

I am actually making my loader it's own program at when give a program to run with it will runtime deobf then load the progr


RE: Redstone lab (Open source) - CX gamer - 10-21-2014

It can now load schematics without crashing, still have to do tileEntities, entities, ticking, setBlock, ... I started using JUnit so I don't have manually load and check everything.


RE: Redstone lab (Open source) - Chibill - 10-21-2014

I am working on my Loader for you at https://github.com/chibill/DeObfuscating-Loader


RE: Redstone lab (Open source) - CX gamer - 10-22-2014

Awesome man, thanks! Big Grin


RE: Redstone lab (Open source) - Chibill - 10-22-2014

I am testing a system today / Actually trying stuff.


RE: Redstone lab (Open source) - Chibill - 10-25-2014

If you right now just started using a MCP src dir to dev you program you could run the reobf to srg then take the files in a reobf folder in a jar and using a minecraft with fml installed and a edited .json for it you could launch it with the normal MC Launcher. Still making mine.


RE: Redstone lab (Open source) - CX gamer - 10-25-2014

That's roughly the same as when making a mod, right? With the difference being that I'm calling the game, as opposed to the other way around. I may start doing that if it's not too much work, otherwise I may wait until your loader before rewriting everything.


RE: Redstone lab (Open source) - Chibill - 10-25-2014

I was going to try porting it over to my Loader after I finished it.


RE: Redstone lab (Open source) - CX gamer - 10-28-2014

Just made it compatible with MCedit 1.1.1 which now stores TileTicks in its schematics. This means things like clocks will resume after loading a schematic from MCedit.

Edit: Quickly added a nbt viewer:

[Image: AFHJOmA.png]


RE: Redstone lab (Open source) - CX gamer - 11-14-2014

I just broke the functionality of my previous post. No idea where or how, but nothing simulates anymore. Even though everything else seems to work as time moves forward, nothing updates anymore. >.< Been searching for a while now, must be something obvious.


RE: Redstone lab (Open source) - Chibill - 11-15-2014

There might be a change in how updates work in 1.8 I think. (Right you updated?) I have not dug in to 1.8 code much so I could not tell you.


RE: Redstone lab (Open source) - CX gamer - 11-21-2014

Oh I solved it now, had no internet during the fix so didn't update my post. In the end, it seems I have changed a method without thinking twice over it. I was first only setting worldTime, but now also totalTime. So all is fine. Big Grin

I don't think much changed on the updating itself, but rather the naming. Now it's not the block id stored in TileTick, but a string pointing to the block.


RE: Redstone lab (Open source) - Chibill - 11-22-2014

And no metadata a new fancy block state system.


RE: Redstone lab (Open source) - CX gamer - 11-26-2014

Metadata is still being used to save and load to and from schematics, it still works that way. Just also discovered that I may use cycleProperty to rotate things instead of trying to do it manually with block data.

I'm now on the way to fix right clicking on buttons, levers, .. I need to get the property "facing". The problem now is that it uses the IProperty's hashCode rather than just the name.

Code:
The IProperty we wish to obtain:
-1224145743 PropertyDirection{name=facing, clazz=class ej, values=[down, up, north, south, west, east]}
BlockLever's property and its value that we need:
-1329114687 PropertyEnum{name=facing, clazz=class axk, values=[down_x, east, west, south, north, up_z, up_x, down_z]}: west

In this case I can't find the lever's property because I'm asking for the wrong kind of direction (because levers on top and bottom can be rotated in 2 directions). But a ton of blocks have their own enums that you'll have to use to get those properties in every class in a case by case basis, which is way too much work.

An EnumFacing is required to activate blocks (as well as EntityPlayer but I'm skipping that for now), and normally that comes from what the player is looking at, so it would require teleporting a player object around and I want to avoid that. My goal now is to find another way to get a EnumFacing of a given coordinate for the couple blocks that need it and just null it in other cases.


RE: Redstone lab (Open source) - Chibill - 12-05-2014

if you need a player object use the way forge does a fake player and just change it facing you should not have to teleport it if it just looks at its facing and or rotation.


RE: Redstone lab (Open source) - CX gamer - 12-06-2014

Oh yes good. Until now I've only been extracting classes from minecraft.jar, but a PlayerEntity requires a GameProfile, which is in a mojang lib authlib. I have some code that will specially get that single class and use it to create a player now.

As for the facing problem, good point, no teleporting required. Still I'm pondering how to implement it, as I want the cleanest solution possible. Right now my best bet is just trying the 6 directions and checking which fail, but I'm not very pleased with that solution.


RE: Redstone lab (Open source) - CX gamer - 12-09-2014

Still stuck with authlib. When decompiling, its constructor asks for a UUID and a String, just like MC expects. But when accessing said class with reflection, suddenly it's String and String. Also the legacy and the PropertyMap fields are gone, as well as all related methods. There should be no SecurityManager denying me access. There is a UUIDTypeAdapter with converts between UUID and String, but I have no idea how it would change the constructor when calling it with reflection.


RE: Redstone lab (Open source) - Chibill - 12-09-2014

Why use reflection? its another file you could load as a library..... And actually import if its loaded before the class using it instance is created.


RE: Redstone lab (Open source) - CX gamer - 12-09-2014

*Facepalms* that's a way better solution, I load in all libraries anyway, just did that. Still thoughwhen I try to create an instance with its constructor (UUID, String),

[Image: d2wYtr7.png]

it will still expect (String, String),

Code:
java.lang.NoSuchMethodError: com.mojang.authlib.GameProfile.<init>(Ljava/util/UUID;Ljava/lang/String;)V

exactly in the way reflection sees it. I think it may be some kind of security measure or something.


RE: Redstone lab (Open source) - Chibill - 12-12-2014

I see you fixed repeater rotation on github.


RE: Redstone lab (Open source) - CX gamer - 12-15-2014

Yeah, a pretty dumb mistake. Can apply to more than repeaters, but I only found a problem with them. There's 2 more deep issues I know of in the simulator. One occurs when going back in time after having placed blocks, placing a new block at the same time will delete some of the previous ones. Another one is my ChunkProvider not yet giving back a chunk based on BlockPos. I'm first fixing the latter as it may magically fix the former.

EDIT: Fixed both of them. Big Grin


RE: Redstone lab (Open source) - CX gamer - 12-18-2014

I finally fixed TileEntities for good, now the hopper clock works for example. Posted a video showing off the NBTviewer as well:

http://youtu.be/19a47ZsGCW8

EDIT: Currently trying to get entities working, but they check for things like canSpawnAnimals and canSpawnNPCs, which are in MinecraftServer. It's not obfuscated so I had to create a separate list of classes that don't deobfuscate. Then I tried loading it in with objenesis (just like the way WorldServer was created), but it didn't work flasslessly, don't yet know why. I'm also working towards a release, but also have exams coming.

EDIT2: Scrap MinecraftServer, I'll recreate something like updateEntityWithOptionalForce myself. Too bad I can't just call that, because it's overridden by WorldServer, which will check for animal/npc spawning, which fails. Pretty sweet now, dispensers and pressure plates work, but pistons and minecarts won't budge yet.


RE: Redstone lab (TileEntities) - LordDecapo - 12-20-2014

hey,,, If i load my CPU into this.. can it run the full 3D schem faster then the ingame 10ticks?


RE: Redstone lab (TileEntities) - CX gamer - 12-21-2014

Some blocks like pistons don't yet work, but I don't think your CPU has any of those. Most redstone components do work though. It will still take 10 ticks, but you get to decide how fast they go. The fast forward button is set to do about 100 ticks per second right now.

Please let me know if it works, I haven't tried a CPU yet. If you run into any problems, you can provide me the schematic and I'll try to figure out where it goes wrong.


RE: Redstone lab (TileEntities) - CX gamer - 12-24-2014

Oh just figured I didn't upload a .jar yet, so you can't try it out. >.<

Either way, entities are now being displayed:
https://www.youtube.com/watch?v=fie4LyhEVqk


RE: Redstone lab (Entities) - CX gamer - 12-26-2014

The method I'm using to go back in time is just to save every time to my own WorldState object which contains all block data and the lists with the objects of tileTicks, tileEntities and entities. Then I'd just revert it back to the needed frame. In hindsight that can't work, since I just keep the reference to the said objects, and MC can still modify those objects. Pretty stupid mistake that I realized way too late.

So now I'll just convert them to NBT and back. I was trying to avoid this since it's slower, but I don't have any other choice. So going back in time will be less seamless from now.

In other news, I had little bit of fun with benchmarking different kinds of clocks.


RE: Redstone lab (Entities) - CX gamer - 12-29-2014

Just did it like that, so going back in time loads a schematic completely instead of trying to replicate that state's conditions. There's a small problem yet where entities aren't saved properly as NBT, so they'll sometimes disappear. Example:

Code:
toString: EntityItem['item.tile.notGate'/1, l='Simulator', x=1,78, y=1,75, z=1,13]
NBT: {Motion:[0:0.131878... Age:0s,}
toString: EntityItem['item.tile.notGate'/2, l='Simulator', x=1,49, y=1,55, z=1,59]
NBT: {}



RE: Redstone lab (Entities) - tokumei - 12-31-2014

(12-09-2014, 06:09 PM)CX gamer Wrote: [Image: d2wYtr7.png]

Thank you for making me not the only one to use IDEA :3


RE: Redstone lab (Entities) - Phase - 01-05-2015

I'm not seeing a good use for this.... Why not just go in-game and test out your circuits? Does/Will this have better features than in-game?


RE: Redstone lab (Entities) - CX gamer - 01-06-2015

(12-31-2014, 12:39 AM)DJ8X Wrote: Thank you for making me not the only one to use IDEA :3
*High five* Big Grin

(01-05-2015, 01:02 PM)Phasesaber Wrote: Why not just go in-game and test out your circuits? Does/Will this have better features than in-game?
That's the premise, yes. The aim is to provide features on top of the game. Every opened schematic runs a separate world, so you can multitask better. You can go back in time and take a look at every tick in close detail. I'm bargaining there's a much better overview for circuits in 2D layer format than in 3D, once you get used to it. There will be plenty of tools that aid circuit designing.

Another goal is to provide a better way for people to share schematics and export images, as opposed to so many people making of a video of building it block by block and providing an entire world to download.


RE: Redstone lab (Entities) - Phase - 01-06-2015

redstone lab + opengl


RE: Redstone lab (Entities) - CX gamer - 01-07-2015

I'm not trying to replace MCedit. :p


RE: Redstone lab (Entities) - CX gamer - 01-11-2015

Oh! I found out why pistons weren't reacting. Turns out WorldServer caches block events (used for pistons, beacons and chests) and doesn't update it itself, by doing that pistons are moving now. The problem is that I'm getting ConcurrentModificationExceptions all over the place when working with them, so that's something to think about.

EDIT: Nvm I'll just keep converting to arrays. It's be less performant but it doesn't complain as much.

EDIT2: https://www.youtube.com/watch?v=DzylK1RoAd0


RE: Redstone lab (Entities) - CX gamer - 02-01-2015

Hi everyone! I've uploaded a pre-alpha release so you guys can play with it a bit. If you see something is wrong, chances are I already know, but feel free to report whatever you find. Lots of stuff may be broken. Enjoy! Smile

https://github.com/CXgamer/MCsim/releases/tag/v0.1-pre-alpha

Oh also I need to finalize the name. It'd be either Redstone lab, MCsim or RSsim, feel free to suggest as well. Smile


RE: MCsim (pre-alpha release) - LordDecapo - 02-05-2015

Sry if this has been asked, but can this read .schem?


RE: MCsim (pre-alpha release) - Legofreak - 02-05-2015

Red-Edit

Redstone CX

MCFGPA

MC Ticker


RE: MCsim (pre-alpha release) - Chibill - 02-05-2015

Yes lord...


RE: MCsim (pre-alpha release) - CX gamer - 02-11-2015

Not much progress lately, I've been refactoring a bit of the bad core.

(02-05-2015, 09:23 PM)LordDecapo Wrote: Sry if this has been asked, but can this read .schem?

Yes as Bill said, it's the only thing it'll read.

(02-05-2015, 09:57 PM)RekcirBrickeR Wrote: Red-Edit

Redstone CX

MCFGPA

MC Ticker

I like MC ticker, very to the point. Big Grin


RE: MCsim (pre-alpha release) - Iceglade - 02-11-2015

This has got to be the single most bumped thread in the history of forums


RE: MCsim (pre-alpha release) - Tommyand - 03-01-2015

(02-11-2015, 11:09 PM)Iceglade Wrote: This has got to be the single most bumped thread in the history of forums

I'm not so sure about that. I refer you to the subforum dedicated entirely to being spammed, which I can't remember the name of right now.

I agree with the name 'MC Ticker'. It's very apt and literal. Perfect description of what it does! xD
I'll say more once I've actually tried it.


RE: MCsim (pre-alpha release) - CX gamer - 03-03-2015

Indeed! Big Grin

I had quite some trouble narrowing down an infinite repaint loop, but it seems to be solved. Did some more work towards selecting stuff, and it seems to be consistently working now. It works just like in excel with shift and ctrl (or cmd). Up next is moving the contents of selections and tiling, both will take a while.

[attachment=559]

I've also released version 0.2, which has mostly internal changes, still lots of bugs.

https://github.com/CXgamer/MCsim/releases/tag/v0.2-pre-alpha

EDIT: Good news! Because of this problem I couldn't get an instance of a player without adding authlib as dependency. That player instance was necessary to right click certain things like repeaters (because of playerIn.capabilities.allowEdit). It was a stupid mistake and it is now fixed again. It worked before, but I couldn't export the jar with authlib still in it, so in this release right click won't work, in future ones it will. Big Grin

EDIT2: Oh yeah, to top off the good new with some bad news, I found out there is at least one simulation inaccuracy with this kind of piston worms. Still scratching my head about it.

EDIT3: Fixed it! Big Grin Much more accurate now. I'll mainly focus on making things stable for a while.


RE: MCsim (pre-alpha release) - CX gamer - 03-18-2015

The export window has been broken for a while now, so I completely remade it, it should be ready for anything you throw at it, though still a bit buggy.

[Image: Q28rMbS.png]


[Image: y0x4VRw.gif]


RE: MCsim (pre-alpha release) - Chibill - 03-18-2015

Cool. I am going to work on my deobfuscating loader more but I can't really do anything till next week because of theater...


RE: MCsim (pre-alpha release) - CX gamer - 03-22-2015

Awesome! Big Grin

I ripped the images of the wiki and put them into the NBT viewer:

[Image: 01GWDGG.png]


RE: MCsim (pre-alpha release) - CX gamer - 04-01-2015

I fixed a bug that puzzled me for at least a year (and was probably in there for much longer). I looked everywhere and searched for days with no avail. But now it's fixed and the fix was stupid. xD Anyway I've been adding icons to a lot of places, there are now keyboard shortcuts for tool selection and scrolling in the editor for zooming/layer selection. Also there is now a graphic for a solid block behind the current layer, because I was finding it hard to place redstone wires on blocks you can't see. The readme has been updated to reflect these changes.

So now my plan is to fix small inconveniences here and there, and then release an alpha version. For that version I'm going to look for testers who will report any bugs they may find. The simulation should be bug-free, or at least what is expected to be simulated.


RE: MCsim (pre-alpha release) - vin97 - 06-16-2015

I would be happy to test it.


RE: MCsim (pre-alpha release) - jxu - 06-17-2015

idk if CX gamer is still alive, but he always turns up eventually


RE: MCsim (pre-alpha release) - Chibill - 06-22-2015

He is might just have other stuff to do.


RE: MCsim (pre-alpha release) - CX gamer - 06-23-2015

Hey guys, I'm still alive! Big Grin I was in the middle of exams, so haven't had any time to work on the sim. Now that I have no more obligations, I can continue development. Thanks for your interest guys. Smile


RE: MCsim (pre-alpha release) - Chibill - 06-23-2015

Smile


RE: MCsim (pre-alpha release) - vin97 - 10-17-2015

Just wanted to say that MCsim will cause the same buggy behaviour in instant logic as it does in Minecraft.

Here is a looped 4-bit instant adder (counter), theoretically capable of 5 Hz processing.
The inputs and outputs are at y=3.
The feedback delay is 2 ticks, which results in 5 Hz operation speed.

You can analyze each individual tick in MCsim and see which piston behaves buggy at which point.


RE: MCsim (pre-alpha release) - Chibill - 10-18-2015

Which is good right?


RE: MCsim (pre-alpha release) - vin97 - 10-18-2015

Hmm, I hoped for it to be a bugfree redstone simulator in order have at least one possibility of running reliable instant logic.


RE: MCsim (pre-alpha release) - Chibill - 10-18-2015

It was designed to act exactly as Minecraft does. (It uses MC to be that accurate.)


RE: MCsim (pre-alpha release) - jxu - 10-18-2015

(06-23-2015, 01:39 PM)CX gamer Wrote: Hey guys, I'm still alive! Big Grin

Made a commit 19 days ago, so I still have hope


RE: MCsim (pre-alpha release) - vin97 - 10-19-2015

You could incldue an option to fix Minecraft's block-update-order-caused bugs.
Would be really cool to have at least some way of messing with some more complex instant logic.


RE: MCsim (pre-alpha release) - Chibill - 10-19-2015

unless you have an MC mod that fixes it. It is sort of hard...


RE: MCsim (pre-alpha release) - Chibill - 12-24-2017

I hate to bump but I am curious if this is still a thing.


RE: MCsim (pre-alpha release) - Apuly - 12-24-2017

now that's one hella bump yo